Jelajahi Sumber

'214700900-001'

zory 5 hari lalu
induk
melakukan
ad1d431816
1 mengubah file dengan 20 tambahan dan 5 penghapusan
  1. 20 5
      pages/order/detail.vue

+ 20 - 5
pages/order/detail.vue

@@ -245,12 +245,29 @@ export default {
 		this.$scope.onPay = this.onPay;
 		this.$scope.handleRefund = this.handleRefund;
 		this.$scope.onErrors = this.onErrors;
+	},
+	onShow(){
+	    let allPages = getCurrentPages(); //获取当前页面栈的实例;
+		let lastPages = allPages.length - 1; // 获得倒数第二个元素的索引;
+		let option = allPages[lastPages].options; // 获得上个页面传递的参数;
+		this.order = option.order?option.order:''
+		this.storeData = uni.getStorageSync("contact");
+		this.getOrder()
+	},
+	onBackPress(options) {
+		console.log('from:' + options.from)
+	},
+	onUnload() {
+		uni.switchTab({
+			url:"/pages/order/order"
+		})
 	},
 	onLoad({order}) {
 		app = this;
-		app.order = order;
-		app.storeData = uni.getStorageSync("contact");
-		app.getOrder()
+		app.order = order;
+		tt.setSwipeBackMode(0)
+		// app.storeData = uni.getStorageSync("contact");
+		// app.getOrder()
 	},
 	methods: {
 		toTs(text){
@@ -312,7 +329,6 @@ export default {
 			console.log("错误",e)
 		},
 		getOrder(){
-			console.log(app.order)
 			Api.detail({"order":app.order}).then((res)=>{
 				app.loading = false;
 				if (res.code && res.code !== 1) {
@@ -321,7 +337,6 @@ export default {
 					});
 					return ;
 				}
-				console.log(res.data)
 				app.poiData = res.data.poi;
 				app.goodsData = res.data.product;
 				app.orderData = res.data;