From 460c30737965deeeaee0d21132e74bc72b3b61a6 Mon Sep 17 00:00:00 2001 From: Default User Date: Tue, 6 Jan 2026 10:24:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=90=88=E4=BD=9C=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E9=80=89=E6=8B=A9=E5=8A=9F=E8=83=BD=EF=BC=9A=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=E9=97=AE=E5=8F=B7=E5=B8=AE=E5=8A=A9=E6=8C=89=E9=92=AE?= =?UTF-8?q?=EF=BC=8C=E5=AE=9E=E7=8E=B0=E7=82=B9=E5=87=BB=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E8=AF=A6=E7=BB=86=E8=AF=B4=E6=98=8E=EF=BC=8C=E8=B4=B8=E6=98=93?= =?UTF-8?q?=E5=95=86=E4=B8=8D=E6=98=BE=E7=A4=BA=E5=8C=85=E5=9C=BA=E5=90=88?= =?UTF-8?q?=E4=BD=9C=E9=80=89=E9=A1=B9=EF=BC=8C=E4=BC=98=E5=8C=96=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=E6=A0=B7=E5=BC=8F=E5=92=8C=E6=96=87=E5=AD=97=E6=8E=92?= =?UTF-8?q?=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/settlement/index.js | 171 ++++++++++++++++++++++++++++++++++-- pages/settlement/index.wxml | 54 ++++++------ pages/settlement/index.wxss | 93 ++++++++++++++++++++ 3 files changed, 281 insertions(+), 37 deletions(-) diff --git a/pages/settlement/index.js b/pages/settlement/index.js index 320117f..ee23b91 100644 --- a/pages/settlement/index.js +++ b/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) diff --git a/pages/settlement/index.wxml b/pages/settlement/index.wxml index 74b1abd..8bacb34 100644 --- a/pages/settlement/index.wxml +++ b/pages/settlement/index.wxml @@ -119,12 +119,12 @@ - 详细地址 + 详细地址 + {{detailedAddressError || '请输入详细地址'}} 合作模式 - ? @@ -156,7 +156,7 @@ @@ -164,15 +164,16 @@ 包场合作 @@ -194,7 +195,7 @@ - {{collaborationid === 'chicken' ? '鸡场营业执照(选填)' : '贸易商营业执照(选填)'}} + {{collaborationid === 'chicken' ? '鸡场营业执照' : '贸易商营业执照'}} + 点击上传营业执照 @@ -207,11 +208,12 @@ 删除 + {{businessLicenseError || '请上传营业执照'}} - 动物检疫合格证明(选填) + 动物检疫合格证明 + 点击上传动物检疫合格证明 @@ -224,11 +226,12 @@ 删除 + {{proofError || '请上传动物检疫合格证明'}} - 法人身份证正反面(选填) + 法人身份证正反面 + 点击上传法人身份证正反面 @@ -241,10 +244,11 @@ 删除 + {{proofError || '请上传法人身份证正反面'}} - 品牌授权链文件 + 品牌授权链文件(选填) + 点击上传品牌授权链文件 @@ -357,22 +361,14 @@ - - - - 合作模式说明 - - - - - - - - - {{selectedCooperationDetail.title}} - {{selectedCooperationDetail.content}} - + + + + {{currentCooperationDetail.title}} + {{currentCooperationDetail.content}} + + + - - + \ No newline at end of file diff --git a/pages/settlement/index.wxss b/pages/settlement/index.wxss index 6b72a77..204c7e3 100644 --- a/pages/settlement/index.wxss +++ b/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;