Ver código fonte

优化部分代码

zaijin 1 ano atrás
pai
commit
dc88a2f1cb

+ 2 - 2
common/apiurl.js

@@ -170,9 +170,9 @@ export const apiurl = {
     // 新增发票
     addInvoiceUrl: '/client/orderInvo',
     // 修改发票
-    updateInvoiceUrl: '/admin/invoiceInfo/update',
+    updateInvoiceUrl: '/',
     // 删除发票
-    deleteInvoiceUrl: '/admin/invoiceInfo/delete',
+    deleteInvoiceUrl: '/',
     // 获取发票详情
     getInvoiceDetailsUrl: '/client/orderInvo/',
     // 获取发票开头列表

+ 1 - 1
pages/VehicleInquiry/VehicleInquiry.vue

@@ -217,7 +217,7 @@ export default {
         } catch (error) {
           this.loading = false;
           this.pageErrorShow = true;
-					error = JSON.parse(error.data)
+          error = JSON.parse(error.data);
           this.pageErrorTxt = error?.msg ?? '查询出错啦!';
         }
       } else {

+ 14 - 24
pages/applyRefundDetails/applyRefundAchieveDetails.vue

@@ -3,7 +3,7 @@
   <view class="order-details">
     <view class="order-details-content">
       <view class="order-details-content-header">
-        <image src="../../static/img/refund-success.png"></image>
+        <image src="/static/img/refund-success.png"></image>
         <view>+{{ details.refundAmount }}</view>
       </view>
       <view class="order-details-content-item">
@@ -34,31 +34,21 @@ export default {
       details: {}
     };
   },
-  onLoad(page) {
-    this.getOrderRefundDetails(page.orderId);
+  onLoad(options) {
+    const { orderId } = options;
+    this.getOrderRefundDetails(orderId);
   },
   methods: {
-    getOrderRefundDetails(orderId) {
-      this.$u.api
-        .getOrderRefundDetails({
-          orderId: orderId
-        })
-        .then((res) => {
-          if (res.code === 200) {
-            this.details = res.data;
-          } else {
-            this.$refs.uToast.show({
-              title: res.msg,
-              type: 'error'
-            });
-          }
-        })
-        .catch((err) => {
-          this.$refs.uToast.show({
-            title: '操作失败',
-            type: 'error'
-          });
-        });
+    /** 
+     * @description: 获取退款详情
+     * @param {*} orderId
+     * @return {*}
+     */
+    async getOrderRefundDetails(orderId) {
+      const { code, data } = await this.$u.api.getOrderRefundDetails({ orderId });
+      if (code === 200) {
+        this.details = data;
+      }
     }
   }
 };

+ 13 - 23
pages/applyRefundDetails/applyRefundDetails.vue

@@ -65,31 +65,21 @@ export default {
       details: {}
     };
   },
-  onLoad(page) {
-    this.getOrderRefundDetails(page.orderId);
+  onLoad(options) {
+    const { orderId } = options;
+    this.getOrderRefundDetails(orderId);
   },
   methods: {
-    getOrderRefundDetails(orderId) {
-      this.$u.api
-        .getOrderRefundDetails({
-          orderId: orderId
-        })
-        .then((res) => {
-          if (res.code === 200) {
-            this.details = res.data;
-          } else {
-            this.$refs.uToast.show({
-              title: res.msg,
-              type: 'error'
-            });
-          }
-        })
-        .catch((err) => {
-          this.$refs.uToast.show({
-            title: '操作失败',
-            type: 'error'
-          });
-        });
+    /**
+     * @description: 获取退款详情
+     * @param {*} orderId
+     * @return {*}
+     */
+    async getOrderRefundDetails(orderId) {
+      const { code, data } = await this.$u.api.getOrderRefundDetails({ orderId });
+      if (code === 200) {
+        this.details = data;
+      }
     },
     jumpPage(url) {
       this.$u.route({

+ 9 - 30
pages/bannerDetails/bannerDetails.vue

@@ -1,8 +1,7 @@
 <template>
   <!-- 轮播详情 -->
-  <view>
+  <view class="ql-editor">
     <u-parse :html="dom"></u-parse>
-    <u-toast ref="uToast" />
   </view>
 </template>
 
@@ -13,37 +12,17 @@ export default {
       dom: ''
     };
   },
-  onLoad(page) {
-    if (page.id) {
-      this.getDetails(page.id);
-    }
+  onLoad(options) {
+    const { id } = options;
+    if (id) this.getDetails(id);
   },
   methods: {
     // 获取详情
-    getDetails(id) {
-      this.$u.api
-        .getIndexData()
-        .then((res) => {
-          if (res.code === 200) {
-            const list = res.data?.advs;
-            list.forEach((item) => {
-              if (item.id == id) {
-                this.dom = item.content;
-              }
-            });
-          } else {
-            this.$refs.uToast.show({
-              title: res.msg,
-              type: 'error'
-            });
-          }
-        })
-        .catch((err) => {
-          this.$refs.uToast.show({
-            title: '操作失败!',
-            type: 'error'
-          });
-        });
+    async getDetails(id) {
+      const { code, data } = await this.$u.api.getIndexData();
+      if (code === 200) {
+        this.dom = (data?.advs || []).find((item) => item.id === id).content || '';
+      }
     }
   }
 };

+ 116 - 150
pages/chargeStandard/chargeStandard.vue

@@ -2,7 +2,7 @@
   <!-- 收费标准 -->
   <view class="charge">
     <view class="charge-rules-container" v-for="(item, index) in chargeRulesInfo" :key="index">
-      <view class="charge-rules-list">
+      <view class="charge-rules-list" v-if="item.list.length">
         <view class="charge-rule-list-header">
           <view class="charge-type">
             <text v-if="item.feePeriod == 1">节假日规则</text>
@@ -36,8 +36,8 @@
         </view>
       </view>
     </view>
-    <view class="charge-instructions">
-      <u-parse :html="chargeContent"></u-parse>
+    <view class="charge-instructions ql-editor">
+      <u-parse :html="chargeContent" />
     </view>
   </view>
 </template>
@@ -47,7 +47,7 @@ export default {
   data() {
     return {
       roadNo: '',
-			parkNo: '',
+      parkNo: '',
       info: {
         freeTime: '',
         topAmt: ''
@@ -64,10 +64,10 @@ export default {
       this.getSystems(3);
       this.getChargeRulesInfo(roadNo);
     } else if (parkNo) {
-			this.parkNo = parkNo;
-			this.getSystems(3);
-			this.getParkingChargeRulesInfo(parkNo);
-		} else {
+      this.parkNo = parkNo;
+      this.getSystems(3);
+      this.getParkingChargeRulesInfo(parkNo);
+    } else {
       uni.showToast({
         title: '参数丢失,返回上一个页面',
         duration: 2000,
@@ -76,164 +76,130 @@ export default {
       });
     }
   },
-  onShow() {},
   methods: {
     /**
      * 获取收费标准
      * {roadNo} 路段
      * */
-    getChargeRulesInfo(roadNo) {
-      this.$u.api.roadChargeRule({ roadNo }).then((res) => {
-        if (res.code === 200) {
-          // 数据整合后
-          let chargeRulesArr = [];
-          for (let i = 0; i < res.data.length; i++) {
-            let item = res.data[i];
-            this.info.freeTime = res.data[0].freeTime;
-            this.info.topAmt = res.data[0].topAmt;
-            const obj = {
-              feeName: item.feeName,
-              feeNo: item.feeNo,
-              feePeriod: item.feePeriod,
-              feeStep: item.feeStep,
-              feeType: item.feeType,
-              freeTime: item.freeTime,
-              topAmt: item.topAmt,
-              id: item.id,
-              list: [],
-              repeatList: [] // 用来检验已存在
+    async getChargeRulesInfo(roadNo) {
+      const { code, data } = await this.$u.api.roadChargeRule({ roadNo });
+      if (code === 200) {
+        let chargeRulesArr = [];
+        for (let i = 0; i < data.length; i++) {
+          let item = data[i];
+          this.info.freeTime = data[0].freeTime;
+          this.info.topAmt = data[0].topAmt;
+          const obj = {
+            feeName: item.feeName,
+            feeNo: item.feeNo,
+            feePeriod: item.feePeriod,
+            feeStep: item.feeStep,
+            feeType: item.feeType,
+            freeTime: item.freeTime,
+            topAmt: item.topAmt,
+            id: item.id,
+            list: [],
+            repeatList: [] // 用来检验已存在
+          };
+          for (let j = 0; j < item.vehicleRules.length; j++) {
+            let jItem = item.vehicleRules[j];
+            const obj1 = {
+              amt: jItem.amt,
+              beginTime: jItem.beginTime,
+              endTime: jItem.endTime,
+              vehicleFeeNo: jItem.vehicleFeeNo,
+              vehicleType: jItem.vehicleType,
+              list: []
             };
-            for (let j = 0; j < item.vehicleRules.length; j++) {
-              let jItem = item.vehicleRules[j];
-              const obj1 = {
-                amt: jItem.amt,
-                beginTime: jItem.beginTime,
-                endTime: jItem.endTime,
-                vehicleFeeNo: jItem.vehicleFeeNo,
-                vehicleType: jItem.vehicleType,
-                list: []
-              };
-              if (obj.repeatList.indexOf(jItem.vehicleType) === -1) {
-                obj.repeatList.push(jItem.vehicleType);
-                obj1.list.push(jItem);
-              } else {
-                for (let k = 0; k < item.vehicleRules.length; k++) {
-                  if (obj1.vehicleType === item.vehicleRules[k].vehicleType) {
-                    obj1.list.push(item.vehicleRules[k]);
-                    obj.list.push(obj1);
-                  }
+            if (obj.repeatList.indexOf(jItem.vehicleType) === -1) {
+              obj.repeatList.push(jItem.vehicleType);
+              obj1.list.push(jItem);
+            } else {
+              for (let k = 0; k < item.vehicleRules.length; k++) {
+                if (obj1.vehicleType === item.vehicleRules[k].vehicleType) {
+                  obj1.list.push(item.vehicleRules[k]);
+                  obj.list.push(obj1);
                 }
               }
             }
-            // 存在重复,去除重复操作
-            let obj2 = {};
-            obj.list = obj.list.reduce((cur, next) => {
-              obj[next.vehicleType] ? '' : (obj[next.vehicleType] = true && cur.push(next));
-              return cur;
-            }, []);
-            chargeRulesArr.push(obj);
           }
-          this.chargeRulesInfo = chargeRulesArr;
-        } else {
-          uni.showToast({
-            title: `${res.msg}`,
-            duration: 3000,
-            icon: 'none',
-            mask: true
-          });
+          // 存在重复,去除重复操作
+          obj.list = obj.list.reduce((cur, next) => {
+            obj[next.vehicleType] ? '' : (obj[next.vehicleType] = true && cur.push(next));
+            return cur;
+          }, []);
+          chargeRulesArr.push(obj);
         }
-      });
+        this.chargeRulesInfo = chargeRulesArr;
+      }
     },
-		/**
-		 * 获取收费标准
-		 * {roadNo} 路段
-		 * */
-		getParkingChargeRulesInfo(parkNo) {
-		  this.$u.api.parkingLotChargeRule({ parkNo }).then((res) => {
-		    if (res.code === 200) {
-		      // 数据整合后
-		      let chargeRulesArr = [];
-		      for (let i = 0; i < res.data.length; i++) {
-		        let item = res.data[i];
-		        this.info.freeTime = res.data[0].freeTime;
-		        this.info.topAmt = res.data[0].topAmt;
-		        const obj = {
-		          feeName: item.feeName,
-		          feeNo: item.feeNo,
-		          feePeriod: item.feePeriod,
-		          feeStep: item.feeStep,
-		          feeType: item.feeType,
-		          freeTime: item.freeTime,
-		          topAmt: item.topAmt,
-		          id: item.id,
-		          list: [],
-		          repeatList: [] // 用来检验已存在
-		        };
-		        for (let j = 0; j < item.vehicleRules.length; j++) {
-		          let jItem = item.vehicleRules[j];
-		          const obj1 = {
-		            amt: jItem.amt,
-		            beginTime: jItem.beginTime,
-		            endTime: jItem.endTime,
-		            vehicleFeeNo: jItem.vehicleFeeNo,
-		            vehicleType: jItem.vehicleType,
-		            list: []
-		          };
-		          if (obj.repeatList.indexOf(jItem.vehicleType) === -1) {
-		            obj.repeatList.push(jItem.vehicleType);
-		            obj1.list.push(jItem);
-		          } else {
-		            for (let k = 0; k < item.vehicleRules.length; k++) {
-		              if (obj1.vehicleType === item.vehicleRules[k].vehicleType) {
-		                obj1.list.push(item.vehicleRules[k]);
-		                obj.list.push(obj1);
-		              }
-		            }
-		          }
-		        }
-		        // 存在重复,去除重复操作
-		        let obj2 = {};
-		        obj.list = obj.list.reduce((cur, next) => {
-		          obj[next.vehicleType] ? '' : (obj[next.vehicleType] = true && cur.push(next));
-		          return cur;
-		        }, []);
-		        chargeRulesArr.push(obj);
-		      }
-		      this.chargeRulesInfo = chargeRulesArr;
-		    } else {
-		      uni.showToast({
-		        title: `${res.msg}`,
-		        duration: 3000,
-		        icon: 'none',
-		        mask: true
-		      });
-		    }
-		  });
-		},
     /**
      * 获取收费标准
+     * {roadNo} 路段
      * */
-    getSystems(termsType) {
-      this.$u.api
-        .getSystems({
-          termsType: Number(termsType)
-        })
-        .then((res) => {
-          if (res.code === 200) {
-            this.chargeContent = res.data?.content;
-          } else {
-            this.$refs.uToast.show({
-              title: res.msg,
-              type: 'error'
-            });
+    async getParkingChargeRulesInfo(parkNo) {
+      const { code, data } = await this.$u.api.parkingLotChargeRule({ parkNo });
+      if (code === 200) {
+        // 数据整合后
+        let chargeRulesArr = [];
+        for (let i = 0; i < data.length; i++) {
+          let item = data[i];
+          this.info.freeTime = data[0].freeTime;
+          this.info.topAmt = data[0].topAmt;
+          const obj = {
+            feeName: item.feeName,
+            feeNo: item.feeNo,
+            feePeriod: item.feePeriod,
+            feeStep: item.feeStep,
+            feeType: item.feeType,
+            freeTime: item.freeTime,
+            topAmt: item.topAmt,
+            id: item.id,
+            list: [],
+            repeatList: [] // 用来检验已存在
+          };
+          for (let j = 0; j < item.vehicleRules.length; j++) {
+            let jItem = item.vehicleRules[j];
+            const obj1 = {
+              amt: jItem.amt,
+              beginTime: jItem.beginTime,
+              endTime: jItem.endTime,
+              vehicleFeeNo: jItem.vehicleFeeNo,
+              vehicleType: jItem.vehicleType,
+              list: []
+            };
+            if (obj.repeatList.indexOf(jItem.vehicleType) === -1) {
+              obj.repeatList.push(jItem.vehicleType);
+              obj1.list.push(jItem);
+            } else {
+              for (let k = 0; k < item.vehicleRules.length; k++) {
+                if (obj1.vehicleType === item.vehicleRules[k].vehicleType) {
+                  obj1.list.push(item.vehicleRules[k]);
+                  obj.list.push(obj1);
+                }
+              }
+            }
           }
-        })
-        .catch((err) => {
-          this.$refs.uToast.show({
-            title: '系统错误!',
-            type: 'error'
-          });
-        });
+          // 存在重复,去除重复操作
+          obj.list = obj.list.reduce((cur, next) => {
+            obj[next.vehicleType] ? '' : (obj[next.vehicleType] = true && cur.push(next));
+            return cur;
+          }, []);
+          chargeRulesArr.push(obj);
+        }
+        this.chargeRulesInfo = chargeRulesArr;
+      }
+    },
+    /**
+     * @description: 获取收费标准
+     * @param {*} termsType
+     * @return {*}
+     */
+    async getSystems(termsType) {
+      const { code, data } = await this.$u.api.getSystems({ termsType: Number(termsType) });
+      if (code === 200) {
+        this.chargeContent = data?.content;
+      }
     }
   }
 };

+ 0 - 81
pages/noninductivePay/addVehicle.vue

@@ -1,81 +0,0 @@
-<template>
-  <view>
-    <u-navbar
-      title-color="#fff"
-      :custom-back="customBack"
-      :border-bottom="false"
-      back-icon-color="#CCE8FF"
-      :background="{ background: '#008CFF' }"
-      title="新增免密支付车牌"
-    ></u-navbar>
-    <view class="new-plate-number">
-      <view class="message-input-wrap" @click="messageInputClick">
-        <u-message-input :maxlength="8" width="70" font-size="50" :disabled-keyboard="true" v-model="newPlateNumber"></u-message-input>
-      </view>
-      <u-keyboard
-        ref="uKeyboard"
-        mode="car"
-        @change="keyboardChange"
-        @confirm="keyboardConfirm"
-        @backspace="backspace"
-        v-model="keyboardshow"
-      ></u-keyboard>
-    </view>
-
-    <u-toast ref="uToast" />
-    <u-modal v-model="delCarshow" :show-cancel-button="true" @confirm="confirmDelCar" :content="delCarContent"></u-modal>
-    <u-action-sheet :list="colorList" @click="confirmColor" v-model="colorShow"></u-action-sheet>
-  </view>
-</template>
-
-<script>
-export default {
-  data() {
-    return {
-      keyboardshow: false,
-      delCarshow: false,
-      colorShow: false,
-      delCarContent: '',
-      colorList: [
-        { text: '蓝色', colorCode: 0 },
-        { text: '黄色', colorCode: 1 },
-        { text: '黑色', colorCode: 2 },
-        { text: '白色', colorCode: 3 },
-        { text: '绿色', colorCode: 4 },
-        { text: '其他', colorCode: 99 }
-      ]
-    };
-  },
-  methods: {
-    customBack() {
-      this.$u.route({
-        type: 'switchTab',
-        url: 'pages/index/index'
-      });
-    },
-    messageInputClick() {
-      this.keyboardshow = true;
-    },
-    // 按键被点击(点击退格键不会触发此事件)
-    keyboardChange(val) {
-      // 将每次按键的值拼接到value变量中,注意+=写法
-      this.newPlateNumber += val;
-      console.log(this.newPlateNumber);
-    },
-    // 退格键被点击
-    backspace() {
-      // 删除value的最后一个字符
-      if (this.newPlateNumber.length) this.newPlateNumber = this.newPlateNumber.substr(0, this.newPlateNumber.length - 1);
-      console.log(this.newPlateNumber);
-    },
-    keyboardConfirm() {
-      this.colorShow = true;
-    },
-    confirmColor(e) {
-      this.vehicleColor = this.colorList[e].colorCode;
-    }
-  }
-};
-</script>
-
-<style></style>

+ 0 - 8
pages/noninductivePay/noninductivePay.vue

@@ -1,8 +0,0 @@
-<template>
-</template>
-
-<script>
-</script>
-
-<style>
-</style>

+ 0 - 103
pages/payPage/payPage.scss

@@ -1,103 +0,0 @@
-.order-info {
-  margin-top: 50rpx;
-  margin-bottom: 75rpx;
-  .order-info-top {
-    position: relative;
-    border-top-left-radius: 20rpx;
-    border-top-right-radius: 20rpx;
-    color: #fff;
-    padding: 35rpx 40rpx;
-    background: linear-gradient(135deg, #00bfff 0%, #008dff 100%);
-    .addr {
-      margin-bottom: 16rpx;
-      .addr-text {
-        margin-left: 17rpx;
-        font-size: 24rpx;
-        font-weight: 400;
-      }
-    }
-    .car {
-      .car-no {
-        font-size: 40rpx;
-        font-weight: 500;
-        color: #ffffff;
-        letter-spacing: 1px;
-        line-height: 56rpx;
-        margin-right: 13rpx;
-      }
-      .car-type {
-        font-size: 24rpx;
-      }
-    }
-    .time {
-      font-size: 22rpx;
-      font-weight: 400;
-      color: #cdecff;
-      line-height: 30rpx;
-      margin-bottom: 3rpx;
-    }
-    .duration {
-      margin-top: 17rpx;
-      font-size: 30rpx;
-      font-weight: 400;
-      color: #ffffff;
-      line-height: 42rpx;
-      letter-spacing: 1px;
-    }
-    .total-amount {
-      position: absolute;
-      right: 40rpx;
-      bottom: 25rpx;
-      font-size: 60rpx;
-      font-weight: 500;
-      color: #ffffff;
-      letter-spacing: 2rpx;
-    }
-  }
-  .order-info-bottom {
-    padding-top: 44rpx;
-    padding-bottom: 56rpx;
-    background: #ffffff;
-    border-bottom-left-radius: 20rpx;
-    border-bottom-right-radius: 20rpx;
-    box-shadow: 0px 6rpx 14rpx 0px rgba(200, 200, 200, 0.5);
-    .u-cell {
-      padding-left: 40rpx;
-      padding-right: 40rpx;
-    }
-    /deep/ .u-iconfont {
-      color: #d8d8d8;
-    }
-    .pay-amount {
-      border-top: 1px solid #cacaca;
-      padding-top: 33rpx;
-      padding: 33rpx 40rpx 9rpx;
-      color: #ff751d;
-      .title {
-        font-size: 30rpx;
-        font-weight: 600;
-        color: #ff751d;
-        line-height: 42rpx;
-        letter-spacing: 1px;
-      }
-      .amount {
-        font-size: 36rpx;
-        font-weight: 600;
-        color: #ff8233;
-        line-height: 33rpx;
-        letter-spacing: 1px;
-        .rmb {
-          font-size: 24rpx;
-          margin-right: 5rpx;
-        }
-      }
-    }
-    .tip {
-      font-size: 22rpx;
-      font-weight: 400;
-      color: #999999;
-      line-height: 30rpx;
-      padding: 0 40rpx;
-    }
-  }
-}

+ 0 - 157
pages/payPage/payPage.vue

@@ -1,157 +0,0 @@
-<template>
-  <view class="wrap">
-    <view class="order-info">
-      <view class="order-info-top">
-        <view class="addr u-flex">
-          <u-icon name="map-fill" color="#fff" size="28"></u-icon>
-          <view class="addr-text">{{ orderInfo.roadName }}</view>
-        </view>
-        <view class="car u-flex">
-          <view class="car-no">{{ orderInfo.vehicleNo }}</view>
-          <view class="car-type">临时车</view>
-        </view>
-        <view class="time in-time">进场时间:{{ orderInfo.inTime }}</view>
-        <view class="time out-time">进场时间:{{ orderInfo.outTime }}</view>
-        <view class="duration">已停放 {{ orderInfo.duration }}</view>
-        <view class="total-amount">¥{{ orderInfo.totalAmount }}</view>
-      </view>
-      <view class="order-info-bottom">
-        <u-cell-item
-          center
-          :border-bottom="false"
-          :value="orderInfo.preferentialAmount"
-          :title-style="{ color: '#8A8A8A' }"
-          :icon-style="{ color: '#D8D8D8' }"
-          title="已优惠"
-        ></u-cell-item>
-        <view class="pay-amount u-flex u-row-between">
-          <view class="title">应付金额</view>
-          <view class="amount"><span class="rmb">¥</span>{{ orderInfo.payAmount }}</view>
-        </view>
-        <view class="tip">停车费不超过30元,可先离场后在付费</view>
-      </view>
-    </view>
-    <view class="bottom-btn static" @click="handlewxpay">去支付</view>
-
-    <u-toast ref="uToast" />
-  </view>
-</template>
-
-<script>
-import getUrlParams from '@/utils/getUrlParams.js';
-export default {
-  data() {
-    return {
-      orderId: null,
-      orderInfo: []
-    };
-  },
-  onLoad() {
-    let locationLocaturl = window.location.hash;
-    this.orderId = getUrlParams(locationLocaturl, 'orderId'); // 截取orderId
-    console.log('this.orderId', this.orderId);
-    this.handleGetOrderinfo(this.orderId);
-  },
-  methods: {
-    handleGetOrderinfo(orderId) {
-      this.$u.api
-        .getOrderinfo({ id: orderId })
-        .then((res) => {
-          // this.$refs.uToast.show({
-          // 	title: res.msg,
-          // 	type: 'success',
-          // });
-          this.orderInfo = res.data;
-          console.log('handleGetOrderinfo', JSON.parse(JSON.stringify(res)));
-        })
-        .catch((err) => {
-          this.$refs.uToast.show({
-            title: err.msg,
-            type: 'error'
-          });
-          console.log('handleGetOrderinfo ', err);
-        });
-    },
-    getCode() {
-      var local = window.location.href; // 获取页面url
-      let locationLocaturl = window.location.search;
-      this.code = getUrlParams(locationLocaturl, 'code'); // 截取code
-      if (this.code == null || this.code === '') {
-        // 如果没有code,则去请求
-        window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${this.config.wxAppid}&redirect_uri=${encodeURIComponent(
-          local
-        )}&response_type=code&scope=snsapi_userinfo&#wechat_redirect`;
-      } else {
-        this.handleGetWXInfo(this.code); //把code传给后台获取用户信息
-      }
-    },
-    handleGetWXInfo(code) {
-      // 通过code获取 openId等用户信息,/api/user/wechat/login 为后台接口
-      let _this = this;
-      this.$u.api
-        .getWXInfo(code)
-        .then((res) => {
-          if (res.code === 200) {
-            this.$u.vuex('vuex_wxinfo', res.data);
-            // 继续支付
-          }
-        })
-        .catch((err) => {
-          this.$refs.uToast.show({
-            title: err.msg,
-            type: 'error'
-          });
-        });
-    },
-    handlewxpay() {
-      if (!this.$store.state.vuex_wxinfo.openId) {
-        // 如果微信openId,则需用code去后台获取
-        this.$refs.uToast.show({
-          title: '请登录后重试!',
-          type: 'info'
-          // url: '/pages/user/index'
-        });
-        this.getCode();
-      } else {
-        // 别的业务逻辑
-        this.getWXPay();
-      }
-    },
-    async getWXPay(id) {
-      let params = {
-        orderId: this.orderId,
-        openid: this.$store.state.vuex_wxinfo.openId,
-        tradeType: 'test'
-      };
-      await this.$wxApi.config();
-      this.$pay.wxPay(params).then((res) => {
-        console.log('wxPay', res.code);
-        if (res.code == 0) {
-          // 成功
-          this.$u.route({
-            url: 'pages/index/index'
-            // params: {
-            // 	keyword: this.keyword
-            // }
-          });
-        } else if (res.code == 1) {
-          // 取消
-          // uni.redirectTo({
-          // 	url: '/pages/userCenter/myOrder/myOrder'
-          // })
-        } else if (res.code == 2) {
-          this.$refs.uToast.show({
-            title: '支付失败,请检查!',
-            type: 'error'
-            // url: '/pages/user/index'
-          });
-        }
-      });
-    }
-  }
-};
-</script>
-
-<style lang="scss" scoped>
-@import './payPage.scss';
-</style>

+ 1 - 1
pages/searchparking/searchparking.vue

@@ -221,7 +221,7 @@ export default {
           if (this.parkinglist.length <= 0) {
             this.listEmpty = true;
           }
-        })
+        });
     }
   }
 };