|
|
@@ -2,24 +2,20 @@
|
|
|
<view class="app-content">
|
|
|
<form @submit="formSubmit">
|
|
|
<view class="module-com input-line-wrap">
|
|
|
-
|
|
|
<tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="openAddres">
|
|
|
<view class="tui-title">城市</view>
|
|
|
<view class="tui-input" v-if="form.province || form.city">{{ form.province + '-' + form.city }}</view>
|
|
|
<view class="tui-placeholder" v-else>请选择</view>
|
|
|
<input v-model="form.province" name="province" hidden />
|
|
|
</tui-list-cell>
|
|
|
- <tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="selectRegion">
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
<view class="tui-title">地址</view>
|
|
|
- <view class="tui-input" v-if="form.address">{{ form.address }}</view>
|
|
|
- <view class="tui-placeholder" v-else>请填写详细地址</view>
|
|
|
- <input v-model="form.address" name="address" hidden />
|
|
|
+ <input v-model="form.address" placeholder-class="phcolor" class="tui-input" name="address" placeholder="请填写地址" />
|
|
|
</tui-list-cell>
|
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
|
<view class="tui-title ">门牌</view>
|
|
|
<input v-model="form.floor" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="楼号门牌号(建议填写,方便查找)" />
|
|
|
</tui-list-cell>
|
|
|
-
|
|
|
</view>
|
|
|
<view class="confirm-btn">
|
|
|
<button class="admin-button-com big blue" formType="submit">提交</button>
|
|
|
@@ -27,8 +23,6 @@
|
|
|
</form>
|
|
|
<!-- 省市联动 -->
|
|
|
<simple-address ref="simpleAddress" :pickerValueDefault="cityPickerValueDefault" @onConfirm="onCityConfirm"></simple-address>
|
|
|
- <!-- 选择地区 -->
|
|
|
- <app-area-sel :show.sync="showRegion" :city="form.city" @change="changeAreaFn" />
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
@@ -59,7 +53,6 @@ export default {
|
|
|
floor: '',
|
|
|
showAddress:''
|
|
|
},
|
|
|
- showRegion: false,
|
|
|
region: {
|
|
|
lat: 0,
|
|
|
long: 0
|
|
|
@@ -72,28 +65,11 @@ export default {
|
|
|
if(this.option.name){
|
|
|
uni.setNavigationBarTitle({ title: this.option.name })
|
|
|
}
|
|
|
- },
|
|
|
- onShow() {
|
|
|
-
|
|
|
},
|
|
|
methods: {
|
|
|
...mapActions(['setUserShopAll']),
|
|
|
init() {
|
|
|
|
|
|
- },
|
|
|
- // 选择城市
|
|
|
- selectRegion() {
|
|
|
- if (!this.form.city) {
|
|
|
- this.$msg('请先选择城市!')
|
|
|
- return false
|
|
|
- }
|
|
|
- this.showRegion = true
|
|
|
- },
|
|
|
- changeAreaFn(e) {
|
|
|
- this.form.address = e.title
|
|
|
- this.form.showAddress = e.address
|
|
|
- this.region.lat = e.location.lat
|
|
|
- this.region.long = e.location.lng
|
|
|
},
|
|
|
//省市联动
|
|
|
openAddres() {
|
|
|
@@ -103,11 +79,15 @@ export default {
|
|
|
this.form.province = e.provinceName
|
|
|
this.form.city = e.cityName
|
|
|
this.form.address = ''
|
|
|
+ this.form.showAddress = ''
|
|
|
this.region.lat = 0
|
|
|
this.region.long = 0
|
|
|
},
|
|
|
confirmFn() {
|
|
|
let that = this
|
|
|
+ this.region.long = 10
|
|
|
+ this.region.long = 11
|
|
|
+ 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}
|
|
|
@@ -122,9 +102,7 @@ export default {
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
- // 表单验证
|
|
|
formSubmit(e) {
|
|
|
- // 表单规则
|
|
|
let rules = [
|
|
|
{
|
|
|
name: 'province',
|