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}}
+ 人收藏
+
-
+
联系信息
@@ -126,7 +126,7 @@
-
+
+ "中国最专业的鸡蛋现货交易平台"
diff --git a/pages/settlement/index.js b/pages/settlement/index.js
index c0ff419..722310a 100644
--- a/pages/settlement/index.js
+++ b/pages/settlement/index.js
@@ -38,9 +38,15 @@ Page({
// 登录弹窗相关
showAuthModal: false,
showOneKeyLoginModal: false,
+ // 合作模式帮助弹窗
+ showCooperationHelp: false,
+ selectedCooperationDetail: null,
loginModalTitle: '请先登录',
loginModalContent: '为了您的账户安全,请先完成手机号登录',
- showLoginButton: true
+ showLoginButton: true,
+
+ // 合作模式帮助弹窗
+ showCooperationHelp: false
},
onLoad(options) {
@@ -1453,5 +1459,57 @@ Page({
} catch (error) {
console.error('同步入驻状态失败:', error);
}
+ },
+
+ /**
+ * 显示合作模式帮助弹窗
+ */
+ showCooperationHelp() {
+ this.setData({
+ showCooperationHelp: true,
+ selectedCooperationDetail: null
+ });
+ },
+
+ /**
+ * 显示合作模式详情
+ */
+ showCooperationDetail(e) {
+ const type = e.currentTarget.dataset.type;
+ const cooperationDetails = {
+ '货源委托': {
+ title: '货源委托',
+ content: '货源委托是指供应商将货源委托给平台销售,平台负责销售和结算,供应商无需自行销售,只需要按照约定时间、数量、质量标准提供货源即可。'
+ },
+ '自主定价销售': {
+ title: '自主定价销售',
+ content: '供应商可以自主制定销售价格,自行负责销售和盈亏,平台提供交易撮合服务,按约定收取服务费。'
+ },
+ '区域包场合作': {
+ title: '区域包场合作',
+ content: '在指定区域内独家合作,享受区域保护政策,平台提供区域内的独家销售权限和支持。'
+ },
+ '其他': {
+ title: '其他合作模式',
+ content: '其他特殊合作模式,需与平台单独协商具体合作条款和条件。'
+ }
+ };
+
+ this.setData({
+ selectedCooperationDetail: cooperationDetails[type] || {
+ title: type,
+ content: '暂无详细说明'
+ }
+ });
+ },
+
+ /**
+ * 关闭合作模式帮助弹窗
+ */
+ closeCooperationHelp() {
+ this.setData({
+ showCooperationHelp: false,
+ selectedCooperationDetail: null
+ });
}
});
\ No newline at end of file
diff --git a/pages/settlement/index.wxml b/pages/settlement/index.wxml
index 558ff35..b89c355 100644
--- a/pages/settlement/index.wxml
+++ b/pages/settlement/index.wxml
@@ -142,6 +142,7 @@
取消
+
+
+
+
+
+ 合作模式说明
+
+
+
+
+
+
+
+
+ {{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 {