Commit 0f217e74 authored by xinzhedeai's avatar xinzhedeai

add:消费着 商户详情编辑 疏散图

parent 860cf5e3
...@@ -185,6 +185,9 @@ ...@@ -185,6 +185,9 @@
<van-row> <van-row>
<van-col span="24">{{merInformation.businessAddress}}</van-col> <van-col span="24">{{merInformation.businessAddress}}</van-col>
</van-row> </van-row>
<van-row>
<van-col @click="picDetail()" span="24" style="margin-top:0.2rem; font-weight: 500;font-size: .28rem;color: #1081E3;">查看商家平面疏散图></van-col>
</van-row>
</div> </div>
</div> </div>
<!-- 第三层:表单区 --> <!-- 第三层:表单区 -->
......
...@@ -46,6 +46,28 @@ window.addEventListener("load", function () { ...@@ -46,6 +46,28 @@ window.addEventListener("load", function () {
// } // }
// }, // },
methods: { methods: {
showImage4shusan(liststr, index) {
const list = liststr.split(',') || []
const images = list.map((item)=>{
return this.previewUrl + item
})
console.log(images, 'images')
vant.ImagePreview({
images,
startPosition: index,
closeable: true,
});
},
picDetail(){ // 平面疏散图显示
if(!this.merInformation.floorEvacuationPlan){
vant.Dialog.alert({
message: '该商家还未上传平面疏散图',
})
return
}
this.showImage4shusan(this.merInformation.floorEvacuationPlan, 0)
},
showImage(list, index) { showImage(list, index) {
const images = list.map((item) => { const images = list.map((item) => {
return this.previewUrl + item return this.previewUrl + item
......
...@@ -268,9 +268,34 @@ ...@@ -268,9 +268,34 @@
</van-uploader> </van-uploader>
</div> </div>
</div> </div>
</div>
<div>
<h5 class="imager-item-title">
<span class="form-label">商家平面疏散图</span>
<span></span>
</h5>
<!-- 详情模式 -->
<div class="img-wrapper" style="display: flex;gap:.16rem;">
<div style="position: relative;" v-for="(imgItem, index) in formData.floorEvacuationPlan">
<img
:src="previewUrl + imgItem"
style="width: 1.6rem; height: 1.6rem;"
@click="showImage(formData.floorEvacuationPlan, index)"
/>
<div v-if="flag=='XG'" class="van-uploader__preview-delete" @click="handleDeleteFloorPlan(index, 'floorEvacuationPlan')"><i class="van-icon van-icon-cross van-uploader__preview-delete-icon"></i></div>
</div>
<div v-if="formData.floorEvacuationPlan.length<4 && flag=='XG' ">
<van-uploader
:before-read="beforeRead"
:after-read="(file) => afterRead(file, 'floorEvacuationPlan')"
class="uploader-wrapper"
:deletable="false"
:preview-image="false"
>
<img src="../image/code/upload.png" style="width:1.6rem;height: 1.6rem;" alt="" srcset="">
</van-uploader>
</div>
</div>
</div> </div>
<div> <div>
<h5 class="imager-item-title"> <h5 class="imager-item-title">
......
...@@ -121,6 +121,8 @@ window.addEventListener('load', function () { ...@@ -121,6 +121,8 @@ window.addEventListener('load', function () {
this.formData.businessLicensePhotos.splice(index, 1); this.formData.businessLicensePhotos.splice(index, 1);
}else if(type === 'storeFront'){ }else if(type === 'storeFront'){
this.formData.storefrontPhotos.splice(index, 1); this.formData.storefrontPhotos.splice(index, 1);
}else if(type === 'floorEvacuationPlan'){
this.formData.storefrontPhotos.splice(index, 1);
} }
}, },
beforeRead(file) { beforeRead(file) {
...@@ -141,7 +143,6 @@ window.addEventListener('load', function () { ...@@ -141,7 +143,6 @@ window.addEventListener('load', function () {
return true; return true;
}, },
afterRead(file, type) { // 调用爱山东中台系统,将数据流传递过去 afterRead(file, type) { // 调用爱山东中台系统,将数据流传递过去
alert(type)
vant.Toast.loading({ vant.Toast.loading({
message: '正在处理...', message: '正在处理...',
forbidClick: true, forbidClick: true,
...@@ -175,7 +176,10 @@ window.addEventListener('load', function () { ...@@ -175,7 +176,10 @@ window.addEventListener('load', function () {
this.formData.businessLicensePhotos.push(value.fileName) this.formData.businessLicensePhotos.push(value.fileName)
}else if(type === 'storeFront'){ }else if(type === 'storeFront'){
this.formData.storefrontPhotos.push(value.fileName) this.formData.storefrontPhotos.push(value.fileName)
}else if(type === 'floorEvacuationPlan'){
this.formData.floorEvacuationPlan.push(value.fileName)
} }
// 可根据后端返回的数据做进一步处理,如显示上传成功信息等 // 可根据后端返回的数据做进一步处理,如显示上传成功信息等
setTimeout(() => { setTimeout(() => {
vant.Toast.clear() vant.Toast.clear()
...@@ -561,7 +565,7 @@ window.addEventListener('load', function () { ...@@ -561,7 +565,7 @@ window.addEventListener('load', function () {
reqParam.floorPlanPhotos = this.formData.floorPlanPhotos.join(',') reqParam.floorPlanPhotos = this.formData.floorPlanPhotos.join(',')
reqParam.businessLicensePhotos = this.formData.businessLicensePhotos.join(',') reqParam.businessLicensePhotos = this.formData.businessLicensePhotos.join(',')
reqParam.storefrontPhotos = this.formData.storefrontPhotos.join(',') reqParam.storefrontPhotos = this.formData.storefrontPhotos.join(',')
reqParam.floorEvacuationPlan = this.formData.floorEvacuationPlan.join(',')
http3.put('/gq/merchant', reqParam).then((res) => { http3.put('/gq/merchant', reqParam).then((res) => {
console.log('保存结果', res) console.log('保存结果', res)
vant.Toast({ vant.Toast({
...@@ -641,6 +645,9 @@ window.addEventListener('load', function () { ...@@ -641,6 +645,9 @@ window.addEventListener('load', function () {
if(tempData['storefrontPhotos']){ if(tempData['storefrontPhotos']){
tempData['storefrontPhotos'] = tempData['storefrontPhotos'].split(',') tempData['storefrontPhotos'] = tempData['storefrontPhotos'].split(',')
} }
if(tempData['floorEvacuationPlan']){
tempData['floorEvacuationPlan'] = tempData['floorEvacuationPlan'].split(',')
}
this.formData = tempData this.formData = tempData
console.log('******详情********', tempData) console.log('******详情********', tempData)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment