|
@@ -138,11 +138,6 @@ export default {
|
|
|
initAddressList() {
|
|
|
this.$api.getComStorage('clubInfo').then(resolve => {
|
|
|
this.userId = resolve.userId
|
|
|
- // 设置默认地址 测试使用
|
|
|
- // const clubInfo = uni.getStorageSync('clubInfo')
|
|
|
- // this.userId = clubInfo.userId
|
|
|
- // this.userId = '13914'
|
|
|
- console.log(this.userId)
|
|
|
let params = { pageNum: this.pageNum, pageSize: this.pageSize, userId: this.userId }
|
|
|
this.UserService.QueryAddressList(params)
|
|
|
.then(response => {
|
|
@@ -225,18 +220,22 @@ export default {
|
|
|
setDefaultAddress(id) {
|
|
|
this.UserService.DefaultAddress({ addressId: id, userId: this.userId })
|
|
|
.then(res => {
|
|
|
- console.log(res)
|
|
|
- if(res.code === 0){
|
|
|
+ if (res.code === 0) {
|
|
|
this.$util.msg('操作成功', 1000, true, 'success')
|
|
|
- setTimeout(()=>{
|
|
|
- this.pageNum = 1
|
|
|
- this.addressList = []
|
|
|
- this.initAddressList()
|
|
|
- },1000)
|
|
|
+ this.pageNum = 1
|
|
|
+ this.addressList = []
|
|
|
+ this.initAddressList()
|
|
|
+ // this.addressList = res.data.list
|
|
|
+ // this.pageNum = res.data.pageNum
|
|
|
+ // this.hasNextPage = res.data.hasNextPage
|
|
|
+ // console.log(this.addressList)
|
|
|
}
|
|
|
})
|
|
|
.catch(err => {
|
|
|
- console.log(err)
|
|
|
+ this.$util.msg('操作失败,请重试', 1000, true, 'error')
|
|
|
+ this.pageNum = 1
|
|
|
+ this.addressList = []
|
|
|
+ this.initAddressList()
|
|
|
})
|
|
|
}
|
|
|
}
|