|
@@ -126,7 +126,7 @@ export default {
|
|
|
this.imgArr = this.formData.collectionItemList[0].fileInfoList || [];
|
|
this.imgArr = this.formData.collectionItemList[0].fileInfoList || [];
|
|
|
} else {
|
|
} else {
|
|
|
if (this.formData.mediaInfos) {
|
|
if (this.formData.mediaInfos) {
|
|
|
- this.getLocalImgData(this.formData.mediaInfos);
|
|
|
|
|
|
|
+ this.downloadImage(this.formData.mediaInfos);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -140,22 +140,23 @@ export default {
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- getLocalImgData(mediaInfos) {
|
|
|
|
|
|
|
+ downloadImage(mediaInfos) {
|
|
|
console.log('mediaInfos:', mediaInfos);
|
|
console.log('mediaInfos:', mediaInfos);
|
|
|
if (!mediaInfos.length) {
|
|
if (!mediaInfos.length) {
|
|
|
console.log('this.imgArr1:', this.imgArr);
|
|
console.log('this.imgArr1:', this.imgArr);
|
|
|
return;
|
|
return;
|
|
|
} else {
|
|
} else {
|
|
|
let mediaitem = mediaInfos.pop();
|
|
let mediaitem = mediaInfos.pop();
|
|
|
- wx.getLocalImgData({
|
|
|
|
|
- localId: mediaitem.mediaId, // 图片的localID
|
|
|
|
|
|
|
+ wx.downloadImage({
|
|
|
|
|
+ serverId: mediaitem.mediaId,
|
|
|
|
|
+ isShowProgressTips: 0, // 默认为1,显示进度提示
|
|
|
success: (res) => {
|
|
success: (res) => {
|
|
|
console.log('res.localData:', res.localData);
|
|
console.log('res.localData:', res.localData);
|
|
|
this.imgArr.push({
|
|
this.imgArr.push({
|
|
|
mediaId: mediaitem.mediaId,
|
|
mediaId: mediaitem.mediaId,
|
|
|
fileUrl: res.localData,
|
|
fileUrl: res.localData,
|
|
|
});
|
|
});
|
|
|
- this.getLocalImgData(mediaInfos);
|
|
|
|
|
|
|
+ this.downloadImage(mediaInfos);
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|