Browse Source

订单详情调整

zaijin 2 years ago
parent
commit
09cda031d3

+ 2 - 1
common/config.js

@@ -25,6 +25,7 @@ export const config = {
     'pages/parkentrace/parkentrace',
     'pages/geomagnetismLock/geomagnetismLock',
     'pages/wechatLogin/wechatLogin',
-    'pages/goldPlan/goldPlan'
+    'pages/goldPlan/goldPlan',
+		'pages/center/phoneLogin/phoneLogin'
   ] // 只需要微信登录的页面路径
 };

+ 1 - 1
common/http.interceptor.js

@@ -10,7 +10,7 @@ const install = (Vue, vm) => {
     }
     // 请求地址加时间戳
     config.url = config.url + '?t=' + Date.now();
-    let noTokenList = ['/client/wechat/h5/code/', '/client/auth/sendSmsCodeV2', '/client/auth/verifyCodeV2'];
+    let noTokenList = ['/client/wechat/h5/code/', '/client/auth/sendSmsCodeV2', '/client/auth/verifyCodeV2', '/client/auth/loginToWxOpenId', '/client/auth/sendSmsCodeV3', '/client/auth/loginToMobile'];
     if (noTokenList.includes(config.url)) config.header.noToken = true;
     return config;
   };

+ 34 - 32
pages/center/order/orderDetails/orderDetails.scss

@@ -1,39 +1,41 @@
-.order-info{
-	.u-cell{
-		padding: 17rpx 0;
-	}
-	/deep/ .u-cell_title{font-weight: 600;}
+.order-info {
+  .u-cell {
+    padding: 17rpx 0;
+  }
+  /deep/ .u-cell_title {
+    font-weight: 600;
+  }
 }
-.order-info-img{
-	margin: 54rpx auto 10rpx;
+.order-info-img {
+  margin: 54rpx auto 10rpx;
 }
-.addr{
-	text-align: center;
-	margin-bottom: 10rpx;
-	font-size: 26rpx;
-	font-weight: 400;
-	color: #737373;
-	line-height: 37rpx;
-	letter-spacing: 1px;
+.addr {
+  text-align: center;
+  margin-bottom: 10rpx;
+  font-size: 26rpx;
+  font-weight: 400;
+  color: #737373;
+  line-height: 37rpx;
+  letter-spacing: 1px;
 }
-.pay-amount{
-	text-align: center;
-	font-size: 60rpx;
-	font-weight: 500;
-	color: #010101;
-	line-height: 84rpx;
-	letter-spacing: 2px;
-	margin-bottom: 18rpx;
+.pay-amount {
+  text-align: center;
+  font-size: 60rpx;
+  font-weight: 500;
+  color: #010101;
+  line-height: 84rpx;
+  letter-spacing: 2px;
+  margin-bottom: 18rpx;
 }
 .loading-warp {
-	display: flex;
-	flex-direction: column;
-	align-items: center;
-	justify-content: center;
-	height: 100%;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+  height: 100%;
 }
 .loading-text {
-	margin-top: 20rpx;
-	color: #fff;
-	font-size: 20rpx;
-}
+  margin-top: 20rpx;
+  color: #fff;
+  font-size: 20rpx;
+}

+ 9 - 4
pages/center/order/orderDetails/orderDetails.vue

@@ -1,7 +1,7 @@
 <template>
   <view class="wrap">
     <view class="order-info">
-      <u-image class="order-info-img" width="90rpx" height="90rpx" src="../../../../static/img/position.png" />
+      <u-image class="order-info-img" width="90rpx" height="90rpx" src="/static/img/position.png" />
       <view class="addr">{{ orderInfo.roadName }}</view>
       <view class="pay-amount" v-if="orderInfo.payAmount">-{{ orderInfo.payAmount }}</view>
       <view class="pay-amount" v-else>{{ orderInfo.payAmount }}</view>
@@ -143,13 +143,18 @@
         <view class="tips">提示:可寻找附近的收费员打印小票并扫码出场</view>
       </view>
     </template>
-    <!-- 其他显示支付按钮条件  支付状态(0-未支付,2-支付中,3-支付失败) -->
-    <template v-else-if="orderInfo.deviceType !== 1 && orderInfo.payStatus !== 1 && openFlag !== 'open'">
+    <!-- 其他显示支付按钮条件  支付状态(0-未支付,2-支付中,3-支付失败) 订单类型非停车场 -->
+    <template v-else-if="orderInfo.deviceType !== 1 && orderInfo.payStatus !== 1 && openFlag !== 'open' && orderType !== 'park'">
+      <view class="bottom-btn-wrap">
+        <view class="bottom-btn" @click="goPay(orderId)">去支付</view>
+      </view>
+    </template>
+    <!-- 订单类型停车场 订单状态欠费未缴 orderStatus为2  -->
+    <template v-else-if="orderInfo.deviceType !== 1 && orderType === 'park' && Number(orderInfo.orderStatus) === 2">
       <view class="bottom-btn-wrap">
         <view class="bottom-btn" @click="goPay(orderId)">去支付</view>
       </view>
     </template>
-
     <view class="bottom-btn-wrap" v-if="openFlag === 'open' && orderInfo.payStatus == 1">
       <view class="bottom-btn" @click="jumpOrderList()">返回订单页</view>
     </view>

+ 28 - 31
pages/wechatLogin/wechatLogin.vue

@@ -15,6 +15,10 @@ export default {
     };
   },
   onLoad(page) {
+    uni.showLoading({
+      title: '登录中...',
+      mask: true
+    });
     let local = window.location.href;
     let locationLocaturl = window.location.search;
     // 微信返回的回调地址
@@ -56,9 +60,6 @@ export default {
   methods: {
     // 通过code获取 openId等用户信息
     handleGetWXInfo(code) {
-      uni.showLoading({
-        title: '加载中'
-      });
       this.$u.api
         .getWXInfo(code)
         .then((res) => {
@@ -85,37 +86,33 @@ export default {
      * @param {Object} openId
      */
     getToken(openId) {
-      this.$u.api.codeV2Api
-        .sendSmsCodeV2api({
-          openId
-        })
-        .then((res) => {
-          if (res.code === 200) {
-            this.$u.vuex('vuex_token', res.data.accessToken);
-            this.$u.vuex('vuex_hasLogin', true);
-            if (res.data.needVerify) {
-              localStorage.setItem('backUrl', this.backUrl);
-              this.$u.route({
-                url: 'pages/center/phoneLogin/phoneLogin',
-                type: 'reLaunch'
-              });
+      this.$u.api.codeV2Api.sendSmsCodeV2api({ openId }).then((res) => {
+        if (res.code === 200) {
+          this.$u.vuex('vuex_token', res.data.accessToken);
+          this.$u.vuex('vuex_hasLogin', true);
+          if (res.data.needVerify) {
+            localStorage.setItem('backUrl', this.backUrl);
+            this.$u.route({
+              url: 'pages/center/phoneLogin/phoneLogin',
+              type: 'reLaunch'
+            });
+          } else {
+            this.$u.vuex('vuex_user', res.data);
+            if (this.backUrl.indexOf('wechatLogin') > -1) {
+              location.href = '/';
             } else {
-              this.$u.vuex('vuex_user', res.data);
-              if (this.backUrl.indexOf('wechatLogin') > -1) {
-                location.href = '/';
-              } else {
-                location.href = this.backUrl;
-              }
+              location.href = this.backUrl;
             }
-            uni.hideLoading();
-          } else {
-            this.$refs.uToast.show({
-              title: res.msg || '获取用户信息失败!',
-              type: 'error'
-            });
-            uni.hideLoading();
           }
-        });
+          uni.hideLoading();
+        } else {
+          this.$refs.uToast.show({
+            title: res.msg || '获取用户信息失败!',
+            type: 'error'
+          });
+          uni.hideLoading();
+        }
+      });
     },
     /**
      * @description: