Selaa lähdekoodia

feat(KIP-13066): 停车缴费首页功能管理

john 1 vuosi sitten
vanhempi
sitoutus
c3983be961

+ 6 - 0
src/api/parking/index.js

@@ -317,4 +317,10 @@ export function parkingRecord(vehicleId, params) {
 export function checkEligibility(vehicleId) {
   return window.requestms.get(`vehicles/check-eligibility/${vehicleId}`, {} , { loading: false });
   // return window.requestms.delete(`https://dev-kip-service-internal.kerryonvip.com/temporary-parking-service/vehicles/${vehicleId}`, params, { loading: false });
+}
+
+// 通过LBSID查询 停车缴费首页功能管理后端接口
+export function getPortalsByLbs(brandId,lbsIds) {
+  return window.requestms.get(`portals/lbs?brandId=${brandId}&lbsIds=${lbsIds}`, {} , { loading: false });
+  // return window.requestms.delete(`https://dev-kip-service-internal.kerryonvip.com/temporary-parking-service/vehicles/${vehicleId}`, params, { loading: false });
 }

+ 70 - 1
src/pages/parkingFee/mixins/parkingFee.js

@@ -17,7 +17,7 @@ import uni from '@/utils/uniHooks';
 // import greenCom from '../components/green/home.vue';
 // import officeBlueCom from '../components/officeBlue/home.vue';
 // import purpleCom from '../components/purple/home.vue';
-import { parkingLots, qrCodes, unlicensedCarCheckIn, getConfValueOfKey, getVehicles, parkingRecord, checkEligibility, addVehicles } from '@/api/parking';
+import { parkingLots, qrCodes, unlicensedCarCheckIn, getConfValueOfKey, getVehicles, parkingRecord, checkEligibility, addVehicles, getPortalsByLbs } from '@/api/parking';
 import { reject } from 'lodash';
 
 export default {
@@ -67,6 +67,9 @@ export default {
       // 2.19新增内容
       eligibility: {}, // 
       eventId: '',
+      // 2.22新增内容:https://kerryprops.atlassian.net/browse/KIP-13059
+      portalsByLbsList: [],
+      portalsByLbsInfo: {}
     };
   },
   computed: {
@@ -119,6 +122,7 @@ export default {
   async mounted() {
     console.log(1111111);
     this.getVehiclesINTMP()
+    this.getPortalsByLbs()
     setTimeout(() => {
       window?.toWXSendMsg({
         type: 'nowRoute',
@@ -929,6 +933,71 @@ export default {
       // 无牌车这边去支付的时候,属于场内缴费,需要调用场内缴费的接口 /parking/check-out
       this.$store.commit('SET_ENDLESS_LOOP', '');
       this.toHandleSearch(this.unlicensedCar);
+    },
+    async getPortalsByLbs() {
+      try {
+        const res = await getPortalsByLbs(this.groupId, this.mallId);
+        this.portalsByLbsList = res.displayFunctionList.filter(elm => elm.enabled).map(elm => elm.code)
+        this.portalsByLbsInfo = res
+      } catch (e) {
+        console.log('getPortalsByLbs', e)
+      }
+    },
+    async menuToPage(type) {
+      let query = {}
+      switch (type){
+        case 'PAYMENT_RECORDS': // 缴费记录
+          query = {
+            ...this.$route.query,
+          }
+          query.fromPage = ''
+          query.format = ''
+          query.loginCount = ''
+          this.$store.commit('SET_REGRESH_PAGE_KEY')
+          this.$router.push({path: 'parkingFeeList', query});
+          break
+        case 'COUPON_EXCHANGE': // 停车券兑换
+          this.$store.dispatch('clearUnlicensed');
+          uni.setStorageSync('loadData', '');
+          wx.miniProgram.navigateTo({
+            "url": "/pages/pointsMall/pointsMall?exchangeTypes=2" // 去 login 页面 1 去登录
+          })
+          break
+        case 'PARKING_INVOICE': // 停车开票
+          const isJump = await this.jumpToPreJudgmentOfParkingInvoice();
+          if (isJump) return
+          uni.hideLoading()
+          uni.removeStorageSync('invoiceindex');
+          this.$store.dispatch('clearUnlicensed');
+          this.$store.commit('SET_REGRESH_PAGE_KEY')
+          query = {
+            ...this.$route.query,
+          }
+          query.fromPage = ''
+          query.format = ''
+          query.loginCount = ''
+          uni.setStorageSync('loadData', '');
+         
+          this.$router.push({path: 'parkingReceipt', query});
+          break
+        case 'VEHICLE_MANAGE': // 车辆管理
+          this.$store.dispatch('clearUnlicensed');
+          this.$store.commit('SET_REGRESH_PAGE_KEY')
+          uni.setStorageSync('loadData', '');
+          query = {
+            ...this.$route.query,
+          }
+          query.fromPage = ''
+          query.format = ''
+          query.loginCount = ''
+          uni.removeStorageSync('passLogin');
+          this.$router.push({path: 'vehicleManagement', query});
+          break
+        case 'PARKING_BENEFITS': // 停车权益
+          console.log('停车权益', this.portalsByLbsInfo)
+          this.$router.push({path: 'parkingRights', query: this.portalsByLbsInfo});
+          break
+      }
     }
   },
 };

+ 13 - 9
src/pages/parkingFee/parkingFee.vue

@@ -12,24 +12,28 @@
             blue_top_menu: custTypeId === 1,
             green_top_menu: custTypeId === 2,
           }"
-            v-if="custTypeId >= 0"
+            v-if="custTypeId >= 0 && portalsByLbsList.length"
           >
-            <div class="menu_item" @click="doRouter">
-              <img :src="`${require(`./static/images/icon-order.png`)}`" />
+          <div class="menu_item" @click="menuToPage('PAYMENT_RECORDS')" v-if="portalsByLbsList.indexOf('PAYMENT_RECORDS') > -1">
+              <img :src="`${require(`@/pages/parkingFee/static/images/icon-order.png`)}`" />
               <span>缴费记录</span>
             </div>
-            <div class="menu_item" @click="doRouter3" v-if="source !== 'KIP'">
-              <img :src="`${require(`./static/images/icon-coupon.png`)}`" />
+            <div class="menu_item" @click="menuToPage('COUPON_EXCHANGE')" v-if="source !== 'KIP' && portalsByLbsList.indexOf('COUPON_EXCHANGE') > -1">
+              <img :src="`${require(`@/pages/parkingFee/static/images/icon-coupon.png`)}`" />
               <span>停车券兑换</span>
             </div>
-            <div class="menu_item" @click="doRouter1">
-              <img :src="`${require(`./static/images/icon-ticket.png`)}`" />
+            <div class="menu_item" @click="menuToPage('PARKING_INVOICE')" v-if="portalsByLbsList.indexOf('PARKING_INVOICE') > -1">
+              <img :src="`${require(`@/pages/parkingFee/static/images/icon-ticket.png`)}`" />
               <span>停车开票</span>
             </div>
-            <div class="menu_item" @click="doRouter2">
-              <img :src="`${require(`./static/images/icon-car.png`)}`" />
+            <div class="menu_item" @click="menuToPage('VEHICLE_MANAGE')" v-if="portalsByLbsList.indexOf('VEHICLE_MANAGE') > -1">
+              <img :src="`${require(`@/pages/parkingFee/static/images/icon-car.png`)}`" />
               <span>车辆管理</span>
             </div>
+            <div class="menu_item" @click="menuToPage('PARKING_BENEFITS')" v-if="portalsByLbsList.indexOf('PARKING_BENEFITS') > -1">
+              <img :src="`${require(`@/pages/parkingFee/static/images/parkingRights.svg`)}`" />
+              <span>停车权益</span>
+            </div>
           </div>
           
           <!-- 中控 -->

+ 69 - 0
src/pages/parkingFee/parkingRights.vue

@@ -0,0 +1,69 @@
+<template>
+  <div :class="theme">
+    <img class="parkingRights-img" :src="query.benefitsBgUrl" />
+    <div class="add_plate_box" @click="back">
+      <div class="add_plate_btn">我已知晓</div>
+      <div class="btnpb"></div>
+    </div>
+  </div>
+</template>
+<script>
+import baseMixins from './mixins/base';
+
+export default {
+  mixins: [baseMixins],
+  data() {
+    return {
+      query: {},
+    };
+  },
+  mounted() {
+    this.query = this.$route.query;
+  },
+  methods: {
+    back() {
+      this.$router.back();
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.parkingRights-img {
+  width: 100%;
+  display: block;
+}
+.scroll-Y {
+  width: 100%;
+  display: flex;
+  flex-direction: column;
+  height: 100vh;
+  background: #f4f7ff;
+}
+.add_plate_box {
+  text-align: center;
+  background-color: #fafbff;
+  position: fixed;
+  bottom: 0;
+  right: 0;
+  left: 0;
+  z-index: 999;
+  padding: 30px 30px 50px 30px;
+  box-shadow: 0 0 2px 0 hsla(0, 6%, 58%, 0.6);
+
+  .btnpb {
+    width: 100%;
+  }
+
+  .add_plate_btn {
+    width: 100%;
+    height: 90px;
+    line-height: 90px;
+    background-color: var(--k-color-primary-01);
+    border-radius: 45px;
+    font-size: 34px;
+    font-weight: 400;
+    color: #ffffff;
+  }
+}
+</style>

+ 15 - 0
src/pages/parkingFee/static/images/parkingRights.svg

@@ -0,0 +1,15 @@
+<svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M20 68.8123V61.31H21.2125V68.8123C21.2125 69.4342 21.7166 69.9383 22.3385 69.9383H27.2703V76.4299C27.2703 77.0517 27.7744 77.5558 28.3962 77.5558H36.4504C37.0723 77.5558 37.5764 77.0517 37.5764 76.4299V71.466H38.7889V76.4299C38.7889 77.7214 37.7419 78.7683 36.4504 78.7683H28.3962C27.1047 78.7683 26.0578 77.7214 26.0578 76.4299V71.1508H22.3385C21.047 71.1508 20 70.1038 20 68.8123Z" fill="black"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M59.4564 71.4823H32.6551V70.2698H60.6689V76.4301C60.6689 77.0519 61.173 77.556 61.7948 77.556H70.1064C70.7283 77.556 71.2324 77.0519 71.2324 76.4301V70.876H72.4449V76.4301C72.4449 77.7216 71.3979 78.7686 70.1064 78.7686H61.7948C60.5033 78.7686 59.4564 77.7216 59.4564 76.4301V71.4823Z" fill="black"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M79 61.31V69.1436C79 70.4351 77.9531 71.4821 76.6616 71.4821H65.2897V70.2695H76.6616C77.2834 70.2695 77.7875 69.7654 77.7875 69.1436V61.31H79Z" fill="black"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M79 54.8434H20.1055V53.6308H79V54.8434Z" fill="black"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M63.968 48.3529C71.1864 48.3529 77.0382 42.5012 77.0382 35.2827C77.0382 28.0642 71.1864 22.2125 63.968 22.2125C56.7495 22.2125 50.8978 28.0642 50.8978 35.2827C50.8978 42.5012 56.7495 48.3529 63.968 48.3529ZM63.968 49.5654C71.8561 49.5654 78.2507 43.1708 78.2507 35.2827C78.2507 27.3946 71.8561 21 63.968 21C56.0799 21 49.6853 27.3946 49.6853 35.2827C49.6853 43.1708 56.0799 49.5654 63.968 49.5654Z" fill="black"/>
+<circle cx="32.1774" cy="62.4659" r="4.82879" stroke="black" stroke-width="1.4"/>
+<circle cx="66.2717" cy="62.4659" r="4.82879" stroke="black" stroke-width="1.4"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M72.3318 47.9331L75.3831 53.4873L74.3204 54.0711L71.2691 48.517L72.3318 47.9331Z" fill="black"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M31.0642 36.4243C31.9983 34.3351 34.0731 32.9901 36.3617 32.9901H49.0689V34.2026H36.3617C34.5513 34.2026 32.9101 35.2666 32.1712 36.9193L24.5223 54.0265L23.4154 53.5315L31.0642 36.4243Z" fill="black"/>
+<path d="M57.7226 34.3981V42.8004H70.366V34.3981" stroke="black" stroke-width="1.2"/>
+<path d="M64.0282 30.2634C64.5616 29.0631 66.2653 26.7 67.6292 27.196C69.0963 27.7295 67.9954 29.0101 67.7626 29.1964C67.0957 29.7301 65.273 30.219 64.2949 30.5302" stroke="black" stroke-width="1.2"/>
+<path d="M63.8948 30.2584C63.4024 29.0347 61.83 26.6258 60.5712 27.1314C59.2172 27.6753 60.2495 28.9539 60.4481 29.1707C60.9606 29.7301 62.7459 30.2131 63.6486 30.5303" stroke="black" stroke-width="1.2"/>
+<path d="M56.1398 30.5303V34.1313H71.6303V30.5303H55.6154" stroke="black" stroke-width="1.2"/>
+</svg>

+ 70 - 1
src/pages/parkingFeeV2/mixins/parkingFee.js

@@ -12,7 +12,7 @@ const app = {
   },
 };
 import uni from '@/utils/uniHooks';
-import {parkingLots, qrCodes, unlicensedCarCheckIn, getConfValueOfKey, getVehicles, parkingRecord, checkEligibility, addVehicles} from '@/api/parking';
+import {parkingLots, qrCodes, unlicensedCarCheckIn, getConfValueOfKey, getVehicles, parkingRecord, checkEligibility, addVehicles, getPortalsByLbs} from '@/api/parking';
 
 export default {
   components: {
@@ -59,6 +59,9 @@ export default {
       // 2.19新增内容
       eligibility: {}, // 
       eventId: '',
+      // 2.22新增内容:https://kerryprops.atlassian.net/browse/KIP-13059
+      portalsByLbsList: [],
+      portalsByLbsInfo: {}
     };
   },
   computed: {
@@ -149,6 +152,7 @@ export default {
     //   await initWxJsSdkConfig(['checkJsApi', 'scanQRCode']);
     // }
     this.getVehiclesINTMP()
+    this.getPortalsByLbs()
     const openid = uni.getStorageSync('openid');
 
     // 如果用户未登录的话,返回之后,重新获取数据用户的基础数据
@@ -988,5 +992,70 @@ export default {
       });
       return array
     },
+    async getPortalsByLbs() {
+      try {
+        const res = await getPortalsByLbs(this.groupId, this.mallId);
+        this.portalsByLbsList = res.displayFunctionList.filter(elm => elm.enabled).map(elm => elm.code)
+        this.portalsByLbsInfo = res
+      } catch (e) {
+        console.log('getPortalsByLbs', e)
+      }
+    },
+    async menuToPage(type) {
+      let query = {}
+      switch (type){
+        case 'PAYMENT_RECORDS': // 缴费记录
+          query = {
+            ...this.$route.query,
+          }
+          query.fromPage = ''
+          query.format = ''
+          query.loginCount = ''
+          this.$store.commit('SET_REGRESH_PAGE_KEY')
+          this.$router.push({path: 'parkingFeeList', query});
+          break
+        case 'COUPON_EXCHANGE': // 停车券兑换
+          this.$store.dispatch('clearUnlicensed');
+          uni.setStorageSync('loadData', '');
+          wx.miniProgram.navigateTo({
+            "url": "/pages/pointsMall/pointsMall?exchangeTypes=2" // 去 login 页面 1 去登录
+          })
+          break
+        case 'PARKING_INVOICE': // 停车开票
+          const isJump = await this.jumpToPreJudgmentOfParkingInvoice();
+          if (isJump) return
+          uni.hideLoading()
+          uni.removeStorageSync('invoiceindex');
+          this.$store.dispatch('clearUnlicensed');
+          this.$store.commit('SET_REGRESH_PAGE_KEY')
+          query = {
+            ...this.$route.query,
+          }
+          query.fromPage = ''
+          query.format = ''
+          query.loginCount = ''
+          uni.setStorageSync('loadData', '');
+         
+          this.$router.push({path: 'parkingReceipt', query});
+          break
+        case 'VEHICLE_MANAGE': // 车辆管理
+          this.$store.dispatch('clearUnlicensed');
+          this.$store.commit('SET_REGRESH_PAGE_KEY')
+          uni.setStorageSync('loadData', '');
+          query = {
+            ...this.$route.query,
+          }
+          query.fromPage = ''
+          query.format = ''
+          query.loginCount = ''
+          uni.removeStorageSync('passLogin');
+          this.$router.push({path: 'vehicleManagement', query});
+          break
+        case 'PARKING_BENEFITS': // 停车权益
+          console.log('停车权益', this.portalsByLbsInfo)
+          this.$router.push({path: 'parkingRights', query: this.portalsByLbsInfo});
+          break
+      }
+    }
   },
 };

+ 31 - 5
src/pages/parkingFeeV2/parkingFee.vue

@@ -4,6 +4,28 @@
       <div class="wrap">
         <div class="parkingFee">
           <!-- <wx-points-commit ref='wxPointsCommit'></wx-points-commit> -->
+          <!-- KIP菜单 -->
+          <div
+            v-if="source === 'KIP'"
+            :class="{
+              top_menu: true,
+              blue_top_menu: custTypeId === 1,
+              green_top_menu: custTypeId === 2,
+            }"
+          >
+            <div class="menu_item" @click="menuToPage('PAYMENT_RECORDS')">
+              <img :src="`${require(`@/pages/parkingFee/static/images/icon-order.png`)}`" />
+              <span>缴费记录</span>
+            </div>
+            <div class="menu_item" @click="menuToPage('PARKING_INVOICE')">
+              <img :src="`${require(`@/pages/parkingFee/static/images/icon-ticket.png`)}`" />
+              <span>停车开票</span>
+            </div>
+            <div class="menu_item" @click="menuToPage('VEHICLE_MANAGE')">
+              <img :src="`${require(`@/pages/parkingFee/static/images/icon-car.png`)}`" />
+              <span>车辆管理</span>
+            </div>
+          </div>
           <!-- 菜单 -->
           <div
             :class="{
@@ -11,24 +33,28 @@
             blue_top_menu: custTypeId === 1,
             green_top_menu: custTypeId === 2,
           }"
-            v-if="custTypeId >= 0"
+            v-if="custTypeId >= 0 && portalsByLbsList.length && source !== 'KIP'"
           >
-            <div class="menu_item" @click="doRouter">
+            <div class="menu_item" @click="menuToPage('PAYMENT_RECORDS')" v-if="portalsByLbsList.indexOf('PAYMENT_RECORDS') > -1">
               <img :src="`${require(`@/pages/parkingFee/static/images/icon-order.png`)}`" />
               <span>缴费记录</span>
             </div>
-            <div class="menu_item" @click="doRouter3" v-if="source !== 'KIP'">
+            <div class="menu_item" @click="menuToPage('COUPON_EXCHANGE')" v-if="portalsByLbsList.indexOf('COUPON_EXCHANGE') > -1">
               <img :src="`${require(`@/pages/parkingFee/static/images/icon-coupon.png`)}`" />
               <span>停车券兑换</span>
             </div>
-            <div class="menu_item" @click="doRouter1">
+            <div class="menu_item" @click="menuToPage('PARKING_INVOICE')" v-if="portalsByLbsList.indexOf('PARKING_INVOICE') > -1">
               <img :src="`${require(`@/pages/parkingFee/static/images/icon-ticket.png`)}`" />
               <span>停车开票</span>
             </div>
-            <div class="menu_item" @click="doRouter2">
+            <div class="menu_item" @click="menuToPage('VEHICLE_MANAGE')" v-if="portalsByLbsList.indexOf('VEHICLE_MANAGE') > -1">
               <img :src="`${require(`@/pages/parkingFee/static/images/icon-car.png`)}`" />
               <span>车辆管理</span>
             </div>
+            <div class="menu_item" @click="menuToPage('PARKING_BENEFITS')" v-if="portalsByLbsList.indexOf('PARKING_BENEFITS') > -1">
+              <img :src="`${require(`@/pages/parkingFee/static/images/parkingRights.svg`)}`" />
+              <span>停车权益</span>
+            </div>
           </div>
           
           <!-- 中控 -->

+ 69 - 0
src/pages/parkingFeeV2/parkingRights.vue

@@ -0,0 +1,69 @@
+<template>
+  <div :class="theme">
+    <img class="parkingRights-img" :src="query.benefitsBgUrl" />
+    <div class="add_plate_box" @click="back">
+      <div class="add_plate_btn">我已知晓</div>
+      <div class="btnpb"></div>
+    </div>
+  </div>
+</template>
+<script>
+import baseMixins from './mixins/base';
+
+export default {
+  mixins: [baseMixins],
+  data() {
+    return {
+      query: {},
+    };
+  },
+  mounted() {
+    this.query = this.$route.query;
+  },
+  methods: {
+    back() {
+      this.$router.back();
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.parkingRights-img {
+  width: 100%;
+  display: block;
+}
+.scroll-Y {
+  width: 100%;
+  display: flex;
+  flex-direction: column;
+  height: 100vh;
+  background: #f4f7ff;
+}
+.add_plate_box {
+  text-align: center;
+  background-color: #fafbff;
+  position: fixed;
+  bottom: 0;
+  right: 0;
+  left: 0;
+  z-index: 999;
+  padding: 30px 30px 50px 30px;
+  box-shadow: 0 0 2px 0 hsla(0, 6%, 58%, 0.6);
+
+  .btnpb {
+    width: 100%;
+  }
+
+  .add_plate_btn {
+    width: 100%;
+    height: 90px;
+    line-height: 90px;
+    background-color: var(--k-color-primary-01);
+    border-radius: 45px;
+    font-size: 34px;
+    font-weight: 400;
+    color: #ffffff;
+  }
+}
+</style>

+ 5 - 0
src/routes/index.js

@@ -149,6 +149,11 @@ const routes = [
     name: 'parkingFeeMsg',
     component: () => import('@/pages/parkingFee/parkingFeeMsg.vue'),
   },
+  {
+    path: '/parkingRights',
+    name: 'parkingRights',
+    component: () => import('@/pages/parkingFee/parkingRights.vue'),
+  },
   {
     path: '/dome',
     name: 'dome',

+ 4 - 0
src/routes/indexV2.js

@@ -82,6 +82,10 @@ export const routes = [
         path: '/parkingFeeSuccess',
         name: 'parkingFeeSuccess',
         component: () => import('@/pages/parkingFeeV2/parkingFeeSuccess.vue'),
+    },{
+        path: '/parkingRights',
+        name: 'parkingRights',
+        component: () => import('@/pages/parkingFeeV2/parkingRights.vue'),
     },
       {
         path: '/about',