Authored by xuqi

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

@@ -306,6 +306,9 @@ class AbstractAction extends Controller_Abstract @@ -306,6 +306,9 @@ class AbstractAction extends Controller_Abstract
306 if (isset($cookieList[1]) && is_numeric($cookieList[1])) { 306 if (isset($cookieList[1]) && is_numeric($cookieList[1])) {
307 if ($useSession) { 307 if ($useSession) {
308 $token = $this->getSession('_TOKEN'); 308 $token = $this->getSession('_TOKEN');
  309 + if (empty($token)) {
  310 + $token = $this->getCookie('_TOKEN');
  311 + }
309 if ($token === Helpers::makeToken($cookieList[1])) { 312 if ($token === Helpers::makeToken($cookieList[1])) {
310 $this->_uid = $cookieList[1]; 313 $this->_uid = $cookieList[1];
311 } 314 }
@@ -2028,8 +2028,8 @@ $('#search').on('touchend', function() { @@ -2028,8 +2028,8 @@ $('#search').on('touchend', function() {
2028 2028
2029 if (historys && historys.length > 0) { 2029 if (historys && historys.length > 0) {
2030 historys = historys.split(ranToken); 2030 historys = historys.split(ranToken);
2031 - for (i = 0; i < historys.length; i++) {  
2032 - history = historys[i]; 2031 + for (i = historys.length; i > 0; i--) {
  2032 + history = historys[i - 1];
2033 2033
2034 if (history === '') { 2034 if (history === '') {
2035 continue; 2035 continue;
@@ -4711,7 +4711,7 @@ var goodsDiscountEl = document.getElementById('goodsDiscount'), @@ -4711,7 +4711,7 @@ var goodsDiscountEl = document.getElementById('goodsDiscount'),
4711 goodsDiscountHammer = goodsDiscountEl && new Hammer(goodsDiscountEl); 4711 goodsDiscountHammer = goodsDiscountEl && new Hammer(goodsDiscountEl);
4712 4712
4713 var $cart = $('.cart-bar'); 4713 var $cart = $('.cart-bar');
4714 -var UA = navigator.userAgent.toLowerCase().toString(); 4714 +
4715 4715
4716 require("js/product/detail/desc"); 4716 require("js/product/detail/desc");
4717 require("js/product/detail/comments-consults"); 4717 require("js/product/detail/comments-consults");
@@ -4777,9 +4777,10 @@ $.ajax({ @@ -4777,9 +4777,10 @@ $.ajax({
4777 } 4777 }
4778 }); 4778 });
4779 4779
4780 -if (UA.indexOf('mqqbrowser') > -1) {  
4781 - $('.detail > div').removeClass('column').addClass('oldbox'); 4780 +if ($('.good-detail-page').length > 0) {
  4781 + $('#yoho-footer').css('border-top', '1px solid #e0e0e0');
4782 } 4782 }
  4783 +
4783 require("js/product/detail/like"); 4784 require("js/product/detail/like");
4784 4785
4785 }); 4786 });
@@ -4804,6 +4805,8 @@ var introUrl = $('#introUrl').val(), @@ -4804,6 +4805,8 @@ var introUrl = $('#introUrl').val(),
4804 var sizeSwiper, 4805 var sizeSwiper,
4805 refSwiper; 4806 refSwiper;
4806 4807
  4808 +var UA = navigator.userAgent.toLowerCase().toString();
  4809 +
4807 //判断是否要显示向左滑动提示 4810 //判断是否要显示向左滑动提示
4808 function hiddenTips($ele) { 4811 function hiddenTips($ele) {
4809 var offsetContainer, 4812 var offsetContainer,
@@ -4855,7 +4858,9 @@ function search() { @@ -4855,7 +4858,9 @@ function search() {
4855 4858
4856 hiddenTips($('#size-swiper-container')); 4859 hiddenTips($('#size-swiper-container'));
4857 hiddenTips($('#reference-swiper-container')); 4860 hiddenTips($('#reference-swiper-container'));
4858 - 4861 + if (UA.indexOf('mqqbrowser') > 0) {
  4862 + $('.detail > div').removeClass('column').addClass('oldbox');
  4863 + }
4859 searching = false; 4864 searching = false;
4860 end = true; 4865 end = true;
4861 loading.hideLoadingMask(); 4866 loading.hideLoadingMask();
@@ -4986,15 +4991,19 @@ var recommendSwiper, @@ -4986,15 +4991,19 @@ var recommendSwiper,
4986 4991
4987 if (preferenceUrl) { 4992 if (preferenceUrl) {
4988 $.get(preferenceUrl).then(function(html) { 4993 $.get(preferenceUrl).then(function(html) {
4989 - $recommendForYou.html(html).show();  
4990 - if ($('#swiper-recommend').length) {  
4991 - recommendSwiper = new Swiper('#swiper-recommend', {  
4992 - slidesPerView: 'auto',  
4993 - grabCursor: true,  
4994 - slideElement: 'a',  
4995 - lazyLoading: true,  
4996 - watchSlidesVisibility: true  
4997 - }); 4994 + if (html.length < 5) {
  4995 + $recommendForYou.css('display', 'none');
  4996 + } else {
  4997 + $recommendForYou.html(html).show();
  4998 + if ($('#swiper-recommend').length) {
  4999 + recommendSwiper = new Swiper('#swiper-recommend', {
  5000 + slidesPerView: 'auto',
  5001 + grabCursor: true,
  5002 + slideElement: 'a',
  5003 + lazyLoading: true,
  5004 + watchSlidesVisibility: true
  5005 + });
  5006 + }
4998 } 5007 }
4999 5008
5000 window.rePosFooter(); 5009 window.rePosFooter();
@@ -5784,7 +5793,6 @@ function loadData($parent, url, page) { @@ -5784,7 +5793,6 @@ function loadData($parent, url, page) {
5784 } else { 5793 } else {
5785 return; 5794 return;
5786 } 5795 }
5787 - window.rePosFooter();  
5788 5796
5789 //},1000); 5797 //},1000);
5790 } 5798 }
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
@@ -18,7 +18,6 @@ var introUrl = $('#introUrl').val(), @@ -18,7 +18,6 @@ var introUrl = $('#introUrl').val(),
18 var sizeSwiper, 18 var sizeSwiper,
19 refSwiper; 19 refSwiper;
20 20
21 -var UA = navigator.userAgent.toLowerCase().toString();  
22 21
23 //判断是否要显示向左滑动提示 22 //判断是否要显示向左滑动提示
24 function hiddenTips($ele) { 23 function hiddenTips($ele) {
@@ -38,6 +37,19 @@ function hiddenTips($ele) { @@ -38,6 +37,19 @@ function hiddenTips($ele) {
38 } 37 }
39 } 38 }
40 39
  40 +function isFlexSupport() {
  41 + var flex = document.createElement('p').style.flex,
  42 + webkitFlex = document.createElement('p').style.webkitFlex,
  43 + flexWrap = document.createElement('p').style.flexWrap;
  44 +
  45 + if ((flex === '' || webkitFlex === '') && flexWrap === '') {
  46 + return true;
  47 + } else {
  48 + return false;
  49 + }
  50 +}
  51 +
  52 +
41 function search() { 53 function search() {
42 if (searching || end) { 54 if (searching || end) {
43 return; 55 return;
@@ -71,8 +83,9 @@ function search() { @@ -71,8 +83,9 @@ function search() {
71 83
72 hiddenTips($('#size-swiper-container')); 84 hiddenTips($('#size-swiper-container'));
73 hiddenTips($('#reference-swiper-container')); 85 hiddenTips($('#reference-swiper-container'));
74 - if (UA.indexOf('mqqbrowser') > 0) {  
75 - $('.detail > div').removeClass('column').addClass('oldbox'); 86 +
  87 + if (!isFlexSupport()) {
  88 + $('.detail .column').removeClass('column').addClass('oldbox');
76 } 89 }
77 searching = false; 90 searching = false;
78 end = true; 91 end = true;
@@ -457,5 +457,6 @@ $listNav.on('touchstart', 'li', function() { @@ -457,5 +457,6 @@ $listNav.on('touchstart', 'li', function() {
457 457
458 // 用于统计点击了商品列表的第几个商品,序号从1开始计算。 458 // 用于统计点击了商品列表的第几个商品,序号从1开始计算。
459 if (window._yas) { 459 if (window._yas) {
460 - window._yas(1 * new Date(), '1.0.13.2', 'yohobuy_m', window._ozuid, '#goods-container >div >div .good-thumb >img'); 460 + window._yas(1 * new Date(), '1.0.13.2', 'yohobuy_m', window._ozuid,
  461 + '', '#goods-container >div >div .good-thumb >img');
461 } 462 }
@@ -88,9 +88,13 @@ @@ -88,9 +88,13 @@
88 position: relative; 88 position: relative;
89 float: left; 89 float: left;
90 color: #fff; 90 color: #fff;
91 - font-size: pxToRem(22px);  
92 - line-height: pxToRem(38px);  
93 - width: pxToRem(213px); 91 + font-size: pxToRem(32px);
  92 + width: pxToRem(320px);
  93 + // width: pxToRem(213px); 三栏宽度
  94 +
  95 + p {
  96 + font-size: pxToRem(22px);
  97 + }
94 98
95 &:after { 99 &:after {
96 content: ''; 100 content: '';
@@ -113,7 +113,9 @@ @@ -113,7 +113,9 @@
113 display: block; 113 display: block;
114 } 114 }
115 } 115 }
116 - 116 + .cost {
  117 + padding: 0 0 0 30rem / $pxConvertRem;
  118 + }
117 .cost li { 119 .cost li {
118 height: 90rem / $pxConvertRem; 120 height: 90rem / $pxConvertRem;
119 line-height: 90rem / $pxConvertRem; 121 line-height: 90rem / $pxConvertRem;
@@ -125,6 +127,7 @@ @@ -125,6 +127,7 @@
125 } 127 }
126 > span { 128 > span {
127 float: right; 129 float: right;
  130 + padding: 0 30rem / $pxConvertRem 0 0;
128 } 131 }
129 } 132 }
130 133
@@ -168,6 +168,9 @@ @@ -168,6 +168,9 @@
168 &.focus { 168 &.focus {
169 color: #000; 169 color: #000;
170 } 170 }
  171 + .comments-num {
  172 + display: none;
  173 + }
171 } 174 }
172 .comment-nav { 175 .comment-nav {
173 border-right: 1px solid #ccc; 176 border-right: 1px solid #ccc;
@@ -350,12 +350,18 @@ $basicBtnC:#eb0313; @@ -350,12 +350,18 @@ $basicBtnC:#eb0313;
350 background-color: #fff; 350 background-color: #fff;
351 border-bottom: 1px solid $borderC; 351 border-bottom: 1px solid $borderC;
352 h1 { 352 h1 {
353 - padding: pxToRem(30px) pxToRem(28px); 353 + position: relative;
  354 + padding: pxToRem(30px) pxToRem(60px) pxToRem(30px) pxToRem(28px);
354 line-height: pxToRem(36px); 355 line-height: pxToRem(36px);
  356 + white-space: nowrap;
  357 + overflow: hidden;
  358 + text-overflow: ellipsis;
355 // line-height: pxToRem(88px); 359 // line-height: pxToRem(88px);
356 } 360 }
357 .iconfont { 361 .iconfont {
358 - display: inline-block; 362 + position: absolute;
  363 + top: pxToRem(30px);
  364 + right: pxToRem(36px);
359 width: pxToRem(35px); 365 width: pxToRem(35px);
360 font-size: pxToRem(45px); 366 font-size: pxToRem(45px);
361 float: right; 367 float: right;
@@ -28,10 +28,14 @@ @@ -28,10 +28,14 @@
28 {{#isLogin}}{{brand_favorite_total}}{{/isLogin}} 28 {{#isLogin}}{{brand_favorite_total}}{{/isLogin}}
29 <p>收藏的品牌</p> 29 <p>收藏的品牌</p>
30 </a> 30 </a>
  31 + {{!
31 <a class="link-item" href="/home/record"> 32 <a class="link-item" href="/home/record">
32 - {{#isLogin}}{{product_browse}}{{/isLogin}} 33 + <!-- product_browse -->
  34 +
33 <p>浏览记录</p> 35 <p>浏览记录</p>
34 </a> 36 </a>
  37 + }}
  38 +
35 </div> 39 </div>
36 <div class="my-order"> 40 <div class="my-order">
37 <div class="order-title"> 41 <div class="order-title">
@@ -102,6 +106,7 @@ @@ -102,6 +106,7 @@
102 <span class="iconfont num">&#xe604;</span> 106 <span class="iconfont num">&#xe604;</span>
103 </a> 107 </a>
104 </div> 108 </div>
  109 + {{!
105 <div class="group-list"> 110 <div class="group-list">
106 <a class="list-item" href="/help.html"> 111 <a class="list-item" href="/help.html">
107 <span class="iconfont icon">&#xe639;</span> 112 <span class="iconfont icon">&#xe639;</span>
@@ -109,6 +114,7 @@ @@ -109,6 +114,7 @@
109 <span class="iconfont num">&#xe604;</span> 114 <span class="iconfont num">&#xe604;</span>
110 </a> 115 </a>
111 </div> 116 </div>
  117 + }}
112 118
113 {{> product/recommend-for-you}} 119 {{> product/recommend-for-you}}
114 {{> product/suspend-cart}} 120 {{> product/suspend-cart}}
1 <ul id="nav-tab" class="nav-tab clearfix"> 1 <ul id="nav-tab" class="nav-tab clearfix">
2 - <li class="comment-nav">商品评价(<span class="comments-num">{{commentsNum}}</span>)</li> 2 + <li class="comment-nav">商品评价<span class="comments-num">{{commentsNum}}</span></li>
3 <li class="consult-nav">购买咨询(<span class="consults-num">{{consultsNum}}</span>)</li> 3 <li class="consult-nav">购买咨询(<span class="consults-num">{{consultsNum}}</span>)</li>
4 </ul> 4 </ul>
5 <div id="feedback-content" > 5 <div id="feedback-content" >
@@ -27,7 +27,7 @@ @@ -27,7 +27,7 @@
27 </div> 27 </div>
28 {{/if}} 28 {{/if}}
29 <!-- <div class="comment-content-footer"> 29 <!-- <div class="comment-content-footer">
30 - <a href="{{link}}">查看更多 <span class="iconfont">&#xe604;</span></a> 30 + <a href="{{link}}">查看更多 <span class="iconfont">&#xe604;</span></a>
31 </div> --> 31 </div> -->
32 </div> 32 </div>
33 33
@@ -51,8 +51,8 @@ @@ -51,8 +51,8 @@
51 </div> 51 </div>
52 <div class="consult-content-footer" data-href="{{link}}"> 52 <div class="consult-content-footer" data-href="{{link}}">
53 <a href="javascript:;"> 53 <a href="javascript:;">
54 - 查看更多  
55 - <span class="iconfont">&#xe604;</span></a> 54 + 查看更多
  55 + <span class="iconfont">&#xe604;</span></a>
56 </div> 56 </div>
57 {{else}} 57 {{else}}
58 <div class="consult-content-main content-main no-item"> 58 <div class="consult-content-main content-main no-item">
@@ -61,9 +61,9 @@ @@ -61,9 +61,9 @@
61 61
62 <div class="consult-content-footer" data-href="{{link}}"> 62 <div class="consult-content-footer" data-href="{{link}}">
63 <a href="javascript:;"> 63 <a href="javascript:;">
64 - 我要咨询  
65 - <span class="iconfont">&#xe604;</span></a> 64 + 我要咨询
  65 + <span class="iconfont">&#xe604;</span></a>
66 </div> 66 </div>
67 {{/if}} 67 {{/if}}
68 </div> 68 </div>
69 -</div>  
  69 +</div>
@@ -805,7 +805,7 @@ class HomeController extends AbstractAction @@ -805,7 +805,7 @@ class HomeController extends AbstractAction
805 'payLink' => '', 805 'payLink' => '',
806 'appId' => 'weixin', 806 'appId' => 'weixin',
807 'app' => '微信支付', 807 'app' => '微信支付',
808 - 'hint' => '需安装微信客户端', 808 + 'hint' => '推荐使用',
809 'subHint' => '', 809 'subHint' => '',
810 ), 810 ),
811 ), 811 ),
@@ -79,7 +79,7 @@ class DetailModel @@ -79,7 +79,7 @@ class DetailModel
79 $result['goodsPrice'] = array(); 79 $result['goodsPrice'] = array();
80 $result['goodsPrice']['currentPrice'] = $baseInfo['productPriceBo']['formatSalesPrice']; 80 $result['goodsPrice']['currentPrice'] = $baseInfo['productPriceBo']['formatSalesPrice'];
81 if ($baseInfo['productPriceBo']['formatMarketPrice'] !== $baseInfo['productPriceBo']['formatSalesPrice']) { 81 if ($baseInfo['productPriceBo']['formatMarketPrice'] !== $baseInfo['productPriceBo']['formatSalesPrice']) {
82 - $result['goodsPrice']['previousPrice'] = $baseInfo['productPriceBo']['formatMarketPrice']; 82 + $result['goodsPrice']['previousPrice'] = strtr($baseInfo['productPriceBo']['formatMarketPrice'], array('¥' => ''));
83 } 83 }
84 } 84 }
85 // VIP商品价格 85 // VIP商品价格
@@ -87,7 +87,7 @@ class DetailModel @@ -87,7 +87,7 @@ class DetailModel
87 $build = array(); 87 $build = array();
88 foreach ($baseInfo['productPriceBo']['vipPrices'] as $value) { 88 foreach ($baseInfo['productPriceBo']['vipPrices'] as $value) {
89 $build['level'] = $value['vipLevel']; 89 $build['level'] = $value['vipLevel'];
90 - $build['text'] = $value['vipPrice']; 90 + $build['text'] = strtr($value['vipPrice'], array('¥' => ''));
91 $build['currentLevel'] = ($value['vipLevel'] == $vipLevel) ? true : false; 91 $build['currentLevel'] = ($value['vipLevel'] == $vipLevel) ? true : false;
92 $result['vipLevel']['list'][] = $build; 92 $result['vipLevel']['list'][] = $build;
93 } 93 }
@@ -419,7 +419,7 @@ class DetailModel @@ -419,7 +419,7 @@ class DetailModel
419 if (isset($sizeInfo['productIntroBo']['productIntro'])) { 419 if (isset($sizeInfo['productIntroBo']['productIntro'])) {
420 $productIntro = ''; 420 $productIntro = '';
421 if (!empty($sizeInfo['productDescBo']['phrase'])) { 421 if (!empty($sizeInfo['productDescBo']['phrase'])) {
422 - $productIntro .= $sizeInfo['productDescBo']['phrase']; 422 + $productIntro .= $sizeInfo['productDescBo']['phrase'] . '<br/>';
423 } 423 }
424 $productIntro .= $sizeInfo['productIntroBo']['productIntro']; 424 $productIntro .= $sizeInfo['productIntroBo']['productIntro'];
425 if ($productIntro) { 425 if ($productIntro) {
@@ -118,7 +118,7 @@ class LoginController extends AbstractAction @@ -118,7 +118,7 @@ class LoginController extends AbstractAction
118 } 118 }
119 119
120 /* 调用登录接口进行登录 */ 120 /* 调用登录接口进行登录 */
121 - $data = LoginData::signin($area, $profile, $password); 121 + $data = LoginData::signin($area, $profile, $password);
122 if ($data['code'] != 200 || !isset($data['data']['uid'])) { 122 if ($data['code'] != 200 || !isset($data['data']['uid'])) {
123 break; 123 break;
124 } 124 }
@@ -187,8 +187,8 @@ class LoginController extends AbstractAction @@ -187,8 +187,8 @@ class LoginController extends AbstractAction
187 $refer = rawurldecode($refer); 187 $refer = rawurldecode($refer);
188 } 188 }
189 189
190 - if ($result['code'] == 200 && !empty($result['data']['uid'])) {  
191 - $this->setSession('_TOKEN', Helpers::makeToken($result['data']['uid'])); 190 + if (isset($result['code']) && $result['code'] == 200 && !empty($result['data']['uid'])) {
  191 + $this->setCookie('_TOKEN', Helpers::makeToken($result['data']['uid']));
192 $this->go(Helpers::syncUserSession($result['data']['uid'], $refer)); 192 $this->go(Helpers::syncUserSession($result['data']['uid'], $refer));
193 } else { 193 } else {
194 $this->go($refer); 194 $this->go($refer);
@@ -217,8 +217,8 @@ class LoginController extends AbstractAction @@ -217,8 +217,8 @@ class LoginController extends AbstractAction
217 $refer = rawurldecode($refer); 217 $refer = rawurldecode($refer);
218 } 218 }
219 219
220 - if ($result['code'] == 200 && !empty($result['data']['uid'])) {  
221 - $this->setSession('_TOKEN', Helpers::makeToken($result['data']['uid'])); 220 + if (isset($result['code']) && $result['code'] == 200 && !empty($result['data']['uid'])) {
  221 + $this->setCookie('_TOKEN', Helpers::makeToken($result['data']['uid']));
222 $this->go(Helpers::syncUserSession($result['data']['uid'], $refer)); 222 $this->go(Helpers::syncUserSession($result['data']['uid'], $refer));
223 } else { 223 } else {
224 $this->go($refer); 224 $this->go($refer);
@@ -247,8 +247,8 @@ class LoginController extends AbstractAction @@ -247,8 +247,8 @@ class LoginController extends AbstractAction
247 $refer = rawurldecode($refer); 247 $refer = rawurldecode($refer);
248 } 248 }
249 249
250 - if ($result['code'] == 200 && !empty($result['data']['uid'])) {  
251 - $this->setSession('_TOKEN', Helpers::makeToken($result['data']['uid'])); 250 + if (isset($result['code']) && $result['code'] == 200 && !empty($result['data']['uid'])) {
  251 + $this->setCookie('_TOKEN', Helpers::makeToken($result['data']['uid']));
252 $this->go(Helpers::syncUserSession($result['data']['uid'], $refer)); 252 $this->go(Helpers::syncUserSession($result['data']['uid'], $refer));
253 } else { 253 } else {
254 $this->go($refer); 254 $this->go($refer);