Authored by Lynnic

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

@@ -3,5 +3,12 @@ @@ -3,5 +3,12 @@
3 * @author: bikai<kai.bi@yoho.cn> 3 * @author: bikai<kai.bi@yoho.cn>
4 * @date: 2015/11/12 4 * @date: 2015/11/12
5 */ 5 */
  6 +var $ = require('jquery');
  7 +var $userAvatar = $('.user-avatar');
  8 +var myImage = new Image();
6 9
7 -require('../product/recommend-for-you.js');  
  10 +require('../product/recommend-for-you.js');
  11 +myImage.src = $userAvatar.attr('src');
  12 +myImage.onerror = function() {
  13 + $userAvatar.attr('src', 'http://static.dev.yohobuy.com/img/me/index/user-avatar.png');
  14 +};
  1 +/**
  2 + * 个人信息
  3 + * @author: bikai<kai.bi@yoho.cn>
  4 + * @date: 2015/11/19
  5 + */
  6 +var $ = require('jquery');
  7 +var $userAvatar = $('.user-avatar');
  8 +var myImage = new Image();
  9 +
  10 +myImage.src = $userAvatar.attr('src');
  11 +myImage.onerror = function() {
  12 + $userAvatar.attr('src', 'http://static.dev.yohobuy.com/img/me/index/user-avatar.png');
  13 +};
@@ -83,8 +83,36 @@ overflow: hidden; @@ -83,8 +83,36 @@ overflow: hidden;
83 margin-right: 2px; 83 margin-right: 2px;
84 } 84 }
85 .swiper-pagination-bullet-active { 85 .swiper-pagination-bullet-active {
86 - background-color: #000;  
87 - } 86 + background-color: #000;
  87 + }
  88 +
  89 + .swiper-button-prev,
  90 + .swiper-button-next {
  91 + position: absolute;
  92 + top: 50%;
  93 + width: pxToRem(48px);
  94 + height: pxToRem(48px);
  95 + margin-top: pxToRem(-44px);
  96 + cursor: pointer;
  97 + z-index:10;
  98 + -moz-background-size: pxToRem(48px) pxToRem(48px);
  99 + -webkit-background-size: pxToRem(48px) pxToRem(48px);
  100 + background-size: pxToRem(48px) pxToRem(48px);
  101 + background-position: center;
  102 + background-repeat: no-repeat;
  103 + }
  104 +
  105 + .swiper-button-next.swiper-button-grey {
  106 + background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M27%2C22L27%2C22L5%2C44l-2.1-2.1L22.8%2C22L2.9%2C2.1L5%2C0L27%2C22L27%2C22z'%20fill%3D'%23f0f0f0'%2F%3E%3C%2Fsvg%3E");
  107 + right: pxToRem(30px);
  108 + left: auto;
  109 + }
  110 +
  111 + .swiper-button-prev.swiper-button-grey {
  112 + background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M0%2C22L22%2C0l2.1%2C2.1L4.2%2C22l19.9%2C19.9L22%2C44L0%2C22L0%2C22L0%2C22z'%20fill%3D'%23f0f0f0'%2F%3E%3C%2Fsvg%3E");
  113 + left: pxToRem(30px);
  114 + right: auto;
  115 + }
88 } 116 }
89 117
90 } 118 }
1 {{> layout/header}} 1 {{> layout/header}}
2 <div class="personal-details"> 2 <div class="personal-details">
3 <ul> 3 <ul>
4 - <li><span>头像</span><span><i class="head-portrait"><img src="{{ head_ico }}"></i></span></li> 4 + <li><span>头像</span><span><i class="head-portrait"><img class="user-avatar" src="{{ head_ico }}"></i></span></li>
5 <li><span>昵称</span><span>{{ username }}</span></li> 5 <li><span>昵称</span><span>{{ username }}</span></li>
6 <li><span>性别</span><span>{{ gender }}</span></li> 6 <li><span>性别</span><span>{{ gender }}</span></li>
7 <li><span>生日</span><span>{{ birthday }}</span></li> 7 <li><span>生日</span><span>{{ birthday }}</span></li>
@@ -253,4 +253,9 @@ @@ -253,4 +253,9 @@
253 <script> 253 <script>
254 seajs.use('js/me/my-guang'); 254 seajs.use('js/me/my-guang');
255 </script> 255 </script>
  256 +{{/if}}
  257 +{{#if personalDetailsPage}}
  258 +<script>
  259 + seajs.use('js/me/personal-details');
  260 +</script>
256 {{/if}} 261 {{/if}}
@@ -16,6 +16,6 @@ @@ -16,6 +16,6 @@
16 </div> 16 </div>
17 17
18 <!-- 如果需要导航按钮 --> 18 <!-- 如果需要导航按钮 -->
19 - <div class="swiper-button-prev"></div>  
20 - <div class="swiper-button-next"></div> 19 + <div class="swiper-button-prev swiper-button-grey"></div>
  20 + <div class="swiper-button-next swiper-button-grey"></div>
21 </div> 21 </div>
@@ -27,7 +27,8 @@ class HomeController extends AbstractAction @@ -27,7 +27,8 @@ class HomeController extends AbstractAction
27 // { 27 // {
28 // // 检查用户是否登录, 未登录则跳转到登录页 28 // // 检查用户是否登录, 未登录则跳转到登录页
29 // $uid = $this->getUid(true); 29 // $uid = $this->getUid(true);
30 -// if (!$uid) { 30 +// $action = $this->getRequest()->getActionName();
  31 +// if (!$uid && $action !== 'index') {
31 // $this->go(Helpers::url('/signin.html')); 32 // $this->go(Helpers::url('/signin.html'));
32 // } 33 // }
33 // 34 //
@@ -43,18 +44,22 @@ class HomeController extends AbstractAction @@ -43,18 +44,22 @@ class HomeController extends AbstractAction
43 $this->setTitle('个人中心'); 44 $this->setTitle('个人中心');
44 $this->setNavHeader('个人中心'); 45 $this->setNavHeader('个人中心');
45 46
46 - // $uid = $this->getUid();  
47 - $uid = 8826435;  
48 - $data = \Index\UserModel::getUserProfileData($uid);  
49 - $data += \Index\UserModel::getInfoNumData($uid);  
50 -  
51 - // 优选新品数据  
52 - $channel = Helpers::getChannelByCookie();  
53 - $data['recommendForYou'] = \Index\UserModel::getPreferenceData($channel);  
54 - // print_r($data);  
55 -  
56 - $data['myIndexPage'] = true;  
57 - $data['pageFooter'] = true; 47 + $data = array(
  48 + 'myIndexPage' => true,
  49 + 'pageFooter' => true
  50 + );
  51 + echo $this->getRequest()->getActionName();
  52 + $uid = $this->getUid();
  53 + if ($uid) {
  54 + $data['isLogin'] = true;
  55 + $uid = 8826435;
  56 + $data += \Index\UserModel::getUserProfileData($uid);
  57 + $data += \Index\UserModel::getInfoNumData($uid);
  58 +
  59 + // 优选新品数据
  60 + $channel = Helpers::getChannelByCookie();
  61 + $data['recommendForYou'] = \Index\UserModel::getPreferenceData($channel);
  62 + }
58 63
59 $this->_view->display('index', $data); 64 $this->_view->display('index', $data);
60 } 65 }
@@ -127,6 +132,7 @@ class HomeController extends AbstractAction @@ -127,6 +132,7 @@ class HomeController extends AbstractAction
127 // $uid = $this->getUid(); 132 // $uid = $this->getUid();
128 $uid = 967016; 133 $uid = 967016;
129 $data = \Index\UserModel::getUserProfileData($uid); 134 $data = \Index\UserModel::getUserProfileData($uid);
  135 + $data['personalDetailsPage'] = true;
130 $data['pageFooter'] = true; 136 $data['pageFooter'] = true;
131 $this->_view->display('personal-details', $data); 137 $this->_view->display('personal-details', $data);
132 } 138 }
@@ -520,7 +526,7 @@ class HomeController extends AbstractAction @@ -520,7 +526,7 @@ class HomeController extends AbstractAction
520 { 526 {
521 echo " "; 527 echo " ";
522 } 528 }
523 - elseif ($page = 1) 529 + elseif ($page == 1)
524 { 530 {
525 $order['walkwayUrl'] = self::strollAction(); 531 $order['walkwayUrl'] = self::strollAction();
526 } 532 }