Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#90

Merged
merged 23 commits into from
Sep 11, 2024
Merged

#90

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div align="center">
<img width="130" src="https://github.com/muxiK-StackFrontend2.0.png" alt="muxiK-StackFrontend2.0 logo">
<img width="130" src="https://github.com/eleliauk/muxiK-StackFrontend2.0/blob/main/src/common/assets/img/login/logo.png" alt="muxiK-StackFrontend2.0 logo">
<h1 align="center">muxiK-StackFrontend2.0</h1>
<h3>muxiK-StackFrontend2.0</h3>
<a href="https://github.com/MuxiKeStack/muxiK-StackFrontend2.0"><strong>探索项目文档 »</strong></a>
Expand Down
5 changes: 2 additions & 3 deletions src/app.config.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
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',
'pages/myCollection/index',
'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: [
{
Expand Down
144 changes: 72 additions & 72 deletions src/auto-imports.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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']
}
1 change: 1 addition & 0 deletions src/common/components/CourseInfo/CourseInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { View } from '@tarojs/components';
import React from 'react';

import './index.scss';

interface ICourseInfoProps {
Expand Down
1 change: 1 addition & 0 deletions src/common/components/PublishHeader/PublishHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Image, Text, View } from '@tarojs/components';
import React from 'react';

import './index.scss';

interface IPublishHeaderProps {
Expand Down
1 change: 0 additions & 1 deletion src/common/components/iconfont/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* tslint:disable */
/* eslint-disable */

import React, { FunctionComponent } from 'react';

Expand Down
1 change: 1 addition & 0 deletions src/modules/profile/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down
45 changes: 7 additions & 38 deletions src/pages/classInfo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
// 定义接口
Expand Down Expand Up @@ -129,10 +127,12 @@ export default function Index() {
<Label3 key={keyindex} content={feature} />
))}
</View>
{/*<>*/}
<View className="h-1/3 w-5/6">
<LineChart className="flex content-center justify-center"></LineChart>
</View>
{/*</>*/}

{/* <Demo></Demo> */}

{/* <Charts options={}></Charts> */}
{comments &&
comments.map((comment) => (
<Comment
Expand All @@ -150,34 +150,3 @@ export default function Index() {
</View>
);
}

// function Demo() {
// const echartsRef = useRef<EchartsHandle>(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 <Echarts echarts={echarts} option={option} ref={echartsRef}></Echarts>;
// }
5 changes: 5 additions & 0 deletions src/pages/editUser/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,8 @@
background: #f19900;
color: white;
}
.logout-button {
margin-top: 10vw;
width: 40vw;
height: 10vh;
}
19 changes: 18 additions & 1 deletion src/pages/editUser/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<View>
<View className="avatar-container">
Expand Down Expand Up @@ -168,6 +182,9 @@ const EditUser: React.FC = () => {
保存
</Button>
</View>
<Button className="mt-7 h-1/6 w-1/3" onClick={handleLogout}>
退出登陆
</Button>
</View>
);
};
Expand Down
2 changes: 1 addition & 1 deletion src/pages/evaluate/evaluate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Empty file.
11 changes: 8 additions & 3 deletions src/pages/publishQuestion/index.tsx
Original file line number Diff line number Diff line change
@@ -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; // 用户昵称
Expand Down
2 changes: 1 addition & 1 deletion src/pages/research/research.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const Research: React.FC = () => {

const handleClick = () => {
console.log(2);
Taro.redirectTo({
Taro.switchTab({
url: '/pages/main/index',
});
};
Expand Down
Loading