fix(collectionSettings): 修复已绑定账号时的表单禁用逻辑和地址选择处理
添加对已绑定收款账号的禁用逻辑,防止修改用户信息 地址选择器点击时增加已绑定账号的提示 移除保存按钮的条件显示,始终显示保存按钮
Showing
1 changed file
with
19 additions
and
19 deletions
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2022-09-19 14:11:06 | 2 | * @Date: 2022-09-19 14:11:06 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-08-16 14:16:46 | 4 | + * @LastEditTime: 2025-08-18 09:55:02 |
| 5 | * @FilePath: /jgdl/src/pages/collectionSettings/index.vue | 5 | * @FilePath: /jgdl/src/pages/collectionSettings/index.vue |
| 6 | * @Description: 收款设置 | 6 | * @Description: 收款设置 |
| 7 | --> | 7 | --> |
| ... | @@ -69,8 +69,6 @@ | ... | @@ -69,8 +69,6 @@ |
| 69 | class="form-input custom-input native-input" :cursor-spacing="50" @blur="validateBankAccount" /> | 69 | class="form-input custom-input native-input" :cursor-spacing="50" @blur="validateBankAccount" /> |
| 70 | <text v-if="bankAccountError" class="error-text">{{ bankAccountError }}</text> | 70 | <text v-if="bankAccountError" class="error-text">{{ bankAccountError }}</text> |
| 71 | </view> | 71 | </view> |
| 72 | - | ||
| 73 | - | ||
| 74 | </view> | 72 | </view> |
| 75 | 73 | ||
| 76 | <!-- 操作按钮 --> | 74 | <!-- 操作按钮 --> |
| ... | @@ -78,8 +76,8 @@ | ... | @@ -78,8 +76,8 @@ |
| 78 | <nut-button type="default" @click="closeAccountModal" class="footer-btn footer-btn-cancel"> | 76 | <nut-button type="default" @click="closeAccountModal" class="footer-btn footer-btn-cancel"> |
| 79 | 关闭 | 77 | 关闭 |
| 80 | </nut-button> | 78 | </nut-button> |
| 81 | - <!-- 保存按钮 - 只有在未绑定收款账户时才显示 --> | 79 | + <!-- 保存按钮 --> |
| 82 | - <nut-button v-if="!jeePayReceiverId" type="primary" @click="saveAccountInfo" color="#ffa500" | 80 | + <nut-button type="primary" @click="saveAccountInfo" color="#ffa500" |
| 83 | :disabled="!tempAccountInfo.bankName || !tempAccountInfo.bankAccount" | 81 | :disabled="!tempAccountInfo.bankName || !tempAccountInfo.bankAccount" |
| 84 | class="footer-btn footer-btn-save"> | 82 | class="footer-btn footer-btn-save"> |
| 85 | 保存 | 83 | 保存 |
| ... | @@ -105,13 +103,13 @@ | ... | @@ -105,13 +103,13 @@ |
| 105 | <view class="form-content"> | 103 | <view class="form-content"> |
| 106 | <view class="form-item"> | 104 | <view class="form-item"> |
| 107 | <text class="form-label"><text class="required-mark">*</text>用户名称</text> | 105 | <text class="form-label"><text class="required-mark">*</text>用户名称</text> |
| 108 | - <input v-model="tempIdentityInfo.userName" placeholder="请输入真实姓名" class="form-input native-input" /> | 106 | + <input v-model="tempIdentityInfo.userName" placeholder="请输入真实姓名" class="form-input native-input" :disabled="jeePayReceiverId" /> |
| 109 | </view> | 107 | </view> |
| 110 | 108 | ||
| 111 | <view class="form-item"> | 109 | <view class="form-item"> |
| 112 | <text class="form-label"><text class="required-mark">*</text>身份证号码</text> | 110 | <text class="form-label"><text class="required-mark">*</text>身份证号码</text> |
| 113 | <input v-model="tempIdentityInfo.idCard" placeholder="请输入身份证号码" class="form-input native-input" | 111 | <input v-model="tempIdentityInfo.idCard" placeholder="请输入身份证号码" class="form-input native-input" |
| 114 | - maxlength="18" @blur="handleIdCardBlur" :cursor-spacing="50" /> | 112 | + maxlength="18" @blur="handleIdCardBlur" :cursor-spacing="50" :disabled="jeePayReceiverId" /> |
| 115 | <text v-if="idCardError" class="error-text">{{ idCardError }}</text> | 113 | <text v-if="idCardError" class="error-text">{{ idCardError }}</text> |
| 116 | </view> | 114 | </view> |
| 117 | 115 | ||
| ... | @@ -122,7 +120,7 @@ | ... | @@ -122,7 +120,7 @@ |
| 122 | <view v-if="tempIdentityInfo.idcard_1_img" class="idcard-img-preview"> | 120 | <view v-if="tempIdentityInfo.idcard_1_img" class="idcard-img-preview"> |
| 123 | <image :src="tempIdentityInfo.idcard_1_img" class="idcard-img-image" mode="aspectFill" | 121 | <image :src="tempIdentityInfo.idcard_1_img" class="idcard-img-image" mode="aspectFill" |
| 124 | @tap="previewIdcard1Img" /> | 122 | @tap="previewIdcard1Img" /> |
| 125 | - <view class="idcard-img-actions"> | 123 | + <view class="idcard-img-actions" v-if="!jeePayReceiverId"> |
| 126 | <text class="change-img-btn" @tap="changeIdcard1Img">重新上传</text> | 124 | <text class="change-img-btn" @tap="changeIdcard1Img">重新上传</text> |
| 127 | <text class="delete-img-btn" @tap="deleteIdcard1Img">删除</text> | 125 | <text class="delete-img-btn" @tap="deleteIdcard1Img">删除</text> |
| 128 | </view> | 126 | </view> |
| ... | @@ -141,7 +139,7 @@ | ... | @@ -141,7 +139,7 @@ |
| 141 | <view v-if="tempIdentityInfo.idcard_2_img" class="idcard-img-preview"> | 139 | <view v-if="tempIdentityInfo.idcard_2_img" class="idcard-img-preview"> |
| 142 | <image :src="tempIdentityInfo.idcard_2_img" class="idcard-img-image" mode="aspectFill" | 140 | <image :src="tempIdentityInfo.idcard_2_img" class="idcard-img-image" mode="aspectFill" |
| 143 | @tap="previewIdcard2Img" /> | 141 | @tap="previewIdcard2Img" /> |
| 144 | - <view class="idcard-img-actions"> | 142 | + <view class="idcard-img-actions" v-if="!jeePayReceiverId"> |
| 145 | <text class="change-img-btn" @tap="changeIdcard2Img">重新上传</text> | 143 | <text class="change-img-btn" @tap="changeIdcard2Img">重新上传</text> |
| 146 | <text class="delete-img-btn" @tap="deleteIdcard2Img">删除</text> | 144 | <text class="delete-img-btn" @tap="deleteIdcard2Img">删除</text> |
| 147 | </view> | 145 | </view> |
| ... | @@ -153,17 +151,13 @@ | ... | @@ -153,17 +151,13 @@ |
| 153 | </view> | 151 | </view> |
| 154 | </view> | 152 | </view> |
| 155 | 153 | ||
| 156 | - | ||
| 157 | - | ||
| 158 | - | ||
| 159 | - | ||
| 160 | <!-- 身份证地址 --> | 154 | <!-- 身份证地址 --> |
| 161 | <view class="form-item"> | 155 | <view class="form-item"> |
| 162 | <text class="form-label"><text class="required-mark">*</text>身份证地址</text> | 156 | <text class="form-label"><text class="required-mark">*</text>身份证地址</text> |
| 163 | <!-- 地址选择器触发器 --> | 157 | <!-- 地址选择器触发器 --> |
| 164 | <view | 158 | <view |
| 165 | class="address-selector" | 159 | class="address-selector" |
| 166 | - @click="showAddressSelector = true" | 160 | + @click="handleAddressClick" |
| 167 | > | 161 | > |
| 168 | <text class="address-text" :class="{ 'address-selected': addressData.full_address && addressData.full_address !== 'NaN' }"> | 162 | <text class="address-text" :class="{ 'address-selected': addressData.full_address && addressData.full_address !== 'NaN' }"> |
| 169 | {{ (addressData.full_address && addressData.full_address !== 'NaN' && addressData.full_address.trim()) || '请选择省市县并填写详细地址' }} | 163 | {{ (addressData.full_address && addressData.full_address !== 'NaN' && addressData.full_address.trim()) || '请选择省市县并填写详细地址' }} |
| ... | @@ -188,8 +182,6 @@ | ... | @@ -188,8 +182,6 @@ |
| 188 | </view> | 182 | </view> |
| 189 | </nut-popup> | 183 | </nut-popup> |
| 190 | 184 | ||
| 191 | - | ||
| 192 | - | ||
| 193 | <!-- 固定返回按钮 - 只有当参数target=sell时才显示 --> | 185 | <!-- 固定返回按钮 - 只有当参数target=sell时才显示 --> |
| 194 | <view v-if="showBackButton" class="fixed-back-btn" @click="goBack"> | 186 | <view v-if="showBackButton" class="fixed-back-btn" @click="goBack"> |
| 195 | <text class="back-text">返回</text> | 187 | <text class="back-text">返回</text> |
| ... | @@ -973,9 +965,6 @@ const transformAreaData = (areaList) => { | ... | @@ -973,9 +965,6 @@ const transformAreaData = (areaList) => { |
| 973 | }) | 965 | }) |
| 974 | } | 966 | } |
| 975 | 967 | ||
| 976 | -// 转换后的地区数据 | ||
| 977 | -const areaData = ref(transformAreaData(areaList)) | ||
| 978 | - | ||
| 979 | // findNodeByCode 函数已移除,现在直接从 @vant/area-data 的扁平化数据中获取地区名称 | 968 | // findNodeByCode 函数已移除,现在直接从 @vant/area-data 的扁平化数据中获取地区名称 |
| 980 | 969 | ||
| 981 | /** | 970 | /** |
| ... | @@ -1022,6 +1011,17 @@ const onAddressChange = (address) => { | ... | @@ -1022,6 +1011,17 @@ const onAddressChange = (address) => { |
| 1022 | idcard_address: address.detail_address | 1011 | idcard_address: address.detail_address |
| 1023 | }) | 1012 | }) |
| 1024 | } | 1013 | } |
| 1014 | + | ||
| 1015 | +const handleAddressClick = () => { | ||
| 1016 | + if (jeePayReceiverId) { | ||
| 1017 | + Taro.showToast({ | ||
| 1018 | + title: '已绑定收款账号,不能修改地址, 如需修改请联系客服', | ||
| 1019 | + icon: 'none' | ||
| 1020 | + }) | ||
| 1021 | + return | ||
| 1022 | + } | ||
| 1023 | + showAddressSelector = true | ||
| 1024 | +} | ||
| 1025 | </script> | 1025 | </script> |
| 1026 | 1026 | ||
| 1027 | <script> | 1027 | <script> | ... | ... |
-
Please register or login to post a comment