|
@@ -10,7 +10,7 @@
|
|
|
</tui-list-cell>
|
|
</tui-list-cell>
|
|
|
<tui-list-cell v-if="hasMap == 0" class="line-cell" :hover="false">
|
|
<tui-list-cell v-if="hasMap == 0" class="line-cell" :hover="false">
|
|
|
<view class="tui-title">地址</view>
|
|
<view class="tui-title">地址</view>
|
|
|
- <input v-model="form.address" placeholder-class="phcolor" class="tui-input" name="address" @input="modifyShow" placeholder="请填写地址" />
|
|
|
|
|
|
|
+ <input v-model="form.address" placeholder-class="phcolor" class="tui-input" name="address" placeholder="请填写地址" />
|
|
|
</tui-list-cell>
|
|
</tui-list-cell>
|
|
|
<tui-list-cell v-else class="line-cell" :hover="false" :arrow="true" @click="selectRegion">
|
|
<tui-list-cell v-else class="line-cell" :hover="false" :arrow="true" @click="selectRegion">
|
|
|
<view class="tui-title">地址</view>
|
|
<view class="tui-title">地址</view>
|
|
@@ -20,7 +20,7 @@
|
|
|
</tui-list-cell>
|
|
</tui-list-cell>
|
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
|
<view class="tui-title ">门牌</view>
|
|
<view class="tui-title ">门牌</view>
|
|
|
- <input v-model="form.floor" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="楼号门牌号(建议填写,方便查找)" @input="modifyShow" />
|
|
|
|
|
|
|
+ <input v-model="form.floor" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="楼号门牌号(建议填写,方便查找)" />
|
|
|
</tui-list-cell>
|
|
</tui-list-cell>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="confirm-btn">
|
|
<view class="confirm-btn">
|
|
@@ -73,7 +73,6 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- //...mapActions(['setUserShopAll']),
|
|
|
|
|
init() {
|
|
init() {
|
|
|
getHasMap().then(res=>{
|
|
getHasMap().then(res=>{
|
|
|
this.hasMap = res.data.hasMap
|
|
this.hasMap = res.data.hasMap
|
|
@@ -89,12 +88,9 @@ export default {
|
|
|
this.region.lat = 0
|
|
this.region.lat = 0
|
|
|
this.region.long = 0
|
|
this.region.long = 0
|
|
|
},
|
|
},
|
|
|
- modifyShow(){
|
|
|
|
|
- this.form.showAddress = this.form.city+this.form.address+this.form.floor
|
|
|
|
|
- },
|
|
|
|
|
selectRegion() {
|
|
selectRegion() {
|
|
|
if (!this.form.city) {
|
|
if (!this.form.city) {
|
|
|
- this.$msg('请先选择城市!')
|
|
|
|
|
|
|
+ this.$msg('请选择城市')
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
|
this.showRegion = true
|
|
this.showRegion = true
|
|
@@ -103,26 +99,27 @@ export default {
|
|
|
this.form.address = e.name
|
|
this.form.address = e.name
|
|
|
let locationStr = e.location
|
|
let locationStr = e.location
|
|
|
let fruits = locationStr.split(",").map(fruit => fruit.trim())
|
|
let fruits = locationStr.split(",").map(fruit => fruit.trim())
|
|
|
|
|
+ this.region.lat = fruits[1]||''
|
|
|
|
|
+ this.region.long = fruits[0]||''
|
|
|
|
|
+ this.form.showAddress = e.address||''
|
|
|
|
|
|
|
|
- this.region.lat = fruits[1]
|
|
|
|
|
- this.region.long = fruits[0]
|
|
|
|
|
- this.form.showAddress = e.address
|
|
|
|
|
|
|
+ // 提取地区信息,按遇到第一个"市"字后,把"市"后面的字符串作为地区
|
|
|
|
|
+ const districtStr = e.district || '';
|
|
|
|
|
+ const cityIndex = districtStr.indexOf('市');
|
|
|
|
|
+ this.form.dist = cityIndex !== -1 ? districtStr.substring(cityIndex + 1) : districtStr;
|
|
|
},
|
|
},
|
|
|
confirmFn() {
|
|
confirmFn() {
|
|
|
let that = this
|
|
let that = this
|
|
|
- this.form.showAddress = this.form.city+this.form.address+this.form.floor
|
|
|
|
|
- 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)
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ 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)
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
formSubmit(e) {
|
|
formSubmit(e) {
|