diff --git a/App.vue b/App.vue index ea23ce7..7e7ee2d 100644 --- a/App.vue +++ b/App.vue @@ -19,7 +19,6 @@ }, onLoad: function() { this.getBannerList() - this.getConfigData() console.log('App Show') }, onHide: function() { @@ -46,10 +45,10 @@ }, getConfigData() { this.$api('getConfig', {}, res => { - // console.log('Config data response:', JSON.parse(JSON.stringify(res)) ) + console.log('Config data response:', JSON.parse(JSON.stringify(res)) ) if (res && res.success && Array.isArray(res.result)) { - getApp().globalData.configData = res.result - // console.log('Config data set:', JSON.parse(JSON.stringify(this.configData)) ) + getApp().globalData.configData = res.result + // console.log('Config data set:', JSON.parse(JSON.stringify(this.configData)) ) } }) }, diff --git a/config.js b/config.js index 0a4f6bd..bc962ac 100644 --- a/config.js +++ b/config.js @@ -2,26 +2,26 @@ const type = 'dev' const config = { - dev: { - baseUrl: 'http://youyi-test.natapp1.cc', - }, - prod: { - baseUrl: 'https://www.ddmhs.top', - } + dev: { + baseUrl: 'https://www.ddmhs.top', + }, + prod: { + baseUrl: 'https://www.ddmhs.top', + } } const defaultConfig = { - mapKey: 'XMBBZ-BCPCV-SXPPQ-5Y7MY-PHZXK-YFFVU', - aliOss: { - url: 'https://oss.ddmhs.top/', - config: { - region: 'oss-cn-hangzhou', - accessKeyId: 'LTAI5tDXgH5a42GbUZroVvio', - accessKeySecret: 'TK7jQ0KeXnFBHNxpEHzT83Spp81tl5', - bucket: 'ossddmhs', - endpoint: 'oss-cn-hangzhou.aliyuncs.com', - } - } + mapKey: 'XMBBZ-BCPCV-SXPPQ-5Y7MY-PHZXK-YFFVU', + aliOss: { + url: 'https://oss.ddmhs.top/', + config: { + region: 'oss-cn-hangzhou', + accessKeyId: 'LTAI5tDXgH5a42GbUZroVvio', + accessKeySecret: 'TK7jQ0KeXnFBHNxpEHzT83Spp81tl5', + bucket: 'ossddmhs', + endpoint: 'oss-cn-hangzhou.aliyuncs.com', + } + } } import utils from './utils/utils.js' diff --git a/pages/component/home.vue b/pages/component/home.vue index 9dd30c0..29adfff 100644 --- a/pages/component/home.vue +++ b/pages/component/home.vue @@ -11,8 +11,19 @@ style="width: 100%; height: 380rpx;" > - - @@ -79,9 +90,8 @@ - - + + 价格概览 @@ -89,13 +99,8 @@ - - + + {{item.name}} ¥ {{item.price}} @@ -398,7 +403,7 @@ export default { .banner { width: 100%; - height: 380rpx; + height: 350rpx; position: relative; overflow: hidden; border-radius: 0 0 30rpx 30rpx; @@ -630,8 +635,8 @@ export default { padding: 30rpx; background-color: #fff8ea; .item-icon { - width: 80rpx; - height: 80rpx; + width: 100rpx; + height: 100rpx; margin-bottom: 10rpx; &.placeholder { width: 80rpx; diff --git a/pages/component/my.vue b/pages/component/my.vue index 047ee73..f6703e1 100644 --- a/pages/component/my.vue +++ b/pages/component/my.vue @@ -2,18 +2,7 @@ @@ -25,9 +37,9 @@ :key="category.id || index" class="category-item" :class="{ active: currentCategory === index }" - @tap="switchCategory(index)" + @click="switchCategory(index)" > - + {{ getCategoryItemCount(index) }} {{ category.title }} @@ -36,24 +48,24 @@ - + - {{item.name}} - - - - 查看品牌 - - - + {{item.service}} + + + 回收规则 + + + ¥ @@ -61,19 +73,11 @@ /件 - + {{item.quantity || 0}} - + - - - 回收规则 - - @@ -88,7 +92,7 @@ ¥ — /件 - + 加载中... 没有更多了 @@ -105,22 +109,22 @@ 已选 {{totalCount}} 件 预计回收可得 - + - + ¥{{priceRange.min}}-{{priceRange.max}} - + - - - × + + + × 回收范围仅支持回收以上品类,按件回收预计比称重回收多 3.76元 @@ -137,9 +141,9 @@ ¥{{item.price}}/件 - + {{item.quantity}} - + @@ -147,18 +151,40 @@ 已选 {{totalCount}} 件 预计回收可得 - + - + ¥{{priceRange.min}}-{{priceRange.max}} - + + + + + 回收规则 + + + 关于旧衣质检 + 请确认本次回收旧衣是可以进行二次穿着的程度,如回收旧衣有破损磨损、开线变形、起球发黄、染色污渍、配饰脱落或款式老旧等问题,无法通过质检。 + + + 质检报告 + 回收商收到衣后1-3个工作日内完成衣质检报告。 + + + 质检结果与回收价格 + 若回收旧衣质检通过,质检价格与用户提交订单时的预估价格一致,回收商将按照预估价打款至您的小程序账户余额。 + + + + + + - 关闭 + 关闭 可回收的品牌 @@ -206,28 +232,26 @@ {{letter}} - + {{brand.name}} - {{letter}} + {{letter}} - + 回收规则 - + - + @@ -239,20 +263,20 @@ 温馨提示 - 1.当前回收快递免费上门,由于快递成本较高,为避免不必要的成本及资源二次浪费不属于可回收品类或不符合回收标准的物品请勿寄出。

- 2.已通过的回收物品将正常结算。不符合回收要求的物品可选择快递取回,运费自付。请在订单结算后48小时内联系在线客服安排取回,逾期未联系将默认捐赠,无法再次取回。

- 3.若用户寄出大量不可回收的物品,平台有权限制下次回收权限,或取消下次包邮服务。

- 4.对于合格率高的回收订单,平台将根据实际情况,给予额外回收奖励。 + 1.当前回收快递免费上门,由于快递成本较高,为避免不必要的成本及资源二次浪费不属于可回收品类或不符合回收标准的物品请勿寄出。 + 2.已通过的回收物品将正常结算。不符合回收要求的物品可选择快递取回,运费自付。请在订单结算后48小时内联系在线客服安排取回,逾期未联系将默认捐赠,无法再次取回。 + 3.若用户寄出大量不可回收的物品,平台有权限制下次回收权限,或取消下次包邮服务。 + 4.对于合格率高的回收订单,平台将根据实际情况,给予额外回收奖励。
- - + +
- + 品牌确认提示 @@ -261,8 +285,8 @@ {{ brandConfirmInfo.name }} 请确认所选品牌是否与实物品牌信息一致,否则将无法进行回收。 - - + + @@ -304,10 +328,8 @@ export default { loadingMore: false, finished: false, pendingBrandIndex: null, // 记录待加一的品牌商品index - shownRuleItems: new Set(), // 记录已经显示过规则弹窗的商品ID - ruleCountdown: 0, // 规则弹窗倒计时 - ruleCountdownTimer: null, // 倒计时定时器 - pendingAddItem: null, // 待添加的商品信息 + showPriceInfoPopup: false, + isWaitingForBrandSelection: false, // 等待品牌选择的标志 } }, computed: { @@ -357,9 +379,22 @@ export default { categories() { const list = getApp().globalData.pricePreviewList || [] return list.filter(item => item.pid === '0').sort((a, b) => a.sort - b.sort) + }, + minMoney() { + const config = getApp().globalData.configData || []; + const item = config.find(i => i.keyName === 'min_money'); + return item ? parseFloat(item.keyContent) : 0; } }, methods: { + showPriceInfoPopups() { + console.log('showPriceInfoPopup called'); + this.showPriceInfoPopup = true + }, + closePriceInfoPopup() { + console.log('closePriceInfoPopup called'); + this.showPriceInfoPopup = false + }, changeTo(e){ this.value = e if(e==2){ @@ -411,37 +446,16 @@ export default { const categoryId = this.categories[this.currentCategory]?.id const item = this.allProducts[categoryId]?.[index] if (!item) return - - const currentQuantity = item.quantity || 0 - let newQuantity = currentQuantity + delta - if (newQuantity < 0) newQuantity = 0 - - // 如果是第一次添加商品(从0变为1)且未显示过规则弹窗 - if (currentQuantity === 0 && delta > 0 && !this.shownRuleItems.has(item.id)) { - // 品牌商品需要先选择品牌 - if (item.shopCion) { - this.pendingBrandIndex = index - this.getGoodsBrandList(item.shopCion) - this.showBrandPopup = true - return - } - - // 普通商品直接显示规则弹窗 - this.pendingAddItem = { categoryId, index, item } - this.showRulesWithCountdown(item) - return - } - - // 品牌商品且数量为0且加一时弹出品牌索引弹窗(非第一次添加或已显示过规则) - if (item.shopCion && currentQuantity === 0 && delta > 0) { + // 品牌商品且数量为0且加一时 + if (item.isPin === 'Y' && (item.quantity || 0) === 0 && delta > 0) { this.pendingBrandIndex = index - this.getGoodsBrandList(item.shopCion) - this.showBrandPopup = true + this.isWaitingForBrandSelection = true; + this.showRules(item); // 先显示回收规则 return } - - // 直接更新数量 - this.$set(item, 'quantity', newQuantity) + let newQuantity = (item.quantity || 0) + delta + if (newQuantity < 0) newQuantity = 0 + this.$set(item, 'quantity', newQuantity) }, // 显示回收规则 showRules(item) { @@ -455,32 +469,6 @@ export default { this.showRulePopup = true }) }, - - // 显示带倒计时的回收规则弹窗 - showRulesWithCountdown(item) { - // 获取回收规则富文本 - this.$api('getGoodsRecycleRule', { goodsId: item.id }, res => { - if (res.code === 200 && res.result) { - this.ruleHtml = res.result - } else { - this.ruleHtml = '

暂无回收规则

' - } - 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 @@ \ No newline at end of file +.main-card { + background: #ffffff; + border-radius: 36rpx; + box-shadow: 0 8rpx 32rpx rgba(255, 156, 0, 0.08); + margin: 32rpx 24rpx 0 24rpx; + padding: 40rpx 32rpx 32rpx 32rpx; + display: flex; + flex-direction: column; + align-items: stretch; +} +.rich-text-content { + width: 100%; + line-height: 1.7; + font-size: 26rpx; + color: #444; +} + \ No newline at end of file diff --git a/pages/subcomponent/admin_faq.vue b/pages/subcomponent/admin_faq.vue index f7575d1..22fc705 100644 --- a/pages/subcomponent/admin_faq.vue +++ b/pages/subcomponent/admin_faq.vue @@ -29,11 +29,6 @@
- @@ -55,17 +50,14 @@