Commit 85676d1f authored by xinzhedeai's avatar xinzhedeai

add:商户详情图片上传 lightAppJssdk.uploadFile.chooseFileUpload方法替换处理

parent d49666da
......@@ -218,7 +218,7 @@
</van-uploader>
</div>
</div> -->
<!-- 开始 -->
<div class="img-wrapper">
<div style="position: relative;width:1.6rem;float: left;margin-right: .1rem;" v-for="(imgItem, index) in formData.floorPlanPhotos">
<img :src="previewUrl + imgItem" style="width: 1.6rem; height: 1.6rem;"
......@@ -227,11 +227,12 @@
@click="handleDeleteFloorPlan(index, 'floorPlan')"><i
class="van-icon van-icon-cross van-uploader__preview-delete-icon"></i></div>
</div>
<div v-if="formData.floorPlanPhotos.length<6 && flag=='XG' ">
<div v-if="formData.floorPlanPhotos.length<4 && flag=='XG' ">
<img src="../image/code/upload.png" style="width:1.6rem;height: 1.6rem;"
alt="" srcset="" @click="paizhao('floorPlan',4)">
</div>
</div>
<!-- 结束 -->
</div>
<div>
<h5 class="imager-item-title">
......@@ -239,7 +240,7 @@
<span></span>
</h5>
<!-- 详情模式 -->
<div class="img-wrapper" style="display: flex;gap:.16rem;">
<!-- <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)" />
......@@ -253,15 +254,30 @@
<img src="../image/code/upload.png" style="width:1.6rem;height: 1.6rem;" alt="" srcset="">
</van-uploader>
</div>
</div> -->
<!-- 开始 -->
<div class="img-wrapper">
<div style="position: relative;width:1.6rem;float: left;margin-right: .1rem;" 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' ">
<img src="../image/code/upload.png" style="width:1.6rem;height: 1.6rem;"
alt="" srcset="" @click="paizhao('floorEvacuationPlan',4)">
</div>
</div>
<div>
<!-- 结束 -->
</div>
<div style="overflow: hidden;">
<h5 class="imager-item-title">
<span class="form-label">营业执照</span>
<span></span>
</h5>
<!-- 详情模式 -->
<div class="img-wrapper" style="display: flex;gap:.16rem;">
<!-- <div class="img-wrapper" style="display: flex;gap:.16rem;">
<div style="position: relative;" v-for="(imgItem, index) in formData.businessLicensePhotos">
<img :src="previewUrl + imgItem" style="width: 1.6rem; height: 1.6rem;"
@click="showImage(formData.businessLicensePhotos, index)" />
......@@ -275,15 +291,31 @@
<img src="../image/code/upload.png" style="width:1.6rem;height: 1.6rem;" alt="" srcset="">
</van-uploader>
</div>
</div> -->
<!-- 开始 -->
<div class="img-wrapper">
<div style="position: relative;width:1.6rem;float: left;margin-right: .1rem;" v-for="(imgItem, index) in formData.businessLicensePhotos">
<img :src="previewUrl + imgItem" style="width: 1.6rem; height: 1.6rem;"
@click="showImage(formData.businessLicensePhotos, index)" />
<div v-if="flag=='XG'" class="van-uploader__preview-delete"
@click="handleDeleteFloorPlan(index, 'businessLicensePhotos')"><i
class="van-icon van-icon-cross van-uploader__preview-delete-icon"></i></div>
</div>
<div v-if="formData.businessLicensePhotos.length<1 && flag=='XG' ">
<img src="../image/code/upload.png" style="width:1.6rem;height: 1.6rem;"
alt="" srcset="" @click="paizhao('businessLicensePhotos',1)">
</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 class="img-wrapper" style="display: flex;gap:.16rem;">
<div style="position: relative;" v-for="(imgItem, index) in formData.storefrontPhotos">
<img :src="previewUrl + imgItem" style="width: 1.6rem; height: 1.6rem;"
@click="showImage(formData.storefrontPhotos, index)" />
......@@ -297,7 +329,23 @@
<img src="../image/code/upload.png" style="width:1.6rem;height: 1.6rem;" alt="" srcset="">
</van-uploader>
</div>
</div> -->
<!-- 开始 -->
<div class="img-wrapper">
<div style="position: relative;width:1.6rem;float: left;margin-right: .1rem;" v-for="(imgItem, index) in formData.storefrontPhotos">
<img :src="previewUrl + imgItem" style="width: 1.6rem; height: 1.6rem;"
@click="showImage(formData.storefrontPhotos, index)" />
<div v-if="flag=='XG'" class="van-uploader__preview-delete"
@click="handleDeleteFloorPlan(index, 'storefrontPhotos')"><i
class="van-icon van-icon-cross van-uploader__preview-delete-icon"></i></div>
</div>
<div v-if="formData.storefrontPhotos.length<1 && flag=='XG' ">
<img src="../image/code/upload.png" style="width:1.6rem;height: 1.6rem;"
alt="" srcset="" @click="paizhao('storefrontPhotos',1)">
</div>
</div>
<!-- 结束 -->
</div>
<button v-if="flag=='XG'" class="save-btn" style="margin-left: 50%; transform: translateX(-50%)" @click="save">
......
......@@ -85,16 +85,18 @@ window.addEventListener('load', function () {
if (userType == 'wgy' || userType == 'safety') {
this.flag = 'XG'
} else {
this.flag = 'XQ'
// this.flag = 'XQ'
this.flag = 'XG'
}
this.detail()
this.getDict4fangwuType()
this.getDict4fangwuyongtuType()
this.getDict4businessType()
this.getDict4community()
this.getDict4industryType()
this.detail()
// this.getDict4changhsuoType()
},
watch: {
......@@ -161,7 +163,7 @@ window.addEventListener('load', function () {
// 根据选择的图片不同进行区分设置
if(VUE.photosType === 'floorPlan'){
photosVar = VUE.formData.floorPlanPhotos
}else if(VUE.photosType === 'license'){
}else if(VUE.photosType === 'businessLicensePhotos'){
photosVar = VUE.formData.businessLicensePhotos
}else if(VUE.photosType === 'storeFront'){
photosVar = VUE.formData.storefrontPhotos
......@@ -174,13 +176,16 @@ window.addEventListener('load', function () {
console.log('photsVar方法', JSON.stringify(photosVar))
if (value) {
// VUE.formData.attachmentFile.push(...JSON.parse(value).fileNames)
if(gemhoUtil.isIOSStrict()){ // ios直接返回对象
if(gemhoUtil.isIOSStrict() || gemhoUtil.isHarmonyOS()){ // ios、鸿蒙系统直接返回对象
photosVar.push(...value.fileNames)
}else{ // 俺安卓机 返回字符串
photosVar.push(...JSON.parse(value).fileNames)
}
console.log('大小', photosVar.length, maxSelectNum,photosVar.length > maxSelectNum)
if (photosVar.length > maxSelectNum) {
const result = photosVar.slice(0, maxSelectNum)
console.log('大小比较', photosVar.length > maxSelectNum, result)
photosVar = result
}
}
......
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