feat(收款设置): 添加银行选择器组件及样式
- 替换银行名称输入框为银行选择器组件 - 添加银行选择弹窗及相关样式 - 修改银行账号输入框为原生input组件 - 优化表单输入框的placeholder样式
Showing
2 changed files
with
217 additions
and
17 deletions
| ... | @@ -107,16 +107,22 @@ | ... | @@ -107,16 +107,22 @@ |
| 107 | 107 | ||
| 108 | .form-input { | 108 | .form-input { |
| 109 | width: 100%; | 109 | width: 100%; |
| 110 | - padding: 24rpx 0; | 110 | + // color: #eee; |
| 111 | - font-size: 32rpx; | 111 | + // padding: 24rpx 0; |
| 112 | + font-size: 30rpx; | ||
| 112 | border: none; | 113 | border: none; |
| 113 | - // border-bottom: 2rpx solid #eee; | 114 | + border-bottom: 2rpx solid #eee; |
| 114 | background: transparent; | 115 | background: transparent; |
| 115 | transition: border-color 0.3s; | 116 | transition: border-color 0.3s; |
| 116 | 117 | ||
| 117 | &:focus { | 118 | &:focus { |
| 118 | border-bottom-color: #1890ff; | 119 | border-bottom-color: #1890ff; |
| 119 | } | 120 | } |
| 121 | + | ||
| 122 | + &::placeholder { | ||
| 123 | + color: #e5e5e5; | ||
| 124 | + font-size: 24rpx; | ||
| 125 | + } | ||
| 120 | } | 126 | } |
| 121 | 127 | ||
| 122 | .error-text { | 128 | .error-text { |
| ... | @@ -125,6 +131,38 @@ | ... | @@ -125,6 +131,38 @@ |
| 125 | color: #ff4d4f; | 131 | color: #ff4d4f; |
| 126 | margin-top: 8rpx; | 132 | margin-top: 8rpx; |
| 127 | } | 133 | } |
| 134 | + | ||
| 135 | + // 银行选择器样式 | ||
| 136 | + .bank-selector { | ||
| 137 | + display: flex; | ||
| 138 | + align-items: center; | ||
| 139 | + justify-content: space-between; | ||
| 140 | + padding: 24rpx 0; | ||
| 141 | + border-bottom: 2rpx solid #eee; | ||
| 142 | + cursor: pointer; | ||
| 143 | + transition: border-color 0.3s; | ||
| 144 | + | ||
| 145 | + &:active { | ||
| 146 | + border-bottom-color: #1890ff; | ||
| 147 | + } | ||
| 148 | + | ||
| 149 | + .bank-text { | ||
| 150 | + font-size: 32rpx; | ||
| 151 | + color: #ccc; | ||
| 152 | + flex: 1; | ||
| 153 | + | ||
| 154 | + &.bank-selected { | ||
| 155 | + color: #333; | ||
| 156 | + } | ||
| 157 | + } | ||
| 158 | + | ||
| 159 | + .arrow-down { | ||
| 160 | + font-size: 32rpx; | ||
| 161 | + color: #ccc; | ||
| 162 | + // transform: rotate(90deg); | ||
| 163 | + transition: transform 0.3s; | ||
| 164 | + } | ||
| 165 | + } | ||
| 128 | } | 166 | } |
| 129 | } | 167 | } |
| 130 | 168 | ||
| ... | @@ -155,6 +193,69 @@ | ... | @@ -155,6 +193,69 @@ |
| 155 | } | 193 | } |
| 156 | } | 194 | } |
| 157 | } | 195 | } |
| 196 | + | ||
| 197 | + // 银行选择弹窗样式 | ||
| 198 | + .bank-modal-content { | ||
| 199 | + height: 100%; | ||
| 200 | + display: flex; | ||
| 201 | + flex-direction: column; | ||
| 202 | + background-color: #fff; | ||
| 203 | + | ||
| 204 | + .bank-modal-header { | ||
| 205 | + padding: 32rpx; | ||
| 206 | + border-bottom: 1rpx solid #eee; | ||
| 207 | + background-color: #fff; | ||
| 208 | + position: sticky; | ||
| 209 | + top: 0; | ||
| 210 | + z-index: 10; | ||
| 211 | + | ||
| 212 | + .bank-modal-title { | ||
| 213 | + font-size: 36rpx; | ||
| 214 | + font-weight: 600; | ||
| 215 | + color: #333; | ||
| 216 | + text-align: center; | ||
| 217 | + } | ||
| 218 | + } | ||
| 219 | + | ||
| 220 | + .bank-list { | ||
| 221 | + flex: 1; | ||
| 222 | + overflow-y: auto; | ||
| 223 | + | ||
| 224 | + .bank-item { | ||
| 225 | + display: flex; | ||
| 226 | + align-items: center; | ||
| 227 | + justify-content: space-between; | ||
| 228 | + padding: 32rpx 24rpx; | ||
| 229 | + border-bottom: 1rpx solid #f0f0f0; | ||
| 230 | + transition: background-color 0.2s; | ||
| 231 | + cursor: pointer; | ||
| 232 | + | ||
| 233 | + &:last-child { | ||
| 234 | + border-bottom: none; | ||
| 235 | + } | ||
| 236 | + | ||
| 237 | + &:active { | ||
| 238 | + background-color: #f8f8f8; | ||
| 239 | + } | ||
| 240 | + | ||
| 241 | + &.bank-item-selected { | ||
| 242 | + background-color: #e6f7ff; | ||
| 243 | + } | ||
| 244 | + | ||
| 245 | + .bank-name { | ||
| 246 | + font-size: 32rpx; | ||
| 247 | + color: #333; | ||
| 248 | + flex: 1; | ||
| 249 | + } | ||
| 250 | + | ||
| 251 | + .bank-check { | ||
| 252 | + font-size: 32rpx; | ||
| 253 | + color: #1890ff; | ||
| 254 | + font-weight: bold; | ||
| 255 | + } | ||
| 256 | + } | ||
| 257 | + } | ||
| 258 | + } | ||
| 158 | } | 259 | } |
| 159 | 260 | ||
| 160 | // NutUI 组件样式覆盖 | 261 | // NutUI 组件样式覆盖 |
| ... | @@ -165,6 +266,29 @@ | ... | @@ -165,6 +266,29 @@ |
| 165 | } | 266 | } |
| 166 | } | 267 | } |
| 167 | 268 | ||
| 269 | +// 原生input组件样式 | ||
| 270 | +.native-input { | ||
| 271 | + width: 100%; | ||
| 272 | + height: 88rpx; | ||
| 273 | + // padding: 0 24rpx; | ||
| 274 | + font-size: 32rpx; | ||
| 275 | + color: #333; | ||
| 276 | + background-color: #f8f8f8; | ||
| 277 | + border: 2rpx solid #e5e5e5; | ||
| 278 | + border-radius: 8rpx; | ||
| 279 | + box-sizing: border-box; | ||
| 280 | + | ||
| 281 | + &::placeholder { | ||
| 282 | + color: #e5e5e5; | ||
| 283 | + font-size: 24rpx; | ||
| 284 | + } | ||
| 285 | + | ||
| 286 | + &:focus { | ||
| 287 | + border-color: #fa2c19; | ||
| 288 | + outline: none; | ||
| 289 | + } | ||
| 290 | +} | ||
| 291 | + | ||
| 168 | :deep(.nut-input) { | 292 | :deep(.nut-input) { |
| 169 | .nut-input-value { | 293 | .nut-input-value { |
| 170 | font-size: 32rpx; | 294 | font-size: 32rpx; | ... | ... |
| 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-05 20:03:22 | 4 | + * @LastEditTime: 2025-08-06 10:33:06 |
| 5 | * @FilePath: /jgdl/src/pages/collectionSettings/index.vue | 5 | * @FilePath: /jgdl/src/pages/collectionSettings/index.vue |
| 6 | * @Description: 收款设置 | 6 | * @Description: 收款设置 |
| 7 | --> | 7 | --> |
| ... | @@ -55,21 +55,22 @@ | ... | @@ -55,21 +55,22 @@ |
| 55 | <view class="form-content"> | 55 | <view class="form-content"> |
| 56 | <view class="form-item"> | 56 | <view class="form-item"> |
| 57 | <text class="form-label">银行名称</text> | 57 | <text class="form-label">银行名称</text> |
| 58 | - <nut-input | 58 | + <view class="bank-selector" @click="showBankPicker"> |
| 59 | - v-model="tempAccountInfo.bankName" | 59 | + <text class="bank-text" :class="{ 'bank-selected': tempAccountInfo.bankName }"> |
| 60 | - placeholder="请输入银行名称" | 60 | + {{ tempAccountInfo.bankName || '请选择银行' }} |
| 61 | - class="form-input" | 61 | + </text> |
| 62 | - /> | 62 | + <text class="arrow-down">></text> |
| 63 | + </view> | ||
| 63 | </view> | 64 | </view> |
| 64 | 65 | ||
| 65 | <view class="form-item"> | 66 | <view class="form-item"> |
| 66 | <text class="form-label">银行账号</text> | 67 | <text class="form-label">银行账号</text> |
| 67 | - <nut-input | 68 | + <input |
| 68 | v-model="tempAccountInfo.bankAccount" | 69 | v-model="tempAccountInfo.bankAccount" |
| 69 | placeholder="请输入银行账号" | 70 | placeholder="请输入银行账号" |
| 70 | - class="form-input" | 71 | + class="form-input custom-input native-input" |
| 71 | type="number" | 72 | type="number" |
| 72 | - :cursorSpacing="50" | 73 | + :cursor-spacing="50" |
| 73 | /> | 74 | /> |
| 74 | </view> | 75 | </view> |
| 75 | </view> | 76 | </view> |
| ... | @@ -95,6 +96,36 @@ | ... | @@ -95,6 +96,36 @@ |
| 95 | </view> | 96 | </view> |
| 96 | </nut-popup> | 97 | </nut-popup> |
| 97 | 98 | ||
| 99 | + <!-- 银行选择弹窗 --> | ||
| 100 | + <nut-popup | ||
| 101 | + v-model:visible="showBankModal" | ||
| 102 | + position="bottom" | ||
| 103 | + :style="{ width: '100%', height: '60%' }" | ||
| 104 | + :catch-move="true" | ||
| 105 | + closeable | ||
| 106 | + close-icon-position="top-right" | ||
| 107 | + @close="closeBankModal" | ||
| 108 | + > | ||
| 109 | + <view class="bank-modal-content"> | ||
| 110 | + <view class="bank-modal-header"> | ||
| 111 | + <text class="bank-modal-title">选择银行</text> | ||
| 112 | + </view> | ||
| 113 | + | ||
| 114 | + <view class="bank-list"> | ||
| 115 | + <view | ||
| 116 | + v-for="bank in bankList" | ||
| 117 | + :key="bank.id" | ||
| 118 | + class="bank-item" | ||
| 119 | + :class="{ 'bank-item-selected': tempAccountInfo.bankName === bank.name }" | ||
| 120 | + @click="selectBank(bank)" | ||
| 121 | + > | ||
| 122 | + <text class="bank-name">{{ bank.name }}</text> | ||
| 123 | + <view v-if="tempAccountInfo.bankName === bank.name" class="bank-check">✓</view> | ||
| 124 | + </view> | ||
| 125 | + </view> | ||
| 126 | + </view> | ||
| 127 | + </nut-popup> | ||
| 128 | + | ||
| 98 | <!-- 身份信息弹窗 --> | 129 | <!-- 身份信息弹窗 --> |
| 99 | <nut-popup | 130 | <nut-popup |
| 100 | v-model:visible="showIdentityModal" | 131 | v-model:visible="showIdentityModal" |
| ... | @@ -113,22 +144,22 @@ | ... | @@ -113,22 +144,22 @@ |
| 113 | <view class="form-content"> | 144 | <view class="form-content"> |
| 114 | <view class="form-item"> | 145 | <view class="form-item"> |
| 115 | <text class="form-label">用户名称</text> | 146 | <text class="form-label">用户名称</text> |
| 116 | - <nut-input | 147 | + <input |
| 117 | v-model="tempIdentityInfo.userName" | 148 | v-model="tempIdentityInfo.userName" |
| 118 | placeholder="请输入真实姓名" | 149 | placeholder="请输入真实姓名" |
| 119 | - class="form-input" | 150 | + class="form-input native-input" |
| 120 | /> | 151 | /> |
| 121 | </view> | 152 | </view> |
| 122 | 153 | ||
| 123 | <view class="form-item"> | 154 | <view class="form-item"> |
| 124 | <text class="form-label">身份证号码</text> | 155 | <text class="form-label">身份证号码</text> |
| 125 | - <nut-input | 156 | + <input |
| 126 | v-model="tempIdentityInfo.idCard" | 157 | v-model="tempIdentityInfo.idCard" |
| 127 | placeholder="请输入身份证号码" | 158 | placeholder="请输入身份证号码" |
| 128 | - class="form-input" | 159 | + class="form-input native-input" |
| 129 | maxlength="18" | 160 | maxlength="18" |
| 130 | @blur="handleIdCardBlur" | 161 | @blur="handleIdCardBlur" |
| 131 | - :cursorSpacing="50" | 162 | + :cursor-spacing="50" |
| 132 | /> | 163 | /> |
| 133 | <text v-if="idCardError" class="error-text">{{ idCardError }}</text> | 164 | <text v-if="idCardError" class="error-text">{{ idCardError }}</text> |
| 134 | </view> | 165 | </view> |
| ... | @@ -202,6 +233,7 @@ const tempIdentityInfo = ref({ | ... | @@ -202,6 +233,7 @@ const tempIdentityInfo = ref({ |
| 202 | */ | 233 | */ |
| 203 | const showAccountModal = ref(false); | 234 | const showAccountModal = ref(false); |
| 204 | const showIdentityModal = ref(false); | 235 | const showIdentityModal = ref(false); |
| 236 | +const showBankModal = ref(false); | ||
| 205 | 237 | ||
| 206 | /** | 238 | /** |
| 207 | * 身份证号码错误信息 | 239 | * 身份证号码错误信息 |
| ... | @@ -209,6 +241,27 @@ const showIdentityModal = ref(false); | ... | @@ -209,6 +241,27 @@ const showIdentityModal = ref(false); |
| 209 | const idCardError = ref(''); | 241 | const idCardError = ref(''); |
| 210 | 242 | ||
| 211 | /** | 243 | /** |
| 244 | + * 银行列表数据(模拟数据,后期从接口获取) | ||
| 245 | + */ | ||
| 246 | +const bankList = ref([ | ||
| 247 | + { id: 1, name: '中国工商银行' }, | ||
| 248 | + { id: 2, name: '中国建设银行' }, | ||
| 249 | + { id: 3, name: '中国农业银行' }, | ||
| 250 | + { id: 4, name: '中国银行' }, | ||
| 251 | + { id: 5, name: '交通银行' }, | ||
| 252 | + { id: 6, name: '招商银行' }, | ||
| 253 | + { id: 7, name: '中信银行' }, | ||
| 254 | + { id: 8, name: '光大银行' }, | ||
| 255 | + { id: 9, name: '华夏银行' }, | ||
| 256 | + { id: 10, name: '民生银行' }, | ||
| 257 | + { id: 11, name: '广发银行' }, | ||
| 258 | + { id: 12, name: '平安银行' }, | ||
| 259 | + { id: 13, name: '浦发银行' }, | ||
| 260 | + { id: 14, name: '兴业银行' }, | ||
| 261 | + { id: 15, name: '邮储银行' } | ||
| 262 | +]); | ||
| 263 | + | ||
| 264 | +/** | ||
| 212 | * 获取用户信息 | 265 | * 获取用户信息 |
| 213 | */ | 266 | */ |
| 214 | const getUserInfo = async () => { | 267 | const getUserInfo = async () => { |
| ... | @@ -295,6 +348,29 @@ const handleIdCardBlur = () => { | ... | @@ -295,6 +348,29 @@ const handleIdCardBlur = () => { |
| 295 | }; | 348 | }; |
| 296 | 349 | ||
| 297 | /** | 350 | /** |
| 351 | + * 显示银行选择弹窗 | ||
| 352 | + */ | ||
| 353 | +const showBankPicker = () => { | ||
| 354 | + showBankModal.value = true; | ||
| 355 | +}; | ||
| 356 | + | ||
| 357 | +/** | ||
| 358 | + * 关闭银行选择弹窗 | ||
| 359 | + */ | ||
| 360 | +const closeBankModal = () => { | ||
| 361 | + showBankModal.value = false; | ||
| 362 | +}; | ||
| 363 | + | ||
| 364 | +/** | ||
| 365 | + * 选择银行 | ||
| 366 | + * @param {Object} bank - 银行对象 | ||
| 367 | + */ | ||
| 368 | +const selectBank = (bank) => { | ||
| 369 | + tempAccountInfo.value.bankName = bank.name; | ||
| 370 | + closeBankModal(); | ||
| 371 | +}; | ||
| 372 | + | ||
| 373 | +/** | ||
| 298 | * 打开收款账号弹窗 | 374 | * 打开收款账号弹窗 |
| 299 | */ | 375 | */ |
| 300 | const openAccountModal = () => { | 376 | const openAccountModal = () => { | ... | ... |
-
Please register or login to post a comment