|
|
@ -250,16 +250,15 @@ |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 回收规则弹窗 --> |
|
|
|
<view v-if="showRulePopup" class="rule-popup-mask" @click.self="closeRulePopup"> |
|
|
|
<view v-if="showRulePopup" class="rule-popup-mask" @click.self="handleRulePopupMaskClick"> |
|
|
|
<view class="rule-popup"> |
|
|
|
<view class="rule-popup-title">回收规则</view> |
|
|
|
<scroll-view class="rule-popup-content" scroll-y> |
|
|
|
<scroll-view class="rule-popup-content" scroll-y @scroll="onRuleContentScroll"> |
|
|
|
<uv-parse :content="ruleHtml"></uv-parse> |
|
|
|
<view class="rule-content-bottom-indicator"></view> |
|
|
|
</scroll-view> |
|
|
|
<button class="rule-popup-btn" @click="closeRulePopup">我知道了</button> |
|
|
|
<!-- <view class="rule-popup-close" @tap="closeRulePopup"> |
|
|
|
<uni-icons type="close" size="36" color="#fff" /> |
|
|
|
</view> --> |
|
|
|
<view v-if="!hasScrolledToBottom" class="scroll-tip">请滚动到底部阅读完整内容</view> |
|
|
|
<button class="rule-popup-btn" :class="{ disabled: !hasScrolledToBottom }" @click="closeRulePopup">我知道了</button> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
@ -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; |
|
|
|