+30
-32
@@ -149,20 +149,25 @@
|
||||
</view>
|
||||
|
||||
<u-form-item prop="typeText">
|
||||
<u-cell title="店铺类型" :border="false" isLink @click="changeType(true)">
|
||||
<u-cell title="店铺类型" :border="false" isLink>
|
||||
<template #icon>
|
||||
<text class="required">*</text>
|
||||
</template>
|
||||
<template #value>
|
||||
<u--text :text="form.typeText" v-if="form.typeText"></u--text>
|
||||
<u--text text="请选择类型" color="#c0c4cc" v-else></u--text>
|
||||
<picker
|
||||
:value="indexType"
|
||||
:range="columnsType"
|
||||
mode=selector
|
||||
range-key="name"
|
||||
class="picker"
|
||||
@change="typeChange"
|
||||
>
|
||||
<u--text v-if="form.typeText" :text="form.typeText"></u--text>
|
||||
<u--text v-else text="请选择类型" color="#c0c4cc"></u--text>
|
||||
</picker>
|
||||
</template>
|
||||
</u-cell>
|
||||
</u-form-item>
|
||||
|
||||
<u-picker :show="showType" :defaultIndex="indexType" :columns="columnsType" keyName="name"
|
||||
@confirm="confirmType" @cancel="cancelType"/>
|
||||
|
||||
<u-form-item prop="contact">
|
||||
<u-cell title="联系人姓名" :border="false">
|
||||
<template #icon>
|
||||
@@ -430,7 +435,6 @@ export default {
|
||||
trigger: ['blur', 'change']
|
||||
}
|
||||
},
|
||||
showType: false,
|
||||
columnsType: [],
|
||||
indexType: [0],
|
||||
district: [],
|
||||
@@ -455,9 +459,6 @@ export default {
|
||||
this.$refs.shopForm.setRules(this.rules);
|
||||
},
|
||||
methods: {
|
||||
changeType(state){
|
||||
this.showType=state
|
||||
},
|
||||
changeRemove(state){
|
||||
this.showRemove=state
|
||||
},
|
||||
@@ -487,14 +488,13 @@ export default {
|
||||
|
||||
init() {
|
||||
getCity().then(({data}) => {
|
||||
this.district = data;
|
||||
});
|
||||
|
||||
this.district = data
|
||||
})
|
||||
getShopData().then(({data}) => {
|
||||
this.columnsType.push(data.hotelTypeList);
|
||||
this.notice = data.merchantApplyNotice;
|
||||
this.initInfo();
|
||||
});
|
||||
this.columnsType = data.hotelTypeList
|
||||
this.notice = data.merchantApplyNotice
|
||||
this.initInfo()
|
||||
})
|
||||
},
|
||||
|
||||
initInfo() {
|
||||
@@ -530,9 +530,9 @@ export default {
|
||||
}
|
||||
})
|
||||
}
|
||||
this.indexType = this.columnsType[0].findIndex(item => item.id === this.form.type);
|
||||
if (this.indexType != -1) {
|
||||
this.form.typeText = this.columnsType[0][this.indexType].name;
|
||||
this.indexType = this.columnsType.findIndex(item => item.id === this.form.type)
|
||||
if (this.indexType !== -1) {
|
||||
this.form.typeText = this.columnsType[this.indexType].name
|
||||
}
|
||||
this.form.position = this.$forceToDecimal(this.form.longitude, 6) + ',' + this.$forceToDecimal(this.form.latitude, 6);
|
||||
this.form.area = `${this.form.provinceName} ${this.form.cityName} ${this.form.areaName}`;
|
||||
@@ -595,17 +595,15 @@ export default {
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
// 回调参数为包含column indexs、value、values
|
||||
confirmType(e) {
|
||||
this.indexType = e.indexs;
|
||||
this.form.type = e.value[0].id;
|
||||
this.form.typeText = e.value[0].name;
|
||||
this.showType = false;
|
||||
},
|
||||
|
||||
cancelType() {
|
||||
this.showType = false;
|
||||
typeChange(e) {
|
||||
const idx = parseInt(e.detail.value)
|
||||
this.columnsType.map((item, index) => {
|
||||
if (index === idx) {
|
||||
this.form.typeText = item.name
|
||||
this.indexType = index
|
||||
this.form.type = item.id
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 省市区
|
||||
|
||||
Reference in New Issue
Block a user