From eba5e3fa5479b9fe720cf79218496a009ff43f4f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=99=88=E7=8B=BC?= <2468023037@qq.com>
Date: Sun, 23 Feb 2025 00:08:41 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E9=A1=B5=E9=9D=A2=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/interceptor.ts | 2 +-
src/views/withdraw/index.vue | 85 +++++++++++++++++++++++++-----------
2 files changed, 61 insertions(+), 26 deletions(-)
diff --git a/src/api/interceptor.ts b/src/api/interceptor.ts
index ebad100..0353206 100644
--- a/src/api/interceptor.ts
+++ b/src/api/interceptor.ts
@@ -42,7 +42,7 @@ axios.interceptors.response.use(
// if the custom code is not 20000, it is judged as an error.
if (res.code !== 200) {
Message.error({
- content: res.msg || 'Error',
+ content: res.msg || res.message || 'Error',
duration: 5 * 1000,
});
console.log(response.status)
diff --git a/src/views/withdraw/index.vue b/src/views/withdraw/index.vue
index 40abfbb..0745467 100644
--- a/src/views/withdraw/index.vue
+++ b/src/views/withdraw/index.vue
@@ -75,7 +75,8 @@
- 审批
+ 拒绝
+ 同意
@@ -163,37 +164,71 @@ const handleTableChange = (page:number) => {
// queryParams.value.pageSize = pagination.pageSize;
// getAll();
// }
-const showConfirm = (record) => {
- Modal.confirm({
- title: '操作提醒',
- content: '是否同意该用户的提现申请',
- okText: '同意',
- cancelText: '拒绝',
- onOk: () => handleBlock(record),
- onCancel: () => handleNotBlock(record),
- });
-};
+// const showConfirm = (record) => {
+// Modal.confirm({
+// title: '操作提醒',
+// content: '是否同意该用户的提现申请',
+// okText: '同意',
+// cancelText: '拒绝',
+// onOk: () => handleBlock(record),
+// onCancel: () => handleNotBlock(record),
+// });
+// };
//同意提现
const handleBlock = async(record:any) => {
- record.type = 0;
- const res = await pushMoney(record);
- if(res.code === 200 ){
- reset();
- Message.success('操作成功')
- }else{
- Message.error(res.msg)
- }
+ Modal.confirm({
+ title: '操作提醒',
+ content: '是否确认该选择',
+ okText: '确认',
+ cancelText: '取消',
+ onOk: async () => {
+ record.type = 0;
+ const res = await pushMoney(record);
+ if (res.code === 200) {
+ reset();
+ Message.success('操作成功');
+ } else {
+ reset();
+ Message.error('操作失败');
+ }
+ },
+ onCancel: () => {
+ // 用户点击取消按钮时的操作(可选)
+ Message.info('操作已取消');
+ }
+ });
};
//不同意提现
const handleNotBlock = async(record:any) => {
- record.type = 1;
- const res = await pushMoney(record);
- if(res.code === 200 ){
- reset();
- Message.success('操作成功')
- }
+ Modal.confirm({
+ title: '操作提醒',
+ content: '是否确认该选择',
+ okText: '确认',
+ cancelText: '取消',
+ onOk: async () => {
+ record.type = 1;
+ const res = await pushMoney(record);
+ if (res.code === 200) {
+ reset();
+ Message.success('操作成功');
+ } else {
+ reset();
+ Message.error('操作失败');
+ }
+ },
+ onCancel: () => {
+ // 用户点击取消按钮时的操作(可选)
+ Message.info('操作已取消');
+ }
+ });
+
+ // const res = await pushMoney(record);
+ // if(res.code === 200 ){
+ // reset();
+ // Message.success('操作成功')
+ // }
};
//显示合计