feat(认证车源): 添加认证费用说明弹窗及支付流程
添加认证费用说明弹窗组件,包含费用展示和说明信息 修改提交按钮文本为"提交申请并支付" 新增获取认证费用API接口
Showing
5 changed files
with
269 additions
and
9 deletions
| ... | @@ -11,6 +11,7 @@ const Api = { | ... | @@ -11,6 +11,7 @@ const Api = { |
| 11 | GET_SCHOOLS: '/srv/?a=common&t=get_schools', | 11 | GET_SCHOOLS: '/srv/?a=common&t=get_schools', |
| 12 | GET_BRANDS_MODELS: '/srv/?a=common&t=get_brands_models', | 12 | GET_BRANDS_MODELS: '/srv/?a=common&t=get_brands_models', |
| 13 | GET_VEHICLE_BRANDS: '/srv/?a=common&t=get_vehicle_brands', | 13 | GET_VEHICLE_BRANDS: '/srv/?a=common&t=get_vehicle_brands', |
| 14 | + GET_VERIFICATION_PRICE: '/srv/?a=common&t=get_verification_price', | ||
| 14 | SUBMIT_FEEDBACK: '/srv/?a=feedback&t=add', | 15 | SUBMIT_FEEDBACK: '/srv/?a=feedback&t=add', |
| 15 | GET_FEEDBACK_LIST: '/srv/?a=feedback&t=list', | 16 | GET_FEEDBACK_LIST: '/srv/?a=feedback&t=list', |
| 16 | GET_FAVORITE_LIST: '/srv/?a=favorite&t=list', | 17 | GET_FAVORITE_LIST: '/srv/?a=favorite&t=list', |
| ... | @@ -40,6 +41,13 @@ export const getBrandsModelsAPI = (params) => fn(fetch.get(Api.GET_BRANDS_MODELS | ... | @@ -40,6 +41,13 @@ export const getBrandsModelsAPI = (params) => fn(fetch.get(Api.GET_BRANDS_MODELS |
| 40 | export const getVehicleBrandsAPI = (params) => fn(fetch.get(Api.GET_VEHICLE_BRANDS, params)); | 41 | export const getVehicleBrandsAPI = (params) => fn(fetch.get(Api.GET_VEHICLE_BRANDS, params)); |
| 41 | 42 | ||
| 42 | /** | 43 | /** |
| 44 | + * @description: 获取认证费用 | ||
| 45 | + * @param {*} params | ||
| 46 | + * @returns | ||
| 47 | + */ | ||
| 48 | +export const getVerificationPriceAPI = (params) => fn(fetch.get(Api.GET_VERIFICATION_PRICE, params)); | ||
| 49 | + | ||
| 50 | +/** | ||
| 43 | * @description: 获取收藏列表 | 51 | * @description: 获取收藏列表 |
| 44 | * @param {*} params | 52 | * @param {*} params |
| 45 | * @param {number} params.page - 页码,从0开始 | 53 | * @param {number} params.page - 页码,从0开始 | ... | ... |
| 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-07-23 16:00:30 | 4 | + * @LastEditTime: 2025-08-01 15:04:35 |
| 5 | * @FilePath: /jgdl/src/pages/auth/index.vue | 5 | * @FilePath: /jgdl/src/pages/auth/index.vue |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | --> | 7 | --> | ... | ... |
| ... | @@ -276,19 +276,19 @@ | ... | @@ -276,19 +276,19 @@ |
| 276 | padding-left: 24rpx; | 276 | padding-left: 24rpx; |
| 277 | padding-right: 24rpx; | 277 | padding-right: 24rpx; |
| 278 | } | 278 | } |
| 279 | - | 279 | + |
| 280 | .auth-car-page .text-lg { | 280 | .auth-car-page .text-lg { |
| 281 | font-size: 32rpx; | 281 | font-size: 32rpx; |
| 282 | } | 282 | } |
| 283 | - | 283 | + |
| 284 | .auth-car-page .text-sm { | 284 | .auth-car-page .text-sm { |
| 285 | font-size: 26rpx; | 285 | font-size: 26rpx; |
| 286 | } | 286 | } |
| 287 | - | 287 | + |
| 288 | .auth-car-page .text-xs { | 288 | .auth-car-page .text-xs { |
| 289 | font-size: 22rpx; | 289 | font-size: 22rpx; |
| 290 | } | 290 | } |
| 291 | - | 291 | + |
| 292 | .auth-button { | 292 | .auth-button { |
| 293 | height: 88rpx; | 293 | height: 88rpx; |
| 294 | font-size: 30rpx; | 294 | font-size: 30rpx; |
| ... | @@ -336,3 +336,166 @@ | ... | @@ -336,3 +336,166 @@ |
| 336 | border: 1rpx solid #bbf7d0; | 336 | border: 1rpx solid #bbf7d0; |
| 337 | display: inline-block; | 337 | display: inline-block; |
| 338 | } | 338 | } |
| 339 | + | ||
| 340 | +/* 认证费用说明弹窗样式 */ | ||
| 341 | +.auth-info-popup { | ||
| 342 | + height: 100%; | ||
| 343 | + display: flex; | ||
| 344 | + flex-direction: column; | ||
| 345 | + background-color: #ffffff; | ||
| 346 | +} | ||
| 347 | + | ||
| 348 | +.popup-header { | ||
| 349 | + padding: 40rpx 32rpx 32rpx; | ||
| 350 | + border-bottom: 1rpx solid #f3f4f6; | ||
| 351 | + background-color: #ffffff; | ||
| 352 | + position: sticky; | ||
| 353 | + top: 0; | ||
| 354 | + z-index: 10; | ||
| 355 | +} | ||
| 356 | + | ||
| 357 | +.popup-title { | ||
| 358 | + font-size: 36rpx; | ||
| 359 | + font-weight: 600; | ||
| 360 | + color: #1f2937; | ||
| 361 | + text-align: center; | ||
| 362 | +} | ||
| 363 | + | ||
| 364 | +.popup-content { | ||
| 365 | + flex: 1; | ||
| 366 | + padding: 32rpx; | ||
| 367 | + overflow-y: auto; | ||
| 368 | + overflow-x: hidden; | ||
| 369 | + width: 100%; | ||
| 370 | + box-sizing: border-box; | ||
| 371 | +} | ||
| 372 | + | ||
| 373 | +.content-section { | ||
| 374 | + margin-bottom: 48rpx; | ||
| 375 | + width: 100%; | ||
| 376 | + box-sizing: border-box; | ||
| 377 | +} | ||
| 378 | + | ||
| 379 | +.section-title { | ||
| 380 | + font-size: 32rpx; | ||
| 381 | + font-weight: 600; | ||
| 382 | + color: #1f2937; | ||
| 383 | + margin-bottom: 24rpx; | ||
| 384 | + padding-bottom: 16rpx; | ||
| 385 | + border-bottom: 2rpx solid #fb923c; | ||
| 386 | + display: inline-block; | ||
| 387 | +} | ||
| 388 | + | ||
| 389 | +/* 弹窗内容样式 */ | ||
| 390 | +.popup-content-text { | ||
| 391 | + padding: 32rpx; | ||
| 392 | +} | ||
| 393 | + | ||
| 394 | +.auth-fee-item { | ||
| 395 | + display: flex; | ||
| 396 | + justify-content: space-between; | ||
| 397 | + align-items: center; | ||
| 398 | + padding: 24rpx 0; | ||
| 399 | + border-bottom: 1rpx solid #f3f4f6; | ||
| 400 | + margin-bottom: 24rpx; | ||
| 401 | +} | ||
| 402 | + | ||
| 403 | +.auth-fee-label { | ||
| 404 | + font-size: 32rpx; | ||
| 405 | + color: #1f2937; | ||
| 406 | + font-weight: 600; | ||
| 407 | +} | ||
| 408 | + | ||
| 409 | +.auth-fee-value { | ||
| 410 | + font-size: 32rpx; | ||
| 411 | + color: #fb923c; | ||
| 412 | + font-weight: 700; | ||
| 413 | +} | ||
| 414 | + | ||
| 415 | +.auth-desc-item { | ||
| 416 | + display: flex; | ||
| 417 | + flex-direction: column; | ||
| 418 | + gap: 16rpx; | ||
| 419 | +} | ||
| 420 | + | ||
| 421 | +.auth-desc-label { | ||
| 422 | + font-size: 32rpx; | ||
| 423 | + color: #1f2937; | ||
| 424 | + font-weight: 600; | ||
| 425 | +} | ||
| 426 | + | ||
| 427 | +.auth-desc-text { | ||
| 428 | + font-size: 28rpx; | ||
| 429 | + color: #4b5563; | ||
| 430 | + line-height: 1.8; | ||
| 431 | + word-wrap: break-word; | ||
| 432 | + word-break: break-all; | ||
| 433 | + background-color: #f9fafb; | ||
| 434 | + padding: 24rpx; | ||
| 435 | + border-radius: 12rpx; | ||
| 436 | + border-left: 4rpx solid #fb923c; | ||
| 437 | +} | ||
| 438 | + | ||
| 439 | +/* 底部按钮区域 */ | ||
| 440 | +.popup-footer { | ||
| 441 | + padding: 24rpx 32rpx; | ||
| 442 | + border-top: 1rpx solid #f3f4f6; | ||
| 443 | + background-color: #ffffff; | ||
| 444 | + display: flex; | ||
| 445 | + gap: 24rpx; | ||
| 446 | +} | ||
| 447 | + | ||
| 448 | +.footer-btn { | ||
| 449 | + flex: 1; | ||
| 450 | + height: 88rpx; | ||
| 451 | + border-radius: 44rpx; | ||
| 452 | + font-size: 30rpx; | ||
| 453 | + font-weight: 500; | ||
| 454 | +} | ||
| 455 | + | ||
| 456 | +.cancel-btn { | ||
| 457 | + border: 1rpx solid #d1d5db; | ||
| 458 | + color: #6b7280; | ||
| 459 | +} | ||
| 460 | + | ||
| 461 | +.confirm-btn { | ||
| 462 | + background: linear-gradient(135deg, #fb923c 0%, #f97316 100%); | ||
| 463 | + border: none; | ||
| 464 | + color: #ffffff; | ||
| 465 | +} | ||
| 466 | + | ||
| 467 | +/* NutUI弹窗组件样式覆盖 */ | ||
| 468 | +:deep(.nut-popup) { | ||
| 469 | + border-radius: 0; | ||
| 470 | +} | ||
| 471 | + | ||
| 472 | +:deep(.nut-popup__close-icon) { | ||
| 473 | + top: 32rpx; | ||
| 474 | + right: 32rpx; | ||
| 475 | + width: 48rpx; | ||
| 476 | + height: 48rpx; | ||
| 477 | + background-color: rgba(0, 0, 0, 0.1); | ||
| 478 | + border-radius: 50%; | ||
| 479 | + display: flex; | ||
| 480 | + align-items: center; | ||
| 481 | + justify-content: center; | ||
| 482 | +} | ||
| 483 | + | ||
| 484 | +/* 滚动条样式 */ | ||
| 485 | +.popup-content::-webkit-scrollbar { | ||
| 486 | + width: 8rpx; | ||
| 487 | +} | ||
| 488 | + | ||
| 489 | +.popup-content::-webkit-scrollbar-track { | ||
| 490 | + background: #f1f1f1; | ||
| 491 | + border-radius: 4rpx; | ||
| 492 | +} | ||
| 493 | + | ||
| 494 | +.popup-content::-webkit-scrollbar-thumb { | ||
| 495 | + background: #c1c1c1; | ||
| 496 | + border-radius: 4rpx; | ||
| 497 | +} | ||
| 498 | + | ||
| 499 | +.popup-content::-webkit-scrollbar-thumb:hover { | ||
| 500 | + background: #a8a8a8; | ||
| 501 | +} | ... | ... |
| 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-07-17 15:51:44 | 4 | + * @LastEditTime: 2025-08-04 10:21:56 |
| 5 | * @FilePath: /jgdl/src/pages/authCar/index.vue | 5 | * @FilePath: /jgdl/src/pages/authCar/index.vue |
| 6 | * @Description: 认证车源 | 6 | * @Description: 认证车源 |
| 7 | --> | 7 | --> |
| ... | @@ -84,6 +84,56 @@ | ... | @@ -84,6 +84,56 @@ |
| 84 | 84 | ||
| 85 | <!-- 成功提示 --> | 85 | <!-- 成功提示 --> |
| 86 | <nut-toast v-model:visible="toastVisible" :msg="toastMessage" :type="toastType" /> | 86 | <nut-toast v-model:visible="toastVisible" :msg="toastMessage" :type="toastType" /> |
| 87 | + | ||
| 88 | + <!-- 认证费用说明弹窗 --> | ||
| 89 | + <nut-popup | ||
| 90 | + v-model:visible="showAuthInfoPopup" | ||
| 91 | + position="right" | ||
| 92 | + :style="{ width: '100%', height: '100%' }" | ||
| 93 | + closeable | ||
| 94 | + close-icon-position="top-right" | ||
| 95 | + @close="showAuthInfoPopup = false" | ||
| 96 | + > | ||
| 97 | + <view class="auth-info-popup"> | ||
| 98 | + <!-- 标题 --> | ||
| 99 | + <view class="popup-header"> | ||
| 100 | + <text class="popup-title">认证费用说明</text> | ||
| 101 | + </view> | ||
| 102 | + | ||
| 103 | + <!-- 滚动内容区域 --> | ||
| 104 | + <scroll-view class="popup-content" :scroll-y="true"> | ||
| 105 | + <view class="popup-content-text"> | ||
| 106 | + <view class="auth-fee-item"> | ||
| 107 | + <text class="auth-fee-label">认证费用:</text> | ||
| 108 | + <text class="auth-fee-value">¥{{ authFee }}</text> | ||
| 109 | + </view> | ||
| 110 | + <view class="auth-desc-item"> | ||
| 111 | + <text class="auth-desc-label">认证说明:</text> | ||
| 112 | + <text class="auth-desc-text">{{ authDesc }}</text> | ||
| 113 | + </view> | ||
| 114 | + </view> | ||
| 115 | + </scroll-view> | ||
| 116 | + | ||
| 117 | + <!-- 底部按钮 --> | ||
| 118 | + <view class="popup-footer"> | ||
| 119 | + <nut-button | ||
| 120 | + plain | ||
| 121 | + class="footer-btn cancel-btn" | ||
| 122 | + @click="showAuthInfoPopup = false" | ||
| 123 | + > | ||
| 124 | + 关闭 | ||
| 125 | + </nut-button> | ||
| 126 | + <nut-button | ||
| 127 | + type="warning" | ||
| 128 | + class="footer-btn confirm-btn" | ||
| 129 | + color="#fb923c" | ||
| 130 | + @click="handleConfirmAuth" | ||
| 131 | + > | ||
| 132 | + 知道了 | ||
| 133 | + </nut-button> | ||
| 134 | + </view> | ||
| 135 | + </view> | ||
| 136 | + </nut-popup> | ||
| 87 | </view> | 137 | </view> |
| 88 | </template> | 138 | </template> |
| 89 | 139 | ||
| ... | @@ -95,6 +145,8 @@ import { useFavorite } from '@/composables/useFavorite' | ... | @@ -95,6 +145,8 @@ import { useFavorite } from '@/composables/useFavorite' |
| 95 | import './index.less' | 145 | import './index.less' |
| 96 | // 接口导入 | 146 | // 接口导入 |
| 97 | import { getVehicleListAPI } from '@/api/car'; | 147 | import { getVehicleListAPI } from '@/api/car'; |
| 148 | +import { getVerificationPriceAPI } from '@/api/other'; | ||
| 149 | + | ||
| 98 | import { DEFAULT_COVER_IMG } from '@/utils/config' | 150 | import { DEFAULT_COVER_IMG } from '@/utils/config' |
| 99 | // Banner图片数据 | 151 | // Banner图片数据 |
| 100 | const bannerImages = ref([ | 152 | const bannerImages = ref([ |
| ... | @@ -106,6 +158,10 @@ const bannerImages = ref([ | ... | @@ -106,6 +158,10 @@ const bannerImages = ref([ |
| 106 | // 认证车源数据 | 158 | // 认证车源数据 |
| 107 | const authCars = ref([]) | 159 | const authCars = ref([]) |
| 108 | 160 | ||
| 161 | +// 认证费用和说明 | ||
| 162 | +const authFee = ref('180') | ||
| 163 | +const authDesc = ref('认证服务包含车辆基础信息验证、车况检测、平台担保等服务,认证通过后可获得平台认证标识,提升车辆可信度和成交率。认证费用一经支付不可退还,认证有效期为1年。') | ||
| 164 | + | ||
| 109 | // 收藏状态 | 165 | // 收藏状态 |
| 110 | // 收藏功能现在使用基于对象属性的模式 | 166 | // 收藏功能现在使用基于对象属性的模式 |
| 111 | 167 | ||
| ... | @@ -120,6 +176,9 @@ const toastVisible = ref(false) | ... | @@ -120,6 +176,9 @@ const toastVisible = ref(false) |
| 120 | const toastMessage = ref('') | 176 | const toastMessage = ref('') |
| 121 | const toastType = ref('success') | 177 | const toastType = ref('success') |
| 122 | 178 | ||
| 179 | +// 认证费用说明弹窗 | ||
| 180 | +const showAuthInfoPopup = ref(false) | ||
| 181 | + | ||
| 123 | // 滚动样式 | 182 | // 滚动样式 |
| 124 | const scrollStyle = computed(() => { | 183 | const scrollStyle = computed(() => { |
| 125 | return { | 184 | return { |
| ... | @@ -131,7 +190,17 @@ const scrollStyle = computed(() => { | ... | @@ -131,7 +190,17 @@ const scrollStyle = computed(() => { |
| 131 | * 处理认证按钮点击 | 190 | * 处理认证按钮点击 |
| 132 | */ | 191 | */ |
| 133 | const handleAuth = () => { | 192 | const handleAuth = () => { |
| 134 | - // TODO: 跳转到认证页面 | 193 | + // 显示认证费用说明弹窗 |
| 194 | + showAuthInfoPopup.value = true | ||
| 195 | +} | ||
| 196 | + | ||
| 197 | +/** | ||
| 198 | + * 确认认证,跳转到认证页面 | ||
| 199 | + */ | ||
| 200 | +const handleConfirmAuth = () => { | ||
| 201 | + // 关闭弹窗 | ||
| 202 | + showAuthInfoPopup.value = false | ||
| 203 | + // 跳转到认证页面 | ||
| 135 | Taro.navigateTo({ url: '/pages/setAuthCar/index' }) | 204 | Taro.navigateTo({ url: '/pages/setAuthCar/index' }) |
| 136 | } | 205 | } |
| 137 | 206 | ||
| ... | @@ -224,10 +293,30 @@ const showToast = (message, type = 'success') => { | ... | @@ -224,10 +293,30 @@ const showToast = (message, type = 'success') => { |
| 224 | toastVisible.value = true | 293 | toastVisible.value = true |
| 225 | } | 294 | } |
| 226 | 295 | ||
| 296 | +/** | ||
| 297 | + * 获取认证费用 | ||
| 298 | + */ | ||
| 299 | + | ||
| 300 | +const getVerificationPrice = async () => { | ||
| 301 | + try { | ||
| 302 | + const response = await getVerificationPriceAPI() | ||
| 303 | + if (response && response.code === 1 && response.data) { | ||
| 304 | + // 处理认证费用数据 | ||
| 305 | + authFee.value = response.data.verification_price | ||
| 306 | + authDesc.value = response.data.verification_desc | ||
| 307 | + } | ||
| 308 | + } catch (error) { | ||
| 309 | + console.error('获取认证费用失败:', error) | ||
| 310 | + showToast('网络错误,请稍后重试', 'error') | ||
| 311 | + } | ||
| 312 | +} | ||
| 313 | + | ||
| 227 | // 初始化 | 314 | // 初始化 |
| 228 | onMounted(async () => { | 315 | onMounted(async () => { |
| 229 | // 加载初始认证车辆数据 | 316 | // 加载初始认证车辆数据 |
| 230 | await loadAuthCarData() | 317 | await loadAuthCarData() |
| 318 | + // 获取认证费用 | ||
| 319 | + await getVerificationPrice() | ||
| 231 | }) | 320 | }) |
| 232 | </script> | 321 | </script> |
| 233 | 322 | ... | ... |
| 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-01 15:16:04 | 4 | + * @LastEditTime: 2025-08-04 09:58:48 |
| 5 | * @FilePath: /jgdl/src/pages/setAuthCar/index.vue | 5 | * @FilePath: /jgdl/src/pages/setAuthCar/index.vue |
| 6 | * @Description: 申请认证 | 6 | * @Description: 申请认证 |
| 7 | --> | 7 | --> |
| ... | @@ -132,7 +132,7 @@ | ... | @@ -132,7 +132,7 @@ |
| 132 | <!-- 底部按钮 --> | 132 | <!-- 底部按钮 --> |
| 133 | <view class="bottom-actions"> | 133 | <view class="bottom-actions"> |
| 134 | <nut-button color="#f97316" size="large" block @click="onSubmit"> | 134 | <nut-button color="#f97316" size="large" block @click="onSubmit"> |
| 135 | - {{ isEditMode ? '提交申请' : '提交申请' }} | 135 | + {{ isEditMode ? '提交申请并支付' : '提交申请并支付' }} |
| 136 | </nut-button> | 136 | </nut-button> |
| 137 | </view> | 137 | </view> |
| 138 | 138 | ... | ... |
-
Please register or login to post a comment