Browse Source

fix余额支付问题

ylong 7 tháng trước cách đây
mục cha
commit
fd875036db
4 tập tin đã thay đổi với 35 bổ sung13 xóa
  1. 1 1
      .env.dev.js
  2. 10 3
      pages-mine/pages/cashier-desk.vue
  3. 23 8
      pages/home/index.vue
  4. 1 1
      pages/mine/index.vue

+ 1 - 1
.env.dev.js

@@ -1,5 +1,5 @@
 export default {
     "NODE_ENV": 'development',
-    "apiUrl":"https://bpi.shuhi.com",
+    "apiUrl":"https://bk.shuhi.com",
     "apiUrlPrefix":"/api",
 };

+ 10 - 3
pages-mine/pages/cashier-desk.vue

@@ -151,8 +151,14 @@ export default {
             // 获取支付参数
             uni.$u.post('/token/order/refundOrderPay', this.formData).then(res => {
                 if (res.code === 200) {
-                    // 调用统一支付方法
-                    this.handlePayment(res.data);
+                    if (res.data.needPay == 1) {
+                        // 调用统一支付方法
+                        this.handlePayment(res.data);
+                    } else {
+                        uni.navigateTo({
+                            url: `/pages-mine/pages/pay-success?orderId=${this.formData.refundOrderId}`
+                        });
+                    }
                 } else {
                     uni.showToast({
                         title: res.msg || '获取支付参数失败',
@@ -165,8 +171,9 @@ export default {
                     title: err.msg || '获取支付参数失败',
                     icon: 'none'
                 });
+            }).finally(() => {
                 uni.hideLoading();
-            });
+            })
         },
 
         radioGroupChange(e) {

+ 23 - 8
pages/home/index.vue

@@ -28,7 +28,8 @@
                         件 预估回收价
                         <text class="color-red">¥{{ orderInfo.totalRecycleMoney || 0 }}</text>
                     </view>
-                    <text class="common-text tip">*旧书预估价格满{{ orderInfo.minOrderMoney }}元起收</text>
+                    <text class="common-text tip">*<text v-if="orderInfo.minOrderNum">旧书满{{ orderInfo.minOrderNum
+                            }}本,或</text>预估价格满{{ orderInfo.minOrderMoney }}元起收</text>
                 </view>
 
                 <button class="scan-btn next-btn" @click="handleValidate" :disabled="isDisabled">
@@ -89,7 +90,8 @@
         <KindReminder ref="kindReminder" @start="handleStartSelling" @viewRules="handleViewRules" />
 
         <!-- 客服按钮 -->
-        <FloatingDrag :width="126" :height="140" :initial-position="servicePosition" @position-change="handlePositionChange">
+        <FloatingDrag :width="126" :height="140" :initial-position="servicePosition"
+            @position-change="handlePositionChange">
             <!-- #ifdef MP-ALIPAY -->
             <button class="service-btn" @click="navigateToCustomerService">
                 <image src="/static/img/kf.png" mode="widthFix" style="width: 126rpx; height: 140rpx"></image>
@@ -203,7 +205,13 @@ export default {
                 .toFixed(2);
         },
         isDisabled() {
-            return this.totalPrice < this.orderInfo.minOrderMoney;
+            //minOrderNum或minOrderMoney可能没有值,
+            let { minOrderNum, minOrderMoney } = this.orderInfo
+            if (!minOrderMoney && !minOrderNum) return false
+            //minOrderMoney没有值,minOrderNum有值
+            if (minOrderNum && !minOrderMoney) return minOrderNum > this.totalBooks
+            if (minOrderNum && !minOrderMoney) return minOrderMoney > this.totalPrice
+            if (minOrderNum && minOrderMoney) return minOrderNum > this.totalBooks && minOrderMoney > this.totalPrice
         },
     },
     onPageScroll(e) {
@@ -261,8 +269,13 @@ export default {
         });
     },
     onShow() {
-        console.log(app.globalData.isColdLaunch, "onShow");
-        if (!app.globalData.isColdLaunch) return
+        if (!app.globalData.isColdLaunch) {
+            let token = uni.getStorageSync("token");
+            if (token) {
+                this.getLastOrder();
+            }
+            return
+        }
         eventBus.on("loginSuccess", (data) => {
             console.log(data, "登录成功loginSuccess");
             this.loginSuccess(data);
@@ -459,6 +472,7 @@ export default {
                     } else {
                         this.handleBookCode(res.data.code);
                     }
+                    this.getLastOrder();
                 } else {
                     uni.showToast({
                         title: res.msg,
@@ -504,13 +518,13 @@ export default {
                         })
                         : [];
                     this.serviceList = res.data.serviceList || [];
-                }else{
+                } else {
                     uni.showToast({
                         title: res.msg,
                         icon: "none",
                     });
                 }
-            }).finally(()=>{
+            }).finally(() => {
                 // #ifdef MP-ALIPAY
                 my.stopPullDownRefresh()
                 // #endif
@@ -582,6 +596,7 @@ export default {
 
     &.tip {
         color: #ff8a4b;
+        font-size: 26rpx;
     }
 }
 
@@ -644,7 +659,7 @@ export default {
 
     .next-btn {
         margin: 0;
-        margin-left: 20rpx;
+        margin-left: 40rpx;
 
         &[aria-disabled="true"] {
             background-color: #cccccc;

+ 1 - 1
pages/mine/index.vue

@@ -201,7 +201,7 @@ export default {
 				{
 					name: '到货提醒',
 					icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t8.png',
-					path: '/pages/tools/arrival-notice'
+					path: ''
 				},
 				{
 					name: '合伙人计划',