hookehuyr

feat(车辆管理): 更新车辆API操作类型参数

为车辆管理相关页面添加op参数,区分不同操作场景
- 卖车时使用review操作类型
- 认证时使用verification操作类型
- 普通编辑使用edit操作类型
同时更新车辆列表查询条件为review_status
<!--
* @Date: 2022-09-19 14:11:06
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-07-16 15:44:20
* @LastEditTime: 2025-07-16 15:59:35
* @FilePath: /jgdl/src/pages/myAuthCar/index.vue
* @Description: 我的认证车页面
-->
......
<!--
* @Date: 2022-09-19 14:11:06
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-07-16 15:43:55
* @LastEditTime: 2025-07-16 15:50:35
* @FilePath: /jgdl/src/pages/myCar/index.vue
* @Description: 文件描述
-->
......@@ -257,7 +257,7 @@ const fetchCarList = async (page = 0, append = false) => {
try {
// 调用真实API获取车辆列表
const response = await getMyListingVehicleAPI({ page, limit: pageSize.value, verification_status: 1 })
const response = await getMyListingVehicleAPI({ page, limit: pageSize.value, review_status: [1, 3, 5] })
if (response.code === 1) {
const { list, total } = response.data
......
......@@ -812,7 +812,8 @@ const convertScoreToText = (score, type) => {
}
const createCar = async (data) => {
const { code } = await addVehicleAPI({ ...data })
// 新增车辆,且卖车时,op=review,表示只申请卖车审核
const { code } = await addVehicleAPI({ ...data, op: 'review' })
if (code) {
Taro.hideLoading()
Taro.showToast({
......@@ -827,7 +828,9 @@ const createCar = async (data) => {
}
const updateCar = async (id, data) => {
const { code } = await editVehicleAPI({ id, ...data })
// 只编辑车辆时,op=edit,表示只编辑车辆信息
// 编辑车辆,且申请认证时,op=verification,表示申请认证
const { code } = await editVehicleAPI({ id, ...data, op: isAuthMode.value ? 'verification' : 'edit' })
if (code) {
Taro.hideLoading()
Taro.showToast({
......
<!--
* @Date: 2022-09-19 14:11:06
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-07-16 11:46:14
* @LastEditTime: 2025-07-16 15:57:39
* @FilePath: /jgdl/src/pages/setAuthCar/index.vue
* @Description: 申请认证
-->
......@@ -412,12 +412,14 @@ const onSubmit = async () => {
try {
// 调用真实API
if (isEditMode.value) {
const { code } = await editVehicleAPI({ id: carId.value, ...formData })
// 编辑车辆,且申请卖车时,op=review,表示申请卖车审核
const { code } = await editVehicleAPI({ id: carId.value, ...formData, op: 'review' })
if (!code) {
throw new Error('更新失败')
}
} else {
const { code } = await addVehicleAPI(formData)
// 新增车辆,且认证时,op=verification,表示只申请认证
const { code } = await addVehicleAPI({ ...formData, op: 'verification' })
if (!code) {
throw new Error('提交失败')
}
......