guhongwei 2 gadi atpakaļ
vecāks
revīzija
09d94fc856

+ 0 - 3
pagesHome/order/detail.vue

@@ -205,9 +205,6 @@
 		onLoad: async function(e) {
 			const that = this;
 			that.$set(that, `id`, e.id || '');
-		},
-		onShow: async function() {
-			const that = this;
 			await that.searchConfig();
 			await that.search();
 			await that.configShare();

+ 1 - 1
pagesHome/order/order.vue

@@ -266,7 +266,7 @@
 						})
 					} else {
 						uni.showToast({
-							title: arr.data.errmsg || '下单失败!',
+							title: arr.errmsg,
 							icon: 'none'
 						})
 					}

+ 6 - 5
pagesMy/address/index.vue

@@ -52,9 +52,8 @@
 		data() {
 			return {
 				// 购物选地址
-				id: '',
 				type: '',
-				address: -1,
+				address_id: '',
 				// 系统设置
 				config: {},
 				user: {},
@@ -73,7 +72,7 @@
 			that.$set(that, `type`, e && e.type || '');
 			that.$set(that, `id`, e && e.id || '');
 		},
-		onShow: async function(e) {
+		onShow: async function() {
 			const that = this;
 			that.searchConfig();
 			that.watchLogin();
@@ -135,10 +134,11 @@
 					let list = [...that.list, ...res.data];
 					that.$set(that, `list`, list);
 					that.$set(that, `total`, res.total)
+					if (list.length == 0) uni.$emit("id", '')
 					if (that.id) {
 						for (let i = 0; i < list.length; i++) {
 							if (list[i]._id === that.id) {
-								that.address = i;
+								that.address_id = that.id;
 								break;
 							}
 						}
@@ -176,7 +176,7 @@
 				const that = this;
 				for (let i = 0; i < that.list.length; i++) {
 					if (that.list[i]._id === e.detail.value) {
-						that.address = i;
+						that.address_id = e.detail.value;
 						break;
 					}
 				}
@@ -275,6 +275,7 @@
 						if (res.confirm) {
 							const arr = await that.$api(`/address/${e._id}`, 'DELETE');
 							if (arr.errcode == '0') {
+								if (that.address_id === e._id) uni.$emit("id", '')
 								uni.showToast({
 									title: '删除信息成功',
 									icon: 'none'