Browse Source

地址批量删除

h5_css
yanyan 3 years ago
parent
commit
cb154cb359
  1. 13
      subpkg/address/address.vue

13
subpkg/address/address.vue

@ -36,7 +36,7 @@
</view>
<!-- 选择收货地址的盒子 -->
<view class="address-choose-box">
<button type="primary" size="mini" class="uni-button" @click="chooseAddress">全部刪除</button>
<button type="primary" size="mini" class="uni-button" @click="deleteAll">全部刪除</button>
<button type="primary" size="mini" class="uni-button" @click="chooseAddress">新增地址</button>
</view>
</view>
@ -59,7 +59,8 @@
backgroundColor: '#fb1010'
}
}],
addressList: []
addressList: [],
ids:"1"
};
},
onLoad() {
@ -130,6 +131,14 @@
} = await uni.$http.post('/small/project/address/remove', item.guid)
if (!res.success) return uni.$showMsg()
},
async deleteAll() {
this.addressList.forEach(x => this.ids = this.ids + ","+x.guid);
this.addressList = [];
const {
data: res
} = await uni.$http.post('/small/project/address/remove', this.ids)
if (!res.success) return uni.$showMsg()
},
back() {
uni.navigateBack({
delta: 1, //2

Loading…
Cancel
Save