From 14e9e126bd798972e3bd30b113c4e0188aaa58ba Mon Sep 17 00:00:00 2001 From: WindowBird <13870814+windows-bird@user.noreply.gitee.com> Date: Wed, 20 Aug 2025 09:34:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=90=86=E5=95=86=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E4=BF=A1=E6=81=AF=E6=8F=90=E4=BA=A4=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=EF=BC=8C=E5=92=8C=E5=8D=8F=E8=AE=AE=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 30 ++++++------ pages/agents/agents.vue | 105 ++++++++++++++++++++++++++++++++-------- 2 files changed, 101 insertions(+), 34 deletions(-) diff --git a/pages.json b/pages.json index 50210c3..bc913de 100644 --- a/pages.json +++ b/pages.json @@ -1,17 +1,17 @@ { "pages": [ - { - "path": "pages/index/index", - "style": { + { + "path": "pages/index/index", + "style": { "navigationBarTitleText": "设备租赁", "navigationStyle": "custom" - } - }, - { - "path": "pages/login/login", - "style": { - "navigationStyle": "custom" - } + } + }, + { + "path": "pages/login/login", + "style": { + "navigationStyle": "custom" + } }, { "path": "pages/lease/lease", @@ -80,8 +80,8 @@ "style": { "navigationStyle": "custom" } - } - ], + } + ], "tabBar": { "color": "#999999", "selectedColor": "#ff6b6b", @@ -107,11 +107,11 @@ } ] }, - "globalStyle": { - "navigationBarTextStyle": "black", + "globalStyle": { + "navigationBarTextStyle": "black", "navigationBarTitleText": "设备租赁", "navigationBarBackgroundColor": "#fff" - }, + }, "uniIdRouter": {}, "mp-weixin": { "requiredPrivateInfos": [ diff --git a/pages/agents/agents.vue b/pages/agents/agents.vue index 9960747..1faeb17 100644 --- a/pages/agents/agents.vue +++ b/pages/agents/agents.vue @@ -58,9 +58,9 @@ @change="onProvinceChange" > - {{ - selectedProvince ? selectedProvince.name : '请选择省份' - }} + {{ selectedProvince ? selectedProvince.name : '请选择省份' }} + @@ -76,9 +76,9 @@ @change="onCityChange" > - {{ - selectedCity ? selectedCity.name : '请选择城市' - }} + {{ selectedCity ? selectedCity.name : '请选择城市' }} + @@ -94,9 +94,9 @@ @change="onDistrictChange" > - {{ - selectedDistrict ? selectedDistrict.name : '请选择区县' - }} + {{ selectedDistrict ? selectedDistrict.name : '请选择区县' }} + @@ -159,7 +159,19 @@ - + + + + + 我已阅读并同意《代理商协议》 + + @@ -179,12 +191,11 @@ export default { }, canSubmit() { return ( - this.formData.name && - this.formData.phone && - this.formData.idCard && - this.selectedDistrict && // 必须选择到区县级别 - this.formData.detailAddress && - this.formData.agreed && + // this.formData.name && + // this.formData.phone && + // this.formData.idCard && + // this.selectedDistrict && // 必须选择到区县级别 + // this.formData.detailAddress && !this.submitting ) }, @@ -195,18 +206,21 @@ export default { this.loadAgreement() this.loadRegionTreeData() + // 重置协议同意状态,用于测试协议弹窗功能 + this.formData.agreed = false + // 添加测试数据 console.log('页面加载完成,三级选择器已初始化') }, data() { return { formData: { - name: '张珊珊', + name: '', phone: '', idCard: '', serviceArea: '', - detailAddress: '太姥山镇秦屿大道2号', - agreed: true, + detailAddress: '', + agreed: false, }, submitting: false, serviceAreas: [], @@ -384,6 +398,16 @@ export default { // 提交申请 async submitApplication() { + // 检查是否同意协议,如果未同意则自动弹窗 + if (!this.formData.agreed) { + this.showAgreement() + uni.showToast({ + title: '请先阅读并同意代理商协议', + icon: 'none', + }) + return + } + if (!this.validateForm()) { return } @@ -827,6 +851,39 @@ export default { border-top: 1rpx solid #e8e8e8; background: #f8f8f8; + .agreement-modal-checkbox { + display: flex; + align-items: center; + margin-bottom: 20rpx; + + .modal-checkbox { + width: 32rpx; + height: 32rpx; + border: 2rpx solid #ff6b6b; + border-radius: 6rpx; + margin-right: 10rpx; + display: flex; + align-items: center; + justify-content: center; + background: #ffffff; + + &.checked { + background: #f15a04; + } + + .checkmark { + color: #ffffff; + font-size: 20rpx; + font-weight: bold; + } + } + + .modal-checkbox-text { + font-size: 26rpx; + color: #666; + } + } + .agreement-modal-btn { width: 100%; height: 80rpx; @@ -843,6 +900,16 @@ export default { &:active { transform: scale(0.98); } + + &.disabled { + background: #cccccc; + color: #999999; + cursor: not-allowed; + + &:active { + transform: none; + } + } } }