Authored by biao

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

@@ -23,15 +23,17 @@ class Yohobuy @@ -23,15 +23,17 @@ class Yohobuy
23 // const SERVICE_URL = 'http://service.api.yohobuy.com/'; 23 // const SERVICE_URL = 'http://service.api.yohobuy.com/';
24 // const YOHOBUY_URL = 'http://www.yohobuy.com/'; 24 // const YOHOBUY_URL = 'http://www.yohobuy.com/';
25 25
26 - // const API_URL = 'http://apih5.yoho.cn/'; 26 +// const API_URL = 'http://apih5.yoho.cn/';
27 // const API_URL2 = 'http://apih5.yoho.cn/'; 27 // const API_URL2 = 'http://apih5.yoho.cn/';
28 // const SERVICE_URL = 'http://serviceh5.yoho.cn/'; 28 // const SERVICE_URL = 'http://serviceh5.yoho.cn/';
29 // const YOHOBUY_URL = 'http://www.yohobuy.com/'; 29 // const YOHOBUY_URL = 'http://www.yohobuy.com/';
  30 +// const API_OLD = 'http://api2.open.yohobuy.com/';
30 31
31 /* 测试环境 */ 32 /* 测试环境 */
32 const API_URL = 'http://testapi.yoho.cn:28078/'; 33 const API_URL = 'http://testapi.yoho.cn:28078/';
33 const SERVICE_URL = 'http://testservice.yoho.cn:28077/'; 34 const SERVICE_URL = 'http://testservice.yoho.cn:28077/';
34 const YOHOBUY_URL = 'http://www.yohobuy.com/'; 35 const YOHOBUY_URL = 'http://www.yohobuy.com/';
  36 + const API_OLD = 'http://test2.open.yohobuy.com/';
35 37
36 38
37 /** 39 /**
@@ -38,7 +38,7 @@ class HelpData @@ -38,7 +38,7 @@ class HelpData
38 $param['code'] = $code; 38 $param['code'] = $code;
39 $param['return_type'] = 'html'; 39 $param['return_type'] = 'html';
40 $param['client_secret'] = Sign::getSign($param); 40 $param['client_secret'] = Sign::getSign($param);
41 - return Yohobuy::post(Yohobuy::API_URL, $param, true); 41 + return Yohobuy::post(Yohobuy::API_OLD, $param, true);
42 } 42 }
43 43
44 44
@@ -129,7 +129,7 @@ class Helpers @@ -129,7 +129,7 @@ class Helpers
129 */ 129 */
130 public static function getShoppingKeyByCookie() 130 public static function getShoppingKeyByCookie()
131 { 131 {
132 - $cookie = isset($_COOKIE['_Spk']) ? $_COOKIE['_Spk'] : ''; 132 + $cookie = isset($_COOKIE['_SPK']) ? $_COOKIE['_SPK'] : '';
133 133
134 return $cookie; 134 return $cookie;
135 } 135 }
@@ -595,9 +595,13 @@ class Helpers @@ -595,9 +595,13 @@ class Helpers
595 $oneGoods['inValid'] = true; 595 $oneGoods['inValid'] = true;
596 } elseif ($value['goods_type'] == 'gift' && !isset($value['isAdvanceBuy'])) { 596 } elseif ($value['goods_type'] == 'gift' && !isset($value['isAdvanceBuy'])) {
597 $oneGoods['isGift'] = true; 597 $oneGoods['isGift'] = true;
  598 + $oneGoods['salesPrice'] = self::transPrice($value['sales_price']);
  599 + $oneGoods['price'] = self::transPrice($value['sale_price']);
598 } elseif ($value['goods_type'] == 'price_gift') { 600 } elseif ($value['goods_type'] == 'price_gift') {
599 $oneGoods['showCheckbox'] = true; 601 $oneGoods['showCheckbox'] = true;
600 $oneGoods['isAdvanceBuy'] = true; 602 $oneGoods['isAdvanceBuy'] = true;
  603 + $oneGoods['salesPrice'] = self::transPrice($value['sales_price']);
  604 + $oneGoods['price'] = self::transPrice($value['sale_price']);
601 } else { 605 } else {
602 $oneGoods['showCheckbox'] = true; 606 $oneGoods['showCheckbox'] = true;
603 } 607 }
@@ -634,6 +638,7 @@ class Helpers @@ -634,6 +638,7 @@ class Helpers
634 $gift['promotionTitle'] = $value['promotion_title']; 638 $gift['promotionTitle'] = $value['promotion_title'];
635 639
636 foreach ($value['goods_list'] as $single) { 640 foreach ($value['goods_list'] as $single) {
  641 + $oneGoods = array();
637 $oneGoods['id'] = $single['product_skn']; 642 $oneGoods['id'] = $single['product_skn'];
638 $oneGoods['name'] = $single['product_name']; 643 $oneGoods['name'] = $single['product_name'];
639 $oneGoods['thumb'] = !empty($single['goods_images']) ? Images::getImageUrl($single['goods_images'], 120, 160) : ''; 644 $oneGoods['thumb'] = !empty($single['goods_images']) ? Images::getImageUrl($single['goods_images'], 120, 160) : '';
@@ -15,6 +15,8 @@ var chosePanel = require('./chose-panel'), @@ -15,6 +15,8 @@ var chosePanel = require('./chose-panel'),
15 var $cartContent = $('.cart-content'); 15 var $cartContent = $('.cart-content');
16 16
17 var navHammer, 17 var navHammer,
  18 + advanceBuyHammer,
  19 + freebieHammer,
18 cartType = $('#cartType').val(); 20 cartType = $('#cartType').val();
19 21
20 var hasChecked = $('.cart-content:not(.hide) .icon-cb-checked').length > 0 ? true : false; //是否有选中商品 22 var hasChecked = $('.cart-content:not(.hide) .icon-cb-checked').length > 0 ? true : false; //是否有选中商品
@@ -90,6 +92,8 @@ if ($('.cart-nav').length > 0) { @@ -90,6 +92,8 @@ if ($('.cart-nav').length > 0) {
90 //切换普通商品和预售商品购物车显示 92 //切换普通商品和预售商品购物车显示
91 $cartContent.toggleClass('hide'); 93 $cartContent.toggleClass('hide');
92 94
  95 + hasChecked = $('.cart-content:not(.hide) .icon-cb-checked').length > 0 ? true : false;
  96 +
93 //trigger lazyload 97 //trigger lazyload
94 $(window).trigger('scroll'); 98 $(window).trigger('scroll');
95 }); 99 });
@@ -99,13 +103,27 @@ if ($('.cart-nav').length > 0) { @@ -99,13 +103,27 @@ if ($('.cart-nav').length > 0) {
99 }, 3000); 103 }, 3000);
100 } 104 }
101 105
102 -$('.advance-buy').on('touchend', function() { 106 +if ($('.advance-buy').length > 0) {
  107 + advanceBuyHammer = new Hammer(document.getElementsByClassName('advance-buy')[0]);
  108 + advanceBuyHammer.on('tap', function(e) {
103 window.location.href = '/cart/index/advanceBuy?cartType=' + cartType; 109 window.location.href = '/cart/index/advanceBuy?cartType=' + cartType;
104 -}); 110 + });
  111 +}
105 112
106 -$('.freebie').on('touchend', function() { 113 +if ($('.freebie').length > 0) {
  114 + freebieHammer = new Hammer(document.getElementsByClassName('freebie')[0]);
  115 + freebieHammer.on('tap', function(e) {
107 window.location.href = '/cart/index/gift?cartType=' + cartType; 116 window.location.href = '/cart/index/gift?cartType=' + cartType;
108 -}); 117 + });
  118 +}
  119 +
  120 +//$('.advance-buy').on('touchend', function() {
  121 +// window.location.href = '/cart/index/advanceBuy?cartType=' + cartType;
  122 +//});
  123 +//
  124 +//$('.freebie').on('touchend', function() {
  125 +// window.location.href = '/cart/index/gift?cartType=' + cartType;
  126 +//});
109 127
110 $('.btn-balance').on('touchend', function() { 128 $('.btn-balance').on('touchend', function() {
111 if (shouldSelectGift()) { 129 if (shouldSelectGift()) {
@@ -125,8 +143,6 @@ $('.btn-balance').on('touchend', function() { @@ -125,8 +143,6 @@ $('.btn-balance').on('touchend', function() {
125 }); 143 });
126 144
127 $('.chose').on('touchend', function() { 145 $('.chose').on('touchend', function() {
128 -  
129 - //var id = $(this).closest('.gift-advance-good').data('id');  
130 chosePanel.show(); 146 chosePanel.show();
131 }); 147 });
132 148
@@ -70,7 +70,6 @@ function show(html, cb) { @@ -70,7 +70,6 @@ function show(html, cb) {
70 init(); 70 init();
71 } 71 }
72 $('.chose-panel').show(); 72 $('.chose-panel').show();
73 - $('body').css('overflow', 'hidden');  
74 $num = $('#good-num'); 73 $num = $('#good-num');
75 cbFn = cb; 74 cbFn = cb;
76 } 75 }
@@ -78,7 +77,6 @@ function show(html, cb) { @@ -78,7 +77,6 @@ function show(html, cb) {
78 //隐藏当前Panel 77 //隐藏当前Panel
79 function hide() { 78 function hide() {
80 $('.chose-panel').hide(); 79 $('.chose-panel').hide();
81 - $('body').css('overflow', 'auto');  
82 } 80 }
83 81
84 //修改加入购物车的文字和背景 82 //修改加入购物车的文字和背景
@@ -208,11 +206,11 @@ $yohoPage.on('touchstart', '.color-list .block', function() { @@ -208,11 +206,11 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
208 curColorIndex = index; 206 curColorIndex = index;
209 $('#good-num').val(1); 207 $('#good-num').val(1);
210 208
211 - // 设置按钮的样式和文字  
212 - updateConformButtonClassAndText();  
213 -  
214 // 修改颜色时修改商品图片 209 // 修改颜色时修改商品图片
215 changeGoodImgWhenClickColor(); 210 changeGoodImgWhenClickColor();
  211 +
  212 + // 设置按钮的样式和文字
  213 + updateConformButtonClassAndText();
216 }).on('touchstart', '.size-list .block', function() { 214 }).on('touchstart', '.size-list .block', function() {
217 var $this = $(this), 215 var $this = $(this),
218 index, 216 index,
@@ -232,11 +230,12 @@ $yohoPage.on('touchstart', '.color-list .block', function() { @@ -232,11 +230,12 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
232 $allChoseItems.find('.num .left-num').html(''); 230 $allChoseItems.find('.num .left-num').html('');
233 $('#left-num').val(0); 231 $('#left-num').val(0);
234 hasChooseSize = false; 232 hasChooseSize = false;
  233 + curSizeIndex = null;
  234 + $curSizeBlock = null;
235 235
236 // 当前尺码不是选中状态,选中时 236 // 当前尺码不是选中状态,选中时
237 } else { 237 } else {
238 hasChooseSize = true; 238 hasChooseSize = true;
239 -  
240 curGoodNum = $this.data('num'); 239 curGoodNum = $this.data('num');
241 240
242 // 之前选中的尺码去掉勾选样式 241 // 之前选中的尺码去掉勾选样式
@@ -253,18 +252,21 @@ $yohoPage.on('touchstart', '.color-list .block', function() { @@ -253,18 +252,21 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
253 $('#left-num').val(0); 252 $('#left-num').val(0);
254 } 253 }
255 254
  255 + if (curGoodNum === 0 && hasChooseColor) {
  256 + $this.addClass('zero-stock');
256 } 257 }
257 -  
258 - $this.toggleClass('chosed');  
259 curSizeIndex = index; 258 curSizeIndex = index;
260 $curSizeBlock = $this; 259 $curSizeBlock = $this;
261 - $('#good-num').val(1); 260 + }
262 261
263 - // 设置按钮的样式和文字  
264 - updateConformButtonClassAndText(); 262 + $this.toggleClass('chosed');
  263 + $('#good-num').val(1);
265 264
266 // 重置颜色块的样式 265 // 重置颜色块的样式
267 resetColorZeroStock($siblingBlock); 266 resetColorZeroStock($siblingBlock);
  267 +
  268 + // 设置按钮的样式和文字
  269 + updateConformButtonClassAndText();
268 }); 270 });
269 271
270 $yohoPage.on('touchstart', '.btn-minus', function() { 272 $yohoPage.on('touchstart', '.btn-minus', function() {
@@ -281,7 +283,7 @@ $yohoPage.on('touchstart', '.btn-minus', function() { @@ -281,7 +283,7 @@ $yohoPage.on('touchstart', '.btn-minus', function() {
281 return; 283 return;
282 } 284 }
283 if (num < 0) { 285 if (num < 0) {
284 - tip.show('您选择的数量不能为~'); 286 + tip.show('您选择的数量不能为负数~');
285 return; 287 return;
286 } 288 }
287 289
@@ -295,7 +297,6 @@ $yohoPage.on('touchstart', '.btn-minus', function() { @@ -295,7 +297,6 @@ $yohoPage.on('touchstart', '.btn-minus', function() {
295 return; 297 return;
296 } 298 }
297 299
298 -  
299 if (num - 0 === leftNum || 0 === leftNum) { 300 if (num - 0 === leftNum || 0 === leftNum) {
300 return; 301 return;
301 } 302 }
@@ -23,7 +23,8 @@ var dispatchModeHammer, @@ -23,7 +23,8 @@ var dispatchModeHammer,
23 payType, 23 payType,
24 priceTmpl = Handlebars.compile($('#tmpl-price').html()), 24 priceTmpl = Handlebars.compile($('#tmpl-price').html()),
25 queryString = $.queryString(), 25 queryString = $.queryString(),
26 - orderInfo = order.orderInfo; 26 + orderInfo = order.orderInfo,
  27 + isSubmiting;
27 28
28 lazyLoad(); 29 lazyLoad();
29 30
@@ -127,6 +128,9 @@ function submitOrder() { @@ -127,6 +128,9 @@ function submitOrder() {
127 var invoiceText = $invoice.find('[name="invoice-title"]').val() || orderInfo('invoiceText'), 128 var invoiceText = $invoice.find('[name="invoice-title"]').val() || orderInfo('invoiceText'),
128 msg = $('#msg').find('input').val() || orderInfo('msg'); 129 msg = $('#msg').find('input').val() || orderInfo('msg');
129 130
  131 + if (isSubmiting) {
  132 + return false;
  133 + }
130 if (orderInfo('invoice')) { 134 if (orderInfo('invoice')) {
131 if (!invoiceText) { 135 if (!invoiceText) {
132 tip.show('请输入发票抬头'); 136 tip.show('请输入发票抬头');
@@ -144,6 +148,7 @@ function submitOrder() { @@ -144,6 +148,7 @@ function submitOrder() {
144 } 148 }
145 } 149 }
146 loading.showLoadingMask(); 150 loading.showLoadingMask();
  151 + isSubmiting = true;
147 $.ajax({ 152 $.ajax({
148 method: 'POST', 153 method: 'POST',
149 url: '/cart/index/orderSub', 154 url: '/cart/index/orderSub',
@@ -184,6 +189,7 @@ function submitOrder() { @@ -184,6 +189,7 @@ function submitOrder() {
184 }).fail(function() { 189 }).fail(function() {
185 tip.show('网络出错'); 190 tip.show('网络出错');
186 }).always(function() { 191 }).always(function() {
  192 + isSubmiting = false;
187 loading.hideLoadingMask(); 193 loading.hideLoadingMask();
188 }); 194 });
189 } 195 }
@@ -250,3 +256,7 @@ $('.pay-mode').on('click', 'li', function() { @@ -250,3 +256,7 @@ $('.pay-mode').on('click', 'li', function() {
250 payType = $this.data('pay-type'); 256 payType = $this.data('pay-type');
251 submitOrder(); 257 submitOrder();
252 }); 258 });
  259 +
  260 +$('form').on('submit', function() {
  261 + return false;
  262 +});
@@ -191,8 +191,8 @@ function getCouponDate() { @@ -191,8 +191,8 @@ function getCouponDate() {
191 191
192 getCouponDate(); 192 getCouponDate();
193 193
194 -$(window).scroll(function() {  
195 - if ($(window).scrollTop() + $(window).height() > $('body').height() * 0.9) {  
196 - getCouponDate();  
197 - }  
198 -}); 194 +// $(window).scroll(function() {
  195 +// if ($(window).scrollTop() + $(window).height() > $('body').height() * 0.9) {
  196 +// getCouponDate();
  197 +// }
  198 +// });
@@ -5,15 +5,6 @@ @@ -5,15 +5,6 @@
5 margin-left: 34rem / $pxConvertRem; 5 margin-left: 34rem / $pxConvertRem;
6 height: 160rem / $pxConvertRem; 6 height: 160rem / $pxConvertRem;
7 border-bottom: 1px solid #e0e0e0; 7 border-bottom: 1px solid #e0e0e0;
8 -  
9 - &:last-child {  
10 - border-bottom: none;  
11 - }  
12 - }  
13 -  
14 -  
15 - .advance-block .gift-advance-good:last-child {  
16 - border-bottom: none;  
17 } 8 }
18 9
19 .advance-block:last-child .gift-advance-good:last-child { 10 .advance-block:last-child .gift-advance-good:last-child {
@@ -111,6 +111,11 @@ @@ -111,6 +111,11 @@
111 .price { 111 .price {
112 font-size: 0.6rem; 112 font-size: 0.6rem;
113 color: $cartRed; 113 color: $cartRed;
  114 + display: inline;
  115 + .sale-price{
  116 + color: #b0b0b0;
  117 + text-decoration: line-through;
  118 + }
114 } 119 }
115 120
116 .count { 121 .count {
@@ -140,10 +140,11 @@ @@ -140,10 +140,11 @@
140 140
141 > li { 141 > li {
142 box-sizing: border-box; 142 box-sizing: border-box;
143 - height: 90rem / $pxConvertRem;  
144 - line-height: 90rem / $pxConvertRem; 143 + height: 80rem / $pxConvertRem;
  144 + line-height: 80rem / $pxConvertRem;
145 margin-bottom: 10rem / $pxConvertRem; 145 margin-bottom: 10rem / $pxConvertRem;
146 padding: 0 20rem / $pxConvertRem; 146 padding: 0 20rem / $pxConvertRem;
  147 + background: #f1f1f1;
147 148
148 &:last-child { 149 &:last-child {
149 margin-bottom: 0; 150 margin-bottom: 0;
@@ -185,7 +185,7 @@ @@ -185,7 +185,7 @@
185 height: pxToRem(60px); 185 height: pxToRem(60px);
186 color: #444; 186 color: #444;
187 background: #efefef; 187 background: #efefef;
188 - font-size: pxToRem(16px); 188 + font-size: pxToRem(24px);
189 line-height: 1; 189 line-height: 1;
190 outline: 0; 190 outline: 0;
191 border: 0; 191 border: 0;
@@ -49,7 +49,7 @@ @@ -49,7 +49,7 @@
49 .not-use { 49 .not-use {
50 display: block; 50 display: block;
51 width: pxToRem(560px); 51 width: pxToRem(560px);
52 - margin: pxToRem(30px) auto; 52 + margin: pxToRem(30px) auto 0;
53 text-align: center; 53 text-align: center;
54 font-size: pxToRem(32px); 54 font-size: pxToRem(32px);
55 line-height: 2.5; 55 line-height: 2.5;
@@ -61,7 +61,7 @@ @@ -61,7 +61,7 @@
61 position: relative; 61 position: relative;
62 margin-top: pxToRem(30px); 62 margin-top: pxToRem(30px);
63 margin-bottom: pxToRem(30px); 63 margin-bottom: pxToRem(30px);
64 - font-size: pxToRem(14px); 64 + font-size: pxToRem(28px);
65 line-height: 2; 65 line-height: 2;
66 color: #b0b0b0; 66 color: #b0b0b0;
67 text-align: center; 67 text-align: center;
@@ -41,10 +41,12 @@ @@ -41,10 +41,12 @@
41 </p> 41 </p>
42 </div> 42 </div>
43 <p class="row"> 43 <p class="row">
44 - <span class="price">  
45 - ¥{{price}}  
46 - </span>  
47 - 44 + <p class="price">
  45 + <span class="market-price">¥{{price}}</span>
  46 + {{#if isAdvanceBuy}}
  47 + <span class="sale-price">¥{{salesPrice}}</span>
  48 + {{/if}}
  49 + </p>
48 {{#if isVipPrice}} 50 {{#if isVipPrice}}
49 <span class="vip"> 51 <span class="vip">
50 VIP 52 VIP
@@ -640,16 +640,13 @@ class HomeController extends AbstractAction @@ -640,16 +640,13 @@ class HomeController extends AbstractAction
640 * 我的订单页面,获得nav导航条焦点。并且异步请求订单详情列表页(getOrders) 640 * 我的订单页面,获得nav导航条焦点。并且异步请求订单详情列表页(getOrders)
641 * 641 *
642 */ 642 */
643 -  
644 public function ordersAction() 643 public function ordersAction()
645 { 644 {
646 // 审判跳转登录页 645 // 审判跳转登录页
647 $this->auditJumpLogin(); 646 $this->auditJumpLogin();
648 647
649 - $backUrl = Helpers::url('/home');  
650 -  
651 $this->setTitle('我的订单'); 648 $this->setTitle('我的订单');
652 - $this->setNavHeader('我的订单', $backUrl); 649 + $this->setNavHeader('我的订单', Helpers::url('/home') );
653 650
654 $order = array(); 651 $order = array();
655 //获得type值,type:1=>全部,2=>待付款,3=>待发货,4=>待收货,5=>待评论 652 //获得type值,type:1=>全部,2=>待付款,3=>待发货,4=>待收货,5=>待评论
@@ -887,7 +884,7 @@ class HomeController extends AbstractAction @@ -887,7 +884,7 @@ class HomeController extends AbstractAction
887 $this->setTitle($caption); 884 $this->setTitle($caption);
888 $this->setNavHeader($caption); 885 $this->setNavHeader($caption);
889 886
890 - $this->_view->display('helpDetail', array( 887 + $this->_view->display('help-detail', array(
891 'iHelp' => Home\HelpModel::serviceDetail($code), 888 'iHelp' => Home\HelpModel::serviceDetail($code),
892 )); 889 ));
893 } 890 }
@@ -555,8 +555,8 @@ class CartModel @@ -555,8 +555,8 @@ class CartModel
555 $notAvailableRes = self::searchCoupon($uid, $val['couponCode']); 555 $notAvailableRes = self::searchCoupon($uid, $val['couponCode']);
556 // 处理可用的优惠券 556 // 处理可用的优惠券
557 if ($val['isValidity'] === 'N' || (isset($notAvailableRes['code']) && $notAvailableRes['code'] !== 200)) { 557 if ($val['isValidity'] === 'N' || (isset($notAvailableRes['code']) && $notAvailableRes['code'] !== 200)) {
558 -// $val['notAvailable'] = true;  
559 - continue; 558 + $val['notAvailable'] = true;
  559 + // continue;
560 } 560 }
561 $result[] = $val; 561 $result[] = $val;
562 } 562 }
@@ -71,7 +71,7 @@ class HomeModel @@ -71,7 +71,7 @@ class HomeModel
71 71
72 /** 72 /**
73 * 设置选择的频道保存到浏览器COOKIE 73 * 设置选择的频道保存到浏览器COOKIE
74 - * (已废弃,改成JS设置) 74 + * (已废弃,改成JS设置)
75 * 75 *
76 * @param string $cookie 76 * @param string $cookie
77 * @return void 77 * @return void
@@ -289,7 +289,6 @@ class IndexController extends AbstractAction @@ -289,7 +289,6 @@ class IndexController extends AbstractAction
289 $this->go(Helpers::url('/cart/index/index')); 289 $this->go(Helpers::url('/cart/index/index'));
290 } 290 }
291 291
292 -  
293 $cookieData = $this->getCookie('order-info', null); 292 $cookieData = $this->getCookie('order-info', null);
294 $uid = $this->getUid(true); 293 $uid = $this->getUid(true);
295 $data = array( 294 $data = array(
@@ -457,8 +456,8 @@ class IndexController extends AbstractAction @@ -457,8 +456,8 @@ class IndexController extends AbstractAction
457 $result = CartModel::addToCart($productSku, $buyNumber, $goodsType, $isEdit, $promotionId, $uid, $shoppingKey); 456 $result = CartModel::addToCart($productSku, $buyNumber, $goodsType, $isEdit, $promotionId, $uid, $shoppingKey);
458 457
459 // 设置加入购物车凭证到客户端浏览器 458 // 设置加入购物车凭证到客户端浏览器
460 - if (!$shoppingKey && isset($result['data']['shopping_key'])) {  
461 - $this->setCookie('_Spk', $result['data']['shopping_key']); 459 + if (empty($shoppingKey) && isset($result['data']['shopping_key'])) {
  460 + $this->setCookie('_SPK', $result['data']['shopping_key'], time() + 86400 * 360);
462 } 461 }
463 } 462 }
464 463
@@ -17,6 +17,10 @@ class LoginController extends AbstractAction @@ -17,6 +17,10 @@ class LoginController extends AbstractAction
17 */ 17 */
18 public function indexAction() 18 public function indexAction()
19 { 19 {
  20 + // 清除客户端
  21 + $this->setCookie('_UID', '');
  22 + $this->setCookie('_TOKEN', '');
  23 +
20 $refer = $this->get('refer'); 24 $refer = $this->get('refer');
21 if (!empty($refer)) { 25 if (!empty($refer)) {
22 $this->setCookie('refer', $refer); 26 $this->setCookie('refer', $refer);
@@ -61,7 +65,6 @@ class LoginController extends AbstractAction @@ -61,7 +65,6 @@ class LoginController extends AbstractAction
61 $data['isPassportPage'] = true; // 模板中模块标识 65 $data['isPassportPage'] = true; // 模板中模块标识
62 $data['areaCode'] = '+86'; // 默认区号 66 $data['areaCode'] = '+86'; // 默认区号
63 $data['countrys'] = RegData::getAreasData(); // 地区信息列表 67 $data['countrys'] = RegData::getAreasData(); // 地区信息列表
64 -  
65 // 渲染模板 68 // 渲染模板
66 $this->_view->display('international', $data); 69 $this->_view->display('international', $data);
67 } 70 }
@@ -74,6 +77,7 @@ class LoginController extends AbstractAction @@ -74,6 +77,7 @@ class LoginController extends AbstractAction
74 // 清除客户端 77 // 清除客户端
75 $this->setCookie('_UID', ''); 78 $this->setCookie('_UID', '');
76 $this->setCookie('_TOKEN', ''); 79 $this->setCookie('_TOKEN', '');
  80 + $this->setCookie('_SPK', '');
77 // 清除服务端会话 81 // 清除服务端会话
78 $this->setSession('_TOKEN', ''); 82 $this->setSession('_TOKEN', '');
79 83