瀏覽代碼

修改问题

lex-xin 1 月之前
父節點
當前提交
52e135e8ee

+ 1 - 1
miniprogram/pages/index/index.less

@@ -344,7 +344,7 @@ page {
   // margin-bottom: 156rpx;
   // margin-top: 12rpx;
   background: #ffffff;
-  padding-bottom: 162rpx;
+  // padding-bottom: 162rpx;
 
   .title {
     font-size: 28rpx;

+ 14 - 1
miniprogram/pages/orders/order-detail.ts

@@ -341,6 +341,7 @@ Page({
           "orderName": name,
           "orderDesc": name
         })
+        
         if (data.code === 200) {
           const { paymentConfig, paymentType, orderNo } = data.data
           this.onExecutePay(paymentConfig, paymentType, orderNo)
@@ -351,12 +352,17 @@ Page({
             icon: 'none'
           })
         } else if([5435, 5436, 5437, 5439, 5442, 5443, 5408, 5427, 5432].includes(data.code)) {
+          wx.hideLoading()
+          wx.showToast({
+            title: data.message,
+            icon: 'none'
+          })
           wx.navigateBack()
         } else {
           this.onPayError()
         }
       }
-    } catch {
+    } catch(e) {
       wx.hideLoading()
     }
   },
@@ -374,6 +380,13 @@ Page({
         wx.hideLoading()
         if (res.data.code === 200) {
           this.onPay(paymentType, res.data.data.reqParams, orderNo)
+        } else if([5435, 5436, 5437, 5439, 5442, 5443, 5408, 5427, 5432].includes(res.data.code)) {
+          wx.hideLoading()
+          wx.showToast({
+            title: res.data.message,
+            icon: 'none'
+          })
+          wx.navigateBack()
         } else {
           this.onPayError(res.data.message)
         }

+ 1 - 1
miniprogram/pages/orders/order-detail.wxml

@@ -147,7 +147,7 @@
       </view>
     </van-popup>
 
-    <van-popup show="{{ addressListShow }}" safe-area-inset-bottom="{{false}}" lock-scroll="{{true}}" bind:close="onCloseAddressList" position="bottom" round catch:touchstart>
+    <van-popup show="{{ addressListShow }}" safe-area-inset-bottom="{{false}}" lock-scroll="{{true}}" bind:close="onCloseAddressList" position="bottom" round>
       <view class="top-bg"></view>
       <image src="./images/icon-close1.png" class="icon-close" bind:tap="onCloseAddressList" />
       <view class="pop-address-title">

+ 9 - 0
miniprogram/pages/orders/order-result.less

@@ -63,6 +63,15 @@ page {
   display: flex;
   flex-direction: column;
   background-color: #FFFFFF;
+
+
+  .goods-title {
+    font-weight: 600;
+    font-size: 30rpx;
+    color: #502F00;
+    line-height: 42rpx;
+    padding: 0 0 32rpx;
+  }
 }
 
 .item-content {

+ 1 - 1
miniprogram/pages/orders/order-result.ts

@@ -93,7 +93,7 @@ Page({
             ...item,
             integerPart: prices.integerPart,
             decimalPart: prices.decimalPart,
-            originalPrice: formatPrice(item.paymentCashAmount, 'ALL'),
+            originalPrice: formatPrice(item.originalPrice, 'ALL'),
           })
         })
         const addresses = {

+ 1 - 0
miniprogram/pages/orders/order-result.wxml

@@ -12,6 +12,7 @@
     </view> -->
 
     <view class="goods-content" wx:if="{{ goodsInfo.goods && goodsInfo.goods.length > 0 }}">
+      <view class="goods-title">价格明细</view>
       <view class="item-content" wx:for="{{ goodsInfo.goods }}" wx:key="index">
         <image class='goods-icon' src="{{item.goodsUrl}}" mode="" />
         <view class="goods-desc">

+ 6 - 5
miniprogram/plugins/request.ts

@@ -46,13 +46,14 @@ module.exports = function (options: any) {
             // 'x-token': 'x-token'
           },
       success: function (res: any) {
-        if (res.data.code !== 200) {
+        const otherCode = [5435, 5436, 5437, 5439, 5442, 5443, 5408, 5427, 5432];
+        if (res.data.code !== 200 && !otherCode.includes(res.data.code)) {
           if (res.data.code == 5000 || res.data.code == 403) {
             wx.setStorageSync("token", "");
             if (!hideLoading) {
               setTimeout(() => {
                 wx.showToast({
-                  title: "登录超时",
+                  title: "登录过期,请重新登录",
                   icon: "none",
                 });
               }, 100);
@@ -64,7 +65,7 @@ module.exports = function (options: any) {
             // console.log(currentPage.route,'currentPage==>')
             // 为了处理发版处理;
             // https://mp.weixin.qq.com/cgi-bin/announce?action=getannouncement&key=11669729383k7cis&version=1&lang=zh_CN&platform=2
-            const route = currentPage.route === 'pages/purchaseRecord/record' ? currentPage.route : ''
+            const route = currentPage?.route === 'pages/purchaseRecord/record' ? currentPage?.route : ''
             if (currentPage.route != "pages/login/index") {
               wx.redirectTo({
                 url: "/pages/login/index?redirectUrl=" + route,
@@ -74,12 +75,12 @@ module.exports = function (options: any) {
             if (!hideLoading) {
               setTimeout(() => {
                 wx.showToast({
-                  title: res.data.msg,
+                  title: res.data.message,
                   icon: "none",
                 });
               }, 100);
             }
-            reject(res.data.msg);
+            reject(res);
           }
         } else {
           resolve(res);