Skip to content

Commit

Permalink
fix(tcb-shop): fix handling cloud image; fix homepage price
Browse files Browse the repository at this point in the history
  • Loading branch information
Areo-Joe committed Sep 24, 2024
1 parent 40b4780 commit 7207fa8
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions miniprogram/tcb-shop/pages/home/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,9 @@ Page({

async loadHomeSwiper() {
const { images } = await getHomeSwiper();
const imgSrcs = (
await wx.cloud.getTempFileURL({
fileList: images,
})
).fileList.map((x) => x.tempFileURL);
const handledImages = await getCloudImageTempUrl(images);

this.setData({ imgSrcs });
this.setData({ imgSrcs: handledImages });
},

onReTry() {
Expand All @@ -89,7 +85,7 @@ Page({
const images = nextList.map((x) => x.cover_image);
const handledImages = await getCloudImageTempUrl(images);
handledImages.forEach((image, index) => (nextList[index].cover_image = image));
await Promise.all(nextList.map(async (spu) => (spu.price = await getPrice(spu._id))));
await Promise.all(nextList.map(async (spu) => (spu.price = await getPrice(spu._id).catch(() => 0.01))));

const goodsList = fresh ? nextList : this.data.goodsList.concat(nextList);

Expand Down

0 comments on commit 7207fa8

Please sign in to comment.