Commit d41d6683 authored by xinzhedeai's avatar xinzhedeai

fix: 图片上传个数还原。商户编辑图片个数问题排查处理。

parent fdf8850a
...@@ -243,8 +243,8 @@ window.onload = function () { ...@@ -243,8 +243,8 @@ window.onload = function () {
}, },
paizhao(item) { paizhao(item) {
var data = ["相册", "相机"]; var data = ["相册", "相机"];
// var maxSelectNum = 4; var maxSelectNum = 4;
var maxSelectNum = 1; // var maxSelectNum = 1;
lightAppJssdk.notification.showMediaAlert({ lightAppJssdk.notification.showMediaAlert({
arg0: data, arg0: data,
success: function(data) { success: function(data) {
......
...@@ -137,8 +137,8 @@ window.addEventListener("load", function() { ...@@ -137,8 +137,8 @@ window.addEventListener("load", function() {
}, },
paizhao() { paizhao() {
var data = ["相册", "相机"]; var data = ["相册", "相机"];
// var maxSelectNum = 6; var maxSelectNum = 6;
var maxSelectNum = 1; // var maxSelectNum = 1;
lightAppJssdk.notification.showMediaAlert({ lightAppJssdk.notification.showMediaAlert({
arg0: data, arg0: data,
success: function(data) { success: function(data) {
......
...@@ -104,8 +104,8 @@ window.addEventListener("load", function() { ...@@ -104,8 +104,8 @@ window.addEventListener("load", function() {
}, },
paizhao() { paizhao() {
var data = ["相册", "相机"]; var data = ["相册", "相机"];
// var maxSelectNum = 6; var maxSelectNum = 6;
var maxSelectNum = 1; // var maxSelectNum = 1;
lightAppJssdk.notification.showMediaAlert({ lightAppJssdk.notification.showMediaAlert({
arg0: data, arg0: data,
success: function(data) { success: function(data) {
......
...@@ -249,4 +249,5 @@ select:disabled { ...@@ -249,4 +249,5 @@ select:disabled {
.img-wrapper{ .img-wrapper{
display: flex; display: flex;
gap: .12rem; gap: .12rem;
flex-wrap: wrap;
} }
\ No newline at end of file
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</div> </div>
<div v-if="formData.floorEvacuationPlan.length<4 && flag=='XG' "> <div v-if="formData.floorEvacuationPlan.length<4 && flag=='XG' ">
<img src="../image/code/upload.png" style="width:1.6rem;height: 1.6rem;" <img src="../image/code/upload.png" style="width:1.6rem;height: 1.6rem;"
alt="" srcset="" @click="paizhao('floorEvacuationPlan',1)"> alt="" srcset="" @click="paizhao('floorEvacuationPlan',4)">
</div> </div>
</div> </div>
<!-- 结束 --> <!-- 结束 -->
...@@ -268,7 +268,7 @@ ...@@ -268,7 +268,7 @@
</div> </div>
<div v-if="formData.floorPlanPhotos.length<4 && flag=='XG' "> <div v-if="formData.floorPlanPhotos.length<4 && flag=='XG' ">
<img src="../image/code/upload.png" style="width:1.6rem;height: 1.6rem;" <img src="../image/code/upload.png" style="width:1.6rem;height: 1.6rem;"
alt="" srcset="" @click="paizhao('floorPlanPhotos',1)"> alt="" srcset="" @click="paizhao('floorPlanPhotos',4)">
</div> </div>
</div> </div>
<!-- 结束 --> <!-- 结束 -->
......
...@@ -185,10 +185,18 @@ window.addEventListener('load', function () { ...@@ -185,10 +185,18 @@ window.addEventListener('load', function () {
console.log('大小', photosVar.length, maxSelectNum,photosVar.length > maxSelectNum) console.log('大小', photosVar.length, maxSelectNum,photosVar.length > maxSelectNum)
if (photosVar.length > maxSelectNum) { if (photosVar.length > maxSelectNum) {
const result = photosVar.slice(0, maxSelectNum) const result = photosVar.slice(0, maxSelectNum)
console.log('大小比较', photosVar.length > maxSelectNum, result) // VUE.formData.floorEvacuationPlan = result
photosVar = []
photosVar.push(...result)
// 根据选择的图片不同进行数据裁剪后重新赋值(不能用photosVar变量替代。引用地址在这里会发生改变-unknowReason)
if(VUE.photosType === 'floorPlanPhotos'){
VUE.formData.floorPlanPhotos = result
}else if(VUE.photosType === 'businessLicensePhotos'){
VUE.formData.businessLicensePhotos = result
}else if(VUE.photosType === 'storefrontPhotos'){
VUE.formData.storefrontPhotos = result
}else if(VUE.photosType === 'floorEvacuationPlan'){
VUE.formData.floorEvacuationPlan = 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