diff --git a/images/9e590639954f2598a54eddf72b7d1fa.jpg b/images/招商图片.jpg similarity index 100% rename from images/9e590639954f2598a54eddf72b7d1fa.jpg rename to images/招商图片.jpg diff --git a/pages/cooperation/index.wxml b/pages/cooperation/index.wxml index 82a49d3..925fc94 100644 --- a/pages/cooperation/index.wxml +++ b/pages/cooperation/index.wxml @@ -6,7 +6,7 @@ - + diff --git a/pages/favorites/index.js b/pages/favorites/index.js index 0106417..841eb9d 100644 --- a/pages/favorites/index.js +++ b/pages/favorites/index.js @@ -227,6 +227,7 @@ Page({ let contact_phone = ''; let fullRegion = ''; let province = ''; + let status = 'pending_review'; // 默认状态 // 优先从商品列表中获取联系人信息和地区信息 if (matchingProduct) { @@ -236,6 +237,8 @@ Page({ fullRegion = matchingProduct.fullRegion || matchingProduct.region || ''; // 提取省份 province = extractProvince(fullRegion); + // 获取商品状态 + status = matchingProduct.status || 'pending_review'; } // 然后尝试从收藏数据中获取 else if (item.Product) { @@ -245,6 +248,8 @@ Page({ fullRegion = item.Product.region || ''; // 提取省份 province = extractProvince(fullRegion); + // 获取商品状态 + status = item.Product.status || 'pending_review'; } // 更新item对象,确保联系人信息和地区信息同时存在于顶层和Product对象中 @@ -252,16 +257,25 @@ Page({ item.contact_phone = contact_phone; item.fullRegion = fullRegion; item.region = province; + item.status = status; if (item.Product) { item.Product.product_contact = product_contact; item.Product.contact_phone = contact_phone; item.Product.fullRegion = fullRegion; item.Product.region = province; + item.Product.status = status; } return item; }); + // 过滤掉已下架或软删除的商品,只保留已发布状态的货源 + favorites = favorites.filter(item => { + const status = item.status || item.Product?.status || 'pending_review'; + // 只保留已发布状态的商品 + return status === 'published'; + }); + console.log('更新后的收藏列表:', favorites); this.setData({ favoritesList: favorites, diff --git a/pages/goods-detail/goods-detail.wxml b/pages/goods-detail/goods-detail.wxml index 16efdbe..aab45ee 100644 --- a/pages/goods-detail/goods-detail.wxml +++ b/pages/goods-detail/goods-detail.wxml @@ -54,7 +54,7 @@ bindtap="onFavoriteClick" style="display: flex; align-items: center;" > - {{isFavorite ? '❤️' : '🤍'}} + {{isFavorite ? '❤️' : '🤍'}}