|
@@ -1,8 +1,10 @@
|
|
|
-import { calculateDiscount, getPaperCouponDescription,getConfValueOfKey } from "@/api/parking";
|
|
|
-import {paperCouponDescription} from '@/utils/api-crm-member'
|
|
|
+import { calculateDiscount,
|
|
|
+ // getPaperCouponDescription,getConfValueOfKey
|
|
|
+ } from "@/api/parking";
|
|
|
+// import {paperCouponDescription} from '@/utils/api-crm-member'
|
|
|
import { setSelected } from "@/store/order/utils";
|
|
|
import uni from '@/utils/uniHooks';
|
|
|
-import {tempParkingH5VoucherSwitchByParkMallCode} from '@/common/js/BaseDictionary'
|
|
|
+// import {tempParkingH5VoucherSwitchByParkMallCode} from '@/common/js/BaseDictionary'
|
|
|
|
|
|
export default {
|
|
|
/*
|
|
@@ -18,21 +20,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 +37,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?.parkingRule.hasOwnProperty('enablePaperCoupons')) {
|
|
|
+ commit('setEnablePaperCoupons', checkOutResponse.parkingRule.enablePaperCoupons);
|
|
|
+ commit('setPaperCouponsDesc', checkOutResponse.parkingRule.paperDiscountDescription)
|
|
|
}
|
|
|
},
|
|
|
async savePaperCoupon( {commit,dispatch,state},{paperCoupons,callback} ) {
|