Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
meihua-island-book
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
2024-05-25 21:20:29 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
316d863bf6f73a858b479ab727803bb12040ff75
316d863b
1 parent
ad741da9
fix 取消订单操作失败操作优化
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletions
src/components/orderCard.vue
src/components/orderCard.vue
View file @
316d863
...
...
@@ -381,7 +381,7 @@ const cancelOrder = (id) => {
if (res.confirm) {
if (id) {
// 取消订单
const { code, data } = await orderCancelAPI({ id });
const { code, data
, msg
} = await orderCancelAPI({ id });
if (code) {
Taro.showToast({
title: "取消成功",
...
...
@@ -389,6 +389,15 @@ const cancelOrder = (id) => {
duration: 2000,
});
props.data.status = 2; // 取消订单状态置为已取消
} else {
// 通过状态文本查找状态code值
const key = Object.keys(STATUS_TEXT).find(key => STATUS_TEXT[key] === msg);
props.data.status = key; // 退款失败时,订单状态置为接口返回的状态
Taro.showToast({
title: "请刷新后再试",
icon: "error",
duration: 2000,
});
}
}
} else if (res.cancel) {
...
...
Please
register
or
login
to post a comment