Authored by QC-L

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

... ... @@ -43,12 +43,12 @@ class BuyNowController {
let product_sku = req.query.product_sku;
let buy_number = req.query.buy_number;
let isGroup = req.query.is_group || '0';
let isNoGroup = req.query.is_group || '0';
if (isGroup === '1') {
isGroup = false;
if (isNoGroup === '1') {
isNoGroup = false;
} else {
isGroup = true;
isNoGroup = true;
}
if (!product_sku || !buy_number) {
... ... @@ -80,7 +80,7 @@ class BuyNowController {
});
}
if (isGroup) {
if (isNoGroup) {
co(function * () {
let [userProfile, address, result, computeData, validCouponCount, validGiftCardCount] =
yield Promise.all([
... ... @@ -182,6 +182,7 @@ class BuyNowController {
} else {
let activity_id = req.query.activity_id;
let group_no = req.query.group_no;
let is_group = req.query.is_group;
co(function * () {
let [userProfile, address, result, computeData, validCouponCount, validGiftCardCount] =
... ... @@ -247,7 +248,10 @@ class BuyNowController {
}),
selectAddressUrl: helpers.urlFormat('/cart/index/buynow/selectAddress', {
product_sku: product_sku,
buy_number: buy_number
buy_number: buy_number,
is_group,
activity_id,
group_no
}),
selectCouponUrl: helpers.urlFormat('/cart/index/buynow/selectCoupon', {
product_sku: product_sku,
... ... @@ -545,13 +549,24 @@ class BuyNowController {
let uid = req.user.uid;
let product_sku = req.query.product_sku;
let buy_number = req.query.buy_number;
let is_group = req.query.is_group;
let moreUrlParam = {
product_sku: product_sku,
buy_number: buy_number
};
if (is_group) {
moreUrlParam.activity_id = req.query.activity_id;
if (req.query.group_no) {
moreUrlParam.group_no = req.query.group_no;
}
moreUrlParam.is_group = is_group;
}
co(function * () {
let address = yield req.ctx(addressModel).addressData(uid);
let moreUrl = helpers.urlFormat('/cart/index/buynow/orderensure', {
product_sku: product_sku,
buy_number: buy_number
});
let moreUrl = helpers.urlFormat('/cart/index/buynow/orderensure', moreUrlParam);
address = address.data;
... ...