diff --git a/images/立即入驻7.jpg b/images/立即入驻7.jpg new file mode 100644 index 0000000..543d0f2 Binary files /dev/null and b/images/立即入驻7.jpg differ diff --git a/pages/chat/index.js b/pages/chat/index.js index 0e652e9..2a6245d 100644 --- a/pages/chat/index.js +++ b/pages/chat/index.js @@ -89,7 +89,7 @@ Page({ // 保存当前时间戳,用于强制刷新 const forcedLoadTime = Date.now(); this.setData({ - lastLoadTime: forcedLoadTime - 3000, // 设置为3秒前,确保能绕过2秒的节流限制 + lastLoadTime: forcedLoadTime - 2000, // 设置为2秒前,确保能绕过2秒的节流限制 }, () => { // 重新加载聊天列表,实现从聊天详情页返回时立即更新 this.loadChatList(); diff --git a/pages/index/index.js b/pages/index/index.js index f4cee87..2f6ac0a 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -706,6 +706,7 @@ Page({ filteredGoods: filteredGoods, loadingMore: false, isLoading: false, + isRefreshing: false, // 确保下拉刷新状态被重置 page: this.data.page + 1, // 更新缓存时间戳 lastDataTimestamp: new Date().getTime() @@ -894,9 +895,10 @@ Page({ return; } + // 筛选时不显示骨架屏 if (isLoadMore) { this.setData({ loadingMore: true }) - } else { + } else if (!forceRefresh) { // 只有非筛选的首次加载才显示骨架屏 this.setData({ isLoading: true }) } @@ -956,7 +958,11 @@ Page({ }) .catch(err => { console.error('加载商品数据失败:', err) - this.setData({ loadingMore: false, isLoading: false }) + this.setData({ + loadingMore: false, + isLoading: false, + isRefreshing: false // 确保下拉刷新状态被重置 + }) }) }, @@ -1056,6 +1062,7 @@ Page({ filteredGoods: filteredGoods, loadingMore: false, isLoading: false, + isRefreshing: false, // 确保下拉刷新状态被重置 hasMoreData: false // 缓存数据不分页 }); }, @@ -1408,7 +1415,7 @@ Page({ return // 如果选择的分类和当前相同,不重复加载 } - // 清除缓存并重新加载数据 - 仿照下拉刷新机制 + // 清除缓存并重新加载数据 - 筛选时不显示骨架屏,直接显示内容 this.setData({ selectedCategory: category, searchKeyword: '', // 清除搜索关键词,筛选框优先级更高 @@ -1417,7 +1424,8 @@ Page({ hasMoreData: true, goods: [], filteredGoods: [], - isLoading: true, + isLoading: false, // 筛选时不显示骨架屏 + isRefreshing: false, // 筛选时不显示下拉刷新状态 // 清除所有缓存以获取最新数据 categoryQueryCache: {}, lastDataTimestamp: 0, diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 05a3bb8..3f947b0 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -108,7 +108,7 @@ - + @@ -123,7 +123,7 @@ - + 预售 现货 - - {{item.name}} + + {{item.name}} {{item.displaySpecification}} | {{item.displayYolk}} - + {{item.sourceType || ''}} {{item.negotiateStatus}} 库存:{{item.totalStock && item.totalStock !== '充足' ? item.totalStock + '件' : (item.totalStock || '充足')}} @@ -217,6 +217,13 @@ + + + + 📦 + 暂无商品数据 + 下拉刷新试试 + diff --git a/pages/index/index.wxss b/pages/index/index.wxss index 57a50f1..f1f43ea 100644 --- a/pages/index/index.wxss +++ b/pages/index/index.wxss @@ -871,6 +871,86 @@ wx-button:not([size=mini]) { border: 1rpx solid rgba(82, 196, 26, 0.5); } +/* product-status-row 容器样式 */ +.product-status-row { + display: flex; + flex-wrap: nowrap; + align-items: center; + justify-content: flex-start; + gap: 6rpx; + width: 100%; + height: 36rpx; + overflow: visible; + position: relative; + z-index: 9999; + margin: 4rpx 0; + background: transparent; +} + +/* 货源类型标签 - 完全根据字数动态调整宽度 */ +.product-status-row .source-tag { + width: auto; + min-width: 50rpx; + max-width: 120rpx; + white-space: nowrap; + flex-shrink: 0; + font-size: 16rpx; + padding: 6rpx 8rpx; + height: 28rpx; + line-height: 16rpx; + display: flex; + align-items: center; + justify-content: center; + border-radius: 6rpx; + border: 1rpx solid rgba(0, 0, 0, 0.1); + background: rgba(24, 144, 255, 0.1); + color: #096dd9; + box-sizing: border-box; +} + +/* 议价状态标签 - 完全根据字数动态调整宽度 */ +.product-status-row .negotiate-tag { + width: auto; + min-width: 50rpx; + max-width: 80rpx; + white-space: nowrap; + text-align: center; + flex-shrink: 0; + font-size: 16rpx; + padding: 6rpx 8rpx; + height: 28rpx; + line-height: 16rpx; + display: flex; + align-items: center; + justify-content: center; + border-radius: 6rpx; + border: 1rpx solid rgba(0, 0, 0, 0.1); + background: rgba(255, 255, 255, 0.8); + color: #333; + box-sizing: border-box; +} + +/* 库存标签 - 根据字数动态调整宽度 */ +.product-status-row .stock-tag { + width: auto; + min-width: 70rpx; + max-width: 160rpx; + white-space: nowrap; + text-align: center; + font-size: 16rpx; + padding: 6rpx 8rpx; + height: 28rpx; + line-height: 16rpx; + display: flex; + align-items: center; + justify-content: center; + border-radius: 6rpx; + border: 1rpx solid rgba(0, 0, 0, 0.1); + background: rgba(82, 196, 26, 0.1); + color: #389e0d; + box-sizing: border-box; +} + .goods-footer { display: flex; justify-content: space-between;