Authored by Rock Zhang

Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into develop

framework @ 75bbc3b0
1 -Subproject commit 4216b36673d37eecf297c5cc8b7634a32c09dc51 1 +Subproject commit 75bbc3b075de19f239532f60c5995d06c5f814e2
@@ -4,4 +4,5 @@ @@ -4,4 +4,5 @@
4 * @date: 2015/11/10 4 * @date: 2015/11/10
5 */ 5 */
6 6
  7 +require('./index');
7 require('./order'); 8 require('./order');
  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 {
@@ -76,14 +76,14 @@ @@ -76,14 +76,14 @@
76 <div class="list-item"> 76 <div class="list-item">
77 <span class="iconfont icon">&#xe620;</span> 77 <span class="iconfont icon">&#xe620;</span>
78 在线客服 78 在线客服
79 - <span class="iconfont num">3 &#xe604;</span> 79 + <span class="iconfont num">&#xe604;</span>
80 </div> 80 </div>
81 </div> 81 </div>
82 <div class="group-list"> 82 <div class="group-list">
83 <div class="list-item"> 83 <div class="list-item">
84 <span class="iconfont icon">&#xe620;</span> 84 <span class="iconfont icon">&#xe620;</span>
85 帮助 85 帮助
86 - <span class="iconfont num">3 &#xe604;</span> 86 + <span class="iconfont num">&#xe604;</span>
87 </div> 87 </div>
88 </div> 88 </div>
89 89
@@ -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="{{img}}">
10 <div class="price"> 9 <div class="price">
11 - <span class="sale-price"199</span>  
12 - <span class="old-price"233</span> 10 + <span class="sale-price"{{salePrice}}</span>
  11 + <span class="old-price"{{oldPrice}}</span>
13 </div> 12 </div>
14 </div> 13 </div>
  14 + {{/recommendList}}
15 </div> 15 </div>
16 </div> 16 </div>
17 </div> 17 </div>
@@ -20,9 +20,11 @@ class HomeController extends AbstractAction @@ -20,9 +20,11 @@ class HomeController extends AbstractAction
20 */ 20 */
21 public function indexAction() 21 public function indexAction()
22 { 22 {
  23 + // 设置网站标题
  24 + $this->setTitle('个人中心');
  25 +
23 // $uid = $this->getUid(); 26 // $uid = $this->getUid();
24 $uid = 967016; 27 $uid = 967016;
25 -  
26 $data = \Index\UserModel::getUserProfileData($uid); 28 $data = \Index\UserModel::getUserProfileData($uid);
27 29
28 // print_r($data); 30 // print_r($data);
@@ -34,27 +36,55 @@ class HomeController extends AbstractAction @@ -34,27 +36,55 @@ class HomeController extends AbstractAction
34 $data['recommendForYou'] = array( 36 $data['recommendForYou'] = array(
35 'recommendList' => array( 37 'recommendList' => array(
36 array( 38 array(
37 - 'img' => '' 39 + 'img' => '',
  40 + 'salePrice' => '567.44',
  41 + 'oldPrice' => '876.44'
  42 + ),
  43 + array(
  44 + 'img' => '',
  45 + 'salePrice' => '567.44',
  46 + 'oldPrice' => ''
  47 + ),
  48 + array(
  49 + 'img' => '',
  50 + 'salePrice' => '567.44',
  51 + 'oldPrice' => '876.44'
38 ), 52 ),
39 array( 53 array(
40 - 'img' => '' 54 + 'img' => '',
  55 + 'salePrice' => '567.44',
  56 + 'oldPrice' => '876.44'
41 ), 57 ),
42 array( 58 array(
43 - 'img' => '' 59 + 'img' => '',
  60 + 'salePrice' => '567.44',
  61 + 'oldPrice' => '876.44'
44 ), 62 ),
45 array( 63 array(
46 - 'img' => '' 64 + 'img' => '',
  65 + 'salePrice' => '567.44',
  66 + 'oldPrice' => '876.44'
47 ), 67 ),
48 array( 68 array(
49 - 'img' => '' 69 + 'img' => '',
  70 + 'salePrice' => '567.44',
  71 + 'oldPrice' => '876.44'
  72 + ),
  73 + array(
  74 + 'img' => '',
  75 + 'salePrice' => '567.44',
  76 + 'oldPrice' => '876.44'
  77 + ),
  78 + array(
  79 + 'img' => '',
  80 + 'salePrice' => '567.44',
  81 + 'oldPrice' => '876.44'
50 ) 82 )
51 ) 83 )
52 ); 84 );
  85 + $data['myIndexPage'] = true;
53 $data['pageFooter'] = true; 86 $data['pageFooter'] = true;
54 87
55 - // 设置网站标题  
56 - $this->setTitle('个人中心');  
57 -  
58 $this->_view->display('index', $data); 88 $this->_view->display('index', $data);
59 } 89 }
60 90