From 74dd03c93a6499ee165502a0f25a07adc5cf0a86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E9=A3=9E=E6=B4=8B?= <15778543+xufeiyang6017@user.noreply.gitee.com> Date: Mon, 5 Jan 2026 14:18:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=81=E8=AE=B8=E6=9F=A5=E7=9C=8B=E5=B7=B2?= =?UTF-8?q?=E4=B8=8B=E6=9E=B6=E5=95=86=E5=93=81=E8=AF=A6=E6=83=85=EF=BC=9A?= =?UTF-8?q?=E7=A7=BB=E9=99=A4sold=5Fout=E7=8A=B6=E6=80=81=E9=99=90?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/buyer/index.js | 5 +++-- pages/favorites/index.js | 4 ++-- pages/favorites/index.wxml | 17 +++++++++-------- pages/index/index.js | 4 ++-- pages/index/index.wxml | 1 + pages/index/index.wxss | 5 +++++ utils/api.js | 20 +++++++++++++++++--- 7 files changed, 39 insertions(+), 17 deletions(-) diff --git a/pages/buyer/index.js b/pages/buyer/index.js index b07a174..f458f36 100644 --- a/pages/buyer/index.js +++ b/pages/buyer/index.js @@ -672,7 +672,7 @@ Page({ // ✅ 修改:添加分页参数 const { pageSize } = this.data; - API.getProductList('published', { + API.getProductList(['published', 'sold_out'], { viewMode: 'shopping', page: 1, // 第一页 pageSize: pageSize // 使用配置的页面大小 @@ -831,7 +831,7 @@ Page({ } console.log('准备调用API.getProductList,无论是否登录都尝试获取公开商品'); - return API.getProductList('published', { + return API.getProductList(['published', 'sold_out'], { timestamp: timestamp, viewMode: 'shopping', page: currentPage, @@ -1731,6 +1731,7 @@ Page({ } const goodsItem = e.currentTarget.dataset.item; + // 跳转到商品详情页面,并传递商品数据,使用encodeURIComponent编码JSON字符串 wx.navigateTo({ url: '/pages/goods-detail/goods-detail?goodsData=' + encodeURIComponent(JSON.stringify(goodsItem)) diff --git a/pages/favorites/index.js b/pages/favorites/index.js index d818754..a33a0fb 100644 --- a/pages/favorites/index.js +++ b/pages/favorites/index.js @@ -205,7 +205,7 @@ Page({ } // 首先获取所有商品列表,确保包含联系人信息 - API.getProductList('published', { + API.getProductList(['published', 'sold_out'], { page: 1, pageSize: 100 // 获取足够多的商品,确保包含所有收藏商品 }).then(productListRes => { @@ -402,7 +402,7 @@ Page({ // 调用API.getProductList获取完整的商品列表,确保包含联系人信息 wx.showLoading({ title: '加载中' }); - API.getProductList('published', { + API.getProductList(['published', 'sold_out'], { page: 1, pageSize: 100 // 获取足够多的商品,确保包含当前商品 }).then(productListRes => { diff --git a/pages/favorites/index.wxml b/pages/favorites/index.wxml index 8b381e5..5f6f81f 100644 --- a/pages/favorites/index.wxml +++ b/pages/favorites/index.wxml @@ -15,7 +15,7 @@ - + @@ -37,7 +37,7 @@ data-item-id="{{index}}"> - + @@ -51,28 +51,29 @@ - - + + - {{item.Product.supplyStatus || '暂无状态'}} + 已下架 + {{item.Product.supplyStatus}} {{item.Product.productName || '未命名商品'}} V - + {{(item.Product.spec && item.Product.spec !== '无') ? item.Product.spec : (item.Product.specification && item.Product.specification !== '无') ? item.Product.specification : '无'}} | {{item.Product.yolk || '无'}} | {{item.Product.minOrder || item.Product.quantity || 1}}件 - + ¥{{item.Product.price || 0}}