Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
jgdl
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2025-07-10 17:40:59 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3896bff032484caca085e6aef464f82df5b649b4
3896bff0
1 parent
2d354ca9
fix(myCar): 修复车源状态切换时的提示消息不一致问题
修改状态切换逻辑,使用局部变量存储状态值,确保提示消息与操作一致。同时调整成功提示的显示方式和持续时间。
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
src/pages/myCar/index.vue
src/pages/myCar/index.vue
View file @
3896bff
<!--
* @Date: 2022-09-19 14:11:06
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-07-10 1
6:26:10
* @LastEditTime: 2025-07-10 1
7:40:19
* @FilePath: /jgdl/src/pages/myCar/index.vue
* @Description: 文件描述
-->
...
...
@@ -203,18 +203,21 @@ const toggleOffline = (car) => {
const confirmOffline = async () => {
if (currentOfflineCar.value) {
const car = currentOfflineCar.value
let status = car.status
if (car.status === 3) {
car.status = 5
status = 5
} else {
car.
status = 3
status = 3
}
// 调用API更新车源状态
const { code
} = await changeVehicleStatusAPI({ id: car.id, status: car.
status })
const { code
, msg } = await changeVehicleStatusAPI({ id: car.id, status:
status })
if (code) {
Taro.showToast({
title: car.status === 3 ? '已下架' : '已上架',
icon: 'success'
title: status === 5 ? '下架成功' : msg,
icon: 'none',
duration: 2000
})
}
}
...
...
Please
register
or
login
to post a comment