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 22:46:30 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0a1e01a03c2f02cc46b1125b23952f83f2128bff
0a1e01a0
1 parent
316d863b
fix 处理退款中状态显示问题
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
10 deletions
src/api/fn.js
src/components/orderCard.vue
src/api/fn.js
View file @
0a1e01a
/*
* @Date: 2022-05-18 22:56:08
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-0
1-04 16:06:04
* @LastEditTime: 2024-0
5-25 22:35:00
* @FilePath: /meihuaApp/src/api/fn.js
* @Description: 文件描述
*/
...
...
@@ -17,7 +17,7 @@ import Taro from '@tarojs/taro'
export
const
fn
=
(
api
)
=>
{
return
api
.
then
(
res
=>
{
if
(
res
.
data
.
code
===
1
)
{
if
(
res
.
data
.
code
)
{
return
res
.
data
||
true
;
}
else
{
// tslint:disable-next-line: no-console
...
...
src/components/orderCard.vue
View file @
0a1e01a
...
...
@@ -381,21 +381,26 @@ const cancelOrder = (id) => {
if (res.confirm) {
if (id) {
// 取消订单
const { code, data, msg } = await orderCancelAPI({ id });
if (code) {
const { code } = await orderCancelAPI({ id });
// code=1退款成功/code=2退款中,都算取消成功
if (code === 1) {
Taro.showToast({
title: "取消成功",
icon: "success",
duration: 2000,
});
props.data.status = 2; // 取消订单状态置为已取消
} else {
// 通过状态文本查找状态code值
const key = Object.keys(STATUS_TEXT).find(key => STATUS_TEXT[key] === msg);
props.data.status = key; // 退款失败时,订单状态置为接口返回的状态
} else if (code === 2) {
Taro.showToast({
title: "请刷新后再试",
icon: "error",
title: "退款中,请稍后",
icon: "none",
duration: 2000,
});
props.data.status = 2; // 取消订单状态置为已取消
} else { // 退款失败
Taro.showToast({
title: `退款失败,请刷新后再试`,
icon: "none",
duration: 2000,
});
}
...
...
Please
register
or
login
to post a comment