Showing
6 changed files
with
43 additions
and
10 deletions
static/js/me/index.js
0 → 100644
1 | +/** | ||
2 | + * 个人中心首页 | ||
3 | + * @author: bikai<kai.bi@yoho.cn> | ||
4 | + * @date: 2015/11/12 | ||
5 | + */ | ||
6 | + | ||
7 | +var Swiper = require('yoho.iswiper'); | ||
8 | + | ||
9 | +var recommendSwiper; | ||
10 | + | ||
11 | +recommendSwiper = new Swiper('.swiper-recommend', { | ||
12 | + lazyLoading: true, | ||
13 | + lazyLoadingInPrevNext: true, | ||
14 | + slidesPerView: 'auto' | ||
15 | +}); |
@@ -13,15 +13,26 @@ | @@ -13,15 +13,26 @@ | ||
13 | } | 13 | } |
14 | 14 | ||
15 | .swiper-recommend { | 15 | .swiper-recommend { |
16 | - padding: pxToRem(20px) pxToRem(30px); | 16 | + padding: pxToRem(20px) 0; |
17 | + width: 100%; | ||
18 | + overflow: hidden; | ||
19 | + | ||
20 | + .swiper-slider { | ||
21 | + margin: 0 pxToRem(10px); | ||
22 | + | ||
23 | + &:first-child { | ||
24 | + margin-left: pxToRem(30px); | ||
25 | + } | ||
26 | + | ||
27 | + &:last-child { | ||
28 | + margin-right: pxToRem(30px); | ||
17 | } | 29 | } |
18 | 30 | ||
19 | - .img-box { | ||
20 | - display: table-cell; | 31 | + img { |
21 | width: pxToRem(156px); | 32 | width: pxToRem(156px); |
22 | - height: pxToRem(206px); | ||
23 | - vertical-align: middle; | ||
24 | - text-align: center; | 33 | + max-width: none; |
34 | + } | ||
35 | + } | ||
25 | } | 36 | } |
26 | 37 | ||
27 | .price { | 38 | .price { |
@@ -195,8 +195,13 @@ | @@ -195,8 +195,13 @@ | ||
195 | seajs.use('js/shopping-cart/gift-advance'); | 195 | seajs.use('js/shopping-cart/gift-advance'); |
196 | </script> | 196 | </script> |
197 | {{/if}} | 197 | {{/if}} |
198 | - | ||
199 | {{!-- 个人中心 --}} | 198 | {{!-- 个人中心 --}} |
199 | +{{!-- 个人中心首页 --}} | ||
200 | +{{#if myIndexPage}} | ||
201 | +<script> | ||
202 | + seajs.use('js/me/index'); | ||
203 | +</script> | ||
204 | +{{/if}} | ||
200 | {{#if orderPage}} | 205 | {{#if orderPage}} |
201 | <script> | 206 | <script> |
202 | seajs.use('js/me/order'); | 207 | seajs.use('js/me/order'); |
@@ -3,15 +3,15 @@ | @@ -3,15 +3,15 @@ | ||
3 | <div class="title">为您优选新品</div> | 3 | <div class="title">为您优选新品</div> |
4 | <div class="swiper-recommend"> | 4 | <div class="swiper-recommend"> |
5 | <div class="swiper-wrapper"> | 5 | <div class="swiper-wrapper"> |
6 | + {{#recommendList}} | ||
6 | <div class="swiper-slider"> | 7 | <div class="swiper-slider"> |
7 | - <div class="img-box"> | ||
8 | - <img src="http://temp.im/156x206"> | ||
9 | - </div> | 8 | + <img class="img-box" src="http://temp.im/156x206"> |
10 | <div class="price"> | 9 | <div class="price"> |
11 | <span class="sale-price">¥199</span> | 10 | <span class="sale-price">¥199</span> |
12 | <span class="old-price">¥233</span> | 11 | <span class="old-price">¥233</span> |
13 | </div> | 12 | </div> |
14 | </div> | 13 | </div> |
14 | + {{/recommendList}} | ||
15 | </div> | 15 | </div> |
16 | </div> | 16 | </div> |
17 | </div> | 17 | </div> |
-
Please register or login to post a comment