|
|
@ -19,6 +19,8 @@ Page({ |
|
|
city: '', |
|
|
city: '', |
|
|
district: '', |
|
|
district: '', |
|
|
detailedaddress: '', // 详细地址 (原detailAddress)
|
|
|
detailedaddress: '', // 详细地址 (原detailAddress)
|
|
|
|
|
|
showDetailedAddressError: false, |
|
|
|
|
|
detailedAddressError: '', |
|
|
showRegionError: false, |
|
|
showRegionError: false, |
|
|
regionError: '', |
|
|
regionError: '', |
|
|
cooperation: '', // 合作模式 (原selectedCooperation)
|
|
|
cooperation: '', // 合作模式 (原selectedCooperation)
|
|
|
@ -27,9 +29,15 @@ Page({ |
|
|
|
|
|
|
|
|
// 上传资料
|
|
|
// 上传资料
|
|
|
businesslicenseurl: null, // 营业执照URL (原businessLicenseFile)
|
|
|
businesslicenseurl: null, // 营业执照URL (原businessLicenseFile)
|
|
|
|
|
|
showBusinessLicenseError: false, |
|
|
|
|
|
businessLicenseError: '', |
|
|
proofurl: null, // 动物检疫证明URL (原animalQuarantineFile)
|
|
|
proofurl: null, // 动物检疫证明URL (原animalQuarantineFile)
|
|
|
|
|
|
showProofError: false, |
|
|
|
|
|
proofError: '', |
|
|
// idCardFile: null, // 已移除,法人身份证现在使用proofurl字段
|
|
|
// idCardFile: null, // 已移除,法人身份证现在使用proofurl字段
|
|
|
brandurl: null, // 品牌授权链URL (原brandAuthFile)
|
|
|
brandurl: null, // 品牌授权链URL (原brandAuthFile)
|
|
|
|
|
|
showBrandAuthError: false, |
|
|
|
|
|
brandAuthError: '', |
|
|
|
|
|
|
|
|
// 审核状态
|
|
|
// 审核状态
|
|
|
partnerstatus: '', // 合作商状态 (原auditStatus),初始为空而不是默认审核中
|
|
|
partnerstatus: '', // 合作商状态 (原auditStatus),初始为空而不是默认审核中
|
|
|
@ -38,8 +46,10 @@ Page({ |
|
|
// 登录弹窗相关
|
|
|
// 登录弹窗相关
|
|
|
showAuthModal: false, |
|
|
showAuthModal: false, |
|
|
showOneKeyLoginModal: false, |
|
|
showOneKeyLoginModal: false, |
|
|
// 合作模式帮助弹窗
|
|
|
// 合作模式确认弹窗
|
|
|
showCooperationHelp: false, |
|
|
showCooperationConfirm: false, |
|
|
|
|
|
currentCooperationDetail: null, |
|
|
|
|
|
pendingCooperationValue: '', |
|
|
selectedCooperationDetail: null, |
|
|
selectedCooperationDetail: null, |
|
|
loginModalTitle: '请先登录', |
|
|
loginModalTitle: '请先登录', |
|
|
loginModalContent: '为了您的账户安全,请先完成手机号登录', |
|
|
loginModalContent: '为了您的账户安全,请先完成手机号登录', |
|
|
@ -303,6 +313,13 @@ Page({ |
|
|
this.setData({ showRegionError: false }); |
|
|
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) { // 使用数据库字段名
|
|
|
if (!this.data.cooperation) { // 使用数据库字段名
|
|
|
this.setData({ showCooperationError: true }); |
|
|
this.setData({ showCooperationError: true }); |
|
|
valid = false; |
|
|
valid = false; |
|
|
@ -404,18 +421,96 @@ Page({ |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 详细地址输入
|
|
|
// 详细地址输入(带实时验证)
|
|
|
onDetailAddressInput(e) { |
|
|
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) { |
|
|
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) { |
|
|
selectCooperation(e) { |
|
|
const value = e.currentTarget.dataset.value; |
|
|
const value = e.currentTarget.dataset.value; |
|
|
|
|
|
|
|
|
@ -725,6 +820,14 @@ Page({ |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!this.data.detailedaddress || !this.data.detailedaddress.trim()) { |
|
|
|
|
|
wx.showToast({ |
|
|
|
|
|
title: '请填写详细地址', |
|
|
|
|
|
icon: 'none' |
|
|
|
|
|
}); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 手机号为空时使用默认值,不再强制要求
|
|
|
// 手机号为空时使用默认值,不再强制要求
|
|
|
if (!contactPhone) { |
|
|
if (!contactPhone) { |
|
|
contactPhone = 'default_phone'; |
|
|
contactPhone = 'default_phone'; |
|
|
@ -740,6 +843,42 @@ Page({ |
|
|
return; |
|
|
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); |
|
|
console.log('省市区字段内容:', this.data.province, this.data.city, this.data.district); |
|
|
|
|
|
|
|
|
@ -1298,6 +1437,8 @@ Page({ |
|
|
city: '', |
|
|
city: '', |
|
|
district: '', |
|
|
district: '', |
|
|
detailedaddress: '', |
|
|
detailedaddress: '', |
|
|
|
|
|
showDetailedAddressError: false, |
|
|
|
|
|
detailedAddressError: '', |
|
|
showRegionError: false, |
|
|
showRegionError: false, |
|
|
regionError: '', |
|
|
regionError: '', |
|
|
cooperation: '', |
|
|
cooperation: '', |
|
|
@ -1306,7 +1447,12 @@ Page({ |
|
|
|
|
|
|
|
|
// 重置上传资料
|
|
|
// 重置上传资料
|
|
|
businesslicenseurl: null, |
|
|
businesslicenseurl: null, |
|
|
|
|
|
showBusinessLicenseError: false, |
|
|
|
|
|
businessLicenseError: '', |
|
|
proofurl: null, |
|
|
proofurl: null, |
|
|
|
|
|
showProofError: false, |
|
|
|
|
|
proofError: '', |
|
|
|
|
|
brandurl: null, |
|
|
|
|
|
|
|
|
// 重置审核相关
|
|
|
// 重置审核相关
|
|
|
auditFailedReason: '' |
|
|
auditFailedReason: '' |
|
|
@ -1343,15 +1489,24 @@ Page({ |
|
|
showIdentityError: false, |
|
|
showIdentityError: false, |
|
|
company: '', // 使用数据库字段名 (原companyName)
|
|
|
company: '', // 使用数据库字段名 (原companyName)
|
|
|
showCompanyNameError: false, |
|
|
showCompanyNameError: false, |
|
|
|
|
|
companyNameError: '', |
|
|
province: '', |
|
|
province: '', |
|
|
city: '', |
|
|
city: '', |
|
|
district: '', |
|
|
district: '', |
|
|
showRegionError: false, |
|
|
|
|
|
detailedaddress: '', // 使用数据库字段名 (原detailAddress)
|
|
|
detailedaddress: '', // 使用数据库字段名 (原detailAddress)
|
|
|
|
|
|
showDetailedAddressError: false, |
|
|
|
|
|
detailedAddressError: '', |
|
|
|
|
|
showRegionError: false, |
|
|
|
|
|
regionError: '', |
|
|
cooperation: '', // 使用数据库字段名 (原selectedCooperation)
|
|
|
cooperation: '', // 使用数据库字段名 (原selectedCooperation)
|
|
|
showCooperationError: false, |
|
|
showCooperationError: false, |
|
|
|
|
|
cooperationError: '', |
|
|
businesslicenseurl: null, // 使用数据库字段名 (原businessLicenseFile)
|
|
|
businesslicenseurl: null, // 使用数据库字段名 (原businessLicenseFile)
|
|
|
|
|
|
showBusinessLicenseError: false, |
|
|
|
|
|
businessLicenseError: '', |
|
|
proofurl: null, // 使用数据库字段名 (原animalQuarantineFile)
|
|
|
proofurl: null, // 使用数据库字段名 (原animalQuarantineFile)
|
|
|
|
|
|
showProofError: false, |
|
|
|
|
|
proofError: '', |
|
|
// idCardFile: null, // 已移除,法人身份证现在使用proofurl字段
|
|
|
// idCardFile: null, // 已移除,法人身份证现在使用proofurl字段
|
|
|
brandurl: null, // 使用数据库字段名 (原brandAuthFile)
|
|
|
brandurl: null, // 使用数据库字段名 (原brandAuthFile)
|
|
|
partnerstatus: 'underreview', // 使用数据库字段名 (原auditStatus)
|
|
|
partnerstatus: 'underreview', // 使用数据库字段名 (原auditStatus)
|
|
|
|