소스 검색

支付方式默认

zaijin 2 년 전
부모
커밋
2c7a595d78
2개의 변경된 파일19개의 추가작업 그리고 2개의 파일을 삭제
  1. 13 1
      App.vue
  2. 6 1
      pages/choosePayment/choosePayment.vue

+ 13 - 1
App.vue

@@ -1,7 +1,7 @@
 <script>
 export default {
   onLaunch: function () {
-    // console.log('App Launch')
+    this.handleUrl(location.href);
     //判断客户端类别
     if (/MicroMessenger/.test(window.navigator.userAgent)) {
       uni.setStorage({
@@ -87,6 +87,18 @@ export default {
       } catch (error) {
         console.log(error);
       }
+    },
+    /**
+     * @description: 首次加载url加入时间戳,防止页面未进行刷新
+     * @param {*} url
+     * @return {*}
+     */
+    handleUrl(url) {
+      // 判断时间戳是否存在
+      if (url.indexOf('_t') < 0) {
+        // 判断?是否存在  存在直接拼接后面   不存在需要拼接?
+        location.href = url.indexOf('?') > -1 ? `${url}&_t=${Date.now()}` : `${url}?_t=${Date.now()}`;
+      }
     }
   }
 };

+ 6 - 1
pages/choosePayment/choosePayment.vue

@@ -264,12 +264,17 @@ export default {
       this.wxEnv = getEnvIsWx();
       // 判断支付宝环境
       this.alipayEnv = getEnvIsAlipay();
+      if (this.wxEnv) {
+        this.radioCurrent = 'weixin';
+      } else {
+        this.radioCurrent = 'juhe';
+      }
       // 打开弹出层
       this.payWayPop = true;
       // 计算订单金额
       this.orderMoney = details.payAmount.toFixed(2);
       // 如果是单个停车订单,且是路边停车,且不是月卡支付,则显示优惠券
-      if (numType === 'single' && orderType === 'parking' && !this.isMonthPay) {
+      if (numType === 'single' && orderType === 'parking' && !this.isMonthPay && this.wxEnv) {
         this.isShowCoupon = true;
         this.isCancelCoupon = true;
         this.getCouponList(details.id);