Skip to content

Let's use AI to Earn!

任务

daoyianfbde35f20bad
diff --git a/src/layout/SysMenu/index.tsx b/src/layout/SysMenu/index.tsx
index 0442f77a..417d3487 100644
--- a/src/layout/SysMenu/index.tsx
+++ b/src/layout/SysMenu/index.tsx
@@ -36,37 +36,37 @@ const App: React.FC = () => {
}, []);
const items: MenuProps['items'] = [
- {
- key: 'userInfo',
- label: (
- <div className="px-2 py-2">
- <div className="flex items-center space-x-2 mb-2">
- <UserOutlined className="text-[#a66ae4]" />
- <span className="text-gray-600">用户名:</span>
- <span className="text-gray-900 font-medium">
- {userStore.userInfo?.name || '-'}
- </span>
- </div>
- <div className="flex items-center space-x-2 mb-2">
- <IdcardOutlined className="text-[#a66ae4]" />
- <span className="text-gray-600">ID:</span>
- <span className="text-gray-900 font-medium">
- {userStore.userInfo?.id || '-'}
- </span>
- </div>
- <div className="flex items-center space-x-2">
- <PhoneOutlined className="text-[#a66ae4]" />
- <span className="text-gray-600">手机:</span>
- <span className="text-gray-900 font-medium">
- {userStore.userInfo?.phone || '-'}
- </span>
- </div>
- </div>
- ),
- },
- {
- type: 'divider',
- },
+ // {
+ // key: 'userInfo',
+ // label: (
+ // <div className="px-2 py-2">
+ // <div className="flex items-center space-x-2 mb-2">
+ // <UserOutlined className="text-[#a66ae4]" />
+ // <span className="text-gray-600">用户名:</span>
+ // <span className="text-gray-900 font-medium">
+ // {userStore.userInfo?.name || '-'}
+ // </span>
+ // </div>
+ // <div className="flex items-center space-x-2 mb-2">
+ // <IdcardOutlined className="text-[#a66ae4]" />
+ // <span className="text-gray-600">ID:</span>
+ // <span className="text-gray-900 font-medium">
+ // {userStore.userInfo?.id || '-'}
+ // </span>
+ // </div>
+ // <div className="flex items-center space-x-2">
+ // <PhoneOutlined className="text-[#a66ae4]" />
+ // <span className="text-gray-600">手机:</span>
+ // <span className="text-gray-900 font-medium">
+ // {userStore.userInfo?.phone || '-'}
+ // </span>
+ // </div>
+ // </div>
+ // ),
+ // },
+ // {
+ // type: 'divider',
+ // },
{
key: 'wallet',
label: (
@@ -138,7 +138,11 @@ const App: React.FC = () => {
overlayClassName="min-w-[240px]"
overlayStyle={{ marginTop: '8px' }}
>
- <div className={styles.sysMenu}>
+ <div
+ className={styles.sysMenu}
+ onClick={() => navigate('/user/mine')}
+ style={{ cursor: 'pointer' }}
+ >
<Image className="sysMenu-avatar" src={defaultAvatar} preview={false} />
</div>
</Dropdown>
diff --git a/src/router/index.tsx b/src/router/index.tsx
index 98ae97d1..05df4cf7 100644
--- a/src/router/index.tsx
+++ b/src/router/index.tsx
@@ -46,6 +46,8 @@ import AiRanking from '../views/aiTool/children/aiRanking/index';
import AiToolWebview from '../views/aiTool/children/aiToolWebview';
import ExpectedIncome from '@/views/finance/expectedIncome';
import Test from '@/views/test';
+import UserProfile from '@/views/user/mine/UserProfile';
+// import Test from '@/views/test';
interface IRouterMeta {
// 路由名称
@@ -163,6 +165,17 @@ export const router: CustomRouteObject[] = [
element: <Test />,
meta: { name: '测试', icon: ShopOutlined },
},
+ {
+ path: '/user',
+ children: [
+ { path: 'mine', element: <UserProfile /> },
+ ],
+ },
+ // {
+ // path: '/test',
+ // element: <Test />,
+ // meta: { name: '测试', icon: ShopOutlined },
+ // },
],
},
{ path: '/login', element: <Login /> },
diff --git a/src/views/login/components/qrcodeLogin.tsx b/src/views/login/components/qrcodeLogin.tsx
index 5cc90a06..9b4f5219 100644
--- a/src/views/login/components/qrcodeLogin.tsx
+++ b/src/views/login/components/qrcodeLogin.tsx
@@ -30,6 +30,7 @@ export default forwardRef<PubItemRef>((props, ref) => {
const [phoneForm] = Form.useForm();
const [openId, setOpenId] = useState('');
const [isFirstLogin, setIsFirstLogin] = useState(false);
+ const [inviteCode, setInviteCode] = useState('');
const userStore = useUserStore();
const navigate = useNavigate();
@@ -116,6 +117,7 @@ export default forwardRef<PubItemRef>((props, ref) => {
phone: values.phone,
code: values.code,
openId: openId,
+ inviteCode: values.inviteCode
});
if (res) {
@@ -198,29 +200,21 @@ export default forwardRef<PubItemRef>((props, ref) => {
label="手机号"
rules={[
{ required: true, message: '请输入手机号' },
- { pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号' },
+ { pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号' }
]}
>
<Input placeholder="请输入手机号" />
</Form.Item>
-
<Form.Item
name="code"
label="验证码"
rules={[
{ required: true, message: '请输入验证码' },
- { len: 6, message: '验证码长度为6位' },
+ { len: 6, message: '验证码长度为6位' }
]}
>
- <div
- style={{
- display: 'flex',
- alignItems: 'center',
- position: 'relative',
- }}
- >
+ <div style={{ display: 'flex', alignItems: 'center', position: 'relative' }}>
<Input placeholder="请输入验证码" style={{ flex: 1 }} />
- {/* <div style={{ marginLeft: '8px', width: '138px', backgroundColor: '#a66ae4', padding: '5px 0', borderRadius: '5px' }}> */}
<GetCode
onGetCode={async (unlock: () => void) => {
const validateRes = await phoneForm
@@ -239,18 +233,21 @@ export default forwardRef<PubItemRef>((props, ref) => {
}
}}
/>
- {/* </div> */}
</div>
</Form.Item>
-
+ <Form.Item
+ name="inviteCode"
+ label="邀请码"
+ rules={[{ required: true, message: '请输入邀请码' }]}
+ >
+ <Input
+ placeholder="请输入邀请码"
+ onChange={(e) => setInviteCode(e.target.value)}
+ />
+ </Form.Item>
<Form.Item>
- <Button
- type="primary"
- htmlType="submit"
- block
- style={{ marginTop: '10px' }}
- >
- 确认绑定
+ <Button type="primary" htmlType="submit" block>
+ 绑定手机号
</Button>
</Form.Item>
</Form>
diff --git a/src/views/task/interactionTask.tsx b/src/views/task/interactionTask.tsx
index b67e08b3..2d80f586 100644
--- a/src/views/task/interactionTask.tsx
+++ b/src/views/task/interactionTask.tsx
@@ -343,7 +343,7 @@ export default function InteractionTask() {
return (
<div className={styles.taskList}>
- <ChooseAccountModule
+ <ChooseAccountModule
open={chooseAccountOpen}
onClose={() => !downloading && setChooseAccountOpen(false)}
platChooseProps={{
diff --git a/src/views/task/task.tsx b/src/views/task/task.tsx
index 857d7e27..58ac4a52 100644
--- a/src/views/task/task.tsx
+++ b/src/views/task/task.tsx
@@ -123,6 +123,7 @@ export default function Task() {
totalCount: 0,
});
const [hasMore, setHasMore] = useState(true);
+ const [isOne, setIsOne] = useState(false);
const selectedTaskRef = useRef<any>(null);
const [selectedTask, setSelectedTask] = useState<any>(null);
const [modalVisible, setModalVisible] = useState(false);
@@ -266,10 +267,11 @@ export default function Task() {
);
// TODO 完善跳转逻辑
const handleJoinTask = (task: any) => {
- if (task.isAccepted) {
- setActiveTab('mine');
- return;
- }
+
+ // if (task.isAccepted) {
+ // setActiveTab('mine')
+ // return
+ // }
// setCommonPubParams({
// title: "标题1",
@@ -314,15 +316,24 @@ export default function Task() {
taskId: string;
} | null>(null);
+
+
/**
* 接受任务
*/
- async function taskApply() {
+ async function taskApply(params: any) {
+
+
+ // return;
// 00.00 测试
if (!selectedTask) return;
try {
- const res: any = await taskApi.taskApply<TaskVideo>(selectedTask?._id);
+ const res: any = await taskApi.taskApply<TaskVideo>(selectedTask?._id, {
+ account: params.account,
+ accountType: params.accountType,
+ uid: params.uid,
+ });
// const res: any = {
// code: 0,
@@ -357,13 +368,26 @@ export default function Task() {
message.error('接受任务失败,请稍后再试');
}
}
+
+ async function isoneFunc(params: any){
+ if (params) {
+ await setIsOne(true);
+ }else{
+ await setIsOne(false);
+ }
+ setChooseAccountOpen(true);
+ }
- async function taskApplyoney() {
+ async function taskApplyoney(params: any){
console.log('------ taskApplyoney', selectedTask);
if (!selectedTask) return;
try {
- const res: any = await taskApi.taskApply<TaskVideo>(selectedTask?._id);
+ const res: any = await taskApi.taskApply<TaskVideo>(selectedTask?._id, {
+ account: params.account,
+ accountType: params.accountType,
+ uid: params.uid,
+ });
// 存储任务记录信息 00.00
// console.log('jieshou :', res);
if (res.code == 0 && res.data) {
@@ -566,7 +590,25 @@ export default function Task() {
// 根据任务类型选择不同的处理逻辑
if (selectedTask?.type === TaskType.ARTICLE) {
// 文章任务使用 pubCore 逻辑
- await pubCore(aList[0]);
+ console.log('文章任务使用 pubCore 逻辑');
+ if (isOne) {
+ for (const account of aList) {
+ taskApplyoney({
+ account: account.account,
+ accountType: account.type,
+ uid: account.uid,
+ });
+ }
+ }else{
+ for (const account of aList) {
+ taskApply({
+ account: account.account,
+ accountType: account.type,
+ uid: account.uid,
+ });
+ }
+ }
+ // await pubCore(aList[0]);
} else {
// 其他任务使用原有的互动任务逻辑
await handleInteraction(aList[0]);
@@ -679,8 +721,9 @@ export default function Task() {
onClick={() => handleJoinTask(item)}
style={{ minWidth: '120px' }}
>
- {item.isAccepted ? '去完成任务' : '参与任务'}
- </Button>,
+ {/* {item.isAccepted ? '去完成任务' : '参与任务'} */}
+ 参与任务
+ </Button>,
]}
>
<Card.Meta
@@ -758,14 +801,14 @@ export default function Task() {
open={modalVisible}
onCancel={() => setModalVisible(false)}
footer={[
- <Button key="cancel" onClick={taskApplyoney}>
+ <Button key="cancel" onClick={() => isoneFunc(true)}>
领取
</Button>,
<Button
key="complete"
type="primary"
icon={<CheckCircleOutlined />}
- onClick={taskApply}
+ onClick={()=> { isoneFunc(false); }}
>
领取&发布
</Button>,