This commit is contained in:
@@ -148,9 +148,29 @@ import toast from '../../../uview-ui/libs/function/toast';
|
||||
async getActivityList() {
|
||||
let res = await this.$u.api.getActivityList();
|
||||
if (res.code == '200') {
|
||||
this.hotList = res.rows
|
||||
this.hotList = res.rows;
|
||||
// 处理图片链接
|
||||
await this.getImageUrl();
|
||||
}
|
||||
},
|
||||
async getImageUrl() {
|
||||
// 处理hotList中的图片链接
|
||||
for (let i = 0; i < this.hotList.length; i++) {
|
||||
const item = this.hotList[i];
|
||||
if (item.activityImgUrl) {
|
||||
try {
|
||||
const imgRes = await this.$u.api.getImageUrl({}, item.activityImgUrl);
|
||||
if (imgRes.code == 200 && imgRes.data && imgRes.data.length > 0) {
|
||||
// 将图片ID替换为实际的图片URL
|
||||
this.$set(this.hotList[i], 'activityImgUrl', imgRes.data[0].url);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取图片链接失败:', error);
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log('t1',this.hotList)
|
||||
},
|
||||
goNoticeDetail(item){
|
||||
let params = {}
|
||||
params.title = item.title
|
||||
|
Reference in New Issue
Block a user