Ver código fonte

feat(KIP-9676): [DE][C端]临时停车,用户在进入缴费页面以后,进入优惠券里面,进入CRM小程序,应该跳转到前海嘉湾汇得商场

john 2 anos atrás
pai
commit
1c63fe4f1d

+ 4 - 4
src/pages/parkingFee/components/officeBlue/parkingFeeCoupon.vue

@@ -1,6 +1,6 @@
 <template>
   <div scroll-y="true" :class="['scroll-Y' , theme]">
-    <div >
+    <div>
       <div class="parkingFeeCoupon">
         <van-checkbox-group :value="checkedCouponList">
           <div class="card-list" v-if="couponList.length">
@@ -24,13 +24,13 @@
                   <span class="span">有效期至 {{ item.expirationDate }}</span>
                 </div>
                 <div class="erwm_box">
-                  <van-checkbox color="#fff" @click="checkboxItemChange(`coupon${index}`, index)" checked-color="var(--k-color-primary)" :disabled="item.disabled" :name="`coupon${index}`" />
+                  <van-checkbox color="#fff" @click="checkboxItemChange(`coupon${index}`, index)" checked-color="var(--k-color-primary)" :disabled="item.disabled" :name="`coupon${index}`"/>
                 </div>
               </div>
             </div>
           </div>
           <div class="no-coupon" v-else>
-            <img :src="require('../../static/images/no-card.png')" />
+            <img :src="require('../../static/images/no-card.png')"/>
             <span class="message">您还没有卡券</span>
           </div>
         </van-checkbox-group>
@@ -48,7 +48,7 @@
           <div class="guide-desc">
             停车优惠券可直接使用,若您还没有兑换或继续兑换,可前往
             <span class="guide-mini">嘉里中心小程序>积分商城</span>
-            <wx-open-launch-weapp username="gh_0bd6a97b6d38" id="launch-btn" :path="`pages/pointsMall/pointsMall.html${launchPath}`" class="wx-open-launch-weapp" :env-version="envVersion" @launch="launchFn" @error="launchErrorFn">
+            <wx-open-launch-weapp username="gh_0bd6a97b6d38" id="launch-btn" :path="`pages/pointsMall/pointsMall.html${launchPath}`" class="wx-open-launch-weapp" :env-version="envVersion" :extra-data="{...extraData, navigate_time:new Date().getTime()}" @launch="launchFn" @error="launchErrorFn">
               <script type="text/wxtag-template">
                 <span style="white-space: nowrap;display: inline-block;color: transparent;text-decoration: underline;margin: 0 5px;font-size: 14PX;"></span>
               </script>

+ 17 - 8
src/pages/parkingFee/mixins/parkingFeeCoupon.js

@@ -18,6 +18,7 @@ export default {
       platform: getPlatform(),
       maxCouponFee: 0, // 计算优惠券已选的总金额
       remainPrice: 0, // 剩余可用优惠额度
+      extraData: {}
     };
   },
   props:{
@@ -35,6 +36,8 @@ export default {
       maxOneDayDiscountFee: (state) => state.order.maxOneDayDiscountFee, // 深圳单日单次使用上限
       usingTotalDiscount: (state) => state.order.usingTotalDiscount, // 当前已使用优惠
       availableDiscountFee: (state) => state.order.availableDiscountFee, // 当前已使用优惠
+      lbsId: (state) => state.lbsId, // 楼栋ID
+      groupId: (state) => state.groupId, // 楼盘ID
     }),
   },
 
@@ -46,7 +49,7 @@ export default {
       });
       if (isInWeixinH5()) {
         initWxJsSdkConfig(['checkJsApi', 'chooseImage'], ['wx-open-launch-weapp']);
-        // this.launchPathInit();
+        this.launchPathInit();
       }
     }, 300);
     this.pageInit();
@@ -367,20 +370,26 @@ export default {
         type: 'all',
       });
       this.launchPath = `?trackSourceType=运营位&trackSourceName=功能球&projectId=${projectId}&groupId=${groupId}&mallId=${mallId}&source=tparkingH5`;
+
+      let isLogin = false
+      const member = uni.getStorageSync('member');
+      if (member && JSON.stringify(this.member) !== '{}') {
+        isLogin = true
+      }
+      this.extraData = {
+        brandId: this.groupId,
+        lbsId: this.lbsId,
+        isLogin: isLogin,
+        navigate_time:new Date().getTime()
+      }
     },
     // 跳转小程序
     navigateToMiniProgram() {
       if (this.platform === 'miniprogram') {
-        // const { projectId } = getAppIdByGroupIdAndMallId({
-        //   groupId: this.$route.params.groupId,
-        //   mallId: this.$route.params.mallId,
-        //   type: 'all',
-        // });
-        // this.launchPathInit();
         window.toWXSendMsg({
           type: 'navigateToMiniProgram',
           options: {
-            launchPath: this.launchPath,
+            retailLbsId: this.lbsId,
           },
         });
         // 订阅微信小程序端的回调

+ 5 - 4
src/pages/parkingFee/mixins/parkingFeeDetail.js

@@ -72,6 +72,7 @@ export default {
       unlicensedInfo: state => state.unlicensedInfo,
       endlessLoop: (state) => state.endlessLoop,
       appId: state => state.appId,
+      source: state => state.source,
     }),
     // 支付按钮状态
     payBtnDisabled() {
@@ -429,10 +430,10 @@ export default {
     },
     coupon() {
       // 如果没有电子券的话,提示用户
-      if (this.coupons.length === 0) {
-      uni.showToast({
-        title: '暂无可使用的优惠券,请前往积分商城兑换优惠券'
-      })
+      if (this.coupons.length === 0 && this.source !== 'KIP') {
+        uni.showToast({
+          title: '暂无可使用的优惠券,请前往积分商城兑换优惠券'
+        })
         return
       }
       this.$router.push({

+ 5 - 1
src/store/index.js

@@ -218,8 +218,12 @@ const store = new Vuex.Store({
           const groupIdAndMallId = getGroupIdAndMallIdByLsbId(lbsId);
           groupId = groupIdAndMallId.groupId;
           mallId = groupIdAndMallId.mallId;
+          // console.log('lbsId', groupIdAndMallId)
+          commit('SET_LBS_ID',mallId);
+        } else {
+          commit('SET_LBS_ID',lbsId);
         }
-        commit('SET_LBS_ID',lbsId);
+        
         commit('SET_CUST_TYPE_ID',custTypeId);
         // 如果为 false,则表示当前用户是从小程序端未登录进入的
         if ( !isLogin ) {

+ 5 - 5
src/utils/index.js

@@ -170,12 +170,12 @@ export function initEnv() {
   const href = window.location.href;
   console.log('当前页面的url地址  ',href);
   if ( /dev-|8080/.test(href) ) {
-    /*window.env = 'qa';
-     window.profileApi = 'https://qa-apim.kerryplus.com/c/api';
-     window.api = 'qaApi';*/
-    window.env = 'dev';
+    window.env = 'qa';
+    window.profileApi = 'https://qa-apim.kerryplus.com/c/api';
+    window.api = 'qaApi';
+    /*window.env = 'dev';
     window.profileApi = 'https://dev-gateway-kip.kerryonvip.com/api';
-    window.api = 'devApi';
+    window.api = 'devApi';*/
     // window.env = 'prod';
     // window.profileApi = 'https://sl-apim.kerryplus.com/c/api';
     // window.api = 'api';