|
@@ -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'
|