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}}