From f1c55ae9066c66c701c1ca7f0074a1cf29463dfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E9=A3=9E=E6=B4=8B?= <15778543+xufeiyang6017@user.noreply.gitee.com> Date: Tue, 23 Dec 2025 15:23:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E4=B9=B0=E5=AE=B6=E3=80=81?= =?UTF-8?q?=E6=94=B6=E8=97=8F=E3=80=81=E5=95=86=E5=93=81=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E3=80=81=E7=BB=93=E7=AE=97=E9=A1=B5=E9=9D=A2=E7=9A=84=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/buyer/index.js | 33 ++- pages/buyer/index.wxml | 10 +- pages/favorites/index.js | 290 ++++++++++++++++++++++----- pages/goods-detail/goods-detail.js | 169 ++++++++++------ pages/goods-detail/goods-detail.wxml | 4 +- pages/index/index.wxml | 2 +- pages/settlement/index.js | 60 +++++- pages/settlement/index.wxml | 21 ++ pages/settlement/index.wxss | 222 +++++++++++++++++++- 9 files changed, 696 insertions(+), 115 deletions(-) diff --git a/pages/buyer/index.js b/pages/buyer/index.js index 0b09c70..e10077b 100644 --- a/pages/buyer/index.js +++ b/pages/buyer/index.js @@ -30,6 +30,36 @@ function formatGrossWeight(grossWeight, weight) { console.log('两个参数都无效,返回空字符串'); return ""; // 返回空字符串以支持文字输入 } + +// 提取地区中的省份信息 +function extractProvince(region) { + if (!region || typeof region !== 'string') { + return region; + } + + // 查找各种省份格式的位置 + const provinceEndIndex = region.indexOf('省'); + const autonomousRegionEndIndex = region.indexOf('自治区'); + const municipalityEndIndex = region.indexOf('市'); // 用于直辖市,如北京市、上海市 + const specialRegionEndIndex = region.indexOf('特别行政区'); // 用于香港、澳门 + + if (provinceEndIndex !== -1) { + // 包含"省"字,提取到"省"字结束 + return region.substring(0, provinceEndIndex + 1); + } else if (autonomousRegionEndIndex !== -1) { + // 包含"自治区",提取到"自治区"结束 + return region.substring(0, autonomousRegionEndIndex + 3); + } else if (specialRegionEndIndex !== -1) { + // 包含"特别行政区",提取到"特别行政区"结束 + return region.substring(0, specialRegionEndIndex + 5); + } else if (municipalityEndIndex === 2) { + // 直辖市(如北京市、上海市),市字在第2个字符位置 + return region.substring(0, municipalityEndIndex + 1); + } + + // 如果没有找到匹配的格式,返回原字符串 + return region; +} Page({ // 分享给朋友/群聊 onShareAppMessage() { @@ -878,7 +908,8 @@ Page({ yolk: product.yolk, spec: (product.spec && product.spec !== '无') ? product.spec : (product.specification && product.specification !== '无') ? product.specification : '', specification: (product.spec && product.spec !== '无') ? product.spec : (product.specification && product.specification !== '无') ? product.specification : '', - region: product.region || '', // 【新增】添加地区字段 + fullRegion: product.region || '', // 保存完整地区数据 + region: product.region ? extractProvince(product.region) : '', // 只显示省份 grossWeight: grossWeightValue, displayGrossWeight: formatGrossWeight(grossWeightValue, product.weight), seller: product.seller && (product.seller.name || product.seller.nickName) ? (product.seller.name || product.seller.nickName) : '未知卖家', diff --git a/pages/buyer/index.wxml b/pages/buyer/index.wxml index 8dfe355..3393dea 100644 --- a/pages/buyer/index.wxml +++ b/pages/buyer/index.wxml @@ -70,11 +70,15 @@ - 已有{{item.reservedCount || 0}}人收藏 + + 已有 + {{item.reservedCount || 0}} + 人收藏 + + + + + + + 合作模式说明 + + + + + + + + + {{selectedCooperationDetail.title}} + {{selectedCooperationDetail.content}} + + + + \ No newline at end of file diff --git a/pages/settlement/index.wxss b/pages/settlement/index.wxss index af83cfb..f9a2e48 100644 --- a/pages/settlement/index.wxss +++ b/pages/settlement/index.wxss @@ -837,8 +837,226 @@ picker { font-size: 28rpx; color: #000; font-weight: 400; - line-height: 1.3; - pointer-events: none; +} + +/* 问号帮助按钮样式 */ +.tip-button { + width: 36rpx; + height: 36rpx; + border-radius: 50%; + border: 2rpx solid #999; + background-color: #fff; + color: #999; + font-size: 24rpx; + font-weight: bold; + display: flex; + align-items: center; + justify-content: center; + margin-left: 10rpx; + cursor: pointer; + user-select: none; + transition: all 0.2s ease; +} + +.tip-button:active { + transform: scale(0.9); + background-color: #f0f0f0; +} + +/* 合作模式帮助弹窗样式 */ +.cooperation-help-overlay { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: rgba(0, 0, 0, 0.6); + display: flex; + align-items: center; + justify-content: center; + z-index: 9999; + padding: 20rpx; +} + +.cooperation-help-container { + background-color: #fff; + border-radius: 20rpx; + padding: 50rpx 40rpx; + max-width: 92%; + max-height: 88%; + overflow-y: auto; + box-shadow: 0 12rpx 40rpx rgba(0, 0, 0, 0.2); + background: linear-gradient(to bottom, #ffffff, #f8f9fa); +} + +/* 自定义滚动条样式 */ +.cooperation-help-container::-webkit-scrollbar { + width: 8rpx; + height: 8rpx; +} + +.cooperation-help-container::-webkit-scrollbar-track { + background: #f5f5f5; + border-radius: 4rpx; +} + +.cooperation-help-container::-webkit-scrollbar-thumb { + background: #d0d0d0; + border-radius: 4rpx; +} + +.cooperation-help-container::-webkit-scrollbar-thumb:hover { + background: #b8b8b8; +} + +.cooperation-help-title { + font-size: 38rpx; + font-weight: bold; + color: #2c3e50; + margin-bottom: 40rpx; + text-align: center; + padding-bottom: 25rpx; + border-bottom: 2rpx solid #e8f5e8; + letter-spacing: 2rpx; +} + +.cooperation-help-content { + font-size: 30rpx; + color: #555555; + line-height: 56rpx; + margin-bottom: 50rpx; +} + +/* 一级标题样式 */ +.cooperation-help-content h3 { + font-size: 34rpx; + font-weight: 700; + color: #2c3e50; + margin: 50rpx 0 25rpx 0; + padding-left: 15rpx; + border-left: 8rpx solid #07C160; + background-color: #f0f9f0; + padding: 15rpx 20rpx; + border-radius: 8rpx; + letter-spacing: 1rpx; +} + +/* 二级标题样式 */ +.cooperation-help-content h4 { + font-size: 32rpx; + font-weight: 600; + color: #34495e; + margin: 40rpx 0 20rpx 0; + padding-left: 20rpx; + background-color: #f8f9fa; + padding: 12rpx 20rpx; + border-radius: 6rpx; +} + +/* 段落样式 */ +.cooperation-help-content p { + margin: 25rpx 0; + text-indent: 2em; + color: #666666; + padding: 0 10rpx; + text-align: justify; + word-break: break-word; +} + +/* 列表样式优化 */ +.cooperation-help-content ul, .cooperation-help-content ol { + margin: 25rpx 0 25rpx 60rpx; +} + +.cooperation-help-content li { + margin: 20rpx 0; + color: #666666; + line-height: 52rpx; + text-indent: 0; +} + +/* 列表项数字/符号样式 */ +.cooperation-help-content ol li { + font-weight: 500; + color: #495057; +} + +.cooperation-buttons { + display: flex; + flex-direction: column; + gap: 20rpx; + margin-bottom: 30rpx; +} + +.cooperation-button { + width: 100%; + padding: 24rpx; + background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%); + color: #333; + border: 2rpx solid rgba(7, 193, 96, 0.2); + border-radius: 12rpx; + font-size: 30rpx; + font-weight: 500; + transition: all 0.3s ease; + cursor: pointer; + box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08); + display: flex; + justify-content: center; + align-items: center; +} + +.cooperation-button:active { + transform: scale(0.98); + background: linear-gradient(135deg, #07C160 0%, #06ae56 100%); + color: white; + border-color: #07C160; +} + +.cooperation-detail { + margin-top: 20rpx; + padding: 24rpx; + background: linear-gradient(135deg, #f0fff4 0%, #e6ffe9 100%); + border-radius: 12rpx; + border: 2rpx solid #c6f6d5; +} + +.detail-title { + font-size: 32rpx; + font-weight: 700; + color: #07C160; + margin-bottom: 16rpx; + text-align: center; +} + +.detail-content { + font-size: 28rpx; + color: #4a5568; + line-height: 1.6; + text-align: center; + white-space: pre-line; +} + +/* 按钮样式优化 */ +.cooperation-help-button { + width: 100%; + height: 92rpx; + background: linear-gradient(135deg, #07C160 0%, #06b358 100%); + color: #fff; + border: none; + border-radius: 46rpx; + font-size: 36rpx; + font-weight: bold; + cursor: pointer; + transition: all 0.3s ease; + margin-top: 30rpx; + box-shadow: 0 6rpx 20rpx rgba(7, 193, 96, 0.3); + letter-spacing: 2rpx; +} + +.cooperation-help-button:active { + transform: scale(0.96); + box-shadow: 0 3rpx 12rpx rgba(7, 193, 96, 0.4); + background: linear-gradient(135deg, #06b358 0%, #05a050 100%); } .cooperation-option.active .cooperation-text {