test
This commit is contained in:
@@ -122,7 +122,7 @@
|
||||
refreshBox,
|
||||
notCover,
|
||||
rightSmallCover,
|
||||
threeCover
|
||||
threeCover,
|
||||
},
|
||||
computed: {
|
||||
userInfo() {
|
||||
@@ -180,6 +180,27 @@
|
||||
.navBarHeight + 'px'; // 计算列表高度
|
||||
},
|
||||
methods: {
|
||||
async getCloudImage(srcLst) {
|
||||
for (let i = 0; i < srcLst.length ; i ++ ) {
|
||||
if (srcLst[i]&&srcLst[i].substring(0, 8) == "cloud://") {
|
||||
const res = await uniCloud.getTempFileURL({fileList: [srcLst[i]]});
|
||||
console.log(res)
|
||||
console.log(res.fileList.tempFileURL)
|
||||
srcLst[i] = res.fileList[0].tempFileURL
|
||||
|
||||
} else if (srcLst[i]&&srcLst[i].substring(0, 8) == "qiniu://") {
|
||||
console.log(srcLst[i])
|
||||
const uniCloudStorageExtCo = uniCloud.importObject("ext-storage-co");
|
||||
const res = await uniCloudStorageExtCo.getTempFileURL({src: srcLst[i]});
|
||||
console.log(res.fileList[0].tempFileURL)
|
||||
srcLst[i] = res.fileList[0].tempFileURL
|
||||
|
||||
} else {
|
||||
srcLst[i] = srcLst[i]
|
||||
}
|
||||
}
|
||||
return srcLst;
|
||||
},
|
||||
dialogConfirm() {
|
||||
console.log('点击确认')
|
||||
},
|
||||
@@ -234,15 +255,22 @@
|
||||
item.thumbnail = [item.thumbnail]
|
||||
}
|
||||
|
||||
|
||||
return item
|
||||
})
|
||||
|
||||
|
||||
// 处理腾讯云文件链接
|
||||
for (const article of listData) {
|
||||
const parseImages = await parseImageUrl(article.thumbnail)
|
||||
const parseImages = await this.getCloudImage(article.thumbnail)
|
||||
// const parseImages = await parseImageUrl(article.thumbnail)
|
||||
console.log(parseImages)
|
||||
|
||||
article.thumbnail = parseImages ? parseImages.map(image => image.src) : []
|
||||
article.thumbnail = parseImages;
|
||||
|
||||
}
|
||||
|
||||
console.log(listData)
|
||||
|
||||
this.listData = this.loadType === 'loadMore' ? this.listData.concat(listData) : listData
|
||||
this.loadType = null
|
||||
|
||||
Reference in New Issue
Block a user