|
|
@ -189,27 +189,27 @@ |
|
|
this.addressForm.areaId = match.id; |
|
|
this.addressForm.areaId = match.id; |
|
|
this.addressForm.areaName = match.title; |
|
|
this.addressForm.areaName = match.title; |
|
|
} else { |
|
|
} else { |
|
|
return this.tui.toast('请搜索并选择有效的楼座'); |
|
|
return this.tui.toast('请搜索并选择有效的楼座',1000); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if(!this.addressForm.areaId) return this.tui.toast('请搜索并选择楼座'); |
|
|
if(!this.addressForm.areaId) return this.tui.toast('请搜索并选择楼座',1000); |
|
|
if(!this.addressForm.floor) return this.tui.toast('请填写所在楼层'); |
|
|
if(!this.addressForm.floor) return this.tui.toast('请填写所在楼层',1000); |
|
|
if(!/^-?\d+$/.test(this.addressForm.floor)) return this.tui.toast('楼层必须为整数'); |
|
|
if(!/^-?\d+$/.test(this.addressForm.floor)) return this.tui.toast('楼层必须为整数',1000); |
|
|
if(!this.addressForm.roomNum) return this.tui.toast('请填写详细地址门牌号'); |
|
|
if(!this.addressForm.roomNum) return this.tui.toast('请填写详细地址门牌号',1000); |
|
|
if(!this.addressForm.receiverName) return this.tui.toast('请填写收件人'); |
|
|
if(!this.addressForm.receiverName) return this.tui.toast('请填写收件人',1000); |
|
|
if(!this.addressForm.receiverPhone) return this.tui.toast('请填写联系电话'); |
|
|
if(!this.addressForm.receiverPhone) return this.tui.toast('请填写联系电话',1000); |
|
|
if(!/^1[3-9]\d{9}$/.test(this.addressForm.receiverPhone)) return this.tui.toast('请输入有效的11位手机号码'); |
|
|
if(!/^1[3-9]\d{9}$/.test(this.addressForm.receiverPhone)) return this.tui.toast('请输入有效的11位手机号码',1000); |
|
|
|
|
|
|
|
|
let url = this.addressForm.id ? "/app/userAddress/edit" : "/app/userAddress/save"; |
|
|
let url = this.addressForm.id ? "/app/userAddress/edit" : "/app/userAddress/save"; |
|
|
let that = this; |
|
|
let that = this; |
|
|
this.addressForm.userId = uni.getStorageSync('id') |
|
|
this.addressForm.userId = uni.getStorageSync('id') |
|
|
that.tui.request(url, "POST", this.addressForm, false, true).then((res) => { |
|
|
that.tui.request(url, "POST", this.addressForm, false, true).then((res) => { |
|
|
if (res.code == 200) { |
|
|
if (res.code == 200) { |
|
|
that.tui.toast("保存成功"); |
|
|
that.tui.toast("保存成功",1000); |
|
|
that.$refs.addBookPopup.close(); |
|
|
that.$refs.addBookPopup.close(); |
|
|
that.getAddressList(); |
|
|
that.getAddressList(); |
|
|
} else { |
|
|
} else { |
|
|
that.tui.toast(res.message); |
|
|
that.tui.toast(res.message,1000); |
|
|
} |
|
|
} |
|
|
}).catch(() => {}); |
|
|
}).catch(() => {}); |
|
|
}, |
|
|
}, |
|
|
@ -222,10 +222,10 @@ |
|
|
if (res.confirm) { |
|
|
if (res.confirm) { |
|
|
that.tui.request("/app/userAddress/delById", "POST", {id: id}, false, true).then((res) => { |
|
|
that.tui.request("/app/userAddress/delById", "POST", {id: id}, false, true).then((res) => { |
|
|
if (res.code == 200) { |
|
|
if (res.code == 200) { |
|
|
that.tui.toast("删除成功"); |
|
|
that.tui.toast("删除成功",1000); |
|
|
that.getAddressList(); |
|
|
that.getAddressList(); |
|
|
} else { |
|
|
} else { |
|
|
that.tui.toast(res.message); |
|
|
that.tui.toast(res.message,1000); |
|
|
} |
|
|
} |
|
|
}).catch(() => {}); |
|
|
}).catch(() => {}); |
|
|
} |
|
|
} |
|
|
|