Explorar el Código

修改登录不能绑定问题/车费查询页面

zaijin hace 2 años
padre
commit
f6cb7a3f90

+ 5 - 1
App.vue

@@ -33,7 +33,11 @@ export default {
       this.getUserInfo(openId);
     }
     // 获取参数
-    this.getFreeTime();
+    const paramsPage = ['pages/goldPlan/goldPlan', 'pages/wechatLogin/wechatLogin'],
+      paramsValidPage = paramsPage.filter((item) => backUrl.indexOf(item) > -1);
+    if (paramsValidPage.length === 0) {
+      this.getFreeTime();
+    }
   },
   onShow: function () {
     console.log('App Show');

+ 3 - 1
common/apiurl.js

@@ -144,5 +144,7 @@ export const apiurl = {
   // 根据订单号刷新优惠券状态(用于取消支付情况)
   updateCouponStatusUrl: '/client/couponInfo/backCoupon',
   // 根据订单id获取符合要求的优惠券
-  getCouponByOrderIdUrl: '/client/couponInfo/memberCoupon'
+  getCouponByOrderIdUrl: '/client/couponInfo/memberCoupon',
+  // 根据车牌查询车辆欠费(针对场内支付)
+  getVehicleInquiryListUrl: ''
 };

+ 4 - 2
common/http.api.js

@@ -103,8 +103,8 @@ const install = (Vue, vm) => {
   let userLoginApi = {
     openidLoginApi: (params = {}) => vm.$u.post(apiurl.userLoginUrl.openidLoginUrl, params),
     sendSmsCodeApi: (params = {}) => vm.$u.post(apiurl.userLoginUrl.sendSmsCodeUrl, params),
-    mobileLoginApi: (params = {}) => vm.$u.post(apiurl.userLoginUrl.mobileLoginUrl, params),
-  }
+    mobileLoginApi: (params = {}) => vm.$u.post(apiurl.userLoginUrl.mobileLoginUrl, params)
+  };
   let geomaLockDetailsApi = (params = {}) => vm.$u.post(apiurl.geomaLockDetailsUrl, params);
   let getDetailEntranceApi = (params = {}) => vm.$u.post(apiurl.getDetailEntrance, params);
   let getDetailAdvanceApi = (params = {}) => vm.$u.post(apiurl.getDetailAdvance, params);
@@ -125,6 +125,7 @@ const install = (Vue, vm) => {
   let exchangeCouponApi = (params = {}) => vm.$u.put(apiurl.exchangeCouponUrl, params);
   let updateCouponStatusApi = (params = {}) => vm.$u.post(apiurl.updateCouponStatusUrl, params);
   let getCouponByOrderIdApi = (params = {}) => vm.$u.get(apiurl.getCouponByOrderIdUrl, params);
+  let getVehicleInquiryListApi = (params = {}) => vm.$u.get(apiurl.getVehicleInquiryListUrl, params);
   // 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
   vm.$u.api = {
     feedbackAdd,
@@ -192,6 +193,7 @@ const install = (Vue, vm) => {
     exchangeCouponApi,
     updateCouponStatusApi,
     getCouponByOrderIdApi,
+    getVehicleInquiryListApi
   };
 };
 

+ 18 - 0
pages.json

@@ -310,6 +310,24 @@
         "navigationBarBackgroundColor": "#008CFF",
         "navigationBarTextStyle": "white"
       }
+    },
+    {
+      "path": "pages/VehicleInquiry/VehicleInquiry",
+      "style": {
+        "navigationBarTitleText": "车费查询",
+        "enablePullDownRefresh": false,
+        "navigationBarBackgroundColor": "#008CFF",
+        "navigationBarTextStyle": "white"
+      }
+    },
+    {
+      "path": "pages/OnsitePayment/OnsitePayment",
+      "style": {
+        "navigationBarTitleText": "停车场",
+        "enablePullDownRefresh": false,
+        "navigationBarBackgroundColor": "#008CFF",
+        "navigationBarTextStyle": "white"
+      }
     }
   ],
   "globalStyle": {

+ 23 - 0
pages/OnsitePayment/OnsitePayment.vue

@@ -0,0 +1,23 @@
+<!-- 场内支付 -->
+<template>
+	<view>
+		
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				
+			}
+		},
+		methods: {
+			
+		}
+	}
+</script>
+
+<style>
+
+</style>

+ 30 - 0
pages/VehicleInquiry/VehicleInquiry.scss

@@ -0,0 +1,30 @@
+.container {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+  height: calc(100vh - 44px);
+  &-title {
+    text-align: center;
+    font-size: 30rpx;
+    color: #888;
+    margin-bottom: 40rpx;
+  }
+  &-select {
+    width: 620rpx;
+    text-align: center;
+    color: #777777;
+    padding: 20rpx 0x;
+    &-empty {
+      text-align: center;
+      font-size: 26rpx;
+    }
+    &-scroll {
+      height: 600rpx;
+    }
+  }
+  &-btn {
+    width: 680rpx;
+    margin-top: 40rpx;
+  }
+}

+ 194 - 0
pages/VehicleInquiry/VehicleInquiry.vue

@@ -0,0 +1,194 @@
+<!-- 车辆查询 -->
+<template>
+  <view class="container">
+    <view class="container-title">
+      <text>输入车牌,查询车费</text>
+    </view>
+    <!-- 车牌输入 -->
+    <view class="container-input" @click="vehicleNoInputClick">
+      <u-message-input :maxlength="8" width="60" font-size="40" :disabled-keyboard="true" v-model="form.vehicleNo" />
+    </view>
+    <!-- 车辆下拉 -->
+    <view class="container-select">
+      <u-collapse ref="refValue" :head-style="{ fontSize: '28rpx' }">
+        <u-collapse-item title="点击选择车牌" align="center">
+          <scroll-view class="container-select-scroll" scroll-y="true">
+            <u-cell-group v-if="vehicleList.length">
+              <u-cell-item :title="item.value" v-for="(item, index) in vehicleList" :key="index" :arrow="false">
+                <u-radio-group v-model="form.vehicleNo" @change="radioGroupChange">
+                  <u-radio :name="item.value" :key="index" />
+                </u-radio-group>
+              </u-cell-item>
+            </u-cell-group>
+            <template v-else>
+              <view class="container-select-empty">暂无绑定车牌</view>
+            </template>
+          </scroll-view>
+        </u-collapse-item>
+      </u-collapse>
+    </view>
+    <view class="container-btn">
+      <u-button type="primary" :loading="loading" @click="submitVehicleInquiry">确定</u-button>
+    </view>
+    <!-- 选择颜色 -->
+    <u-action-sheet :list="bindVehiclePop.colorList" @click="confirmColor" v-model="bindVehiclePop.colorShow" />
+    <!-- 车牌号键盘 -->
+    <u-keyboard ref="uKeyboard" mode="car" @change="keyboardChange" @confirm="keyboardConfirm" @backspace="backspace" v-model="keyboardshow" />
+    <u-toast ref="uToast" />
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      form: {
+        vehicleNo: ''
+      },
+      vehicleList: [],
+      keyboardshow: false,
+      loading: false,
+      showChangeVehicleNo: false,
+      bindVehiclePop: {
+        colorShow: false,
+        colorList: [
+          {
+            text: '蓝色',
+            colorCode: 0
+          },
+          {
+            text: '黄色',
+            colorCode: 1
+          },
+          {
+            text: '黑色',
+            colorCode: 2
+          },
+          {
+            text: '白色',
+            colorCode: 3
+          },
+          {
+            text: '绿色',
+            colorCode: 4
+          },
+          {
+            text: '其他',
+            colorCode: 99
+          }
+        ]
+      }
+    };
+  },
+  onShow() {
+    this.getCarsList();
+  },
+  methods: {
+    /**
+     * @description: 获取我的车辆列表
+     * @return {*}
+     */
+    async getCarsList() {
+      const { data } = await this.$u.api.getMycars({ pageNum: 1, pageSize: 100 });
+      const vehicleList = [];
+      data.rows.forEach((item) => {
+        const { vehicleNo } = item;
+        vehicleList.push({ label: vehicleNo, value: vehicleNo });
+      });
+      this.vehicleList = vehicleList;
+      await this.$nextTick();
+      this.$refs.refValue.init();
+    },
+    /**
+     * @description: 车牌输入框点击
+     * @return {*}
+     */
+    vehicleNoInputClick() {
+      this.keyboardshow = true;
+      this.form.vehicleNo = '';
+    },
+    /**
+     * @description: 单击车牌
+     * @param {*} e
+     * @return {*}
+     */
+    radioGroupChange(e) {
+      this.form.vehicleNo = e;
+    },
+    /**
+     * @description: 颜色下拉确认
+     * @return {*}
+     */
+    confirmColor() {
+      this.bindVehiclePop.colorShow = false;
+    },
+    /**
+     * @description: 车牌键盘输入变化
+     * @param {*} val
+     * @return {*}
+     */
+    keyboardChange(val) {
+      // 将每次按键的值拼接到value变量中,注意+=写法
+      this.form.vehicleNo += val;
+    },
+    /**
+     * @description: 键盘输入完成确认时
+     * @return {*}
+     */
+    keyboardConfirm() {
+      this.bindVehiclePop.colorShow = true;
+    },
+    /**
+     * @description: 退格键被点击
+     * @return {*}
+     */
+    backspace() {
+      // 删除value的最后一个字符
+      if (this.form.vehicleNo.length) this.form.vehicleNo = this.form.vehicleNo.substr(0, this.form.vehicleNo.length - 1);
+    },
+    /** 
+     * @description: 获取当前用户车辆
+     * @return {*}
+     */
+    async getVehicleInquiryList() {
+      try {
+        const response = await this.$u.api.getVehicleInquiryListApi();
+        if (response.code === 200) {
+          console.log(response);
+        }
+      } catch (error) {
+      }
+    },
+    /**
+     * @description: 确认车费查询
+     * @return {*}
+     */
+    async submitVehicleInquiry() {
+      const { vehicleNo } = this.form;
+      if (this.$u.test.carNo(vehicleNo)) {
+        this.loading = true;
+        this.$refs.uToast.show({
+          title: '查询成功!',
+          type: 'success',
+          url: '/pages/OnsitePayment/OnsitePayment',
+          params: {
+            vehicleNo
+          },
+          callback: () => {
+            this.loading = false;
+          }
+        });
+      } else {
+        this.$refs.uToast.show({
+          title: '请输入有效的车牌号!',
+          type: 'error'
+        });
+      }
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+@import './VehicleInquiry.scss';
+</style>

+ 15 - 11
pages/center/coupon/myCoupon/myCoupon.vue

@@ -201,28 +201,32 @@ export default {
      * @date 2022-12-23
      * @returns {any}
      */
-    exchangeCoupon() {
-      this.bindVehiclePop.loading = true;
-      this.$u.api
-        .exchangeCouponApi(this.form)
-        .then((res) => {
-          if (res.code === 200) {
+    async exchangeCoupon() {
+      const { vehicleNo } = this.form;
+      if (this.$u.test.carNo(vehicleNo)) {
+        try {
+          this.bindVehiclePop.loading = true;
+          const { code } = await this.$u.api.exchangeCouponApi({ ...this.form });
+          if (code === 200) {
             this.$refs.uToast.show({
               title: '兑换成功!',
               type: 'success'
             });
-            this.form.exchangeCode = '';
             this.$refs['swiperListItem'][this.current].reloadData();
-            // this.cencelBindVehicle();
             setTimeout(() => {
-              this.bindVehiclePop.loading = false;
               location.href = location.origin + location.pathname;
             }, 500);
           }
-        })
-        .catch(() => {
           this.bindVehiclePop.loading = false;
+        } catch (error) {
+          this.bindVehiclePop.loading = false;
+        }
+      } else {
+        this.$refs.uToast.show({
+          title: '请输入有效的车牌号!',
+          type: 'error'
         });
+      }
     },
     /**
      * 点击输入框弹出车牌键盘

+ 1 - 1
pages/center/phoneLogin/phoneLogin.vue

@@ -124,7 +124,7 @@ export default {
         loginType: 1,
         nickName: this.vuex_wxinfo?.nickname,
         code: value,
-        openId: this.vuex_wxinfo?.openId,
+        openid: this.vuex_wxinfo?.openId,
         mobile: this.tel,
         avatar: this.vuex_wxinfo?.headImgUrl
       };

+ 14 - 6
pages/choosePayment/choosePayment.vue

@@ -226,6 +226,8 @@ export default {
       orderMoney: '',
       // 显示优惠券选项
       isShowCoupon: false,
+      // 是否取消优惠券标识
+      isCancelCoupon: false,
       // 选择优惠券弹框
       couponPopup: {
         // 弹框标识
@@ -259,6 +261,7 @@ export default {
       this.orderMoney = details.payAmount.toFixed(2);
       if (numType === 'single' && orderType === 'parking' && !this.isMonthPay) {
         this.isShowCoupon = true;
+        this.isCancelCoupon = true;
         this.getCouponList(details.id);
       }
     },
@@ -572,11 +575,15 @@ export default {
      * @returns {any}
      */
     modalClose() {
-      (this.wxEnv = true),
-        (this.radioCurrent = ''),
-        (this.orderMoney = ''),
-        (this.isShowCoupon = false),
-        (this.couponPopup = {
+      Object.assign(this, {
+        payWayPop: false,
+        wxEnv: true,
+        alipayEnv: true,
+        radioCurrent: '',
+        orderMoney: '',
+        isShowCoupon: false,
+        isCancelCoupon: false,
+        couponPopup: {
           show: false,
           couponList: [],
           radioCurrent: '',
@@ -584,7 +591,8 @@ export default {
             backgroundColor: '#008CFF'
           },
           currentCoupon: {}
-        });
+        }
+      });
       this.$emit('closePaymentMethod');
     },
     /**

+ 101 - 0
pages/goldPlan/goldPlan.vue

@@ -0,0 +1,101 @@
+<template>
+  <view class="container">
+    <view class="text-img">
+      <image src="../../static/img/text-html-bg.png" mode="aspectFit" />
+    </view>
+    <view class="car-img">
+      <image src="../../static/img/car-html-bg.png" mode="aspectFit" />
+    </view>
+    <view @click="goToBgzchina()" class="button">回到{{ project_name }}智慧停车</view>
+  </view>
+</template>
+
+<script>
+const goldPlan = require('../../static/js/jgoldplan-1.0.0.js');
+export default {
+  data() {
+    return {
+      sub_mch_id: '',
+      out_trade_no: '',
+      project_name: process.env.H_PROJECT_NAME
+    };
+  },
+  onLoad(option) {
+    this.sub_mch_id = option.sub_mch_id; //特约商户号
+    this.out_trade_no = option.out_trade_no; //商户订单号
+  },
+  onReady() {
+    let mchData = {
+      action: 'onIframeReady',
+      displayStyle: 'SHOW_CUSTOM_PAGE',
+      height: 960
+    };
+    let postData = JSON.stringify(mchData);
+    parent.postMessage(postData, 'https://payapp.weixin.qq.com');
+  },
+  methods: {
+    /**
+     * @description: 返回停车页面
+     * @return {*}
+     */
+    goToBgzchina() {
+      const mchData = {
+        action: 'jumpOut',
+        jumpOutUrl: process.env.H_PROJECT_URL //跳转的页面
+      };
+      const pData = JSON.stringify(mchData);
+      parent.postMessage(pData, 'https://payapp.weixin.qq.com');
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.container {
+  height: 100vh;
+  width: 100%;
+  padding: 50px 0;
+  text-align: center;
+  background: linear-gradient(138deg, #7ebab8 0%, #48999a 100%);
+  box-shadow: 0px 2px 4px 0px #0b7c7d;
+}
+
+.text-img {
+  margin: 0 auto;
+  width: 80%;
+  height: 20%;
+  image {
+    width: 100%;
+    height: 100%;
+  }
+}
+
+.car-img {
+  margin: 39px auto 0;
+  width: 65%;
+  height: 25%;
+  image {
+    width: 100%;
+    height: 100%;
+  }
+}
+
+.button {
+  display: inline-block;
+  width: calc(100% - 84px);
+  height: 6vh;
+  line-height: 6vh;
+  text-decoration: none;
+  margin-top: 4vh;
+  outline: none;
+  border: none;
+  background: #ffffff;
+  box-shadow: 0px 7px 13px 0px rgba(0, 105, 106, 0.26);
+  border-radius: 10px;
+  font-size: 1.1em;
+  font-weight: 500;
+  color: #1d8587;
+  font-family: 'PingFangSC-Medium, PingFang SC';
+  cursor: pointer;
+}
+</style>

+ 2 - 0
pages/myCars/myCars.vue

@@ -183,6 +183,8 @@ export default {
             total: 0
           });
           this.mycars = [];
+          this.newPlateNumber = '';
+          this.vehicleColor = '';
           this.handlegetMycars();
         }
       } catch (error) {