Let's use AI to Earn!
TypeScript auto-publishdouyindouyin-apielectron-appelectron-reactkuaishoukwaipublishedshipinhaotoolxiaohongshu
feat: 添加操作图文store的demo
gaoSirf2a2c9b00477
diff --git a/src/views/publish/children/imagePage/page.tsx b/src/views/publish/children/imagePage/page.tsxindex c46d0864..91517ef6 100644--- a/src/views/publish/children/imagePage/page.tsx+++ b/src/views/publish/children/imagePage/page.tsx@@ -24,7 +24,6 @@ import { useAccountStore } from '../../../../store/commont';import { useNavigate } from 'react-router-dom';import { usePubStroe } from '../../../../store/pubStroe';import { ExclamationCircleFilled } from '@ant-design/icons';-import { AccountPlatInfoMap } from '../../../account/comment';const { confirm } = Modal;diff --git a/src/views/task/task.tsx b/src/views/task/task.tsxindex beb8c0d9..08ae8b5e 100644--- a/src/views/task/task.tsx+++ b/src/views/task/task.tsx@@ -7,19 +7,12 @@*/import { useState, useEffect, useRef } from 'react';import {- ShoppingCartOutlined,- ShareAltOutlined,- VideoCameraOutlined,HistoryOutlined,WalletOutlined,- FileTextOutlined,CommentOutlined,UserOutlined,ClockCircleOutlined,CheckCircleOutlined,- PictureOutlined,- LeftOutlined,- RightOutlined,} from '@ant-design/icons';import {Card,@@ -37,18 +30,13 @@ import {notification,Row,Col,- Divider,Carousel,} from 'antd';import { useInView } from 'react-intersection-observer';import styles from './task.module.scss';// 导入现有的任务组件-import CarTask from './carTask';-import PopTask from './popTask';-import VideoTask from './videoTask';import MineTask from './mineTask';-import ArticleTask from './articleTask';// import TaskInfo from './components/TaskInfo';import TaskInfo from './components/popInfo';// 移除 InteractionTask 导入@@ -77,6 +65,8 @@ import WxSphIcon from '../../assets/svgs/account/wx-sph.svg';import XhsIcon from '../../assets/svgs/account/xhs.svg';import DouyinIcon from '../../assets/svgs/account/douyin.svg';import logo from '@/assets/logo.png';+import { useImagePageStore } from '../publish/children/imagePage/useImagePageStore';+import { useShallow } from 'zustand/react/shallow';const { Title, Text } = Typography;@@ -273,7 +263,20 @@ export default function Task() {});};+ const { setCommonPubParams } = useImagePageStore(+ useShallow((state) => ({+ setCommonPubParams: state.setCommonPubParams,+ })),+ );+ // TODO 完善跳转逻辑const handleJoinTask = (task: any) => {+ setCommonPubParams({+ title: '标题',+ describe: '描述',+ topics: ['111', '222'],+ });+ navigate('/publish/image');+ return;setSelectedTask(task);// 根据任务类型选择不同的处理逻辑@@ -398,7 +401,7 @@ export default function Task() {console.log('pubList', pubList);console.log(accountListChoose);- let allAccount = accountListChoose?.length ? accountListChoose : account;+ const allAccount = accountListChoose?.length ? accountListChoose : account;console.log(allAccount);for (const account of allAccount) {