|
@@ -0,0 +1,1034 @@
|
|
|
+import plateNumber from '@/components/plate-number/plateNumber.vue';
|
|
|
+import {LICENSE_PLATE_TYPE_ARR, REG_SOURCE} from '@/constants';
|
|
|
+import LoginDom from '@/components/Login/Login.vue';
|
|
|
+import {mapState} from 'vuex';
|
|
|
+import {initWxJsSdkConfig} from '@/utils/login';
|
|
|
+import {getUrlParams, isHZ} from '@/utils';
|
|
|
+import wxPointsAuth from '@/components/wx-points-auth/wx-points-auth.vue'
|
|
|
+
|
|
|
+const app = {
|
|
|
+ globalData: {
|
|
|
+ regSource: '',
|
|
|
+ },
|
|
|
+};
|
|
|
+import uni from '@/utils/uniHooks';
|
|
|
+import {getCarInformation, parkingLots, qrCodes, unlicensedCarCheckIn, getConfValueOfKey, getVehicles, parkingRecord, checkEligibility, addVehicles, getPortalsByLbs} from '@/api/parking';
|
|
|
+
|
|
|
+export default {
|
|
|
+ components: {
|
|
|
+ plateNumber,
|
|
|
+ LoginDom,
|
|
|
+ 'wx-points-auth': wxPointsAuth,
|
|
|
+ // blueCom,
|
|
|
+ // greenCom,
|
|
|
+ // officeBlueCom,
|
|
|
+ // purpleCom,
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ showPointsAuth: true,
|
|
|
+ vehicleMgt_content_index: -1, //历史车辆选中
|
|
|
+ carType: 0, //车辆类型
|
|
|
+ init_ch: false, // 字体超出隐藏显示
|
|
|
+ search_price: false, //查询按钮隐藏显示
|
|
|
+ parkInfoEntity: {},
|
|
|
+ show_chinese: false, //是否显示汉字键盘
|
|
|
+ show_allBoard: false, //是否显示英文数字键盘
|
|
|
+ plate_number: '', //车牌号
|
|
|
+ description: '', // 车场描述
|
|
|
+ ind: null,
|
|
|
+ numArr: ['', '', '', '', '', '', ''],
|
|
|
+ active: null,
|
|
|
+ carList: [], // 车辆列表
|
|
|
+ classifyList: ['燃油车牌', '新能源', '特殊车牌'], // 车牌类型
|
|
|
+ vehicleNumber: '',
|
|
|
+ localimgPic: '',
|
|
|
+ hourMoney: '',
|
|
|
+ showSq: false,
|
|
|
+ blueHeadBg: 'parkingFee/fee-head-bg.png',
|
|
|
+ picUrl: this.$picUrl,
|
|
|
+ colorAry: ['', '-blue', '-green'],
|
|
|
+ openId: null,
|
|
|
+ options: null,
|
|
|
+ preUrl: '',
|
|
|
+ tabbarActive: 'manualPayment',
|
|
|
+ supportUnlicensed: false, // 控制当前site,是否使用无牌车
|
|
|
+ qrCodeHistory: '',
|
|
|
+ isAlipayClient: isAlipayClient,
|
|
|
+ // custTypeId: 0,
|
|
|
+ // 2.19新增内容
|
|
|
+ eligibility: {}, //
|
|
|
+ eventId: '',
|
|
|
+ // 2.22新增内容:https://kerryprops.atlassian.net/browse/KIP-13059
|
|
|
+ portalsByLbsList: [],
|
|
|
+ portalsByLbsInfo: {}
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ disabledBtn() {
|
|
|
+ return this.numArr.filter((val) => !val).length > 0;
|
|
|
+ },
|
|
|
+ ...mapState({
|
|
|
+ groupId: (state) => state.groupId,
|
|
|
+ openid: (state) => state.openid,
|
|
|
+ mallId: (state) => state.mallId,
|
|
|
+ kipUserId: (state) => state.kipUserId,
|
|
|
+ userInfo: (state) => state.userInfo,
|
|
|
+ member: (state) => state.member,
|
|
|
+ mobile: (state) => state.mobile,
|
|
|
+ custTypeId: (state) => state.custTypeId,
|
|
|
+ unlicensedCar: (state) => state.order.unlicensedCar,
|
|
|
+ // 如果是扫码进入的无牌车
|
|
|
+ unlicensedInfo: (state) => state.unlicensedInfo,
|
|
|
+ endlessLoop: (state) => state.endlessLoop,
|
|
|
+ source: (state) => state.source,
|
|
|
+ }),
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ // console.log('二次加载this.$route.query.fromPage', this.$route.query.fromPage, this.$store.state.pageHistory);
|
|
|
+ // console.log('二次加载', this.$route.query.fromPage && !this.$store.state.pageHistory[this.$route.query.fromPage]);
|
|
|
+ // const fromPage = localStorage.getItem(`${this.$route.query.fromPage}`)
|
|
|
+ // if (this.$route.query?.fromPage && this.$route.query?.fromPage !== 'undefined' && !this.$store.state.pageHistory[this.$route.query.fromPage] && !fromPage) {
|
|
|
+ // // console.log(93939);
|
|
|
+ // this.$store.commit('setPageHistory', {
|
|
|
+ // [this.$route.query.fromPage]: 1
|
|
|
+ // })
|
|
|
+ // localStorage.setItem(`${this.$route.query.fromPage}`, this.$route.query.fromPage)
|
|
|
+ // setTimeout(() => {
|
|
|
+ // this.$router.push({
|
|
|
+ // path: this.$route.query.fromPage, query: {
|
|
|
+ // ...this.$route.query,
|
|
|
+ // loginCount: 1
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // }, 200)
|
|
|
+ // }
|
|
|
+ // const {type = '', code = ''} = this.$route.query
|
|
|
+ // // 无牌车流程
|
|
|
+ // if (/unlicensedOut|unlicensedIn/.test(type) && code && !this.$store.state.pageHistory?.unlicensed && !this.endlessLoop) {
|
|
|
+ // this.$store.commit('setPageHistory', {
|
|
|
+ // unlicensed: 1
|
|
|
+ // })
|
|
|
+ // this.$store.commit('SET_UNLICENSED_INFO', {
|
|
|
+ // type, code
|
|
|
+ // });
|
|
|
+ // this.$store.commit('SET_ENDLESS_LOOP', type);
|
|
|
+ // this.$nextTick(() => {
|
|
|
+ // this.qrCodesRule(code);
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ beforeRouteLeave(to, from, next) {
|
|
|
+ this.$store.commit('cachedViews/DEL_CACHED_VIEW', to);
|
|
|
+ next();
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ openid() {
|
|
|
+ if (this.openid) {
|
|
|
+ // this.getParkInfo();
|
|
|
+ this.showSq = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // unlicensedInfo:{
|
|
|
+ // handler(){
|
|
|
+ // // const member = uni.getStorageSync('member');
|
|
|
+ // // if(!member) return // 如果用户走未登录流程的话
|
|
|
+ // // 不论是否出入场,都使用此函数获取 gateId(闸口机器的ID)
|
|
|
+ // if (this.unlicensedInfo?.type && /unlicensedOut|unlicensedIn/.test(this.unlicensedInfo.type) && this.endlessLoop.length === 0) {
|
|
|
+ // // 此处记录扫码流程执行次数。如果超过一次则不再执行
|
|
|
+ // this.$store.commit('SET_ENDLESS_LOOP', this.unlicensedInfo.type);
|
|
|
+ // this.$nextTick(() => {
|
|
|
+ // this.qrCodesRule(this.unlicensedInfo.code);
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // immediate:true //true就表示会立即执行
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ toggleType(carType) {
|
|
|
+ this.ind = 0;
|
|
|
+ this.active = 0;
|
|
|
+ this.carType = carType;
|
|
|
+ if (carType === 1) {
|
|
|
+ this.numArr = [
|
|
|
+ this.numArr[0],
|
|
|
+ this.numArr[1],
|
|
|
+ this.numArr[2],
|
|
|
+ this.numArr[3],
|
|
|
+ this.numArr[4],
|
|
|
+ this.numArr[5],
|
|
|
+ this.numArr[6],
|
|
|
+ this.numArr[7],
|
|
|
+ ];
|
|
|
+ } else {
|
|
|
+ this.numArr = [
|
|
|
+ this.numArr[0],
|
|
|
+ this.numArr[1],
|
|
|
+ this.numArr[2],
|
|
|
+ this.numArr[3],
|
|
|
+ this.numArr[4],
|
|
|
+ this.numArr[5],
|
|
|
+ this.numArr[6],
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ this.vehicleNumber = this.numArr.join('');
|
|
|
+ },
|
|
|
+ // 获取停车场信息
|
|
|
+ getParkInfo: async function () {
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中',
|
|
|
+ });
|
|
|
+ try {
|
|
|
+ // 加载车场信息
|
|
|
+ const res = await parkingLots(this.$store.state.lbsId);
|
|
|
+ // console.log(res);
|
|
|
+ let reg = /[;;]/g;
|
|
|
+ this.description = res?.description?.replace(reg, '\r\n').replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>');
|
|
|
+ this.supportUnlicensed = res.supportUnlicensed || false
|
|
|
+ const carList = uni.getStorageSync('carList');
|
|
|
+ if (carList) {
|
|
|
+ this.carList = JSON.parse(carList);
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ console.log(225225, e);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //缴费说明隐藏显示
|
|
|
+ top_display() {
|
|
|
+ this.init_ch = !this.init_ch;
|
|
|
+ },
|
|
|
+ // 唤起键盘
|
|
|
+ clickShowKeyboard(index) {
|
|
|
+ if ( index === 7) {
|
|
|
+ this.carType = 1
|
|
|
+ this.$refs['k-tab'].changeTab(this.carType)
|
|
|
+ }
|
|
|
+ this.ind = index;
|
|
|
+ this.active = index;
|
|
|
+ if (index === 0) {
|
|
|
+ this.$refs['plateKeyboard'].openKeyboardCN();
|
|
|
+ } else {
|
|
|
+ this.$refs['plateKeyboard'].closeKeyboardCN();
|
|
|
+ this.$refs['plateKeyboard'].openKeyboardEN();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 接收子组件数据
|
|
|
+ updateCarno(val) {
|
|
|
+ this.numArr = [...val.numArr];
|
|
|
+ this.vehicleNumber = this.numArr.join('');
|
|
|
+ this.active = val.active;
|
|
|
+ this.ind = val.ind;
|
|
|
+ },
|
|
|
+ // 节流函数
|
|
|
+ throttle(fc, waitTime = 500, imme = true) {
|
|
|
+ if (imme) {
|
|
|
+ if (!this.flag) {
|
|
|
+ this.flag = true;
|
|
|
+ typeof fc === 'function' && fc();
|
|
|
+ this.timer = setTimeout(() => {
|
|
|
+ this.flag = false;
|
|
|
+ }, waitTime);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (!this.flag) {
|
|
|
+ this.flag = true;
|
|
|
+ this.timer = setTimeout(() => {
|
|
|
+ this.flag = false;
|
|
|
+ typeof fc === 'function' && fc();
|
|
|
+ }, waitTime);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async checkEligibility(vehicleNumber = this.vehicleNumber) {
|
|
|
+ try {
|
|
|
+ /*
|
|
|
+ * 如果是杭州,并且是登陆情况
|
|
|
+ * {
|
|
|
+ "eligible": false, // 是否优惠车
|
|
|
+ "isBound": false, // 是否绑定
|
|
|
+ "maxBindingCount": 3, // 绑定数量上限
|
|
|
+ "maxChangeCount": 5, // 换绑数量上限
|
|
|
+ "userBindingCount": 3, // 用户当前绑定车牌数量
|
|
|
+ "userRemainingChangeCount": 5, // 用户剩余换绑次数
|
|
|
+ "redirectTo": "CHANGE_BINDING" // 跳转页面
|
|
|
+ }
|
|
|
+ BIND_NEW //去绑定
|
|
|
+ CHANGE_BINDING //去换绑
|
|
|
+ PAY_WITHOUT_DISCOUNT //去无优惠支付或放弃支付
|
|
|
+ CHECK_OUT //直接去查费,带优惠
|
|
|
+ *
|
|
|
+ * */
|
|
|
+ // 如果是杭州,并且是登陆情况
|
|
|
+ this.eligibility = await checkEligibility(vehicleNumber)
|
|
|
+ /*this.eligibility = {
|
|
|
+ "eligible": false, // 是否优惠车
|
|
|
+ "isBound": false, // 是否绑定
|
|
|
+ "maxBindingCount": 3, // 绑定数量上限
|
|
|
+ "maxChangeCount": 5, // 换绑数量上限
|
|
|
+ "userBindingCount": 3, // 用户当前绑定车牌数量
|
|
|
+ "userRemainingChangeCount": 5, // 用户剩余换绑次数
|
|
|
+ "redirectTo": "CHANGE_BINDING" // 跳转页面
|
|
|
+ }*/
|
|
|
+ // 是否优惠车 是否绑定, 或者 直接去查费,带优惠
|
|
|
+ if(this.eligibility.eligible && this.eligibility.isBound || this.eligibility.redirectTo === 'CHECK_OUT') {
|
|
|
+ this.toParkingFeeDetail(vehicleNumber)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 是否绑定
|
|
|
+ if(this.eligibility.redirectTo === 'BIND_NEW' && this.eligibility.maxBindingCount > this.eligibility.userBindingCount) {
|
|
|
+ this.$refs['checkCarPopup'].open({
|
|
|
+ redirectTo: this.eligibility.redirectTo,
|
|
|
+ vehicleNo: vehicleNumber,
|
|
|
+ topBtnFn: async () => {
|
|
|
+ const res = await addVehicles(this.kipUserId,
|
|
|
+ {
|
|
|
+ userId: this.kipUserId,
|
|
|
+ licensePlateType: LICENSE_PLATE_TYPE_ARR[this.carType].value,
|
|
|
+ vehicleNo: vehicleNumber,
|
|
|
+ })
|
|
|
+ if(res?.id) {
|
|
|
+ this.toParkingFeeDetail(vehicleNumber)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ bottomBtnFn: () => {
|
|
|
+ this.toParkingFeeDetail(vehicleNumber)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 是否换绑
|
|
|
+ if(this.eligibility.redirectTo === 'CHANGE_BINDING' && this.eligibility.userRemainingChangeCount) {
|
|
|
+ this.$refs['checkCarPopup'].open({
|
|
|
+ redirectTo: this.eligibility.redirectTo,
|
|
|
+ vehicleNo: vehicleNumber,
|
|
|
+ topBtnName: '去换绑(可享停车优惠)',
|
|
|
+ topBtnFn: async () => {
|
|
|
+ this.doRouter2()
|
|
|
+ },
|
|
|
+ bottomBtnName: '放弃换绑(无停车优惠)',
|
|
|
+ bottomBtnFn: () => {
|
|
|
+ this.toParkingFeeDetail(vehicleNumber)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 去无优惠支付或放弃支付,其余场景都是无优惠
|
|
|
+ /*if(this.eligibility.redirectTo === 'PAY_WITHOUT_DISCOUNT') {
|
|
|
+
|
|
|
+ }*/
|
|
|
+ this.$refs['checkCarPopup'].open({
|
|
|
+ // redirectTo: this.eligibility.redirectTo,
|
|
|
+ redirectTo: 'PAY_WITHOUT_DISCOUNT',
|
|
|
+ vehicleNo: vehicleNumber,
|
|
|
+ topBtnName: '继续缴费(无停车优惠)',
|
|
|
+ topBtnFn: () => {
|
|
|
+ this.toParkingFeeDetail(vehicleNumber)
|
|
|
+ },
|
|
|
+ bottomBtnName: '放弃缴费 ',
|
|
|
+ })
|
|
|
+ } catch (err) {
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 校验车牌号
|
|
|
+ async preHandleSearch() {
|
|
|
+ if (this.disabledBtn) return
|
|
|
+ // 不是杭州的车牌 或者 用户拒绝登陆的场景
|
|
|
+ if (!isHZ(this.mallId) || this.$route.query.isLogin === 'loginDenied') {
|
|
|
+ this.toParkingFeeDetail()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 查询车辆优惠资格并提示跳转页面
|
|
|
+ await this.checkEligibility()
|
|
|
+ },
|
|
|
+ // 去反向寻车详情
|
|
|
+ async toParkingFeeDetail(vehicleNumber = this.vehicleNumber) {
|
|
|
+ uni.setStorageSync('carList', [
|
|
|
+ ...new Set([vehicleNumber, ...this.carList]),
|
|
|
+ ].slice(0, 6));
|
|
|
+ const res = await getCarInformation(vehicleNumber)
|
|
|
+ console.log('resresres', res)
|
|
|
+ if (res.data) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ const query = {
|
|
|
+ ...this.$route.query,
|
|
|
+ vehicleNo: vehicleNumber,
|
|
|
+ }
|
|
|
+ // fromPage && format && unlicensed
|
|
|
+ query.fromPage = ''
|
|
|
+ query.format = ''
|
|
|
+ query.unlicensed = ''
|
|
|
+ this.$router.push({
|
|
|
+ path: 'parkingFindCar',
|
|
|
+ query,
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ // 历史车牌快速查询
|
|
|
+ async toHandleSearchBefore(vehicleNo) {
|
|
|
+ // 不是杭州的车牌 或者 用户拒绝登陆的场景
|
|
|
+ if (!isHZ(this.mallId) || this.$route.query.isLogin === 'loginDenied') {
|
|
|
+ this.toHandleSearch(vehicleNo)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 查询车辆优惠资格并提示跳转页面
|
|
|
+ await this.checkEligibility(vehicleNo)
|
|
|
+
|
|
|
+ },
|
|
|
+ toHandleSearch(vehicleNo) {
|
|
|
+ uni.setStorageSync('carList', [...new Set([vehicleNo, ...this.carList])].slice(0, 6));
|
|
|
+ this.$store.commit('cachedViews/DEL_CACHED_VIEW', {
|
|
|
+ name: 'parkingFeeDetail',
|
|
|
+ });
|
|
|
+ this.$store.commit('SET_REGRESH_PAGE_KEY')
|
|
|
+ this.$nextTick(() => {
|
|
|
+ const query = {
|
|
|
+ ...this.$route.query,
|
|
|
+ vehicleNo: vehicleNo,
|
|
|
+ }
|
|
|
+ // fromPage && format && unlicensed
|
|
|
+ query.fromPage = ''
|
|
|
+ query.format = ''
|
|
|
+ query.unlicensed = ''
|
|
|
+
|
|
|
+ this.$router.push({
|
|
|
+ path: 'parkingFeeDetail',
|
|
|
+ query,
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 查询车费信息
|
|
|
+ async handleSearch(carno, clickEvent = '$ClickQueryAndPayment') {
|
|
|
+ this.vehicleNumber = carno;
|
|
|
+ const params = {
|
|
|
+ carno,
|
|
|
+ mallid: this.mallId,
|
|
|
+ openid: this.openid,
|
|
|
+ vipcode: this.member?.vipcode,
|
|
|
+ mobile: this.mobile,
|
|
|
+ groupId: this.groupId,
|
|
|
+ createuser: 'sys_miniprogram',
|
|
|
+ };
|
|
|
+ // 查询缴费按钮埋点
|
|
|
+ let [carTypeName, redirectUrl, parkTime] = ['ordinary', '', ''];
|
|
|
+ switch (this.carType) {
|
|
|
+ case 0:
|
|
|
+ carTypeName = 'ordinary';
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ carTypeName = 'newEnergy';
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ carTypeName = 'special';
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ this.$md(params);
|
|
|
+ this.$request({
|
|
|
+ // url: this.$baseURL + 'api/1.0/park/checkCarIsInPark',
|
|
|
+ url: this.$baseURL + 'api/1.0/park/checkCarIsInParkAndCarFee',
|
|
|
+ // url: 'http://172.21.90.87:8083/xcrm-api/api/1.0/park/checkCarIsInParkAndCarFee',
|
|
|
+ data: params,
|
|
|
+ method: 'POST',
|
|
|
+ header: JSON.parse(uni.getStorageSync('handleUser')),
|
|
|
+ timeout: 60000 * 2, // 120S
|
|
|
+ showLoading: {
|
|
|
+ title: '加载中',
|
|
|
+ duration: 0,
|
|
|
+ },
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ // console.log(555555, res);
|
|
|
+ // ToastObj.clear();
|
|
|
+ // uni.hideLoading();
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ // 清理旧数据
|
|
|
+ this.parkingFeeDetailInit();
|
|
|
+ uni.setStorageSync('isReload', '3');
|
|
|
+ // this.$destroy();
|
|
|
+ const query = {
|
|
|
+ ...this.$route.query,
|
|
|
+ vehicleNo: carno,
|
|
|
+ }
|
|
|
+ // fromPage && format && unlicensed
|
|
|
+ query.fromPage = ''
|
|
|
+ query.format = ''
|
|
|
+ query.unlicensed = ''
|
|
|
+ this.$router.push({
|
|
|
+ path: 'parkingFeeDetail',
|
|
|
+ query,
|
|
|
+ });
|
|
|
+ parkTime = res.data?.data?.serviceMin;
|
|
|
+ redirectUrl = '/pages/parkingFee/parkingFeeDetail.vue';
|
|
|
+ } else if (res.data.code === 1) {
|
|
|
+ // 当前车辆没有查到账单
|
|
|
+ this.$router.push({
|
|
|
+ path: 'parkingFeePayment',
|
|
|
+ query: {
|
|
|
+ ...this.$route.query,
|
|
|
+ msg: res.data.msg,
|
|
|
+ carno,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ redirectUrl = '/pages/parkingFee/parkingFeePayment.vue';
|
|
|
+ } else if (res.data.code === 2) {
|
|
|
+ // 月租车
|
|
|
+ this.$router.push({
|
|
|
+ path: './parkingFeeHint/parkingFeeHint',
|
|
|
+ query: {
|
|
|
+ ...this.$route.query,
|
|
|
+ carno,
|
|
|
+ },
|
|
|
+ });
|
|
|
+
|
|
|
+ redirectUrl = '/pages/parkingFee/parkingFeeHint/parkingFeeHint.vue';
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: res.data.msg,
|
|
|
+ duration: 2000,
|
|
|
+ icon: 'none',
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ // uni.hideLoading();
|
|
|
+ uni.showToast({
|
|
|
+ title: '网络超时请稍后再试',
|
|
|
+ duration: 2000,
|
|
|
+ icon: 'none',
|
|
|
+ });
|
|
|
+ console.log(err);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 页面初始清空缓存
|
|
|
+ parkingFeeDetailInit() {
|
|
|
+ console.log('清理数据');
|
|
|
+ // 优惠减免(首停、会员、消费)
|
|
|
+ uni.removeStorageSync('checkedList'); // 选中list
|
|
|
+ uni.removeStorageSync('checkedTotal'); // 选中count数
|
|
|
+ uni.removeStorageSync('discountTotal'); // 减免信息(时长、费用)
|
|
|
+
|
|
|
+ // 停车减免(优惠、积分、停车券)
|
|
|
+ uni.removeStorageSync('parkFee');
|
|
|
+
|
|
|
+ // 电子券优惠信息
|
|
|
+ uni.removeStorageSync('checkedCouponList'); // 选中list
|
|
|
+ uni.removeStorageSync('couponInfo'); // 减免信息(时长、费用)
|
|
|
+ uni.removeStorageSync('list'); // 电子券list
|
|
|
+
|
|
|
+ // 总停车优惠信息(时长、费用)
|
|
|
+ uni.removeStorageSync('parkingTotal');
|
|
|
+
|
|
|
+ // 应缴金额
|
|
|
+ uni.removeStorageSync('servicefee');
|
|
|
+
|
|
|
+ // 订单号
|
|
|
+ uni.removeStorageSync('orderno');
|
|
|
+
|
|
|
+ // 纸质优惠券
|
|
|
+ uni.removeStorageSync('paperCouponInfo');
|
|
|
+ },
|
|
|
+ // 缴费记录
|
|
|
+ doRouter: function () {
|
|
|
+ const query = {
|
|
|
+ ...this.$route.query,
|
|
|
+ // vehicleNo: vehicleNo,
|
|
|
+ }
|
|
|
+ // fromPage && format && unlicensed
|
|
|
+ query.fromPage = ''
|
|
|
+ query.format = ''
|
|
|
+ query.loginCount = ''
|
|
|
+ // uni.setStorageSync('loadData', '');
|
|
|
+ // if (this.$store.state.isLogin === 'loginDenied') {
|
|
|
+ // this.$router.push({ path: 'login' });
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ this.$store.commit('SET_REGRESH_PAGE_KEY')
|
|
|
+ this.$router.push({path: 'parkingFeeList', query});
|
|
|
+ },
|
|
|
+ // 车牌管理
|
|
|
+ doRouter2: function () {
|
|
|
+ this.$store.dispatch('clearUnlicensed');
|
|
|
+ // window?.toWXSendMsg({
|
|
|
+ // type: 'uni_func',
|
|
|
+ // funcName: 'setStorageSync',
|
|
|
+ // options: {
|
|
|
+ // key: 'noLoginParkingFeeWebViewPath',
|
|
|
+ // value: ''
|
|
|
+ // },
|
|
|
+ // });
|
|
|
+ this.$store.commit('SET_REGRESH_PAGE_KEY')
|
|
|
+ uni.setStorageSync('loadData', '');
|
|
|
+ // if (this.$store.state.isLogin === 'loginDenied') {
|
|
|
+ // this.$router.push({ path: 'login' });
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ const query = {
|
|
|
+ ...this.$route.query,
|
|
|
+ // vehicleNo: vehicleNo,
|
|
|
+ }
|
|
|
+ // fromPage && format && unlicensed
|
|
|
+ query.fromPage = ''
|
|
|
+ query.format = ''
|
|
|
+ query.loginCount = ''
|
|
|
+ uni.removeStorageSync('passLogin');
|
|
|
+ this.$router.push({path: 'vehicleManagement', query});
|
|
|
+ },
|
|
|
+ async jumpToPreJudgmentOfParkingInvoice() {
|
|
|
+ return new Promise(async (resolve) => {
|
|
|
+ try {
|
|
|
+ // 判断是否启用停车发票
|
|
|
+ uni.showLoading()
|
|
|
+ // const res = await getAccessH5(`${this.mallId}-invoice`);
|
|
|
+ const res = await getConfValueOfKey('HEJIInvoiceSwitch')
|
|
|
+ const lbsId = uni.getStorageSync('lbsId')
|
|
|
+ if (res?.switch && res.lbsId.length && res.lbsId.indexOf(lbsId) > -1) {
|
|
|
+ uni.hideLoading();
|
|
|
+ // console.log(474, this.Dialog);
|
|
|
+ this.$dialog({
|
|
|
+ title: '温馨提示',
|
|
|
+ // message: '小程序“停车开票”功能将从2023年8月10日起提供服务,支持开具3个月内停车记录的发票,如需停车开票,请稍后尝试或咨询服务台',
|
|
|
+ message: res.message,
|
|
|
+ confirmButtonColor: this.$theme[this.theme].primaryColor
|
|
|
+ })
|
|
|
+ // 提示用户
|
|
|
+ // uni.showToast({
|
|
|
+ // title:'尽请期待!'
|
|
|
+ // })
|
|
|
+ resolve(true)
|
|
|
+ }
|
|
|
+ resolve(false)
|
|
|
+ } catch (err) {
|
|
|
+ console.log(err);
|
|
|
+ resolve(false)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // return false
|
|
|
+ },
|
|
|
+ //停车发票
|
|
|
+ doRouter1: async function () {
|
|
|
+ const isJump = await this.jumpToPreJudgmentOfParkingInvoice();
|
|
|
+ if (isJump) return
|
|
|
+ uni.hideLoading()
|
|
|
+ uni.removeStorageSync('invoiceindex');
|
|
|
+ this.$store.dispatch('clearUnlicensed');
|
|
|
+ this.$store.commit('SET_REGRESH_PAGE_KEY')
|
|
|
+ // window?.toWXSendMsg({
|
|
|
+ // type: 'uni_func',
|
|
|
+ // funcName: 'setStorageSync',
|
|
|
+ // options: {
|
|
|
+ // key: 'noLoginParkingFeeWebViewPath',
|
|
|
+ // value: ''
|
|
|
+ // },
|
|
|
+ // });
|
|
|
+ const query = {
|
|
|
+ ...this.$route.query,
|
|
|
+ // vehicleNo: vehicleNo,
|
|
|
+ }
|
|
|
+ // fromPage && format && unlicensed
|
|
|
+ query.fromPage = ''
|
|
|
+ query.format = ''
|
|
|
+ query.loginCount = ''
|
|
|
+ uni.setStorageSync('loadData', '');
|
|
|
+ // if (this.$store.state.isLogin === 'loginDenied') {
|
|
|
+ // this.$router.push({ path: 'login' });
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // uni.removeStorageSync('passLogin');
|
|
|
+ // TODO: 北京停车场开票
|
|
|
+ /* if (this.parkInfoEntity.parkMallCode === 3) {
|
|
|
+ uni.navigateToMiniProgram({
|
|
|
+ appId: this.$etcpAppId,
|
|
|
+ path: this.$etcpAppInvoicePath,
|
|
|
+ envVersion: 'release',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ */
|
|
|
+ this.$router.push({path: 'parkingReceipt', query});
|
|
|
+ },
|
|
|
+ //停车券兑换
|
|
|
+ doRouter3: function () {
|
|
|
+ this.$store.dispatch('clearUnlicensed');
|
|
|
+ // window?.toWXSendMsg({
|
|
|
+ // type: 'uni_func',
|
|
|
+ // funcName: 'setStorageSync',
|
|
|
+ // options: {
|
|
|
+ // key: 'noLoginParkingFeeWebViewPath',
|
|
|
+ // value: ''
|
|
|
+ // },
|
|
|
+ // });
|
|
|
+ uni.setStorageSync('loadData', '');
|
|
|
+ // window.toWXSendMsg({
|
|
|
+ // type: 'toPage',
|
|
|
+ // options: {
|
|
|
+ // fnName: 'navigateTo',
|
|
|
+ // url: '/pages/pointsMall/pointsMall?exchangeTypes=2',
|
|
|
+ // },
|
|
|
+ // });
|
|
|
+
|
|
|
+ wx.miniProgram.navigateTo({
|
|
|
+ "url": "/pages/pointsMall/pointsMall?exchangeTypes=2" // 去 login 页面 1 去登录
|
|
|
+ })
|
|
|
+ },
|
|
|
+ blueComChange(value) {
|
|
|
+ console.log('blueComChange', value);
|
|
|
+ },
|
|
|
+ tabbarActiveEvent(name) {
|
|
|
+ this.tabbarActive = name
|
|
|
+ if (name === 'paymentForUnregisteredVehicle') {
|
|
|
+ this.$store.dispatch('order/unlicensedRule', (code) => {
|
|
|
+
|
|
|
+ // CAR_NOT_FOUND 车场扫描道闸入口,发现无车
|
|
|
+ if (code === 'CAR_NOT_FOUND') {
|
|
|
+
|
|
|
+ }
|
|
|
+ // CAR_HAS_PLATE 车场扫描道闸入口,发现有牌车
|
|
|
+ if (code === 'CAR_HAS_PLATE') {
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 无牌车闸机扫码
|
|
|
+ async scanCarCode() {
|
|
|
+ try {
|
|
|
+ const runScanFn = (res) => {
|
|
|
+ if (res.scanType && res.scanType == 'QR_CODE') {
|
|
|
+ console.log(res.result);
|
|
|
+ // 获取二维码参数之后,模拟提取参数
|
|
|
+ const url = res.result;
|
|
|
+ const {path} = getUrlParams(res.result)
|
|
|
+ let params = null
|
|
|
+ if (path) {
|
|
|
+ params = getUrlParams(decodeURIComponent(path))
|
|
|
+ }
|
|
|
+ /*
|
|
|
+ 微信扫码之后,处理过的参数 {"code": "e41d4d9dd5534f4aa3de88326a2e6f85", "type": "unlicensedIn#wechat-redirect"}
|
|
|
+ */
|
|
|
+ if (params?.type.indexOf('wechat-redirect') > -1) {
|
|
|
+ params.type = params.type.replace('#wechat-redirect', '');
|
|
|
+ }
|
|
|
+ console.log('微信扫码之后,处理过的参数', params);
|
|
|
+ this.$store.commit('SET_UNLICENSED_INFO', params);
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.qrCodesRule(params.code, 'scan');
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ /*
|
|
|
+ 针对微信的小程序码进行的兼容改造
|
|
|
+ 微信扫码结束之后的返回参数 {"errMsg": "scanCode:ok", "scanType": "WX_CODE", "charSet": "ISO8859-1", "rawData": "bGsoP3gyT1Aud3QpbW1JeHRfVHJsUjg4JnR5cGU9dW5saWNlbnNlZElu", "path": "pages/automatic/automaticIndex?scene=code%3D9988%26type%3DunlicensedIn"}
|
|
|
+ */
|
|
|
+ if (res.scanType && res.scanType === 'WX_CODE' && res.path) {
|
|
|
+ const params = getUrlParams(`?${decodeURIComponent(res.path.replace(/.*scene=/g, ''))}`)
|
|
|
+ this.$store.commit('SET_UNLICENSED_INFO', params);
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.qrCodesRule(params.code, 'scan');
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // 兜底逻辑,如果是其他小程序扫描,则提取rawData,进行解析提取入参
|
|
|
+ if (res.scanType && res.scanType === 'WX_CODE' && !res?.path) {
|
|
|
+ let path = atob(res.rawData)
|
|
|
+ path = path.replace(/.*([a-z0-9]{6}&type)/g, '8b$1')
|
|
|
+ const regex = /(\w+)&type=(\w+)/;
|
|
|
+ const match = path.match(regex);
|
|
|
+ const obj = {code: match[1], type: match[2]};
|
|
|
+ this.$store.commit('SET_UNLICENSED_INFO', obj);
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.qrCodesRule(obj.code, 'scan');
|
|
|
+ })
|
|
|
+ }
|
|
|
+ };
|
|
|
+ // 微信小程序
|
|
|
+ // const platform = getPlatform();
|
|
|
+ if (isAlipayClient) {
|
|
|
+ // 判断微信小程序与 h5 是否正常通信
|
|
|
+ // const isReload = await theCommunicationBetweenWechatAndH5IsNormal()
|
|
|
+ // if(!isReload) {
|
|
|
+ // uni.setStorageSync('isReload', 1)
|
|
|
+ // window.location.reload()
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ window.toWXSendMsg({
|
|
|
+ type: 'scanQRCode',
|
|
|
+ });
|
|
|
+ // TODO 兼容支付宝无牌车扫码
|
|
|
+ window.subscribe('scanQRCodeOver', (options) => {
|
|
|
+ console.log('微信扫码结束之后的返回参数', options);
|
|
|
+ runScanFn(options.options);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$wx.scanQRCode({
|
|
|
+ onlyFromCamera: false,
|
|
|
+ // desc: 'scanQRCode desc',
|
|
|
+ needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
|
|
|
+ // scanType: ['qrCode', 'barCode'], // 可以指定扫二维码还是一维码,默认二者都有
|
|
|
+ success: (res) => {
|
|
|
+ console.log('H5页面扫码获取到的参数——成功1', res);
|
|
|
+ // const res = {"resultStr": "lo$Qed.3YuVi*D7vXilrrV0571a1&type=unlicensedIn", "errMsg": "scanQRCode:ok"}
|
|
|
+ // const test = {"resultStr": "lp$Qed.3YuVi*D7vXilrrV0571a2&type=unlicensedOut", "errMsg": "scanQRCode:ok"}
|
|
|
+ let path = res.resultStr.replace(/.*([a-z0-9]{6}&type)/g, '8b$1')
|
|
|
+ console.log(614, path);
|
|
|
+ const regex = /(\w+)&type=(\w+)/;
|
|
|
+ const match = path.match(regex);
|
|
|
+ const obj = {code: match[1], type: match[2]};
|
|
|
+ console.log(618, obj);
|
|
|
+ console.log(696, this.qrCodesRule);
|
|
|
+ this.$store.commit('SET_UNLICENSED_INFO', obj);
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.qrCodesRule(obj.code, 'scan');
|
|
|
+ })
|
|
|
+ // runScanFn(res);
|
|
|
+ // this.formMsg.deviceCode = res.resultStr;
|
|
|
+ },
|
|
|
+ error: (res) => {
|
|
|
+ console.log('H5页面扫码获取到的参数——失败', res);
|
|
|
+ // console.log(242, res);
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } catch (err) {
|
|
|
+ console.log(624, err);
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ // 处理扫码结果: 组装参数,剩余流程,在 缴费支付页面 实现
|
|
|
+ async qrCodesRule(code, source = '') {
|
|
|
+ console.log(717, code, source);
|
|
|
+ // source 是为了避免重复刷新
|
|
|
+ if (this.$store.state.pageHistory.parkingFeeMsg && !source) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ if (this.qrCodeHistory && this.qrCodeHistory === code) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.qrCodeHistory = code
|
|
|
+ const qrCodesres = await qrCodes(code); // 无牌车扫码
|
|
|
+ // 记录buildingId,确保 buildingId 是最新的数据
|
|
|
+ window.localStorage.setItem('buildingId', qrCodesres.buildingId);
|
|
|
+ // 如果是无牌车扫码:出场
|
|
|
+ // console.log('模拟出场', this.unlicensedInfo.type);
|
|
|
+ this.$store.commit('cachedViews/DEL_CACHED_VIEW', {
|
|
|
+ name: 'parkingFeeDetail',
|
|
|
+ });
|
|
|
+ console.log(735);
|
|
|
+ // return
|
|
|
+ if (this.unlicensedInfo?.type === 'unlicensedOut') {
|
|
|
+ const query = {
|
|
|
+ ...this.$route.query,
|
|
|
+ gateId: qrCodesres.gateId,
|
|
|
+ vehicleNo: '',
|
|
|
+ type: this.unlicensedInfo.type
|
|
|
+ }
|
|
|
+ // fromPage && format && unlicensed
|
|
|
+ query.fromPage = ''
|
|
|
+ query.format = ''
|
|
|
+ query.unlicensed = ''
|
|
|
+ query.code = ''
|
|
|
+ this.$router.push({
|
|
|
+ path: 'parkingFeeDetail',
|
|
|
+ query
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 如果是无牌车扫码:入场
|
|
|
+ const unlicensedCarCheckInres = await unlicensedCarCheckIn({ // 获取无牌车牌
|
|
|
+ gateId: qrCodesres.gateId
|
|
|
+ });
|
|
|
+
|
|
|
+ const query = {
|
|
|
+ ...this.$route.query,
|
|
|
+ type: 'success',
|
|
|
+ vehicleNo: unlicensedCarCheckInres.vehicleNo
|
|
|
+ }
|
|
|
+ // fromPage && format && unlicensed
|
|
|
+ query.fromPage = ''
|
|
|
+ query.format = ''
|
|
|
+ query.unlicensed = ''
|
|
|
+ query.code = ''
|
|
|
+ this.$store.commit('setPageHistory', {
|
|
|
+ parkingFeeMsg: 1
|
|
|
+ })
|
|
|
+ // 前往 缴费支付页面
|
|
|
+ this.$router.push({
|
|
|
+ path: 'parkingFeeMsg',
|
|
|
+ query: query
|
|
|
+ })
|
|
|
+ } catch (err) {
|
|
|
+ // 车场扫描道闸入口,发现无车/车场扫描道闸入口,发现有牌车 >>> 停止往下执行,默认提示报错信息
|
|
|
+ if (/CAR_HAS_PLATE/.test(err.code)) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (/CAR_NOT_FOUND|INOUT_FAILED|UNLICENSED_PLATE_ACQUISITION_FAILED/.test(err.code)) {
|
|
|
+ const query = {
|
|
|
+ ...this.$route.query,
|
|
|
+ type: 'fail'
|
|
|
+ }
|
|
|
+ // fromPage && format && unlicensed
|
|
|
+ query.fromPage = ''
|
|
|
+ query.format = ''
|
|
|
+ query.unlicensed = ''
|
|
|
+ query.code = ''
|
|
|
+ this.$store.commit('setPageHistory', {
|
|
|
+ parkingFeeMsg: 1
|
|
|
+ })
|
|
|
+ // 如果是其他错误的话,则继续往下执行
|
|
|
+ this.$router.push({
|
|
|
+ path: 'parkingFeeMsg',
|
|
|
+ query
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 前往支付
|
|
|
+ unlicensedToPay() {
|
|
|
+ // 无牌车这边去支付的时候,属于场内缴费,需要调用场内缴费的接口 /parking/check-out
|
|
|
+ this.$store.commit('SET_ENDLESS_LOOP', '');
|
|
|
+ this.toHandleSearch(this.unlicensedCar);
|
|
|
+ },
|
|
|
+ // 获取会员绑定的车牌列表
|
|
|
+ async getVehiclesINTMP() {
|
|
|
+ /*杭州*/
|
|
|
+ if (!isHZ(this.mallId)) return
|
|
|
+ try {
|
|
|
+ if(this.$route.query.isLogin === 'loginDenied') {
|
|
|
+ throw new Error('设置默认参数')
|
|
|
+ }
|
|
|
+ let vehicles = []
|
|
|
+ // 获取用户车场在停车辆数据集
|
|
|
+ vehicles = await parkingRecord({
|
|
|
+ userId: this.kipUserId,
|
|
|
+ lbsId: this.mallId
|
|
|
+ })
|
|
|
+ // 获取用户的所有车牌
|
|
|
+ // const userVehicles = await getVehicles(this.kipUserId)
|
|
|
+ if (!vehicles.length) {
|
|
|
+ throw new Error('设置默认参数')
|
|
|
+ // vehicles = userVehicles.content
|
|
|
+ }
|
|
|
+ if (vehicles.length) {
|
|
|
+ // 判断是否存在无牌车
|
|
|
+ if(vehicles[0].vehicleNo.indexOf('临') > -1) {
|
|
|
+ this.isUnlicensed(vehicles)
|
|
|
+ throw new Error('设置默认参数')
|
|
|
+ }
|
|
|
+ const vehicleNo = vehicles[0].vehicleNo
|
|
|
+ // 设置车牌类型
|
|
|
+ this.setVehicleNoType(vehicleNo, vehicles)
|
|
|
+ // 赋值
|
|
|
+ this.numArr = vehicles[0].vehicleNo.split('');
|
|
|
+ this.vehicleNumber = vehicles[0].vehicleNo;
|
|
|
+ } else {
|
|
|
+ throw new Error('设置默认参数')
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ // 设置默认参数
|
|
|
+ this.numArr = '浙,A,,,,,'.split(',')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ setVehicleNoType(vehicleNo, vehicles) {
|
|
|
+ // const item = vehicles.filter(e => e.vehicleNo === vehicleNo)
|
|
|
+ const item = vehicles
|
|
|
+ if(item.length) {
|
|
|
+ // let label = LICENSE_PLATE_TYPE_ARR.filter(e => e.value == item[0].licensePlateType)
|
|
|
+ // const index = ['燃油车牌', '新能源', '特殊车牌'].indexOf(label[0].name)
|
|
|
+ const index = item[0].vehicleNo.length === 8 ? 1 : 0
|
|
|
+ this.$refs['k-tab'].changeTab(index)
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ return false
|
|
|
+ },
|
|
|
+ isUnlicensed(vehicles) {
|
|
|
+ // debugger
|
|
|
+ // const unlicensed = vehicles.filter(elm => elm.vehicleNo.indexOf('临') > -1)
|
|
|
+ if (vehicles.length && vehicles[0].vehicleNo.indexOf('临') > -1) {
|
|
|
+ this.tabbarActiveEvent('paymentForUnregisteredVehicle');
|
|
|
+ // this.tabbarActive = 'paymentForUnregisteredVehicle'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ setLicensePlateList(arr) {
|
|
|
+ var array = []
|
|
|
+ arr.forEach(element => {
|
|
|
+ array.push(element.vehicleNo)
|
|
|
+ });
|
|
|
+ return array
|
|
|
+ },
|
|
|
+ async getPortalsByLbs() {
|
|
|
+ try {
|
|
|
+ const res = await getPortalsByLbs(this.groupId, this.mallId);
|
|
|
+ if(res.length) {
|
|
|
+ this.portalsByLbsList = res[0].displayFunctionList.filter(elm => elm.enabled).map(elm => elm.code)
|
|
|
+ this.portalsByLbsInfo = res[0]
|
|
|
+ }
|
|
|
+ } 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
|
|
|
+ case 'FIND_CAR': // 反向寻车
|
|
|
+ console.log('反向寻车', this.portalsByLbsInfo)
|
|
|
+ this.$router.push({path: 'parkingFindCarFirst', query: this.portalsByLbsInfo});
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+};
|