From a5595ba241b1d39242cfa6951b6948d6a70e87d8 Mon Sep 17 00:00:00 2001 From: Lj <1095098147@qq.com> Date: Mon, 30 Jun 2025 18:37:24 +0800 Subject: [PATCH] =?UTF-8?q?'=E4=BF=AE=E6=94=B9=E4=B8=AA=E4=BA=BA=E4=B8=AD?= =?UTF-8?q?=E5=BF=83=E7=94=A8=E6=88=B7=E5=A4=B4=E5=83=8F=E6=A0=87=E8=AF=86?= =?UTF-8?q?=E4=B8=8D=E8=81=94=E5=8A=A8=E3=80=90=E6=8E=A8=E5=B9=BF=E8=BA=AB?= =?UTF-8?q?=E4=BB=BD=E6=B2=A1=E6=9C=89=E6=98=BE=E7=A4=BA=EF=BC=8C=E6=96=87?= =?UTF-8?q?=E5=AD=97=E5=8A=A0=E6=A0=B7=E5=BC=8F=E5=8F=98=E5=8C=96=E3=80=91?= =?UTF-8?q?=20.=E6=88=91=E7=9A=84=E4=BA=8C=E7=BB=B4=E7=A0=81=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E5=88=86=E4=BA=AB=EF=BC=8C=E6=97=A0=E6=B3=95=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E3=80=82=E4=BA=8C=E7=BB=B4=E7=A0=81=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E4=B8=8A=E8=BE=B9=E6=9C=89=E4=B8=AA=E6=88=98=E6=96=97=E4=B8=96?= =?UTF-8?q?=E7=95=8C=EF=BC=9F=E3=80=90=E5=88=86=E4=BA=AB=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E5=8A=A0=E9=A2=9C=E8=89=B2=E3=80=91=E7=AD=89'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/component/home.vue | 48 +++++++--- pages/component/my.vue | 45 ++++++++- pages/component/recycle.vue | 39 +++++++- pages/subcomponent/inspection-report.vue | 74 +++++++------- pages/subcomponent/promo-qrcode.vue | 4 +- pages/subcomponent/promotion.vue | 160 ++++++++++++++++++++++++++++++- 6 files changed, 313 insertions(+), 57 deletions(-) diff --git a/pages/component/home.vue b/pages/component/home.vue index d4bf000..25b7818 100644 --- a/pages/component/home.vue +++ b/pages/component/home.vue @@ -273,13 +273,28 @@ }, computed: { cityListStr() { - // 只取前8个城市,超出用...结尾 - const names = this.cityList.map(c => c.name) - const max = 8 - if (names.length > max) { - return names.slice(0, max).join('、') + '...' + // 提取2级城市(市级),不换行显示,控制显示数量避免超出 + const cityNames = [] + + // 遍历省级数据,提取市级城市 + this.cityList.forEach(province => { + if (province.children && Array.isArray(province.children)) { + province.children.forEach(city => { + // 只取市级城市名称,去掉"市"字后缀使显示更简洁 + const cityName = city.name.replace(/市$/, '') + if (cityName && !cityNames.includes(cityName)) { + cityNames.push(cityName) + } + }) + } + }) + + // 根据屏幕宽度动态调整显示数量,避免超出容器 + const maxDisplay = 6 // 减少到6个城市,确保不超出 + if (cityNames.length > maxDisplay) { + return cityNames.slice(0, maxDisplay).join('、') + '...' } - return names.join('、') + return cityNames.join('、') }, address_cion() { console.log(getApp().globalData.configData, 'home-getApp().globalData.configData') @@ -403,10 +418,10 @@ getFreeCityList() { this.$api('getFreeCityList', {}, res => { if (res && res.code === 200 && Array.isArray(res.result)) { - // 只取一级城市(有children的name) - this.cityList = res.result.map(item => ({ - name: item.name - })).filter(item => item.name) + // 保持完整的省-市-区三级结构,用于提取2级城市 + this.cityList = res.result.filter(province => + province.children && Array.isArray(province.children) && province.children.length > 0 + ) } else { this.cityList = [] } @@ -904,8 +919,17 @@ } .city-list { - font-size: 24rpx; - color: #999; + font-size: 26rpx; + color: #333; + font-weight: bold; + line-height: 1.5; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + word-break: keep-all; + width: 100%; + max-width: 100%; + display: block; } } diff --git a/pages/component/my.vue b/pages/component/my.vue index c2ffaaa..3d59f49 100644 --- a/pages/component/my.vue +++ b/pages/component/my.vue @@ -25,7 +25,7 @@ - {{ userTypeText }} + {{ userTypeText }} {{ userInfo.nickName }} @@ -365,8 +365,27 @@ export default { return item ? item.keyContent : '' }, userTypeText() { - if (this.userInfo.isUser == 'Y') return this.userInfo.isTuiTypeTitle - return '普通用户' + // 根据 isTuiType 字段判断用户类型 + // 0: 用户,1:推广达人,2:推广大使 + switch (this.userInfo.isTuiType) { + case 1: + return '推广达人' + case 2: + return '推广大使' + default: + return '用户' + } + }, + userTypeBadgeClass() { + // 根据用户类型返回不同的样式类 + switch (this.userInfo.isTuiType) { + case 1: + return 'avatar-badge-expert' // 推广达人 + case 2: + return 'avatar-badge-ambassador' // 推广大使 + default: + return 'avatar-badge-user' // 普通用户 + } }, }, onLoad() { @@ -498,6 +517,26 @@ export default { font-weight: 400; letter-spacing: 2rpx; z-index: 2; + + // 普通用户样式(默认) + &.avatar-badge-user { + background: rgba(238, 238, 238, 0.95); + color: #999; + } + + // 推广达人样式 + &.avatar-badge-expert { + background: linear-gradient(90deg, #ff8917, #ffd01e); + color: #fff; + font-weight: 600; + } + + // 推广大使样式 + &.avatar-badge-ambassador { + background: linear-gradient(90deg, #b2f08d, #39e9d2); + color: #fff; + font-weight: 600; + } } .info { diff --git a/pages/component/recycle.vue b/pages/component/recycle.vue index f7d952e..bd2b7c3 100644 --- a/pages/component/recycle.vue +++ b/pages/component/recycle.vue @@ -55,7 +55,7 @@ {{item.name}} - + 查看品牌 @@ -106,7 +106,7 @@ 回收范围仅支持回收以上品类,按件回收预计比称重回收多 - 3.76元 + {{extraRecycleAmount.display}} @@ -130,7 +130,7 @@ × 回收范围仅支持回收以上品类,按件回收预计比称重回收多 - 3.76元 + {{extraRecycleAmount.display}} 已选商品明细 @@ -503,6 +503,39 @@ export default { const config = getApp().globalData.configData || []; const item = config.find(i => i.keyName === 'min_money'); return item ? parseFloat(item.keyContent) : 0; + }, + // 计算比预计回收多的金额(商品回收价格 - (商品回收价格 * 0.066)) + extraRecycleAmount() { + const minPrice = parseFloat(this.priceRange.min) || 0; + const maxPrice = parseFloat(this.priceRange.max) || 0; + + if (minPrice === 0 && maxPrice === 0) { + return { + min: '0.00', + max: '0.00', + display: '0.00元' + }; + } + + // 计算减去6.6%后的金额 + const minExtra = minPrice - (minPrice * 0.066); + const maxExtra = maxPrice - (maxPrice * 0.066); + + // 如果最小值和最大值相等,显示单个值 + if (minPrice === maxPrice) { + return { + min: minExtra.toFixed(2), + max: maxExtra.toFixed(2), + display: `${minExtra.toFixed(2)}元` + }; + } + + // 显示区间 + return { + min: minExtra.toFixed(2), + max: maxExtra.toFixed(2), + display: `${minExtra.toFixed(2)}-${maxExtra.toFixed(2)}元` + }; } }, methods: { diff --git a/pages/subcomponent/inspection-report.vue b/pages/subcomponent/inspection-report.vue index 4b5ec41..9e952c5 100644 --- a/pages/subcomponent/inspection-report.vue +++ b/pages/subcomponent/inspection-report.vue @@ -1,40 +1,38 @@ @@ -139,7 +166,8 @@ export default { rankList: [ ], status: 0, - showProgressModal: false + showProgressModal: false, + showQrcodeModal: false } }, computed: { @@ -236,6 +264,28 @@ export default { }, goToFaq() { uni.navigateTo({ url: '/pages/subcomponent/admin_faq' }) + }, + + // 显示客服二维码弹窗 + openQrcodeModal() { + this.showQrcodeModal = true; + }, + + // 关闭二维码弹窗 + closeQrcodeModal() { + this.showQrcodeModal = false; + }, + + // 处理二维码长按事件 + onQrcodeLongPress() { + console.log('长按二维码'); + // 在微信小程序中,show-menu-by-longpress="true" 会自动处理长按识别 + // 这里可以添加一些反馈提示 + uni.showToast({ + title: '长按识别二维码', + icon: 'none', + duration: 1500 + }); } } } @@ -618,6 +668,12 @@ export default { background: #fff; border-radius: 24rpx; box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.08); + cursor: pointer; + transition: transform 0.2s ease; + + &:active { + transform: scale(0.95); + } } } @@ -744,4 +800,104 @@ export default { justify-content: center; border: none; } + +// 客服二维码弹窗样式 +.qrcode-modal-mask { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: rgba(0, 0, 0, 0.6); + display: flex; + justify-content: center; + align-items: center; + z-index: 9999; + backdrop-filter: blur(5rpx); +} + +.qrcode-modal-content { + background: #fff; + border-radius: 24rpx; + width: 600rpx; + max-width: 90vw; + animation: fadeInScale 0.3s ease; + overflow: hidden; +} + +.qrcode-modal-header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 40rpx 40rpx 20rpx 40rpx; + border-bottom: 1rpx solid #f0f0f0; +} + +.qrcode-modal-title { + font-size: 36rpx; + font-weight: bold; + color: #333; +} + +.qrcode-modal-close { + padding: 10rpx; + margin: -10rpx; +} + +.qrcode-modal-body { + padding: 40rpx; + display: flex; + flex-direction: column; + align-items: center; +} + +.qrcode-modal-img { + width: 400rpx; + height: 400rpx; + border-radius: 16rpx; + margin-bottom: 30rpx; + box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.1); +} + +.qrcode-placeholder { + width: 400rpx; + height: 400rpx; + border-radius: 16rpx; + margin-bottom: 30rpx; + background: #f5f5f5; + display: flex; + justify-content: center; + align-items: center; + + text { + color: #999; + font-size: 28rpx; + } +} + +.qrcode-modal-tip { + font-size: 28rpx; + color: #666; + text-align: center; + line-height: 1.4; + margin-bottom: 10rpx; +} + +.qrcode-modal-benefit { + font-size: 26rpx; + color: #13ac47; + text-align: center; + font-weight: bold; +} + +@keyframes fadeInScale { + from { + opacity: 0; + transform: scale(0.8); + } + to { + opacity: 1; + transform: scale(1); + } +} \ No newline at end of file