Browse Source

优化合作模式选择功能:移除问号帮助按钮,实现点击显示详细说明,贸易商不显示包场合作选项,优化弹窗样式和文字排版

pull/6/head
Default User 2 months ago
parent
commit
460c307379
  1. 171
      pages/settlement/index.js
  2. 54
      pages/settlement/index.wxml
  3. 93
      pages/settlement/index.wxss

171
pages/settlement/index.js

@ -19,6 +19,8 @@ Page({
city: '',
district: '',
detailedaddress: '', // 详细地址 (原detailAddress)
showDetailedAddressError: false,
detailedAddressError: '',
showRegionError: false,
regionError: '',
cooperation: '', // 合作模式 (原selectedCooperation)
@ -27,9 +29,15 @@ Page({
// 上传资料
businesslicenseurl: null, // 营业执照URL (原businessLicenseFile)
showBusinessLicenseError: false,
businessLicenseError: '',
proofurl: null, // 动物检疫证明URL (原animalQuarantineFile)
showProofError: false,
proofError: '',
// idCardFile: null, // 已移除,法人身份证现在使用proofurl字段
brandurl: null, // 品牌授权链URL (原brandAuthFile)
showBrandAuthError: false,
brandAuthError: '',
// 审核状态
partnerstatus: '', // 合作商状态 (原auditStatus),初始为空而不是默认审核中
@ -38,8 +46,10 @@ Page({
// 登录弹窗相关
showAuthModal: false,
showOneKeyLoginModal: false,
// 合作模式帮助弹窗
showCooperationHelp: false,
// 合作模式确认弹窗
showCooperationConfirm: false,
currentCooperationDetail: null,
pendingCooperationValue: '',
selectedCooperationDetail: null,
loginModalTitle: '请先登录',
loginModalContent: '为了您的账户安全,请先完成手机号登录',
@ -303,6 +313,13 @@ Page({
this.setData({ showRegionError: false });
}
if (!this.data.detailedaddress || !this.data.detailedaddress.trim()) {
this.setData({ showDetailedAddressError: true });
valid = false;
} else {
this.setData({ showDetailedAddressError: false });
}
if (!this.data.cooperation) { // 使用数据库字段名
this.setData({ showCooperationError: true });
valid = false;
@ -404,18 +421,96 @@ Page({
});
},
// 详细地址输入
// 详细地址输入(带实时验证)
onDetailAddressInput(e) {
this.setData({ detailedaddress: e.detail.value }); // 使用数据库字段名
const value = e.detail.value.trim();
let showError = false;
let errorMessage = '';
if (value.length > 0) {
if (value.length > 100) {
showError = true;
errorMessage = '详细地址不能超过100个字符';
}
}
this.setData({
detailedaddress: value, // 使用数据库字段名
showDetailedAddressError: showError,
detailedAddressError: errorMessage
});
},
// 详细地址获得焦点
onDetailAddressFocus(e) {
// 可以在这里添加焦点处理逻辑,比如滚动到视图等
console.log('详细地址输入框获得焦点');
// 清除错误状态,让用户重新输入
if (this.data.showDetailedAddressError) {
this.setData({
showDetailedAddressError: false,
detailedAddressError: ''
});
}
},
// 选择合作模式(带验证)
// 处理合作模式选项点击事件
handleCooperationTap(e) {
const value = e.currentTarget.dataset.value;
// 定义合作模式详细说明
const cooperationDetails = {
'代销业务': {
title: '代销业务规则',
content: '\n定价规则:代销商户可自主制定所挂货源的销售价格,价格需符合平台物价管控要求,不得恶意定价。\n\n服务费规则:平台对代销挂货收取固定服务费,标准为1 元 / 件,仅在货源成功卖出后收取,未卖出不产生费用。\n\n保证金规则\n\n参与代销业务的商户需按合作车型缴纳保证金,具体标准如下:\n\n4.2 米车型:300 元 / 车\n\n6.8 米车型:500 元 / 车\n\n9.6 米车型:800 元 / 车\n\n挂车车型:1200 元 / 车\n\n保证金仅作为履约担保,合作结束且无违规违约行为的,平台将按原支付路径全额退回。\n\n协议签署要求:商户参与代销业务前,需与平台签订《委托代销协议书》,明确双方权利、义务及违约责任。\n\n销售风险说明:平台仅提供货源展示、交易撮合服务,不保证代销货源一定能够卖出,货源滞销风险由商户自行承担。\n'
},
'包场合作': {
title: '包销合作规则',
content: '\n(一)包场销售(平台自负盈亏模式)\n\n1. 合作机制:平台与乙方就指定货源协商定价后,由平台全款收购该批货源,按约定时间结算价格,货权归属平台。\n\n2. 乙方义务:乙方需按照合作约定的时间、数量、质量标准提供货源,不得出现拖欠货源、擅自将约定货源自主销售等违约行为。\n\n3. 销售与盈亏:平台自主负责收购货源的销售事宜,独立承担销售过程中的盈利与亏损。\n\n(二)包场销售(乙方自主销售模式)\n\n1. 销售限制:乙方可自主销售约定货源,或委托平台销售,严禁将该批货源委托给平台及乙方之外的第三方销售。\n\n2. 兜底与结算:平台不承担该批货源的销售兜底责任,不设定固定结算周期,实行每日结算。\n\n3. 抽成与利润分配:(委托平台销售)\n\n盈利场景:每日销售盈利部分由甲方与乙方对等分配,平台同步按1元/件标准抽取费用。\n\n亏损场景:若当日销售无盈利或者亏损,平台仍按0.8元/件标准抽取费用(可打折)\n'
},
'采销联盟合作': {
title: '采销联盟合作规则',
content: '\n1. 合作主体:外部采购公司可通过成立独立的盒子公司,与平台开展货源包场或货源收购合作。\n\n2. 风险承担:盒子公司承担合作过程中产生的各类风险(包括但不限于货源质量风险、销售风险、市场风险等)。\n\n3. 利润分配:合作产生的净利润按以下比例分配:平台占20%、甲方占30%、乙方(盒子公司对应的外部采购公司)占50%。\n'
},
'其他': {
title: '其他',
content: '其他合作模式'
}
};
// 显示合作模式详细说明弹窗
this.setData({
showCooperationConfirm: true,
currentCooperationDetail: cooperationDetails[value] || {
title: value,
content: '暂无详细说明'
},
pendingCooperationValue: value
});
},
// 关闭合作模式确认弹窗
closeCooperationConfirm() {
this.setData({
showCooperationConfirm: false,
currentCooperationDetail: null,
pendingCooperationValue: ''
});
},
// 确认选择合作模式
confirmCooperationSelection() {
const value = this.data.pendingCooperationValue;
this.setData({
cooperation: value, // 使用数据库字段名
showCooperationError: false,
cooperationError: '',
showCooperationConfirm: false,
currentCooperationDetail: null,
pendingCooperationValue: ''
});
},
// 选择合作模式(内部调用,带验证)
selectCooperation(e) {
const value = e.currentTarget.dataset.value;
@ -725,6 +820,14 @@ Page({
return;
}
if (!this.data.detailedaddress || !this.data.detailedaddress.trim()) {
wx.showToast({
title: '请填写详细地址',
icon: 'none'
});
return;
}
// 手机号为空时使用默认值,不再强制要求
if (!contactPhone) {
contactPhone = 'default_phone';
@ -740,6 +843,42 @@ Page({
return;
}
// 验证营业执照
if (!this.data.businesslicenseurl) {
this.setData({
showBusinessLicenseError: true,
businessLicenseError: '请上传营业执照'
});
wx.showToast({
title: '请上传营业执照',
icon: 'none'
});
return;
} else {
this.setData({
showBusinessLicenseError: false,
businessLicenseError: ''
});
}
// 验证动物检疫合格证明或法人身份证
if (!this.data.proofurl) {
this.setData({
showProofError: true,
proofError: this.data.collaborationid === 'chicken' ? '请上传动物检疫合格证明' : '请上传法人身份证正反面'
});
wx.showToast({
title: this.data.collaborationid === 'chicken' ? '请上传动物检疫合格证明' : '请上传法人身份证正反面',
icon: 'none'
});
return;
} else {
this.setData({
showProofError: false,
proofError: ''
});
}
// 记录省市区字段内容
console.log('省市区字段内容:', this.data.province, this.data.city, this.data.district);
@ -1298,6 +1437,8 @@ Page({
city: '',
district: '',
detailedaddress: '',
showDetailedAddressError: false,
detailedAddressError: '',
showRegionError: false,
regionError: '',
cooperation: '',
@ -1306,7 +1447,12 @@ Page({
// 重置上传资料
businesslicenseurl: null,
showBusinessLicenseError: false,
businessLicenseError: '',
proofurl: null,
showProofError: false,
proofError: '',
brandurl: null,
// 重置审核相关
auditFailedReason: ''
@ -1343,15 +1489,24 @@ Page({
showIdentityError: false,
company: '', // 使用数据库字段名 (原companyName)
showCompanyNameError: false,
companyNameError: '',
province: '',
city: '',
district: '',
showRegionError: false,
detailedaddress: '', // 使用数据库字段名 (原detailAddress)
showDetailedAddressError: false,
detailedAddressError: '',
showRegionError: false,
regionError: '',
cooperation: '', // 使用数据库字段名 (原selectedCooperation)
showCooperationError: false,
cooperationError: '',
businesslicenseurl: null, // 使用数据库字段名 (原businessLicenseFile)
showBusinessLicenseError: false,
businessLicenseError: '',
proofurl: null, // 使用数据库字段名 (原animalQuarantineFile)
showProofError: false,
proofError: '',
// idCardFile: null, // 已移除,法人身份证现在使用proofurl字段
brandurl: null, // 使用数据库字段名 (原brandAuthFile)
partnerstatus: 'underreview', // 使用数据库字段名 (原auditStatus)

54
pages/settlement/index.wxml

@ -119,12 +119,12 @@
<!-- 详细地址 -->
<view class="form-item">
<view class="form-header">
<text class="form-label">详细地址</text>
<text class="form-label required">详细地址</text>
</view>
<view class="input-wrapper">
<input
class="form-input"
placeholder="请输入详细地址(选填)"
class="form-input {{showDetailedAddressError ? 'error' : ''}}"
placeholder="请输入详细地址"
placeholder-class="form-input-placeholder"
value="{{detailedaddress}}"
bindinput="onDetailAddressInput"
@ -137,18 +137,18 @@
hold-keyboard="{{false}}"
/>
</view>
<text class="error-message" wx:if="{{showDetailedAddressError}}">{{detailedAddressError || '请输入详细地址'}}</text>
</view>
<!-- 合作模式 -->
<view class="form-item">
<view class="form-header">
<text class="form-label required">合作模式</text>
<view class="tip-button" bindtap="showCooperationHelp">?</view>
</view>
<view class="cooperation-options">
<view
class="cooperation-option {{cooperation === '代销业务' ? 'active' : ''}}"
bindtap="selectCooperation"
bindtap="handleCooperationTap"
data-value="代销业务"
>
<view class="cooperation-icon"></view>
@ -156,7 +156,7 @@
</view>
<view
class="cooperation-option {{cooperation === '采销联盟合作' ? 'active' : ''}}"
bindtap="selectCooperation"
bindtap="handleCooperationTap"
data-value="采销联盟合作"
>
<view class="cooperation-icon"></view>
@ -164,15 +164,16 @@
</view>
<view
class="cooperation-option {{cooperation === '包场合作' ? 'active' : ''}}"
bindtap="selectCooperation"
bindtap="handleCooperationTap"
data-value="包场合作"
wx:if="{{collaborationid === 'chicken'}}"
>
<view class="cooperation-icon"></view>
<text class="cooperation-text">包场合作</text>
</view>
<view
class="cooperation-option {{cooperation === '其他' ? 'active' : ''}}"
bindtap="selectCooperation"
bindtap="handleCooperationTap"
data-value="其他"
>
<view class="cooperation-icon"></view>
@ -194,7 +195,7 @@
<view class="page" wx:if="{{currentStep === 2}}">
<!-- 营业执照上传 -->
<view class="section">
<view class="section-title">{{collaborationid === 'chicken' ? '鸡场营业执照(选填)' : '贸易商营业执照(选填)'}}</view>
<view class="section-title">{{collaborationid === 'chicken' ? '鸡场营业执照' : '贸易商营业执照'}}</view>
<view class="upload-area" bindtap="uploadBusinessLicense">
<view class="upload-icon">+</view>
<view class="upload-text">点击上传营业执照</view>
@ -207,11 +208,12 @@
<view class="file-delete" bindtap="deleteBusinessLicense">删除</view>
</view>
</view>
<text class="error-message" wx:if="{{showBusinessLicenseError}}">{{businessLicenseError || '请上传营业执照'}}</text>
</view>
<!-- 鸡场特有字段 -->
<view class="section" wx:if="{{collaborationid === 'chicken'}}">
<view class="section-title">动物检疫合格证明(选填)</view>
<view class="section-title">动物检疫合格证明</view>
<view class="upload-area" bindtap="uploadAnimalQuarantine">
<view class="upload-icon">+</view>
<view class="upload-text">点击上传动物检疫合格证明</view>
@ -224,11 +226,12 @@
<view class="file-delete" bindtap="deleteAnimalQuarantine">删除</view>
</view>
</view>
<text class="error-message" wx:if="{{showProofError}}">{{proofError || '请上传动物检疫合格证明'}}</text>
</view>
<!-- 贸易商特有字段 -->
<view class="section" wx:if="{{collaborationid === 'trader'}}">
<view class="section-title">法人身份证正反面(选填)</view>
<view class="section-title">法人身份证正反面</view>
<view class="upload-area" bindtap="uploadIdCard">
<view class="upload-icon">+</view>
<view class="upload-text">点击上传法人身份证正反面</view>
@ -241,10 +244,11 @@
<view class="file-delete" bindtap="deleteIdCard">删除</view>
</view>
</view>
<text class="error-message" wx:if="{{showProofError}}">{{proofError || '请上传法人身份证正反面'}}</text>
</view>
<view class="section">
<view class="section-title">品牌授权链文件</view>
<view class="section-title">品牌授权链文件(选填)</view>
<view class="upload-area" bindtap="uploadBrandAuth">
<view class="upload-icon">+</view>
<view class="upload-text">点击上传品牌授权链文件</view>
@ -357,22 +361,14 @@
</view>
</view>
<!-- 合作模式帮助弹窗 -->
<view wx:if="{{showCooperationHelp}}" class="cooperation-help-overlay">
<scroll-view class="cooperation-help-container" scroll-y="true" enable-back-to-top="false" scroll-into-view="{{scrollToView}}">
<view class="cooperation-help-title">合作模式说明</view>
<view class="cooperation-help-content">
<view class="cooperation-buttons">
<button class="cooperation-button {{selectedCooperationDetail && selectedCooperationDetail.title === '代销业务规则' ? 'selected' : ''}}" bindtap="showCooperationDetail" data-type="代销业务">代销业务</button>
<button class="cooperation-button {{selectedCooperationDetail && selectedCooperationDetail.title === '采销联盟合作规则' ? 'selected' : ''}}" bindtap="showCooperationDetail" data-type="采销联盟合作">采销联盟合作</button>
<button class="cooperation-button {{selectedCooperationDetail && selectedCooperationDetail.title === '包销合作规则' ? 'selected' : ''}}" bindtap="showCooperationDetail" data-type="包场合作">包场合作</button>
</view>
<view class="cooperation-detail" wx:if="{{selectedCooperationDetail}}" id="cooperation-detail-content">
<view class="detail-title">{{selectedCooperationDetail.title}}</view>
<view class="detail-content">{{selectedCooperationDetail.content}}</view>
</view>
<!-- 合作模式确认弹窗 -->
<view wx:if="{{showCooperationConfirm}}" class="cooperation-confirm-overlay">
<view class="cooperation-confirm-container">
<view class="cooperation-confirm-title">{{currentCooperationDetail.title}}</view>
<view class="cooperation-confirm-content">{{currentCooperationDetail.content}}</view>
<view class="cooperation-confirm-buttons">
<button class="btn btn-outline" bindtap="closeCooperationConfirm">取消</button>
<button class="btn btn-primary" bindtap="confirmCooperationSelection">我知道了</button>
</view>
<button class="cooperation-help-button" bindtap="closeCooperationHelp">关闭</button>
</scroll-view>
</view>
</view>

93
pages/settlement/index.wxss

@ -968,6 +968,99 @@ picker {
display: block;
}
/* 合作模式确认弹窗样式 */
.cooperation-confirm-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: 40rpx;
box-sizing: border-box;
}
.cooperation-confirm-container {
background-color: #fff;
border-radius: 16rpx;
padding: 40rpx;
width: 100%;
max-width: 600rpx;
max-height: 80vh;
display: flex;
flex-direction: column;
box-shadow: 0 10rpx 30rpx rgba(0, 0, 0, 0.3);
}
.cooperation-confirm-title {
font-size: 36rpx;
font-weight: bold;
color: #333;
margin-bottom: 20rpx;
text-align: center;
}
.cooperation-confirm-content {
font-size: 28rpx;
color: #666;
line-height: 1.8;
margin-bottom: 40rpx;
max-height: 60vh;
overflow-y: auto;
padding-right: 10rpx;
text-align: justify;
/* 优化段落间距 */
white-space: pre-wrap;
/* 优化换行和空白处理 */
word-break: break-word;
/* 优化长单词换行 */
flex: 1;
}
/* 为内容中的段落添加间距 */
.cooperation-confirm-content::before {
content: '';
display: block;
height: 10rpx;
}
/* 优化滚动条样式 */
.cooperation-confirm-content::-webkit-scrollbar {
width: 8rpx;
}
.cooperation-confirm-content::-webkit-scrollbar-track {
background: #f1f1f1;
border-radius: 4rpx;
}
.cooperation-confirm-content::-webkit-scrollbar-thumb {
background: #888;
border-radius: 4rpx;
}
.cooperation-confirm-content::-webkit-scrollbar-thumb:hover {
background: #555;
}
.cooperation-confirm-buttons {
display: flex;
justify-content: space-between;
gap: 20rpx;
}
.cooperation-confirm-buttons .btn {
flex: 1;
margin: 0;
border-radius: 8rpx;
font-size: 30rpx;
padding: 20rpx 0;
}
/* 自定义滚动条样式 */
.cooperation-help-container::-webkit-scrollbar {
width: 8rpx;

Loading…
Cancel
Save