Let's use AI to Earn!
TypeScript auto-publishdouyindouyin-apielectron-appelectron-reactkuaishoukwaipublishedshipinhaotoolxiaohongshu
打印和便利
DESKTOP-EMF2SH4\Administratorfc1840faff80
diff --git a/src/views/statistics/index.tsx b/src/views/statistics/index.tsxindex 5398094b..eecc68de 100644--- a/src/views/statistics/index.tsx+++ b/src/views/statistics/index.tsx@@ -274,7 +274,6 @@ const Statistics = () => {async function getAccountStatistics() {setDashboardData([]);const res: StatisticsInfo = await icpGetAccountStatistics();- console.log('res@@@:', res);setStatisticsInfo(res);// 获取到账号列表后,遍历获取每个账号的看板数据if (res.list && res.list.length > 0) {@@ -330,7 +329,6 @@ const Statistics = () => {*/async function getAccountDashboard(id: number) {const res = await icpGetAccountDashboard(id);- console.log('res$$$:', res);return res;}diff --git a/src/views/task/components/withdraw.tsx b/src/views/task/components/withdraw.tsxindex 627e1274..6945cb11 100644--- a/src/views/task/components/withdraw.tsx+++ b/src/views/task/components/withdraw.tsx@@ -5,7 +5,7 @@* @LastEditors: nevin* @Description: 任务提现*/-import { Button, Modal } from 'antd';+import { Button, Modal, Card, Typography, Space, message, Tag } from 'antd';import {Task,TaskProduct,@@ -15,8 +15,6 @@ import {} from '@@/types/task';import { forwardRef, useImperativeHandle, useState } from 'react';import { taskApi } from '@/api/task';-import { financeApi } from '@/api/finance';-import { UserWalletAccount } from '@/api/types/userWalletAccount';import { UserTask } from '@/api/types/task';export interface WithdrawRef {@@ -27,16 +25,16 @@ export interface WithdrawRef {const Com = forwardRef<WithdrawRef>((props: any, ref) => {const [isModalOpen, setIsModalOpen] = useState(false);- const [accountList, setAccountList] = useState<UserWalletAccount[]>([]);- const [account, setAccount] = useState<UserWalletAccount | null>();const [taskInfo, setTaskInfo] = useState<UserTask<Task<TaskProduct | TaskPromotion | TaskVideo>> | null>();+ const [loading, setLoading] = useState(false);++ const { Title, Text, Paragraph } = Typography;async function init(inTaskInfo: UserTask<Task<TaskProduct | TaskPromotion | TaskVideo>>,) {- await getAccountList();setTaskInfo(inTaskInfo);setIsModalOpen(true);}@@ -45,72 +43,113 @@ const Com = forwardRef<WithdrawRef>((props: any, ref) => {init: init,}));- async function getAccountList() {- if (!taskInfo) return;-- const res = await financeApi.getUserWalletAccountList();-- setAccountList(res);- setIsModalOpen(false);- }-/**- * 接受任务+ * 提交提现申请*/- async function withdraw() {- if (!taskInfo || !account) return;+ async function submitWithdraw() {+ if (!taskInfo) return;- const res = await taskApi.withdraw(taskInfo.id, account.id);- setIsModalOpen(false);+ setLoading(true);+ try {+ const res = await taskApi.withdraw(taskInfo.id);+ message.success('提现申请已提交');+ setIsModalOpen(false);+ } catch (error) {+ message.error('提交失败,请稍后重试');+ } finally {+ setLoading(false);+ }}const handleCancel = () => {setIsModalOpen(false);};+ // 获取任务支持的账户类型标签+ const renderAccountTypeTags = () => {+ const accountTypes = taskInfo?.taskId.accountTypes || [];+ if (accountTypes.length === 0) return null;++ return (+ <Space size={[0, 8]} wrap>+ <Text style={{ marginRight: 8 }}>支持账户类型:</Text>+ {accountTypes.map(type => (+ <Tag color="blue" key={type}>+ {type.toUpperCase()}+ </Tag>+ ))}+ </Space>+ );+ };+return (<><Modal- title="任务提现"+ title={<Title level={4}>任务提现申请</Title>}open={isModalOpen}onCancel={handleCancel}+ width={500}footer={[<Button key="back" onClick={handleCancel}>取消</Button>,- <Button key="submit" type="primary" onClick={withdraw}>- 提现+ <Button+ key="submit"+ type="primary"+ onClick={submitWithdraw}+ loading={loading}+ >+ 提交申请</Button>,]}>- <div>- <div>- <p>钱包列表:</p>- {accountList.map((item) => (- <div key={item.id}>- <p>手机号:{item.phone}</p>- <p>账户号:{item.account}</p>- <p>钱包类型:{item.type}</p>- <Button type="primary" onClick={() => setAccount(item)}>- 选择- </Button>- </div>- ))}- </div>- </div>- <div>- {taskInfo ? (- <div>- <p>任务标题:{taskInfo.taskId.title}</p>- <p>任务描述:{taskInfo.taskId.description}</p>- <p>任务类型:{TaskTypeName.get(taskInfo.taskId.type)}</p>- <p>任务图片:{taskInfo.taskId.imageUrl}</p>- <p>任务奖励金额:{taskInfo.taskId.reward}</p>- </div>- ) : (- <div>暂无任务信息</div>- )}- </div>+ <Space direction="vertical" size="large" style={{ width: '100%' }}>+ {/* 提现金额信息卡片 */}+ <Card+ style={{+ backgroundColor: '#f5f5f5',+ borderRadius: '8px'+ }}+ >+ <Space direction="vertical" size="small">+ <Text>任务标题:{taskInfo?.taskId.title || '暂无'}</Text>+ <Space>+ <Text>提现金额:</Text>+ <Text style={{+ fontSize: '24px',+ fontWeight: 'bold',+ color: '#1890ff'+ }}>+ ¥{taskInfo?.taskId.reward || 0}+ </Text>+ </Space>+ <Text type="secondary">+ 任务类型:{taskInfo?.taskId.type ? TaskTypeName.get(taskInfo.taskId.type) : '暂无'}+ </Text>+ {taskInfo?.verificationNote && (+ <Paragraph type="secondary" style={{ marginTop: 8 }}>+ 审核备注:{taskInfo.verificationNote}+ </Paragraph>+ )}+ </Space>+ </Card>++ {/* 提现说明 */}+ <Card>+ <Space direction="vertical">+ <Text strong>提现说明</Text>+ <Text type="secondary">+ 1. 提交申请后,系统将审核您的资金情况+ </Text>+ <Text type="secondary">+ 2. 审核通过后,奖励将自动发放到您的账户钱包+ </Text>+ <Text type="secondary">+ 3. 账户钱包余额可提现到支付宝+ </Text>+ </Space>+ </Card>+ </Space></Modal></>);diff --git a/src/views/task/mineTask.module.scss b/src/views/task/mineTask.module.scssindex ce3089e7..1d82ab61 100644--- a/src/views/task/mineTask.module.scss+++ b/src/views/task/mineTask.module.scss@@ -171,12 +171,12 @@.withdrawButton {width: 100%;- background-color: #ff4d4f;- border-color: #ff4d4f;+ background-color: #a66ae4;+ border-color: #a66ae4;&:hover {- background-color: #ff7875;- border-color: #ff7875;+ background-color: #a66ae4;+ border-color: #a66ae4;}}diff --git a/src/views/task/mineTask.tsx b/src/views/task/mineTask.tsxindex e4096583..9bca4275 100644--- a/src/views/task/mineTask.tsx+++ b/src/views/task/mineTask.tsx@@ -428,10 +428,16 @@ export default function Page() {<Buttontype="primary"danger- className={styles.withdrawButton}+ className={styles.withdrawButton}+ style={{+ backgroundColor: '#a66ae4',+ borderColor: '#a66ae4',+ color: 'white',+ marginBottom: '10px',+ }}onClick={() => withdraw(task)}>- 提现+ 申请提现 <RightOutlined /></Button>)}