From 7f05af1fe20d3ffc8f96e7ed12ef21a98c42cb7c Mon Sep 17 00:00:00 2001 From: "453530270@qq.com" Date: Thu, 4 Jan 2024 15:18:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/goods/list.vue | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pages/goods/list.vue b/pages/goods/list.vue index c27cb09..9c92c17 100644 --- a/pages/goods/list.vue +++ b/pages/goods/list.vue @@ -75,7 +75,7 @@ //解压缩 import pako from '@/core/pako' - import { base64ToUint8Array} from '@/utils/util' + import { base64ToUint8Array,numberWithCommas} from '@/utils/util' const pageSize = 15 const showViewKey = 'GoodsList-ShowView'; @@ -171,6 +171,16 @@ .catch(reject) }) }, + + // 整理列表数据 + initList(newList) { + newList.data.forEach(item => { + // 处理价格表现形式 + item.price = numberWithCommas(item.price) + item.gdimg = pako.inflateRaw(base64ToUint8Array(item.goods_image), {to: 'string'}) + }) + return newList + }, // 切换排序方式 handleSortType(newSortType) {