diff --git a/config.js b/config.js index a1172f2..b78c2f0 100644 --- a/config.js +++ b/config.js @@ -1,5 +1,5 @@ // config.js -const type = 'local' +const type = 'prod' const config = { local: { diff --git a/pages/component/home.vue b/pages/component/home.vue index 2d8e935..0266c69 100644 --- a/pages/component/home.vue +++ b/pages/component/home.vue @@ -3,11 +3,33 @@ - + 回收规则 - + + - - + 请滚动到底部阅读完整内容 + @@ -361,6 +360,7 @@ export default { isUserBlacklisted: false, // 用户是否被拉黑 currentProductId: null, // 当前查看品牌的商品ID searchTimer: null, // 搜索防抖定时器 + hasScrolledToBottom: false, // 是否已滚动到底部 } }, computed: { @@ -664,6 +664,9 @@ export default { return; } + // 重置滚动状态 + this.hasScrolledToBottom = false; + // 获取回收规则富文本 this.$api('getGoodsRecycleRule', { goodsId: item.id }, res => { if (res.code === 200 && res.result) { @@ -692,16 +695,9 @@ export default { return } - if (this.totalCount < 3) { + if (this.totalCount < 3 || Number(this.totalPrice) < this.minMoney) { uni.showToast({ - title: `各品类混合需要满3${this.totalUnitText}才能回收哦`, - icon: 'none' - }) - return - } - if (Number(this.totalPrice) < this.minMoney) { - uni.showToast({ - title: `回收总价需满${this.minMoney}元才能预约`, + title: `各品类混合需要满3${this.totalUnitText}并且各品类混合需要满${this.minMoney}元才能回收哦`, icon: 'none' }) return @@ -874,7 +870,18 @@ export default { this.showRulePopup = true }, closeRulePopup() { + // 如果还没有滚动到底部,显示提示 + if (!this.hasScrolledToBottom) { + uni.showToast({ + title: '请阅读完整回收规则', + icon: 'none' + }) + return + } + this.showRulePopup = false; + this.hasScrolledToBottom = false; // 重置滚动状态 + // 如果是在等待品牌选择的状态下关闭规则弹窗,则接着打开品牌选择 if (this.isWaitingForBrandSelection) { this.isWaitingForBrandSelection = false; // 清除等待状态 @@ -888,6 +895,29 @@ export default { this.showBrandPopup = true; // 打开品牌索引弹窗 } }, + + // 处理规则弹窗遮罩点击 + handleRulePopupMaskClick() { + if (!this.hasScrolledToBottom) { + uni.showToast({ + title: '请阅读完整回收规则', + icon: 'none' + }) + return + } + this.closeRulePopup() + }, + + // 监听规则内容滚动 + onRuleContentScroll(e) { + const { scrollTop, scrollHeight, deltaY } = e.detail + const containerHeight = 500 // 大概的容器高度,单位rpx转换后的px + + // 判断是否滚动到底部(留一些余量) + if (scrollTop + containerHeight >= scrollHeight - 20) { + this.hasScrolledToBottom = true + } + }, loadMoreGoods() { const categoryId = this.categories[this.currentCategory]?.id const page = (this.allProductsPage[categoryId] || 1) + 1 @@ -1951,8 +1981,9 @@ export default { justify-content: center; } .rule-popup { - width: 90vw; - max-width: 600rpx; + width: 95vw; + max-width: 750rpx; + max-height: 85vh; background: #fff; border-radius: 48rpx; box-shadow: 0 8rpx 32rpx rgba(0,0,0,0.12); @@ -1972,7 +2003,8 @@ export default { } .rule-popup-content { width: 100%; - max-height: 420rpx; + max-height: 60vh; + min-height: 400rpx; padding: 0 40rpx; box-sizing: border-box; overflow-y: auto; @@ -1983,6 +2015,21 @@ export default { display: none; /* Chrome, Safari, Opera */ } } +.rule-content-bottom-indicator { + height: 20rpx; + width: 100%; +} +.scroll-tip { + font-size: 24rpx; + color: #ff6b35; + text-align: center; + margin: 16rpx 0 8rpx 0; + animation: tipPulse 2s infinite; +} +@keyframes tipPulse { + 0%, 100% { opacity: 1; } + 50% { opacity: 0.6; } +} .rule-popup-desc { font-size: 26rpx; color: #888; @@ -2025,12 +2072,19 @@ export default { margin: 0 auto; margin-top: 16rpx; box-shadow: 0 4rpx 16rpx rgba(255, 156, 0, 0.08); + transition: all 0.3s ease; &::after { border: none; } &:active { opacity: 0.9; } + &.disabled { + background: #ccc; + color: #999; + box-shadow: none; + opacity: 0.6; + } } .rule-popup-close { position: absolute; diff --git a/pages/index/index.vue b/pages/index/index.vue index 6b75338..cdcd2e0 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -36,7 +36,7 @@ - - - - - - - 推广链接 - - - + + + + 推广链接 - -