...
|
...
|
@@ -24,7 +24,7 @@ function _queryFromServiceAsync(fn) { |
|
|
} else {
|
|
|
return Promise.reject();
|
|
|
}
|
|
|
};
|
|
|
}
|
|
|
|
|
|
Page({
|
|
|
data: {
|
...
|
...
|
@@ -54,7 +54,7 @@ Page({ |
|
|
onShow() {
|
|
|
this.getCartData();
|
|
|
},
|
|
|
onHide: function () {
|
|
|
onHide: function() {
|
|
|
if (this.data.isEditing) {
|
|
|
this.editCartStatus({clearEditing: true});
|
|
|
}
|
...
|
...
|
@@ -128,7 +128,7 @@ Page({ |
|
|
} else {
|
|
|
return Promise.reject({});
|
|
|
}
|
|
|
}).catch((e) => {
|
|
|
}).catch(() => {
|
|
|
this.setData(this._oldOrdinaryCartData);
|
|
|
});
|
|
|
},
|
...
|
...
|
@@ -164,27 +164,27 @@ Page({ |
|
|
this.setData({promotionMoreStatus});
|
|
|
},
|
|
|
navToPromotionPage(e) {
|
|
|
let pItem = e.currentTarget.dataset.promotionItem;
|
|
|
let pItem = e.currentTarget.dataset.promotion;
|
|
|
let promotion_type = pItem.promotion_type;
|
|
|
|
|
|
let gStatus = (+pItem.status === 10 || +pItem.status === 30);
|
|
|
|
|
|
if (promotion_type == 'Gift' && gStatus) {
|
|
|
if (promotion_type === 'Gift' && gStatus) {
|
|
|
router.go('cartGift', {
|
|
|
promotion_id: pItem.promotion_id,
|
|
|
is_gift: 1,
|
|
|
status: pItem.status
|
|
|
});
|
|
|
} else if (promotion_type == 'Needpaygift' && gStatus) {
|
|
|
} else if (promotion_type === 'Needpaygift' && gStatus) {
|
|
|
router.go('cartGift', {
|
|
|
promotion_id: pItem.promotion_id,
|
|
|
status: pItem.status
|
|
|
});
|
|
|
} else {
|
|
|
// console.log("跳转促销商品列表页面");
|
|
|
let spliceUrl = "?title=优惠活动商品" + "&promotionTitle=以下商品参加【" + pItem.promotion_title + "】促销活动&promotion_id=" + promotionItem.promotion_id;
|
|
|
wx.navigateTo({
|
|
|
url: '../goodsList/PromotionList' + spliceUrl,
|
|
|
router.go('productSearch', {
|
|
|
title: '优惠活动商品',
|
|
|
promotionTitle: pItem.promotion_title,
|
|
|
promotionId: pItem.promotion_id
|
|
|
});
|
|
|
}
|
|
|
},
|
...
|
...
|
@@ -219,7 +219,7 @@ Page({ |
|
|
if (res && res.code === 200) {
|
|
|
this.editCart([goods], 'Y');
|
|
|
}
|
|
|
})
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
editBundleNum(e) {
|
...
|
...
|
@@ -340,7 +340,7 @@ Page({ |
|
|
for (let i in this._removeGoodsList) {
|
|
|
if (this._removeGoodsList.hasOwnProperty(i) && this._removeGoodsList[i]) {
|
|
|
removeList.push(this._removeGoodsList[i]);
|
|
|
};
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (!removeList.length) {
|
...
|
...
|
@@ -372,7 +372,7 @@ Page({ |
|
|
if (invalidGoods && invalidGoods.length) {
|
|
|
invalidGoods.map(list => {
|
|
|
invalidList.push.apply(invalidList, list);
|
|
|
})
|
|
|
});
|
|
|
}
|
|
|
|
|
|
return this.removeCartGoodsAsync(invalidList);
|
...
|
...
|
@@ -398,7 +398,7 @@ Page({ |
|
|
});
|
|
|
},
|
|
|
paymentAction: function() {
|
|
|
//如果没有选中商品则不能进入结算页
|
|
|
// 如果没有选中商品则不能进入结算页
|
|
|
if (this.data.shoppingCartData.selected_goods_count <= 0) {
|
|
|
return this.showToast('您还没有选择宝贝哦');
|
|
|
}
|
...
|
...
|
@@ -410,13 +410,13 @@ Page({ |
|
|
confirmColor: '#444444',
|
|
|
cancelColor: '#444444',
|
|
|
}).then(res => {
|
|
|
if (res.confirm) {
|
|
|
// TODO 去选择赠品
|
|
|
// that.navToChooseGiftPage();
|
|
|
} else if (res.cancel) {
|
|
|
//直接跳转 结算页面
|
|
|
router.go('cartEnsure');
|
|
|
}
|
|
|
if (res.confirm) {
|
|
|
// TODO 去选择赠品
|
|
|
// that.navToChooseGiftPage();
|
|
|
} else if (res.cancel) {
|
|
|
// 直接跳转 结算页面
|
|
|
router.go('cartEnsure');
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
router.go('cartEnsure');
|
...
|
...
|
@@ -427,7 +427,7 @@ Page({ |
|
|
Picker.pickerHide(this);
|
|
|
}
|
|
|
},
|
|
|
confirmChoose(e) {
|
|
|
confirmChoose() {
|
|
|
let sku = this.data.selectedSKU;
|
|
|
|
|
|
if (!sku) {
|
...
|
...
|
@@ -437,7 +437,7 @@ Page({ |
|
|
let buyNumber = this.data.pickerData.view.buyNumber;
|
|
|
let min_buy_number = this.data.pickerData.view.min_buy_number > 0 ? this.data.pickerData.view.min_buy_number : 1;
|
|
|
|
|
|
if (buyNumber > 0 && buyNumber < min_buy_number && min_buy_number != 1) {
|
|
|
if (buyNumber > 0 && buyNumber < min_buy_number && min_buy_number !== 1) {
|
|
|
return this.showToast('最低' + min_buy_number + '件起');
|
|
|
}
|
|
|
|
...
|
...
|
@@ -467,6 +467,5 @@ Page({ |
|
|
}
|
|
|
});
|
|
|
},
|
|
|
// eslint-disable-next-line
|
|
|
...Picker.pickerAction
|
|
|
}); |
...
|
...
|
|