Procházet zdrojové kódy

feat(KIP-17684): request body 去除 buildingId 优化接口

john před 1 rokem
rodič
revize
01b817523a
2 změnil soubory, kde provedl 5 přidání a 27 odebrání
  1. 2 2
      src/api/request.js
  2. 3 25
      src/store/order/paperCoupon.js

+ 2 - 2
src/api/request.js

@@ -145,9 +145,9 @@ function XUser(config) {
   }
   
   // params = {"userId": "8aaa809d835ba76d018378bc57180006","sourceType": "WECHAT","phoneNumber": "18521563898","projectId": "paroject1","buildingId": "QHKC-P1","brandId":"8a84853b7c91ac5b017c962dab55030e","cid": "oIUfO5XAVleJ88z13i1_08DCKIhQ","vipCode":"KERRY100200040","lbsId":"8aaa81cb7c836c6b017c83e46b110001"}
-  if (/calculate-discount|unlicensed-car-check-in|unlicensed-car-checkout|paper-coupon/g.test(config.url)) {
+  /* if (/calculate-discount|unlicensed-car-check-in|unlicensed-car-checkout|paper-coupon/g.test(config.url)) {
     params.buildingId = window.localStorage.getItem('buildingId');
-  }
+  } */
   params = Object.assign(params, config['Parking-User'])
   const newParams = {}
   Object.keys(params).forEach(key => {

+ 3 - 25
src/store/order/paperCoupon.js

@@ -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} ) {