-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
45 changed files
with
680 additions
and
863 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,4 @@ babel.config.js | |
ec-canvas | ||
|
||
*.js | ||
src/pages/notification/index.tsx | ||
VirtualList.tsx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Button } from '@tarojs/components'; | ||
import { memo } from 'react'; | ||
|
||
interface TitleButtonProps { | ||
title: string; | ||
isSelected?: boolean; | ||
isDisabled?: boolean; | ||
onClick?: () => void; | ||
} | ||
|
||
const TitleButton: React.FC<TitleButtonProps> = memo( | ||
({ title, isSelected, isDisabled, onClick }) => { | ||
return ( | ||
<Button | ||
className={`whitespace-nowrap px-2 py-1 text-xs text-[#f19900] shadow-lg ${isSelected ? 'bg-[#f19900] text-white' : 'bg-gray-200 text-white'}`} | ||
disabled={isDisabled} | ||
onClick={onClick} | ||
> | ||
{title} | ||
</Button> | ||
); | ||
} | ||
); | ||
|
||
export default TitleButton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import type { VirtualListProps as TaroVirtualListProps } from '@tarojs/components-advanced/dist/components/virtual-list'; | ||
import TaroVirtualList from '@tarojs/components-advanced/dist/components/virtual-list'; | ||
import { memo } from 'react'; | ||
|
||
interface VirtualListProps extends TaroVirtualListProps {} | ||
|
||
const VirtualList: React.FC<VirtualListProps> = memo( | ||
({ height, width, item, itemData, itemCount, itemSize, onScroll }) => ( | ||
<TaroVirtualList | ||
height={height} | ||
width={width} | ||
item={item} | ||
itemData={itemData} | ||
itemCount={itemCount} | ||
itemSize={itemSize} | ||
onScroll={onScroll} | ||
/> | ||
) | ||
); | ||
|
||
export default VirtualList; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
export { default as CollectionCourse } from './CollectionCourse/CollectionCourse'; | ||
export { default as FloatingWindow } from './FloatingWindow/FloatingWindow'; | ||
export { default as TitleButton } from './TitleButton'; | ||
export { default as VirtualList } from './VirtualList'; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
export type UserInfo = { | ||
avatarUrl: string; // 用户头像的URL | ||
nickName: string; // 用户昵称 | ||
}; | ||
|
||
export type ResponseLevel = { | ||
code?: number; | ||
data: WebPointInfoVo; | ||
msg?: string; | ||
}; | ||
|
||
export type WebPointInfoVo = { | ||
level: number; | ||
next_level_points: number; | ||
points: number; | ||
}; | ||
|
||
export type ResponseUser = { | ||
code?: number; | ||
data: WebUserProfileVo; | ||
msg?: string; | ||
}; | ||
|
||
export type WebUserProfileVo = { | ||
avatar: string; | ||
ctime: number; | ||
grade_sharing_is_signed?: boolean; | ||
id: number; | ||
/** | ||
* 是否为新用户,新用户尚未编辑过个人信息 | ||
*/ | ||
new: boolean; | ||
nickname: string; | ||
studentId: string; | ||
title_ownership: { [key: string]: boolean }; | ||
using_title: string; | ||
utime?: number; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
import Taro from '@tarojs/taro'; | ||
|
||
function checkToken() { | ||
const checkToken = () => { | ||
const token: string = Taro.getStorageSync('shortToken'); | ||
|
||
if (token) { | ||
// eslint-disable-next-line no-console | ||
console.log('Token 有'); | ||
void Taro.switchTab({ url: '/pages/main/index' }); | ||
} else { | ||
// eslint-disable-next-line no-console | ||
console.log('无token先登陆'); | ||
void Taro.redirectTo({ url: '/pages/login/index' }); | ||
} | ||
} | ||
}; | ||
|
||
export default checkToken; |
Oops, something went wrong.