Browse Source

feat:订单列表页 寄售列表页 返回拦截

DaMowang 3 years ago
parent
commit
89aa183451

+ 15 - 0
src/pages/account/consignment.vue

@@ -274,6 +274,21 @@ import uniPopup from '@/components/uni-popup/uni-popup.vue'
 					that.loadData();
 				}, 800);
 			}
+		},
+		onBackPress(options) {
+			//避免死循环
+			if (options.from === 'navigateBack') return false;
+			//自己的判断条件,执行自定义的返回操作
+			// if (你的条件) {
+				//你的自定义操作
+			// }
+			//执行uniapp的返回操作
+			// else uni.navigateBack()
+			
+			this.goto("/pages/my/index")
+				
+			//返回true表示我要自定义onBackPress
+			return true
 		}
 	}
 </script>

+ 16 - 0
src/pages/szw-order-list/index.vue

@@ -256,6 +256,22 @@ export default {
             };
         },
     },
+    onBackPress(options) {
+        //避免死循环
+        if (options.from === 'navigateBack') return false;
+        //自己的判断条件,执行自定义的返回操作
+        // if (你的条件) {
+            //你的自定义操作
+        // }
+        //执行uniapp的返回操作
+        // else uni.navigateBack()
+        
+        this.goto("/pages/my/index")
+            
+        //返回true表示我要自定义onBackPress
+        return true
+    }
+
 };
 </script>
 

+ 2 - 2
src/pages/to-pay-list/index.vue

@@ -143,7 +143,7 @@ export default {
                         let p = this.Data.type == 2 ? this.goodsInfo.trade_price : this.goodsInfo.cost_price; //商品单价
                         let y = this.Data.is_sell == 1 ? 0 : this.freight; // 运费   寄售的话退运费为0
                         let a = (p * this.Data.num + y * this.Data.num) * 100; //商品总价
-                        let b = (a - this.userinfo.user_money * 100) / 100;
+                        let b = (a - this.userinfo.user_money * 100) / 100; //待支付金额
                         this.obligation = b > 0 ? b : 0
                     })
                 }
@@ -161,7 +161,7 @@ export default {
                         } else this.DefaultAddress = da[0]
                     }
                     // #ifdef  MP-WEIXIN
-                    if(!da.length) this.getwexinAddress()
+                    if(!da.length && this.Data.is_sell != 1) this.getwexinAddress()
                     // #endif
                 }
             })