暂无回收规则
' - } - this.showRulePopup = true - this.startRuleCountdown() - }) - }, - - // 开始规则弹窗倒计时 - startRuleCountdown() { - this.ruleCountdown = 3 - this.ruleCountdownTimer = setInterval(() => { - this.ruleCountdown-- - if (this.ruleCountdown <= 0) { - clearInterval(this.ruleCountdownTimer) - this.ruleCountdownTimer = null - } - }, 1000) - }, showMore() { uni.showToast({ title: '更多规则请咨询客服', @@ -488,9 +476,16 @@ export default { }) }, submitOrder() { - if (this.totalCount === 0) { + if (this.totalCount < 3) { + uni.showToast({ + title: '各品类混合需要满3件才能回收哦', + icon: 'none' + }) + return + } + if (Number(this.totalPrice) < this.minMoney) { uni.showToast({ - title: '请选择要回收的物品', + title: `回收总价需满${this.minMoney}元才能预约`, icon: 'none' }) return @@ -540,6 +535,9 @@ export default { }, closeBrandPopup() { this.showBrandPopup = false + // 如果用户取消品牌选择,重置状态 + this.pendingBrandIndex = null; + this.isWaitingForBrandSelection = false; }, scrollToLetter(letter) { this.currentLetter = letter @@ -587,29 +585,19 @@ export default { this.showRulePopup = true }, closeRulePopup() { - // 倒计时未结束时不能关闭 - if (this.ruleCountdown > 0) { - uni.showToast({ - title: `请阅读完规则,还需等待${this.ruleCountdown}秒`, - icon: 'none' - }) - return - } - - this.showRulePopup = false - this.ruleCountdown = 0 - if (this.ruleCountdownTimer) { - clearInterval(this.ruleCountdownTimer) - this.ruleCountdownTimer = null - } - - // 如果有待添加的商品,现在添加它 - if (this.pendingAddItem) { - const { categoryId, index, item } = this.pendingAddItem - this.$set(item, 'quantity', 1) - // 记录该商品已显示过规则弹窗 - this.shownRuleItems.add(item.id) - this.pendingAddItem = null + this.showRulePopup = false; + // 如果是在等待品牌选择的状态下关闭规则弹窗,则接着打开品牌选择 + if (this.isWaitingForBrandSelection) { + this.isWaitingForBrandSelection = false; // 清除等待状态 + const categoryId = this.categories[this.currentCategory]?.id; + const item = this.allProducts[categoryId]?.[this.pendingBrandIndex]; + if (item?.isPin === 'Y') { + this.getGoodsBrandList(item.shopCion); + this.showBrandPopup = true; // 打开品牌索引弹窗 + } else { + // 如果商品不是品牌商品,或者出现意外情况,重置状态 + this.pendingBrandIndex = null; + } } }, loadMoreGoods() { @@ -634,6 +622,7 @@ export default { }, openBrandConfirm(brand) { this.brandConfirmInfo = { + id: brand.id, logo: brand.logo, name: brand.name } @@ -645,19 +634,13 @@ export default { confirmBrand() { this.showBrandConfirm = false this.showBrandPopup = false - // 确认后将待加一的商品数量+1 + // 确认后将待加一的商品数量+1,并记录品牌ID if (this.pendingBrandIndex !== null) { const categoryId = this.categories[this.currentCategory]?.id const item = this.allProducts[categoryId]?.[this.pendingBrandIndex] if (item) { - // 如果是第一次添加且未显示过规则弹窗,需要先显示规则弹窗 - if ((item.quantity || 0) === 0 && !this.shownRuleItems.has(item.id)) { - this.pendingAddItem = { categoryId, index: this.pendingBrandIndex, item } - this.showRulesWithCountdown(item) - } else { - // 直接添加数量 - this.$set(item, 'quantity', 1) - } + this.$set(item, 'quantity', 1) + this.$set(item, 'pinId', this.brandConfirmInfo.id); } this.pendingBrandIndex = null } @@ -670,6 +653,7 @@ export default { // 获取品牌名称的拼音首字母 const firstChar = this.getPinyinFirstLetter(item.name) return { + id: item.id, logo: item.image || '/static/brand/alexander.png', name: item.name, letter: firstChar @@ -690,14 +674,9 @@ export default { return key.charAt(0).toUpperCase() } } - - let index = this.brandIndexList.indexOf(firstChar.toUpperCase()) - if (index != -1) { - return this.brandIndexList[index] - } - return '#' }, + }, created() { this.currentCategory = 0 @@ -751,11 +730,6 @@ export default { uni.$off('bannerListUpdated') // 移除事件监听 uni.$off('clearRecycleOrderData') - // 清理倒计时定时器 - if (this.ruleCountdownTimer) { - clearInterval(this.ruleCountdownTimer) - this.ruleCountdownTimer = null - } }, onShow() { const id = getApp().globalData.targetRecycleCategoryId @@ -835,10 +809,11 @@ export default { .banner { background: linear-gradient(135deg, #ff9500,#ff5e00); position: relative; + height: 350rpx; z-index: 1; image { width: 100%; - height: 100%; + height: 90%; } } @@ -871,11 +846,11 @@ export default { } .category-item { position: relative; - padding: 30rpx 10rpx; + padding: 28rpx 20rpx; text-align: center; font-family: PingFang SC; font-weight: 600; - font-size: 30rpx; + font-size: 15px; line-height: 100%; letter-spacing: 0px; color: #666; @@ -884,10 +859,16 @@ export default { position: absolute; top: 15rpx; right: 15rpx; - width: 12rpx; - height: 12rpx; + min-width: 32rpx; + height: 32rpx; + padding: 0 6rpx; background: #ff7a0e; - border-radius: 50%; + border-radius: 16rpx; + color: #fff; + font-size: 20rpx; + text-align: center; + line-height: 32rpx; + box-sizing: border-box; } &.active { @@ -914,7 +895,7 @@ export default { .goods-content { flex: 1; height: 100%; - padding: 0 20rpx; + padding: 0 30rpx; background: #ffffff; width: 70%; margin: 1rpx; @@ -937,8 +918,8 @@ export default { border-bottom: 1rpx solid #f5f5f5; .goods-item-img { - width: 160rpx; - height: 180rpx; + width: 120rpx; + height: 120rpx; border-radius: 24rpx; background: #f8f8f8; margin-right: 28rpx; @@ -954,7 +935,6 @@ export default { } .goods-header { display: flex; - justify-content: space-between; align-items: center; margin-bottom: 10rpx; @@ -969,10 +949,32 @@ export default { vertical-align: middle; color: #333; font-weight: bold; - overflow:hidden; //超出的文本隐藏 - text-overflow:ellipsis; //溢出用省略号显示 - white-space:nowrap; //溢出不换行 - width: 160rpx; + flex-shrink: 1; + flex-grow: 1; + } + + .brand-check-placeholder { + flex-shrink: 0; + margin-left: 10rpx; + } + + .brand-check { + display: flex; + flex-direction: row; + align-items: center; + justify-content: center; + border: 1px solid #f8a01d; + border-radius: 8rpx; + color: #ff7a0e; + font-family: PingFang SC; + font-weight: 400; + font-size: 12px; + padding: 4rpx 10rpx; + line-height: 1; + white-space: nowrap; + text { + margin-right: 4rpx; + } } .goods-desc { @@ -980,6 +982,9 @@ export default { color: #999; display: block; margin-bottom: 20rpx; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; } .goods-info { @@ -1024,7 +1029,7 @@ export default { justify-content: center; font-size: 28rpx; color: #666; - background: #f8f8f8; + background: #ffffff; border: none; border-radius: 50%; @@ -1045,41 +1050,22 @@ export default { } } - .brand-check { - // margin-top: 20rpx; - // margin:0 auto; + .rules-link { + margin-top: 20rpx; + } + + .rules-link .rules { display: flex; - flex-direction: row; align-items: center; - // justify-content: center; - border: 1px solid #f8a01d; - width: 40%; - // background: #fff7f0; - border-radius: 8rpx; - color: #ff7a0e; font-family: PingFang SC; font-weight: 400; font-size: 12px; line-height: 140%; letter-spacing: 0%; - text { - // margin-right: 8rpx; - } + color: #666; } } - -.rules-link{ - flex-shrink: 0; - .rules{ - font-family: PingFang SC; - font-weight: 400; - font-size: 12px; - line-height: 140%; - letter-spacing: 0%; - } -} - .other-unrecycle-card { display: flex; align-items: center; @@ -1090,8 +1076,8 @@ export default { margin: 30rpx 0 0 0; } .other-unrecycle-img { - width: 160rpx; - height: 180rpx; + width: 120rpx; + height: 120rpx; border-radius: 24rpx; background: #f8f8f8; margin-right: 28rpx; @@ -1113,13 +1099,9 @@ export default { word-break: break-all; white-space: normal; overflow: visible; - overflow:hidden; //超出的文本隐藏 - text-overflow:ellipsis; //溢出用省略号显示 - white-space:nowrap; //溢出不换行 - width: 280rpx; } .other-unrecycle-desc { - font-size: 20rpx; + font-size: 24rpx; color: #999; margin-bottom: 12rpx; text-overflow: ellipsis; @@ -1140,14 +1122,13 @@ export default { height: 60rpx; margin-left: 24rpx; border-radius: 50%; - background: #f5f5f5; - color: #ccc; + background: #fff; + color: #666; font-size: 36rpx; border: none; display: flex; align-items: center; justify-content: center; - pointer-events: none; } .fixed-bottom-wrap { @@ -1385,7 +1366,7 @@ export default { justify-content: center; font-size: 32rpx; color: #666; - background: #f5f5f5; + background: #ffffff; border: none; border-radius: 50%; &::after { @@ -1672,14 +1653,6 @@ export default { &:active { opacity: 0.9; } - &.disabled { - background: #ccc; - color: #999; - box-shadow: none; - &:active { - opacity: 1; - } - } } .rule-popup-close { position: absolute; @@ -1729,11 +1702,21 @@ export default { margin-bottom: 24rpx; } .pickup-confirm-content { + width: 100%; font-size: 26rpx; color: #333; text-align: left; line-height: 1.7; margin-bottom: 36rpx; + .confirm-item { + margin-bottom: 24rpx; + &:last-child { + margin-bottom: 0; + } + } + .confirm-item-red { + color: red; + } } .pickup-confirm-btn-row { width: 100%; @@ -1861,4 +1844,77 @@ export default { color: #fff; border: none; } +.price-info-popup-mask { + position: fixed; + left: 0; + right: 0; + top: 0; + bottom: 0; + background: rgba(0,0,0,0.4); + z-index: 6000; + display: flex; + align-items: center; + justify-content: center; +} +.price-info-popup { + width: 85vw; + max-width: 600rpx; + background: #fff; + border-radius: 24rpx; + box-shadow: 0 8rpx 32rpx rgba(0,0,0,0.12); + display: flex; + flex-direction: column; + align-items: center; + position: relative; + padding: 40rpx 40rpx; + .price-info-popup-title { + font-size: 34rpx; + color: #333; + font-weight: bold; + text-align: center; + margin-bottom: 30rpx; + } + .price-info-popup-content { + width: 100%; + max-height: 50vh; + .price-info-section { + margin-bottom: 30rpx; + &:last-child { + margin-bottom: 0; + } + .price-info-heading { + font-size: 28rpx; + color: #333; + font-weight: 500; + margin-bottom: 15rpx; + } + .price-info-text { + font-size: 26rpx; + color: #666; + line-height: 1.6; + } + } + } + .price-info-popup-btn { + width: 100%; + height: 88rpx; + background: linear-gradient(to right, #ffd01e, #ff8917); + border-radius: 44rpx; + color: #fff; + font-size: 32rpx; + font-weight: bold; + display: flex; + align-items: center; + justify-content: center; + border: none; + margin-top: 40rpx; + box-shadow: 0 4rpx 16rpx rgba(255, 156, 0, 0.08); + &::after { + border: none; + } + &:active { + opacity: 0.9; + } + } +} \ No newline at end of file diff --git a/pages/subcomponent/about.vue b/pages/subcomponent/about.vue index afae657..3342bbc 100644 --- a/pages/subcomponent/about.vue +++ b/pages/subcomponent/about.vue @@ -1,258 +1,101 @@ -