|
|
@@ -68,6 +68,9 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
onLoad() {
|
|
|
+ if(this.option.name){
|
|
|
+ uni.setNavigationBarTitle({ title: this.option.name })
|
|
|
+ }
|
|
|
},
|
|
|
onShow() {
|
|
|
|
|
|
@@ -102,16 +105,19 @@ export default {
|
|
|
this.region.long = 0
|
|
|
},
|
|
|
confirmFn() {
|
|
|
- let hostFn = this.option.id ? update : add
|
|
|
- if (this.option.id) {
|
|
|
- this.form.id = this.option.id
|
|
|
- }
|
|
|
- this.form = {...this.form,...this.region}
|
|
|
- uni.showLoading({mask:true})
|
|
|
- modifyAddress(this.form).then(res=>{
|
|
|
- if(res.code == 1){
|
|
|
- uni.hideLoading()
|
|
|
- }
|
|
|
+ let that = this
|
|
|
+ that.$util.confirmModal({content:'确认修改?'},() => {
|
|
|
+ this.form.id = this.option.id ? this.option.id : 0
|
|
|
+ this.form = {...this.form,...this.region}
|
|
|
+ uni.showLoading({mask:true})
|
|
|
+ modifyAddress(this.form).then(res=>{
|
|
|
+ if(res.code == 1){
|
|
|
+ that.$msg('修改成功')
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.navigateBack({})
|
|
|
+ }, 1200)
|
|
|
+ }
|
|
|
+ })
|
|
|
})
|
|
|
},
|
|
|
// 表单验证
|