|
@@ -18,21 +18,11 @@ export default {
|
|
|
*
|
|
|
* */
|
|
|
async paperCouponRule( {commit,dispatch,state},checkOutResponse ) {
|
|
|
- const groupId = uni.getStorageSync('groupId')
|
|
|
const mallId = uni.getStorageSync('mallId')
|
|
|
if(!mallId ||!mallId) {
|
|
|
commit('setEnablePaperCoupons', false);
|
|
|
return
|
|
|
}
|
|
|
- const siteName = tempParkingH5VoucherSwitchByParkMallCode[checkOutResponse?.parkInfo?.parkMallCode]
|
|
|
- let method = paperCouponDescription;
|
|
|
- // 获取config接口中的迁移开关配置
|
|
|
- const new_old_discount_switch = await getConfValueOfKey('new_old_discount_switch')
|
|
|
- let newOldDiscountSwitch = false
|
|
|
- if(new_old_discount_switch.hasOwnProperty(siteName) && new_old_discount_switch[siteName]){
|
|
|
- newOldDiscountSwitch = true
|
|
|
- method = getPaperCouponDescription
|
|
|
- }
|
|
|
if(checkOutResponse?.discountInfo?.paperCoupons?.length) {
|
|
|
const paperCouponsList = []
|
|
|
checkOutResponse.discountInfo.paperCoupons.forEach(elm => {
|
|
@@ -45,21 +35,9 @@ export default {
|
|
|
dispatch('setDiscountFee')
|
|
|
}
|
|
|
}
|
|
|
- const res = await method({
|
|
|
- groupId: groupId,
|
|
|
- mallId: mallId,
|
|
|
- parkMallCode: checkOutResponse?.parkInfo?.parkMallCode,
|
|
|
- brandId: groupId,
|
|
|
- lbsId: mallId,
|
|
|
- })
|
|
|
- if(newOldDiscountSwitch && res) {
|
|
|
- commit('setEnablePaperCoupons', res.enablePaperCoupons);
|
|
|
- commit('setPaperCouponsDesc', res.paperDiscountDescription)
|
|
|
- return
|
|
|
- }
|
|
|
- if (res.msg === 'success' && res.data) {
|
|
|
- commit('setEnablePaperCoupons', true);
|
|
|
- commit('setPaperCouponsDesc', res.data)
|
|
|
+ if(checkOutResponse?.parkInfo.hasOwnProperty('enablePaperCoupons')) {
|
|
|
+ commit('setEnablePaperCoupons', checkOutResponse.parkInfo.enablePaperCoupons);
|
|
|
+ commit('setPaperCouponsDesc', checkOutResponse.parkInfo.paperDiscountDescription)
|
|
|
}
|
|
|
},
|
|
|
async savePaperCoupon( {commit,dispatch,state},{paperCoupons,callback} ) {
|