Authored by 毕凯

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.
@@ -16,9 +16,9 @@ var introUrl = $('#introUrl').val(), @@ -16,9 +16,9 @@ var introUrl = $('#introUrl').val(),
16 end = false; 16 end = false;
17 17
18 var sizeSwiper, 18 var sizeSwiper,
  19 + d = document.documentElement.style
19 refSwiper; 20 refSwiper;
20 21
21 -var UA = navigator.userAgent.toLowerCase().toString();  
22 22
23 //判断是否要显示向左滑动提示 23 //判断是否要显示向左滑动提示
24 function hiddenTips($ele) { 24 function hiddenTips($ele) {
@@ -38,6 +38,7 @@ function hiddenTips($ele) { @@ -38,6 +38,7 @@ function hiddenTips($ele) {
38 } 38 }
39 } 39 }
40 40
  41 +
41 function search() { 42 function search() {
42 if (searching || end) { 43 if (searching || end) {
43 return; 44 return;
@@ -71,8 +72,9 @@ function search() { @@ -71,8 +72,9 @@ function search() {
71 72
72 hiddenTips($('#size-swiper-container')); 73 hiddenTips($('#size-swiper-container'));
73 hiddenTips($('#reference-swiper-container')); 74 hiddenTips($('#reference-swiper-container'));
74 - if (UA.indexOf('mqqbrowser') > 0) {  
75 - $('.detail > div').removeClass('column').addClass('oldbox'); 75 +
  76 + if (('flexWrap' in d) || ('WebkitFlexWrap' in d))) {
  77 + $('.detail .column').removeClass('column').addClass('oldbox');
76 } 78 }
77 searching = false; 79 searching = false;
78 end = true; 80 end = true;
@@ -88,9 +88,11 @@ @@ -88,9 +88,11 @@
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); 91 + font-size: pxToRem(32px);
93 width: pxToRem(213px); 92 width: pxToRem(213px);
  93 + p{
  94 + font-size: pxToRem(22px);
  95 + }
94 96
95 &:after { 97 &:after {
96 content: ''; 98 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
@@ -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);