Skip to content

Let's use AI to Earn!

feat: 提交提现接口

Nevinb06196f60c59
diff --git a/src/api/income.ts b/src/api/income.ts
index 6d32cf17..5a00c913 100644
--- a/src/api/income.ts
+++ b/src/api/income.ts
@@ -8,11 +8,25 @@ export const apiGetIncomeList = (page: {
pageNo: number;
pageSize: number;
}, params: {
- status?: number
+ type?: string
}) => {
return request<{ list: IncomeRecord[], tatol: number }>({
url: `income/list/${page.pageNo}/${page.pageSize}`,
method: 'GET',
params
});
+};
+
+/**
+ * 提交提现
+ */
+export const apiSubmitWithdraw = (incomeRecordId: string, flowId?: string) => {
+ return request<any>({
+ url: `income/withdraw`,
+ method: 'POST',
+ data: {
+ incomeRecordId,
+ flowId
+ }
+ });
};
\ No newline at end of file
diff --git a/src/api/withdraw.ts b/src/api/withdraw.ts
index dede5058..62a57159 100644
--- a/src/api/withdraw.ts
+++ b/src/api/withdraw.ts
@@ -10,4 +10,4 @@ export const apiGetWithdrawRecordList = (page: {pageNo: number, pageSize: number
method: 'GET',
params
});
-};
\ No newline at end of file
+};
diff --git a/src/app/[lng]/demo/demoIncome.tsx b/src/app/[lng]/demo/demoIncome.tsx
index f3320e53..04c97f8a 100644
--- a/src/app/[lng]/demo/demoIncome.tsx
+++ b/src/app/[lng]/demo/demoIncome.tsx
@@ -1,6 +1,6 @@
"use client";
-import { apiGetIncomeList } from "@/api/income";
-import { apiAcceptTask, apiSubmitTask } from "@/api/task";
+import { apiGetIncomeList, apiSubmitWithdraw } from "@/api/income";
+import { apiAcceptTask } from "@/api/task";
import { IncomeRecord } from "@/api/types/income";
import { apiGetWithdrawRecordList } from "@/api/withdraw";
import { useState } from "react";
@@ -16,9 +16,9 @@ export const DemoIncome = () => {
setResult(res.data.list);
}
- async function acceptTask(opportunityId: string) {
+ async function submitWithdraw(opportunityId: string) {
console.log(`----`, opportunityId);
- const res = await apiAcceptTask(opportunityId)
+ const res = await apiSubmitWithdraw(opportunityId)
console.log('----- res', res);
}
@@ -41,7 +41,7 @@ export const DemoIncome = () => {
{result.map((item) => (
<div key={item._id}>
<div>{item._id}</div>
- <button onClick={() => acceptTask(item._id)}>申请提现</button>
+ <button onClick={() => submitWithdraw(item._id)}>申请提现</button>
</div>
))}
</div>