feat(车辆管理): 更新车辆API操作类型参数
为车辆管理相关页面添加op参数,区分不同操作场景 - 卖车时使用review操作类型 - 认证时使用verification操作类型 - 普通编辑使用edit操作类型 同时更新车辆列表查询条件为review_status
Showing
4 changed files
with
13 additions
and
8 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-07-16 15:44:20 | 4 | + * @LastEditTime: 2025-07-16 15:59:35 |
| 5 | * @FilePath: /jgdl/src/pages/myAuthCar/index.vue | 5 | * @FilePath: /jgdl/src/pages/myAuthCar/index.vue |
| 6 | * @Description: 我的认证车页面 | 6 | * @Description: 我的认证车页面 |
| 7 | --> | 7 | --> | ... | ... |
| 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-16 15:43:55 | 4 | + * @LastEditTime: 2025-07-16 15:50:35 |
| 5 | * @FilePath: /jgdl/src/pages/myCar/index.vue | 5 | * @FilePath: /jgdl/src/pages/myCar/index.vue |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | --> | 7 | --> |
| ... | @@ -257,7 +257,7 @@ const fetchCarList = async (page = 0, append = false) => { | ... | @@ -257,7 +257,7 @@ const fetchCarList = async (page = 0, append = false) => { |
| 257 | 257 | ||
| 258 | try { | 258 | try { |
| 259 | // 调用真实API获取车辆列表 | 259 | // 调用真实API获取车辆列表 |
| 260 | - const response = await getMyListingVehicleAPI({ page, limit: pageSize.value, verification_status: 1 }) | 260 | + const response = await getMyListingVehicleAPI({ page, limit: pageSize.value, review_status: [1, 3, 5] }) |
| 261 | 261 | ||
| 262 | if (response.code === 1) { | 262 | if (response.code === 1) { |
| 263 | const { list, total } = response.data | 263 | const { list, total } = response.data | ... | ... |
| ... | @@ -812,7 +812,8 @@ const convertScoreToText = (score, type) => { | ... | @@ -812,7 +812,8 @@ const convertScoreToText = (score, type) => { |
| 812 | } | 812 | } |
| 813 | 813 | ||
| 814 | const createCar = async (data) => { | 814 | const createCar = async (data) => { |
| 815 | - const { code } = await addVehicleAPI({ ...data }) | 815 | + // 新增车辆,且卖车时,op=review,表示只申请卖车审核 |
| 816 | + const { code } = await addVehicleAPI({ ...data, op: 'review' }) | ||
| 816 | if (code) { | 817 | if (code) { |
| 817 | Taro.hideLoading() | 818 | Taro.hideLoading() |
| 818 | Taro.showToast({ | 819 | Taro.showToast({ |
| ... | @@ -827,7 +828,9 @@ const createCar = async (data) => { | ... | @@ -827,7 +828,9 @@ const createCar = async (data) => { |
| 827 | } | 828 | } |
| 828 | 829 | ||
| 829 | const updateCar = async (id, data) => { | 830 | const updateCar = async (id, data) => { |
| 830 | - const { code } = await editVehicleAPI({ id, ...data }) | 831 | + // 只编辑车辆时,op=edit,表示只编辑车辆信息 |
| 832 | + // 编辑车辆,且申请认证时,op=verification,表示申请认证 | ||
| 833 | + const { code } = await editVehicleAPI({ id, ...data, op: isAuthMode.value ? 'verification' : 'edit' }) | ||
| 831 | if (code) { | 834 | if (code) { |
| 832 | Taro.hideLoading() | 835 | Taro.hideLoading() |
| 833 | Taro.showToast({ | 836 | Taro.showToast({ | ... | ... |
| 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-16 11:46:14 | 4 | + * @LastEditTime: 2025-07-16 15:57:39 |
| 5 | * @FilePath: /jgdl/src/pages/setAuthCar/index.vue | 5 | * @FilePath: /jgdl/src/pages/setAuthCar/index.vue |
| 6 | * @Description: 申请认证 | 6 | * @Description: 申请认证 |
| 7 | --> | 7 | --> |
| ... | @@ -412,12 +412,14 @@ const onSubmit = async () => { | ... | @@ -412,12 +412,14 @@ const onSubmit = async () => { |
| 412 | try { | 412 | try { |
| 413 | // 调用真实API | 413 | // 调用真实API |
| 414 | if (isEditMode.value) { | 414 | if (isEditMode.value) { |
| 415 | - const { code } = await editVehicleAPI({ id: carId.value, ...formData }) | 415 | + // 编辑车辆,且申请卖车时,op=review,表示申请卖车审核 |
| 416 | + const { code } = await editVehicleAPI({ id: carId.value, ...formData, op: 'review' }) | ||
| 416 | if (!code) { | 417 | if (!code) { |
| 417 | throw new Error('更新失败') | 418 | throw new Error('更新失败') |
| 418 | } | 419 | } |
| 419 | } else { | 420 | } else { |
| 420 | - const { code } = await addVehicleAPI(formData) | 421 | + // 新增车辆,且认证时,op=verification,表示只申请认证 |
| 422 | + const { code } = await addVehicleAPI({ ...formData, op: 'verification' }) | ||
| 421 | if (!code) { | 423 | if (!code) { |
| 422 | throw new Error('提交失败') | 424 | throw new Error('提交失败') |
| 423 | } | 425 | } | ... | ... |
-
Please register or login to post a comment