|
@@ -113,14 +113,15 @@
|
|
|
|
|
|
<view class="content-box">
|
|
|
<u-form-item prop="storeImage">
|
|
|
- <imgs-upload @update="fileList" :value="1"></imgs-upload>
|
|
|
+ <imgs-upload @update="fileList" :value="1" :imageList="storeInfo.storeImage"></imgs-upload>
|
|
|
<p class="upload-text">店铺门面图(需要包含完整牌匾)</p>
|
|
|
</u-form-item>
|
|
|
</view>
|
|
|
|
|
|
<view class="content-box">
|
|
|
<u-form-item prop="storeInnerImage">
|
|
|
- <imgs-upload @update="fileList" :value="2"></imgs-upload>
|
|
|
+ <imgs-upload @update="fileList" :value="2"
|
|
|
+ :imageList="storeInfo.storeInnerImage.map(item => item.url).join(',')"></imgs-upload>
|
|
|
<p class="upload-text">店内真实环境图</p>
|
|
|
</u-form-item>
|
|
|
</view>
|
|
@@ -152,6 +153,9 @@
|
|
|
storeAddress: "",
|
|
|
mainBusinessName: "", // 主营业务,
|
|
|
ancillaryBusinessName: [], // 辅营业务
|
|
|
+
|
|
|
+ mainBusinessList: [], // 主营业务下拉数组
|
|
|
+ ancillaryBusinessList: [], // 辅营业务数组
|
|
|
storeInfo: {
|
|
|
region: '',
|
|
|
storeAddressDetail: '',
|
|
@@ -246,20 +250,48 @@
|
|
|
cityLevel3: [],
|
|
|
|
|
|
list: [], // 数组控制器
|
|
|
- mainBusinessList: [], // 主营业务下拉数组
|
|
|
- ancillaryBusinessList: [], // 辅营业务数组
|
|
|
+
|
|
|
|
|
|
};
|
|
|
},
|
|
|
onReady() {
|
|
|
//如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
|
|
|
this.$refs.uForm.setRules(this.rules);
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.request()
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+
|
|
|
},
|
|
|
onShow() {
|
|
|
this.initCityData();
|
|
|
- this.request()
|
|
|
- console.log(this.mainBusinessList, this.ancillaryBusinessList)
|
|
|
+ if (this.$store.state.data.merchantInfo) {
|
|
|
+ this.storeInfo = {
|
|
|
+ region: this.$store.state.data.merchantInfo.merchant.region,
|
|
|
+ storeAddressDetail: this.$store.state.data.merchantInfo.storeAddressDetail,
|
|
|
+ legalRepresentativeName: this.$store.state.data.merchantInfo.legalRepresentativeName,
|
|
|
+ mobileNumber: this.$store.state.data.merchantInfo.mobileNumber,
|
|
|
+ storeName: this.$store.state.data.merchantInfo.storeName,
|
|
|
+ storeImage: this.$store.state.data.merchantInfo.storeImage,
|
|
|
+ storeInnerImage: this.$store.state.data.merchantInfo.storeInnerImage,
|
|
|
+ email: this.$store.state.data.merchantInfo.email,
|
|
|
+ longitude: this.$store.state.data.merchantInfo.merchant.longitude,
|
|
|
+ latitude: this.$store.state.data.merchantInfo.merchant.latitude,
|
|
|
+ opening: this.$store.state.data.merchantInfo.merchant.opening,
|
|
|
+
|
|
|
+ city: this.$store.state.data.merchantInfo.merchant.region.toString().slice(0, -2) + "00",
|
|
|
+ province: this.$store.state.data.merchantInfo.merchant.region.toString().slice(0, -4) + "00",
|
|
|
+ district: this.$store.state.data.merchantInfo.merchant.region,
|
|
|
+ mainBusiness: this.$store.state.data.merchantInfo.merchant.mainBusiness, // 主营业务,
|
|
|
+ ancillaryBusiness: this.$store.state.data.merchantInfo.merchant.ancillaryBusiness, // 辅营业务
|
|
|
+ }
|
|
|
+ console.log(this.$store.state.data.merchantInfo, "this.$store.state.data.merchantInfo")
|
|
|
+ // console.log(this.storeInfo)
|
|
|
+
|
|
|
+ }
|
|
|
},
|
|
|
+
|
|
|
methods: {
|
|
|
|
|
|
async request() {
|
|
@@ -282,6 +314,18 @@
|
|
|
status: 1
|
|
|
}
|
|
|
})
|
|
|
+ if (this.$store.state.data.merchantInfo) {
|
|
|
+
|
|
|
+ this.mainBusinessName = this.nameFunction([this.$store.state.data.merchantInfo.merchant
|
|
|
+ .mainBusiness
|
|
|
+ ],
|
|
|
+ this
|
|
|
+ .mainBusinessList)
|
|
|
+ this.ancillaryBusinessName = this.nameFunction(this.$store.state.data.merchantInfo.merchant
|
|
|
+ .ancillaryBusiness, this.ancillaryBusinessList)
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log(this.ancillaryBusinessList, "这是请i去的")
|
|
|
},
|
|
|
// 手动选择城市
|
|
|
manualGetLocation() {
|
|
@@ -414,6 +458,7 @@
|
|
|
},
|
|
|
// 图片
|
|
|
fileList(val, data) {
|
|
|
+ console.log(data, "data")
|
|
|
if (data == 1) {
|
|
|
this.storeInfo.storeImage = val[0];
|
|
|
} else if (data == 2) {
|
|
@@ -425,7 +470,27 @@
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- // 点击选择主营业务
|
|
|
+
|
|
|
+ //回显时展示的
|
|
|
+ nameFunction(idArray, services) {
|
|
|
+ let nameString = ''
|
|
|
+ if (idArray.length > 1) {
|
|
|
+ nameString = idArray
|
|
|
+ .map(id => services.find(service => service.id == id))
|
|
|
+ .filter(service => service)
|
|
|
+ .map(service => service.name);
|
|
|
+ } else {
|
|
|
+
|
|
|
+ nameString = idArray
|
|
|
+ .map(id => services.find(service => service.id == id))
|
|
|
+ .filter(service => service)
|
|
|
+ .map(service => service.name)
|
|
|
+ .join(',');
|
|
|
+
|
|
|
+ }
|
|
|
+ return nameString;
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
};
|
|
|
</script>
|