From 92af3418303f289cb7e95a5447de616fc85bdb4e Mon Sep 17 00:00:00 2001 From: wanghongjun <1445693971@qq,com> Date: Tue, 12 Mar 2024 11:05:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=87=E7=9A=84=E5=95=86=E5=BA=97=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/goods/list.vue | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pages/goods/list.vue b/pages/goods/list.vue index 82920ee..ebd3389 100644 --- a/pages/goods/list.vue +++ b/pages/goods/list.vue @@ -166,12 +166,24 @@ // 合并新数据 const newList = result.data app.list.data = getMoreListData(newList, app.list, pageNo) + app.getHomeListImage() resolve(newList) }) .catch(reject) }) }, - + async getHomeListImage() { + this.list.data.forEach((item,key) => { + if (item.goods_image === "") { + GoodsApi.nbgoodsImage({"id": item.id}).then(res2=>{ + if (res2.code === 200) { + this.list.data[key].goods_image = res2.data.data[0].goods_image; + this.list.data[key].gdimg = pako.inflateRaw(base64ToUint8Array(res2.data.data[0].goods_image), {to: 'string'}) + } + }) + } + }) + }, // 整理列表数据 initList(newList) { newList.data.forEach(item => {