Explorar o código

improve: 订单列表返回更新

From-wh %!s(int64=2) %!d(string=hai) anos
pai
achega
2bf11253f3
Modificáronse 1 ficheiros con 35 adicións e 34 borrados
  1. 35 34
      template/uni-app/pages/goods/order_list/index.vue

+ 35 - 34
template/uni-app/pages/goods/order_list/index.vue

@@ -189,39 +189,40 @@
 				isShowAuth: false //是否隐藏授权
 			};
 		},
-		computed: mapGetters(['isLogin']),
-		/**
-		 * 生命周期函数--监听页面加载
-		 */
-		onLoad: function(options) {
-			if (options.status) this.orderStatus = options.status;
-			console.log('1')
-			if (this.isLogin) {
-				this.page = 1;
-				this.orderList = []
-				this.loadend = false;
-				this.pay_close = false;
-				this.onLoadFun();
-				this.getOrderList();
-			} else {
-				toLogin();
-			}
-			let EnOptions = wx.getEnterOptionsSync();
-			if (EnOptions.scene == '1038' && EnOptions.referrerInfo.appId == 'wxef277996acc166c3' && this.initIn) {
-				// 代表从收银台小程序返回
-				let extraData = EnOptions.referrerInfo.extraData;
-				this.initIn = false
-				if (!extraData) {
-					this.getOrderList();
-					// "当前通过物理按键返回,未接收到返参,建议自行查询交易结果";
-				} else {
-					if (extraData.code == 'success') {
-						this.getOrderList();
-					} else if (extraData.code == 'cancel') {} else {
-						// "支付失败:" + extraData.errmsg;
-					}
-				}
-			}
+		computed: mapGetters(['isLogin']),
+		/**
+		 * 生命周期函数--监听页面加载
+		 */
+		onLoad: function(options) {
+			if (options.status) this.orderStatus = options.status;
+			let EnOptions = wx.getEnterOptionsSync();
+			if (EnOptions.scene == '1038' && EnOptions.referrerInfo.appId == 'wxef277996acc166c3' && this.initIn) {
+				// 代表从收银台小程序返回
+				let extraData = EnOptions.referrerInfo.extraData;
+				this.initIn = false
+				if (!extraData) {
+					this.getOrderList();
+					// "当前通过物理按键返回,未接收到返参,建议自行查询交易结果";
+				} else {
+					if (extraData.code == 'success') {
+						this.getOrderList();
+					} else if (extraData.code == 'cancel') {} else {
+						// "支付失败:" + extraData.errmsg;
+					}
+				}
+			}
+		},
+		onShow() {
+			if (this.isLogin) {
+				this.page = 1;
+				this.orderList = []
+				this.loadend = false;
+				this.pay_close = false;
+				this.onLoadFun();
+				this.getOrderList();
+			} else {
+				toLogin();
+			}
 		},
 		methods: {
 			onLoadFun() {
@@ -248,7 +249,7 @@
 			payClose: function() {
 				this.pay_close = false;
 			},
-		
+
 			/**
 			 * 获取订单统计数据
 			 *