Skip to content

Let's use AI to Earn!

feat: 钱包相关

yikaJasonMicb718cabf9ce2
diff --git a/src/api/finance.ts b/src/api/finance.ts
index 1d0512f5..bd97330e 100644
--- a/src/api/finance.ts
+++ b/src/api/finance.ts
@@ -1,7 +1,7 @@
/*
* @Author: nevin
* @Date: 2025-02-22 12:02:55
- * @LastEditTime: 2025-02-28 13:30:09
+ * @LastEditTime: 2025-02-28 21:47:31
* @LastEditors: nevin
* @Description: 财务
*/
@@ -41,7 +41,7 @@ export const financeApi = {
* @returns
*/
getUserWalletAccountList() {
- return http.get<UserWalletAccount>(`/userWalletAccount/list`, {
+ return http.get<UserWalletAccount[]>(`/userWalletAccount/list`, {
isToken: true,
});
},
diff --git a/src/router/index.tsx b/src/router/index.tsx
index be4c4773..3ee12735 100644
--- a/src/router/index.tsx
+++ b/src/router/index.tsx
@@ -1,7 +1,7 @@
/*
* @Author: nevin
* @Date: 2025-02-10 22:20:15
- * @LastEditTime: 2025-02-27 19:46:42
+ * @LastEditTime: 2025-02-28 21:42:02
* @LastEditors: nevin
* @Description:
*/
@@ -45,6 +45,8 @@ import CarTask from '@/views/task/carTask';
import PopTask from '@/views/task/popTask';
import VideoTask from '@/views/task/videoTask';
import MineTask from '@/views/task/mineTask';
+import UserWalletAccount from '@/views/finance/userWalletAccount';
+import Finance from '@/views/finance/index';
interface IRouterMeta {
// 路由名称
@@ -78,27 +80,18 @@ export const router: CustomRouteObject[] = [
element: <LayoutBody />,
children: [
// 重定向 ---------
- {
- path: '/publish',
- element: <Navigate to="/publish/video" />,
- },
+ { path: '/publish', element: <Navigate to="/publish/video" /> },
// 路由 ----------
{
path: '/',
element: <Account />,
- meta: {
- name: '账户',
- icon: UserOutlined,
- },
+ meta: { name: '账户', icon: UserOutlined },
},
{
path: '/trending',
element: <Trending />,
- meta: {
- name: '热门内容',
- icon: FireOutlined,
- },
+ meta: { name: '热门内容', icon: FireOutlined },
},
// {
// path: '/about',
@@ -111,15 +104,9 @@ export const router: CustomRouteObject[] = [
{
path: '/publish',
element: <Publish />,
- meta: {
- name: '一键发布',
- icon: CopyOutlined,
- },
+ meta: { name: '一键发布', icon: CopyOutlined },
children: [
- {
- path: 'video',
- element: <VideoPage />,
- },
+ { path: 'video', element: <VideoPage /> },
// {
// path: 'image',
// element: <ImagePage />,
@@ -128,90 +115,51 @@ export const router: CustomRouteObject[] = [
// path: 'text',
// element: <TextPage />,
// },
- {
- path: 'pubRecord',
- element: <PubRecord />,
- },
- {
- path: 'drafts',
- element: <Drafts />,
- },
+ { path: 'pubRecord', element: <PubRecord /> },
+ { path: 'drafts', element: <Drafts /> },
],
},
{
path: '/statistics',
element: <Statistics />,
- meta: {
- name: '数据中心',
- icon: UserOutlined,
- },
+ meta: { name: '数据中心', icon: UserOutlined },
},
{
path: '/task',
element: <Task />,
- meta: {
- name: '任务市场',
- icon: UserOutlined,
- },
+ meta: { name: '任务市场', icon: UserOutlined },
children: [
- {
- path: 'car',
- element: <CarTask />,
- },
- {
- path: 'pop',
- element: <PopTask />,
- },
- {
- path: 'video',
- element: <VideoTask />,
- },
- {
- path: 'mine',
- element: <MineTask />,
- },
+ { path: 'car', element: <CarTask /> },
+ { path: 'pop', element: <PopTask /> },
+ { path: 'video', element: <VideoTask /> },
+ { path: 'mine', element: <MineTask /> },
+ ],
+ },
+ {
+ path: '/finance',
+ element: <Finance />,
+ meta: { name: '钱包', icon: UserOutlined },
+ children: [
+ { path: 'userWalletRecord', element: <UserWalletAccount /> },
+ { path: 'userWalletAccount', element: <UserWalletAccount /> },
],
},
{
path: '/ceshi',
element: <Test />,
- meta: {
- name: '测试',
- icon: UserOutlined,
- },
+ meta: { name: '测试', icon: UserOutlined },
children: [
- {
- path: 'video',
- element: <TestVideo />,
- },
- {
- path: 'douyin',
- element: <Douyin />,
- },
- {
- path: 'douyin2',
- element: <Douyin2 />,
- },
- {
- path: 'shipinhao',
- element: <Shipinhao />,
- },
- {
- path: 'xiaohongshu',
- element: <Xiaohongshu />,
- },
- {
- path: 'hotTopic',
- element: <HotTopic />,
- },
+ { path: 'video', element: <TestVideo /> },
+ { path: 'douyin', element: <Douyin /> },
+ { path: 'douyin2', element: <Douyin2 /> },
+ { path: 'shipinhao', element: <Shipinhao /> },
+ { path: 'xiaohongshu', element: <Xiaohongshu /> },
+ { path: 'hotTopic', element: <HotTopic /> },
],
},
],
},
- {
- path: '/login',
- element: <Login />,
- },
+ { path: '/login', element: <Login /> },
];
export default createHashRouter(router);
diff --git a/src/views/finance/components/addWalletAccount.tsx b/src/views/finance/components/addWalletAccount.tsx
new file mode 100644
index 00000000..e69de29b
diff --git a/src/views/finance/finance.module.scss b/src/views/finance/finance.module.scss
new file mode 100644
index 00000000..2abb36ea
--- /dev/null
+++ b/src/views/finance/finance.module.scss
@@ -0,0 +1,16 @@
+.publish {
+ width: 100%;
+ height: 100%;
+ display: flex;
+
+ :global {
+ .ant-segmented {
+ padding: 30px 10px;
+
+ .ant-segmented-item {
+ margin-bottom: 5px;
+ padding: 3px 40px 3px 0;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/views/finance/index.tsx b/src/views/finance/index.tsx
new file mode 100644
index 00000000..170325ef
--- /dev/null
+++ b/src/views/finance/index.tsx
@@ -0,0 +1,40 @@
+/*
+ * @Author: nevin
+ * @Date: 2025-02-10 22:20:15
+ * @LastEditTime: 2025-02-28 21:42:15
+ * @LastEditors: nevin
+ * @Description: 任务页面
+ */
+import { VideoCameraOutlined } from '@ant-design/icons';
+import { Segmented } from 'antd';
+import { Outlet, useNavigate } from 'react-router-dom';
+import styles from './finance.module.scss';
+
+export default function Page() {
+ const navigate = useNavigate();
+
+ return (
+ <div className={styles.publish}>
+ <Segmented
+ vertical
+ size="large"
+ options={[
+ {
+ label: '提现记录',
+ value: 'userWalletRecord',
+ icon: <VideoCameraOutlined />,
+ },
+ {
+ label: '钱包账户',
+ value: 'userWalletAccount',
+ icon: <VideoCameraOutlined />,
+ },
+ ]}
+ onChange={(value) => {
+ navigate(value);
+ }}
+ />
+ <Outlet />
+ </div>
+ );
+}
diff --git a/src/views/finance/userWalletAccount.tsx b/src/views/finance/userWalletAccount.tsx
new file mode 100644
index 00000000..28d7984b
--- /dev/null
+++ b/src/views/finance/userWalletAccount.tsx
@@ -0,0 +1,47 @@
+/*
+ * @Author: nevin
+ * @Date: 2025-02-10 22:20:15
+ * @LastEditTime: 2025-02-28 21:48:18
+ * @LastEditors: nevin
+ * @Description: 用户的钱包账户 userWalletAccount
+ */
+import { Button } from 'antd';
+import { useState, useEffect, useRef } from 'react';
+import { TaskInfoRef } from '../task/components/popInfo';
+import TaskInfo from '../task/components/popInfo';
+import { UserWalletAccount } from '@/api/types/userWalletAccount';
+import { financeApi } from '@/api/finance';
+
+export default function Page() {
+ const [walletAccountList, setWalletAccountList] = useState<
+ UserWalletAccount[]
+ >([]);
+
+ const Ref_TaskInfo = useRef<TaskInfoRef>(null);
+
+ async function getTaskList() {
+ const res = await financeApi.getUserWalletAccountList();
+ setWalletAccountList(res);
+ }
+
+ useEffect(() => {
+ getTaskList();
+ }, []);
+
+ return (
+ <div>
+ <TaskInfo ref={Ref_TaskInfo} />
+ <div>
+ ƒ{' '}
+ {walletAccountList.map((v) => {
+ return (
+ <div key={v.id}>
+ {v.phone}
+ <Button type="primary">查看</Button>
+ </div>
+ );
+ })}
+ </div>
+ </div>
+ );
+}
diff --git a/src/views/task/index.tsx b/src/views/task/index.tsx
index 0f5f3e4d..b7eabf97 100644
--- a/src/views/task/index.tsx
+++ b/src/views/task/index.tsx
@@ -1,7 +1,7 @@
/*
* @Author: nevin
* @Date: 2025-02-10 22:20:15
- * @LastEditTime: 2025-02-27 19:57:12
+ * @LastEditTime: 2025-02-28 21:36:53
* @LastEditors: nevin
* @Description: 任务页面
*/
@@ -19,22 +19,10 @@ export default function Page() {
vertical
size="large"
options={[
- {
- label: '挂车任务',
- value: 'car',
- icon: <VideoCameraOutlined />,
- },
- {
- label: '推广任务',
- value: 'pop',
- icon: <VideoCameraOutlined />,
- },
+ { label: '挂车任务', value: 'car', icon: <VideoCameraOutlined /> },
+ { label: '推广任务', value: 'pop', icon: <VideoCameraOutlined /> },
{ label: '视频任务', value: 'video', icon: <VideoCameraOutlined /> },
- {
- label: '已参与任务',
- value: 'mine',
- icon: <VideoCameraOutlined />,
- },
+ { label: '已参与任务', value: 'mine', icon: <VideoCameraOutlined /> },
]}
onChange={(value) => {
navigate(value);