diff --git a/README.md b/README.md index 554b5ed..10a552c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@
- muxiK-StackFrontend2.0 logo + muxiK-StackFrontend2.0 logo

muxiK-StackFrontend2.0

muxiK-StackFrontend2.0

探索项目文档 » diff --git a/src/app.config.ts b/src/app.config.ts index fa2666e..776af9a 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -1,9 +1,8 @@ export default defineAppConfig({ pages: [ - 'pages/questionList/index', - 'pages/questionInfo/index', 'pages/login/index', 'pages/main/index', + 'pages/publishQuestion/index', 'pages/classInfo/index', 'pages/evaluateInfo/index', 'pages/profile/index', @@ -11,11 +10,11 @@ export default defineAppConfig({ 'pages/notification/index', 'pages/feedback/index', 'pages/evaluate/evaluate', + 'pages/questionInfo/index', 'pages/myclass/myclass', 'pages/research/research', 'pages/index/index', 'pages/editUser/index', - 'pages/publishQuestion/index', ], subpackages: [ { diff --git a/src/auto-imports.d.ts b/src/auto-imports.d.ts index 985f2e1..28514c4 100644 --- a/src/auto-imports.d.ts +++ b/src/auto-imports.d.ts @@ -3,77 +3,77 @@ // @ts-nocheck // noinspection JSUnusedGlobalSymbols // Generated by unplugin-auto-import -export { } +export {} declare global { - const useAPICheck: (typeof import('taro-hooks'))['useAPICheck']; - const useAccountInfo: (typeof import('taro-hooks'))['useAccountInfo']; - const useActionSheet: (typeof import('taro-hooks'))['useActionSheet']; - const useAlertBeforeUnload: (typeof import('taro-hooks'))['useAlertBeforeUnload']; - const useApp: (typeof import('taro-hooks'))['useApp']; - const useArrayBuffer: (typeof import('taro-hooks'))['useArrayBuffer']; - const useAudio: (typeof import('taro-hooks'))['useAudio']; - const useAuthorize: (typeof import('taro-hooks'))['useAuthorize']; - const useBackground: (typeof import('taro-hooks'))['useBackground']; - const useBattery: (typeof import('taro-hooks'))['useBattery']; - const useBluetooth: (typeof import('taro-hooks'))['useBluetooth']; - const useBoolean: (typeof import('taro-hooks'))['useBoolean']; - const useBrightness: (typeof import('taro-hooks'))['useBrightness']; - const useCamera: (typeof import('taro-hooks'))['useCamera']; - const useChooseAddress: (typeof import('taro-hooks'))['useChooseAddress']; - const useClipboardData: (typeof import('taro-hooks'))['useClipboardData']; - const useCreation: (typeof import('taro-hooks'))['useCreation']; - const useDebounce: (typeof import('taro-hooks'))['useDebounce']; - const useDebounceFn: (typeof import('taro-hooks'))['useDebounceFn']; - const useDeviceInfo: (typeof import('taro-hooks'))['useDeviceInfo']; - const useEnterOptions: (typeof import('taro-hooks'))['useEnterOptions']; - const useEnv: (typeof import('taro-hooks'))['useEnv']; - const useEvent: (typeof import('taro-hooks'))['useEvent']; - const useFile: (typeof import('taro-hooks'))['useFile']; - const useFrom: (typeof import('taro-hooks'))['useFrom']; - const useImage: (typeof import('taro-hooks'))['useImage']; - const useInvoice: (typeof import('taro-hooks'))['useInvoice']; - const useKeyboard: (typeof import('taro-hooks'))['useKeyboard']; - const useLatest: (typeof import('taro-hooks'))['useLatest']; - const useLaunchOptions: (typeof import('taro-hooks'))['useLaunchOptions']; - const useLoading: (typeof import('taro-hooks'))['useLoading']; - const useLocation: (typeof import('taro-hooks'))['useLocation']; - const useLogin: (typeof import('taro-hooks'))['useLogin']; - const useManualPullDownRefresh: (typeof import('taro-hooks'))['useManualPullDownRefresh']; - const useMap: (typeof import('taro-hooks'))['useMap']; - const useMemoizedFn: (typeof import('taro-hooks'))['useMemoizedFn']; - const useMenuButtonBoundingClientRect: (typeof import('taro-hooks'))['useMenuButtonBoundingClientRect']; - const useModal: (typeof import('taro-hooks'))['useModal']; - const useMotion: (typeof import('taro-hooks'))['useMotion']; - const useMount: (typeof import('taro-hooks'))['useMount']; - const useNavigationBar: (typeof import('taro-hooks'))['useNavigationBar']; - const useNetworkType: (typeof import('taro-hooks'))['useNetworkType']; - const useOnline: (typeof import('taro-hooks'))['useOnline']; - const usePage: (typeof import('taro-hooks'))['usePage']; - const usePreload: (typeof import('taro-hooks'))['usePreload']; - const usePromise: (typeof import('taro-hooks'))['usePromise']; - const useRecord: (typeof import('taro-hooks'))['useRecord']; - const useRequest: (typeof import('taro-hooks'))['useRequest']; - const useRequestSubscribeMessage: (typeof import('taro-hooks'))['useRequestSubscribeMessage']; - const useRouter: (typeof import('taro-hooks'))['useRouter']; - const useScanCode: (typeof import('taro-hooks'))['useScanCode']; - const useSelectorQuery: (typeof import('taro-hooks'))['useSelectorQuery']; - const useStorage: (typeof import('taro-hooks'))['useStorage']; - const useSystemInfo: (typeof import('taro-hooks'))['useSystemInfo']; - const useTabBar: (typeof import('taro-hooks'))['useTabBar']; - const useThrottle: (typeof import('taro-hooks'))['useThrottle']; - const useThrottleFn: (typeof import('taro-hooks'))['useThrottleFn']; - const useToast: (typeof import('taro-hooks'))['useToast']; - const useToggle: (typeof import('taro-hooks'))['useToggle']; - const useTopBarText: (typeof import('taro-hooks'))['useTopBarText']; - const useUnmount: (typeof import('taro-hooks'))['useUnmount']; - const useUpdate: (typeof import('taro-hooks'))['useUpdate']; - const useUpdateEffect: (typeof import('taro-hooks'))['useUpdateEffect']; - const useUpdateManager: (typeof import('taro-hooks'))['useUpdateManager']; - const useUserInfo: (typeof import('taro-hooks'))['useUserInfo']; - const useVibrate: (typeof import('taro-hooks'))['useVibrate']; - const useVideo: (typeof import('taro-hooks'))['useVideo']; - const useVisible: (typeof import('taro-hooks'))['useVisible']; - const useWeRun: (typeof import('taro-hooks'))['useWeRun']; - const useWebp: (typeof import('taro-hooks'))['useWebp']; - const useWindowInfo: (typeof import('taro-hooks'))['useWindowInfo']; + const useAPICheck: typeof import('taro-hooks')['useAPICheck'] + const useAccountInfo: typeof import('taro-hooks')['useAccountInfo'] + const useActionSheet: typeof import('taro-hooks')['useActionSheet'] + const useAlertBeforeUnload: typeof import('taro-hooks')['useAlertBeforeUnload'] + const useApp: typeof import('taro-hooks')['useApp'] + const useArrayBuffer: typeof import('taro-hooks')['useArrayBuffer'] + const useAudio: typeof import('taro-hooks')['useAudio'] + const useAuthorize: typeof import('taro-hooks')['useAuthorize'] + const useBackground: typeof import('taro-hooks')['useBackground'] + const useBattery: typeof import('taro-hooks')['useBattery'] + const useBluetooth: typeof import('taro-hooks')['useBluetooth'] + const useBoolean: typeof import('taro-hooks')['useBoolean'] + const useBrightness: typeof import('taro-hooks')['useBrightness'] + const useCamera: typeof import('taro-hooks')['useCamera'] + const useChooseAddress: typeof import('taro-hooks')['useChooseAddress'] + const useClipboardData: typeof import('taro-hooks')['useClipboardData'] + const useCreation: typeof import('taro-hooks')['useCreation'] + const useDebounce: typeof import('taro-hooks')['useDebounce'] + const useDebounceFn: typeof import('taro-hooks')['useDebounceFn'] + const useDeviceInfo: typeof import('taro-hooks')['useDeviceInfo'] + const useEnterOptions: typeof import('taro-hooks')['useEnterOptions'] + const useEnv: typeof import('taro-hooks')['useEnv'] + const useEvent: typeof import('taro-hooks')['useEvent'] + const useFile: typeof import('taro-hooks')['useFile'] + const useFrom: typeof import('taro-hooks')['useFrom'] + const useImage: typeof import('taro-hooks')['useImage'] + const useInvoice: typeof import('taro-hooks')['useInvoice'] + const useKeyboard: typeof import('taro-hooks')['useKeyboard'] + const useLatest: typeof import('taro-hooks')['useLatest'] + const useLaunchOptions: typeof import('taro-hooks')['useLaunchOptions'] + const useLoading: typeof import('taro-hooks')['useLoading'] + const useLocation: typeof import('taro-hooks')['useLocation'] + const useLogin: typeof import('taro-hooks')['useLogin'] + const useManualPullDownRefresh: typeof import('taro-hooks')['useManualPullDownRefresh'] + const useMap: typeof import('taro-hooks')['useMap'] + const useMemoizedFn: typeof import('taro-hooks')['useMemoizedFn'] + const useMenuButtonBoundingClientRect: typeof import('taro-hooks')['useMenuButtonBoundingClientRect'] + const useModal: typeof import('taro-hooks')['useModal'] + const useMotion: typeof import('taro-hooks')['useMotion'] + const useMount: typeof import('taro-hooks')['useMount'] + const useNavigationBar: typeof import('taro-hooks')['useNavigationBar'] + const useNetworkType: typeof import('taro-hooks')['useNetworkType'] + const useOnline: typeof import('taro-hooks')['useOnline'] + const usePage: typeof import('taro-hooks')['usePage'] + const usePreload: typeof import('taro-hooks')['usePreload'] + const usePromise: typeof import('taro-hooks')['usePromise'] + const useRecord: typeof import('taro-hooks')['useRecord'] + const useRequest: typeof import('taro-hooks')['useRequest'] + const useRequestSubscribeMessage: typeof import('taro-hooks')['useRequestSubscribeMessage'] + const useRouter: typeof import('taro-hooks')['useRouter'] + const useScanCode: typeof import('taro-hooks')['useScanCode'] + const useSelectorQuery: typeof import('taro-hooks')['useSelectorQuery'] + const useStorage: typeof import('taro-hooks')['useStorage'] + const useSystemInfo: typeof import('taro-hooks')['useSystemInfo'] + const useTabBar: typeof import('taro-hooks')['useTabBar'] + const useThrottle: typeof import('taro-hooks')['useThrottle'] + const useThrottleFn: typeof import('taro-hooks')['useThrottleFn'] + const useToast: typeof import('taro-hooks')['useToast'] + const useToggle: typeof import('taro-hooks')['useToggle'] + const useTopBarText: typeof import('taro-hooks')['useTopBarText'] + const useUnmount: typeof import('taro-hooks')['useUnmount'] + const useUpdate: typeof import('taro-hooks')['useUpdate'] + const useUpdateEffect: typeof import('taro-hooks')['useUpdateEffect'] + const useUpdateManager: typeof import('taro-hooks')['useUpdateManager'] + const useUserInfo: typeof import('taro-hooks')['useUserInfo'] + const useVibrate: typeof import('taro-hooks')['useVibrate'] + const useVideo: typeof import('taro-hooks')['useVideo'] + const useVisible: typeof import('taro-hooks')['useVisible'] + const useWeRun: typeof import('taro-hooks')['useWeRun'] + const useWebp: typeof import('taro-hooks')['useWebp'] + const useWindowInfo: typeof import('taro-hooks')['useWindowInfo'] } diff --git a/src/common/components/CourseInfo/CourseInfo.tsx b/src/common/components/CourseInfo/CourseInfo.tsx index 4645574..093d2f0 100644 --- a/src/common/components/CourseInfo/CourseInfo.tsx +++ b/src/common/components/CourseInfo/CourseInfo.tsx @@ -1,5 +1,6 @@ import { View } from '@tarojs/components'; import React from 'react'; + import './index.scss'; interface ICourseInfoProps { diff --git a/src/common/components/PublishHeader/PublishHeader.tsx b/src/common/components/PublishHeader/PublishHeader.tsx index e22b361..8e1c804 100644 --- a/src/common/components/PublishHeader/PublishHeader.tsx +++ b/src/common/components/PublishHeader/PublishHeader.tsx @@ -1,5 +1,6 @@ import { Image, Text, View } from '@tarojs/components'; import React from 'react'; + import './index.scss'; interface IPublishHeaderProps { diff --git a/src/common/components/iconfont/index.tsx b/src/common/components/iconfont/index.tsx index edb6bb9..76efc3e 100644 --- a/src/common/components/iconfont/index.tsx +++ b/src/common/components/iconfont/index.tsx @@ -1,5 +1,4 @@ /* tslint:disable */ -/* eslint-disable */ import React, { FunctionComponent } from 'react'; diff --git a/src/modules/profile/components/Header.tsx b/src/modules/profile/components/Header.tsx index 0e69f03..c1af66b 100644 --- a/src/modules/profile/components/Header.tsx +++ b/src/modules/profile/components/Header.tsx @@ -35,6 +35,7 @@ const Header: React.FC = memo(() => { }; // eslint-disable-next-line @typescript-eslint/no-unsafe-return return (title: string) => titleMap[title] || title; + // todo 刷新方式 }, []); useEffect(() => { diff --git a/src/pages/classInfo/index.tsx b/src/pages/classInfo/index.tsx index 2cb2638..e50a9cf 100644 --- a/src/pages/classInfo/index.tsx +++ b/src/pages/classInfo/index.tsx @@ -9,15 +9,13 @@ import { useEffect, useState } from 'react'; import './index.scss'; -// import echarts from '../../common/assets/js/echarts'; -// import Charts from '@/common/components/chart'; +import { CommentInfoType, Course } from '@/common/assets/types'; import { Comment } from '@/common/components'; +import LineChart from '@/common/components/chart'; import Label3 from '@/common/components/label3/label3'; import ShowStar from '@/common/components/showStar/showStar'; import { get } from '@/common/utils/fetch'; -import { CommentInfoType, Course } from '../../common/assets/types'; - // import { useRef } from 'react'; // import Echarts, { EChartOption, EchartsHandle } from 'taro-react-echarts'; // 定义接口 @@ -129,10 +127,12 @@ export default function Index() { ))} + {/*<>*/} + + + + {/**/} - {/* */} - - {/* */} {comments && comments.map((comment) => ( ); } - -// function Demo() { -// const echartsRef = useRef(null); -// const option: EChartOption = { -// legend: { -// top: 50, -// left: 'center', -// z: 100, -// }, -// tooltip: { -// trigger: 'axis', -// show: true, -// confine: true, -// }, -// xAxis: { -// type: 'category', -// data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], -// }, -// yAxis: { -// type: 'value', -// }, -// series: [ -// { -// data: [150, 230, 224, 218, 135, 147, 260], -// type: 'line', -// }, -// ], -// }; - -// return ; -// } diff --git a/src/pages/editUser/index.scss b/src/pages/editUser/index.scss index 273d191..13363f5 100644 --- a/src/pages/editUser/index.scss +++ b/src/pages/editUser/index.scss @@ -84,3 +84,8 @@ background: #f19900; color: white; } +.logout-button { + margin-top: 10vw; + width: 40vw; + height: 10vh; +} diff --git a/src/pages/editUser/index.tsx b/src/pages/editUser/index.tsx index 84253e2..838ada7 100644 --- a/src/pages/editUser/index.tsx +++ b/src/pages/editUser/index.tsx @@ -105,7 +105,21 @@ const EditUser: React.FC = () => { setSelectedTitle(title); } }; - + // Taro.redirectTo({url:'pages/login/index'}); + const handleLogout = () => { + void post('/users/logout', {}, true).then((res) => console.log(res)); + void Taro.removeStorage({ + key: 'shortToken', + success: (res) => console.log(res), + fail: (err) => console.log(err), + }); + void Taro.removeStorage({ + key: 'longToken', + success: (res) => console.log(res), + fail: (err) => console.log(err), + }); + void Taro.redirectTo({ url: '/pages/login/index' }); + }; return ( @@ -168,6 +182,9 @@ const EditUser: React.FC = () => { 保存 + ); }; diff --git a/src/pages/evaluate/evaluate.tsx b/src/pages/evaluate/evaluate.tsx index 599ffb0..e827611 100644 --- a/src/pages/evaluate/evaluate.tsx +++ b/src/pages/evaluate/evaluate.tsx @@ -145,7 +145,7 @@ export default function evaluate() { // 或者使用 Taro 的日志记录方式:Taro.showToast({ title: '发布课评成功', icon: 'success' }); // console.log('发布课评成功'); // 使用 redirectTo 跳转 - void Taro.redirectTo({ + void Taro.switchTab({ url: '/pages/main/index', // 页面路径 }); } else { diff --git a/src/pages/personalPage/index.tsx b/src/pages/personalPage/index.tsx new file mode 100644 index 0000000..e69de29 diff --git a/src/pages/publishQuestion/index.tsx b/src/pages/publishQuestion/index.tsx index 5bf141e..e9f9eaa 100644 --- a/src/pages/publishQuestion/index.tsx +++ b/src/pages/publishQuestion/index.tsx @@ -1,16 +1,21 @@ +/* eslint-disable-next-line import/first */ import { Button, Image, Textarea, View } from '@tarojs/components'; import Taro from '@tarojs/taro'; import { useEffect, useState } from 'react'; -// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment +import './index.scss'; + +// eslint-disable-next-line import/first import askicon from '@/common/assets/img/publishQuestion/ask.png'; +// eslint-disable-next-line import/first import { Course } from '@/common/assets/types'; +// eslint-disable-next-line import/first import CourseInfo from '@/common/components/CourseInfo/CourseInfo'; +// eslint-disable-next-line import/first import PublishHeader from '@/common/components/PublishHeader/PublishHeader'; +// eslint-disable-next-line import/first import { get, post } from '@/common/utils/fetch'; -import './index.scss'; - export interface UserInfo { avatarUrl: string; // 用户头像的URL nickName: string; // 用户昵称 diff --git a/src/pages/research/research.tsx b/src/pages/research/research.tsx index 3ad0854..83ab8d8 100644 --- a/src/pages/research/research.tsx +++ b/src/pages/research/research.tsx @@ -56,7 +56,7 @@ const Research: React.FC = () => { const handleClick = () => { console.log(2); - Taro.redirectTo({ + Taro.switchTab({ url: '/pages/main/index', }); };