From 83ab0ca3650c0170aad6914e48f6270cd59d7c65 Mon Sep 17 00:00:00 2001
From: shenzhimin <zhimin.shen@yoho.cn>
Date: Fri, 25 Nov 2016 12:00:19 +0800
Subject: [PATCH] 样式调整

---
 apps/product/views/action/detail/detail.hbs     |  2 +-
 apps/product/views/action/detail/new/detail.hbs | 12 ++++++++----
 public/hbs/product/detail/pricedata.hbs         |  8 +++-----
 public/js/product/new-detail.page.js            | 68 ++++++++++++++++++++++++++++++++++++--------------------------------
 4 files changed, 48 insertions(+), 42 deletions(-)

diff --git a/apps/product/views/action/detail/detail.hbs b/apps/product/views/action/detail/detail.hbs
index d75b193..e068a92 100644
--- a/apps/product/views/action/detail/detail.hbs
+++ b/apps/product/views/action/detail/detail.hbs
@@ -79,7 +79,7 @@
 
     <ul class="vip-level data-bind clearfix">
         <li class="icons-item">
-            <span class="vip-img" style="background-size:contain;">
+            <span class="vip-img">
             </span>
             <span class="vip-price"></span>
         </li>
diff --git a/apps/product/views/action/detail/new/detail.hbs b/apps/product/views/action/detail/new/detail.hbs
index 47b0775..a3477f7 100644
--- a/apps/product/views/action/detail/new/detail.hbs
+++ b/apps/product/views/action/detail/new/detail.hbs
@@ -54,16 +54,19 @@
         </div>
         {{/if}}
     </div>
-	
-	<div id="pricedata"></div>
+    
+    {{!--占位: 学生价/会员价--}}
+	<div id="placeholder-pricedata"></div>
 
 	{{! 品牌优惠券}}
 	<div class="brand-coupon hide">
 	    <i class="iconfont font-right pull-right">&#xe614;</i>
 	    <i class="iconfont font-quan">&#xe900;</i><span>领取优惠券</span>
 	</div>
+
     {{!--占位: 促销--}}
-    <div id="placeholder-promotion"></div>
+    <div id="placeholder-promotion" style="height:100px;background-color:#fff;">
+    </div>
 
     {{!-- 占位: 用户反馈, 店铺入口 --}}
     <div id="placeholder-feedback-store"></div>
@@ -71,7 +74,8 @@
     <div id="productDesc" class="product-desc {{#if limit}}limit{{/if}}"></div>
     {{> detail/recommend-for-you}}
 
-    <div id="infodata">
+    {{!--占位: 购物车部分--}}
+    <div id="placeholder-infodata">
         <div class="cart-bar">
             <a href="javascript:;" class="num-incart iconfont">&#xe62c;</a>
             <a href="javascript:;" class="addto-cart add-to-cart-url">加入购物车</a>
diff --git a/public/hbs/product/detail/pricedata.hbs b/public/hbs/product/detail/pricedata.hbs
index b797699..e800f81 100644
--- a/public/hbs/product/detail/pricedata.hbs
+++ b/public/hbs/product/detail/pricedata.hbs
@@ -4,11 +4,9 @@
         <i class="student-name">学生价</i><span class="student-value">¥{{studentPrice}}</span>
     </div>
 </div>
-{{/if}}
-
-{{# vipLevel}}
+{{else if vipLevel}}
 <ul class="vip-level clearfix">
-    {{#each list}}
+    {{#each vipLevel.list}}
         <li class="icons-item {{#if currentLevel}} current-level {{/if}}">
             <span class="vip-img">
             </span>
@@ -16,4 +14,4 @@
         </li>
     {{/each}}
 </ul>
-{{/ vipLevel}}
\ No newline at end of file
+{{/if}}
\ No newline at end of file
diff --git a/public/js/product/new-detail.page.js b/public/js/product/new-detail.page.js
index 5286088..d562e2d 100644
--- a/public/js/product/new-detail.page.js
+++ b/public/js/product/new-detail.page.js
@@ -1,27 +1,37 @@
-var $ = require('yoho-jquery'),
-    Swiper = require('yoho-swiper'),
-    tip = require('../plugin/tip'),
-    dialog = require('../plugin/dialog');
-
-// 顶部swiper
-new Swiper('.banner-swiper', {
-    preloadImages: false,
-    lazyLoading: true,
-    lazyLoadingInPrevNext: true,
-    lazyLoadingOnTransitionStart: true,
-    paginationClickable: true,
-    pagination: '.banner-top .pagination-inner',
-    nextButton: '.my-swiper-button-next',
-    prevButton: '.my-swiper-button-prev',
-    spaceBetween: 3
-});
-
+var $ = require('yoho-jquery');
 var productId = $('#productId').val();
 var goodsId = $('#goodsId').val();
 var productSkn = $('#productSkn').val();
 var brandId = $('#brand-id').val();
 
-require('../common');
+setTimeout(() => {
+    var Swiper = require('yoho-swiper');
+
+    // 顶部swiper
+    new Swiper('.banner-swiper', {
+        preloadImages: false,
+        lazyLoading: true,
+        lazyLoadingInPrevNext: true,
+        lazyLoadingOnTransitionStart: true,
+        paginationClickable: true,
+        pagination: '.banner-top .pagination-inner',
+        nextButton: '.my-swiper-button-next',
+        prevButton: '.my-swiper-button-prev',
+        spaceBetween: 3
+    });
+
+    require('../common');
+
+    // 领券
+    require('./detail/brand-coupon');
+
+    // 页面底部异步加载的部分
+    require('./detail/desc');
+
+    // 喂你优选
+    require('./detail/recommend-for-you-product-desc');
+}, 100);
+
 
 // 动态加载数据
 (function() {
@@ -53,11 +63,12 @@ require('../common');
             }
         }
 
-        $('#pricedata').replaceWith(priceDataHbs(data));
-        $('#infodata').replaceWith(infoDataHbs(data));
+        $('#placeholder-pricedata').replaceWith(priceDataHbs(data));
+        $('#placeholder-infodata').replaceWith(infoDataHbs(data));
 
         if (data.isDepositAdvance === 'Y') {
             // 定金预售商品
+            var tip = require('../plugin/tip');
             setTimeout(function() {
                 $('#addtoCart').text('立即购买').off('touchstart').on('touchstart', function() {
                     tip.show('定金预售商品只能在APP端购买');
@@ -113,9 +124,11 @@ require('../common');
                         } else {
                             $cartBar = $('.cart-bar');
                         }
-                    }, 200);
+                    }, 500);
 
                     // 限购
+                    var dialog = require('../plugin/dialog');
+
                     $('#limit-sale').on('touchend', function(e) {
                         var loginUrl = $('#loginUrl').val(),
                             time,
@@ -160,7 +173,7 @@ require('../common');
                     });
                 }
             });
-        }, 50);
+        }, 150);
     }
 }());
 
@@ -260,12 +273,3 @@ require('../common');
         });
     }, 200);
 }(productSkn, productId, brandId));
-
-// 领券
-require('./detail/brand-coupon');
-
-// 页面底部异步加载的部分
-require('./detail/desc');
-
-// 喂你优选
-require('./detail/recommend-for-you-product-desc');
--
libgit2 0.24.0