Authored by QC-L

修复点击选择地址,下单展示不正确的问题

@@ -43,12 +43,12 @@ class BuyNowController { @@ -43,12 +43,12 @@ class BuyNowController {
43 let product_sku = req.query.product_sku; 43 let product_sku = req.query.product_sku;
44 let buy_number = req.query.buy_number; 44 let buy_number = req.query.buy_number;
45 45
46 - let isGroup = req.query.is_group || '0'; 46 + let isNoGroup = req.query.is_group || '0';
47 47
48 - if (isGroup === '1') {  
49 - isGroup = false; 48 + if (isNoGroup === '1') {
  49 + isNoGroup = false;
50 } else { 50 } else {
51 - isGroup = true; 51 + isNoGroup = true;
52 } 52 }
53 53
54 if (!product_sku || !buy_number) { 54 if (!product_sku || !buy_number) {
@@ -80,7 +80,7 @@ class BuyNowController { @@ -80,7 +80,7 @@ class BuyNowController {
80 }); 80 });
81 } 81 }
82 82
83 - if (isGroup) { 83 + if (isNoGroup) {
84 co(function * () { 84 co(function * () {
85 let [userProfile, address, result, computeData, validCouponCount, validGiftCardCount] = 85 let [userProfile, address, result, computeData, validCouponCount, validGiftCardCount] =
86 yield Promise.all([ 86 yield Promise.all([
@@ -182,6 +182,7 @@ class BuyNowController { @@ -182,6 +182,7 @@ class BuyNowController {
182 } else { 182 } else {
183 let activity_id = req.query.activity_id; 183 let activity_id = req.query.activity_id;
184 let group_no = req.query.group_no; 184 let group_no = req.query.group_no;
  185 + let is_group = req.query.is_group;
185 186
186 co(function * () { 187 co(function * () {
187 let [userProfile, address, result, computeData, validCouponCount, validGiftCardCount] = 188 let [userProfile, address, result, computeData, validCouponCount, validGiftCardCount] =
@@ -247,7 +248,10 @@ class BuyNowController { @@ -247,7 +248,10 @@ class BuyNowController {
247 }), 248 }),
248 selectAddressUrl: helpers.urlFormat('/cart/index/buynow/selectAddress', { 249 selectAddressUrl: helpers.urlFormat('/cart/index/buynow/selectAddress', {
249 product_sku: product_sku, 250 product_sku: product_sku,
250 - buy_number: buy_number 251 + buy_number: buy_number,
  252 + is_group,
  253 + activity_id,
  254 + group_no
251 }), 255 }),
252 selectCouponUrl: helpers.urlFormat('/cart/index/buynow/selectCoupon', { 256 selectCouponUrl: helpers.urlFormat('/cart/index/buynow/selectCoupon', {
253 product_sku: product_sku, 257 product_sku: product_sku,
@@ -545,13 +549,24 @@ class BuyNowController { @@ -545,13 +549,24 @@ class BuyNowController {
545 let uid = req.user.uid; 549 let uid = req.user.uid;
546 let product_sku = req.query.product_sku; 550 let product_sku = req.query.product_sku;
547 let buy_number = req.query.buy_number; 551 let buy_number = req.query.buy_number;
  552 + let is_group = req.query.is_group;
  553 +
  554 + let moreUrlParam = {
  555 + product_sku: product_sku,
  556 + buy_number: buy_number
  557 + };
  558 +
  559 + if (is_group) {
  560 + moreUrlParam.activity_id = req.query.activity_id;
  561 + if (req.query.group_no) {
  562 + moreUrlParam.group_no = req.query.group_no;
  563 + }
  564 + moreUrlParam.is_group = is_group;
  565 + }
548 566
549 co(function * () { 567 co(function * () {
550 let address = yield req.ctx(addressModel).addressData(uid); 568 let address = yield req.ctx(addressModel).addressData(uid);
551 - let moreUrl = helpers.urlFormat('/cart/index/buynow/orderensure', {  
552 - product_sku: product_sku,  
553 - buy_number: buy_number  
554 - }); 569 + let moreUrl = helpers.urlFormat('/cart/index/buynow/orderensure', moreUrlParam);
555 570
556 address = address.data; 571 address = address.data;
557 572