Commit 9c1b38ae by chenyu

update: update

parent 6112a6ef
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<div class="dialog-img"></div> <div class="dialog-img"></div>
</div> </div>
</draggable> </draggable>
<el-upload :limit="5" multiple :file-list="giftForm.images" :action="uploadAction" :headers="headersUpload" list-type="picture-card" :on-preview="handlePictureCardPreview" :on-exceed="handlePictrueExceed" :before-upload="beforeUpload" :on-success="uploadSuccess" with-credentials :show-file-list="false" v-show="uploadStatus" style="display: inline-block;vertical-align: top;"> <el-upload :limit="5" multiple :file-list="giftFormFileList" :action="uploadAction" :headers="headersUpload" list-type="picture-card" :on-preview="handlePictureCardPreview" :on-exceed="handlePictrueExceed" :before-upload="beforeUpload" :on-success="uploadSuccess" with-credentials :show-file-list="false" v-show="uploadStatus" style="display: inline-block;vertical-align: top;">
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
</el-upload> </el-upload>
</div> </div>
...@@ -609,7 +609,8 @@ export default { ...@@ -609,7 +609,8 @@ export default {
isCorrect: true, // 校验阶梯价的验证是否可以保存阶梯价 isCorrect: true, // 校验阶梯价的验证是否可以保存阶梯价
enterpriseId: '', // 商户id enterpriseId: '', // 商户id
specialOrder: false, // 是否定制 specialOrder: false, // 是否定制
dragging: false dragging: false,
giftFormFileList: []
}; };
}, },
// watch: { // watch: {
...@@ -1097,16 +1098,19 @@ export default { ...@@ -1097,16 +1098,19 @@ export default {
this.giftForm.proReferId = res.data.result.proReferId; this.giftForm.proReferId = res.data.result.proReferId;
this.creatorId = res.data.result.creatorId; this.creatorId = res.data.result.creatorId;
this.refash = !this.refash; this.refash = !this.refash;
let giftFormFileList = [];
this.giftForm.images = []; this.giftForm.images = [];
if (res.data.result.images) { if (res.data.result.images) {
//主图 //主图
for (let item of res.data.result.images) { for (let item of res.data.result.images) {
this.giftForm.images.push({ giftFormFileList.push({
imageUrl: item.imageUrl, imageUrl: item.imageUrl,
imageCode: item.imageFieldCode imageCode: item.imageFieldCode
}); });
} }
} }
this.giftForm.images = [].concat(giftFormFileList);
this.giftFormFileList = [].concat(giftFormFileList);
if (this.giftForm.images.length >= 5) { if (this.giftForm.images.length >= 5) {
this.uploadStatus = false; this.uploadStatus = false;
} else { } else {
...@@ -1515,6 +1519,7 @@ export default { ...@@ -1515,6 +1519,7 @@ export default {
}, },
// 上传图片前 // 上传图片前
beforeUpload(file) { beforeUpload(file) {
console.log(file);
if (this.giftForm.images === null) { if (this.giftForm.images === null) {
this.giftForm.images = []; this.giftForm.images = [];
} }
...@@ -1576,20 +1581,13 @@ export default { ...@@ -1576,20 +1581,13 @@ export default {
deteletDialogImageUrl(index) { deteletDialogImageUrl(index) {
this.uploadStatus = true; this.uploadStatus = true;
this.giftForm.images.splice(index, 1); this.giftForm.images.splice(index, 1);
this.giftFormFileList.splice(index, 1);
}, },
// 放大 // 放大
enlargeDialogImageUrl(index) { enlargeDialogImageUrl(index) {
this.dialogEnlargeImageUrl = this.giftForm.images[index].imageUrl; this.dialogEnlargeImageUrl = this.giftForm.images[index].imageUrl;
this.dialogVisibleImg = true; this.dialogVisibleImg = true;
}, },
// 左移一位
moveLeft(index) {
this.swapArray(this.giftForm.images, index, index - 1);
},
//右移一位
moveRight(index) {
this.swapArray(this.giftForm.images, index, index + 1);
},
//两个数据条换位置 //两个数据条换位置
swapArray(arr, index1, index2) { swapArray(arr, index1, index2) {
arr[index1] = arr.splice(index2, 1, arr[index1])[0]; arr[index1] = arr.splice(index2, 1, arr[index1])[0];
......
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