From d6f670849649d391ab923dd41c979dc88be97d05 Mon Sep 17 00:00:00 2001 From: WindowBird <13870814+windows-bird@user.noreply.gitee.com> Date: Tue, 19 Aug 2025 17:28:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E4=BB=A3=E7=90=86=E5=95=86-?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=8C=BA=E5=9F=9F=E6=88=90=E5=8A=9F=E4=BD=86?= =?UTF-8?q?=E6=98=AF=E6=97=A0=E6=B3=95=E8=81=94=E7=BA=A7=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/agents/agents.vue | 164 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 158 insertions(+), 6 deletions(-) diff --git a/pages/agents/agents.vue b/pages/agents/agents.vue index 830ba3a..3f84c2f 100644 --- a/pages/agents/agents.vue +++ b/pages/agents/agents.vue @@ -101,6 +101,31 @@ + + + + + + 选择服务区域 + × + + + + {{ area }} + + + + + + + + @@ -145,6 +170,8 @@ export default { serviceAreas: [], agreementContent: '', showAgreementModal: false, + showAreaSelector: false, + tempSelectedArea: '', // 区域ID映射 areaIdMap: {}, } @@ -223,12 +250,25 @@ export default { return } - uni.showActionSheet({ - itemList: this.serviceAreas, - success: res => { - this.formData.serviceArea = this.serviceAreas[res.tapIndex] - }, - }) + this.tempSelectedArea = this.formData.serviceArea + this.showAreaSelector = true + }, + + // 选择区域 + selectArea(area) { + this.tempSelectedArea = area + }, + + // 确认区域选择 + confirmAreaSelection() { + this.formData.serviceArea = this.tempSelectedArea + this.hideAreaSelector() + }, + + // 隐藏区域选择器 + hideAreaSelector() { + this.showAreaSelector = false + this.tempSelectedArea = '' }, // 切换协议同意状态 @@ -635,4 +675,116 @@ export default { } } } + +// 服务区域选择器样式 +.area-selector-overlay { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: rgba(0, 0, 0, 0.5); + z-index: 9999; + display: flex; + align-items: center; + justify-content: center; +} + +.area-selector-modal { + width: 90%; + max-width: 600rpx; + max-height: 80%; + background: #ffffff; + border-radius: 20rpx; + overflow: hidden; + display: flex; + flex-direction: column; +} + +.area-selector-header { + padding: 30rpx; + border-bottom: 1rpx solid #e8e8e8; + display: flex; + align-items: center; + justify-content: space-between; + background: #f8f8f8; + + .area-selector-title { + font-size: 32rpx; + font-weight: bold; + color: #333; + } + + .area-selector-close { + font-size: 40rpx; + color: #999; + cursor: pointer; + padding: 10rpx; + } +} + +.area-selector-content { + flex: 1; + max-height: 600rpx; + overflow-y: auto; +} + +.area-item { + padding: 30rpx; + border-bottom: 1rpx solid #f0f0f0; + display: flex; + align-items: center; + justify-content: space-between; + cursor: pointer; + transition: background-color 0.2s; + + &:hover { + background-color: #f8f8f8; + } + + &:active { + background-color: #f0f0f0; + } + + &.area-item-selected { + background-color: #fff5f0; + border-left: 4rpx solid #f15a04; + } + + .area-item-text { + font-size: 28rpx; + color: #333; + flex: 1; + } + + .area-item-check { + font-size: 32rpx; + color: #f15a04; + font-weight: bold; + } +} + +.area-selector-footer { + padding: 30rpx; + border-top: 1rpx solid #e8e8e8; + background: #f8f8f8; + + .area-selector-btn { + width: 100%; + height: 80rpx; + background: #f15a04; + color: #ffffff; + border: none; + border-radius: 12rpx; + font-size: 28rpx; + font-weight: bold; + display: flex; + align-items: center; + justify-content: center; + + &:active { + transform: scale(0.98); + } + } +}