add member login entry in user page

yhy
Dawn_Ocean 2024-03-11 11:58:12 +08:00
parent dd770b8ece
commit 36a9a35886
5 changed files with 65 additions and 8 deletions

View File

@ -0,0 +1,3 @@
export default definePageConfig({
usingComponents: {},
});

View File

View File

@ -0,0 +1,9 @@
import { Component, ReactNode } from 'react';
import { View } from '@tarojs/components';
import './about.scss';
export default class SettingsPage extends Component {
render(): ReactNode {
return <View></View>;
}
}

View File

@ -1,4 +1,4 @@
import { AtList, AtListItem } from 'taro-ui'; import { AtList, AtListItem, AtToast } from 'taro-ui';
import { Component, ReactNode } from 'react'; import { Component, ReactNode } from 'react';
import { View, Picker, Image, Text } from '@tarojs/components'; import { View, Picker, Image, Text } from '@tarojs/components';
import { getUrl } from '@/service'; import { getUrl } from '@/service';
@ -11,6 +11,7 @@ import logo from '@/assets/images/UserPage/logo.png';
import './user.scss'; import './user.scss';
const listLangInterval = 20; const listLangInterval = 20;
const memberClickTimes = 7;
export default class UserPage extends Component { export default class UserPage extends Component {
state = { state = {
@ -19,6 +20,12 @@ export default class UserPage extends Component {
zh_CN: '简体中文', zh_CN: '简体中文',
en_US: 'English', en_US: 'English',
}[pt.getCurLang()], }[pt.getCurLang()],
clicks: memberClickTimes,
isToastOpen: false,
toastText:
pt.get().userPage.memberEntry.front +
memberClickTimes.toString() +
pt.get().userPage.memberEntry.behind,
}; };
// 以下是TabBar相关 // 以下是TabBar相关
@ -29,6 +36,30 @@ export default class UserPage extends Component {
} }
// 以上是TabBar相关 // 以上是TabBar相关
onTapImage = () => {
this.setState({
clicks: this.state.clicks - 1,
});
if (this.state.clicks < 3) {
this.setState({
toastText:
pt.get().userPage.memberEntry.front +
(this.state.clicks + 1).toString() + // React State's feature
pt.get().userPage.memberEntry.behind,
isToastOpen: true,
});
if (this.state.clicks == 0) {
this.setState({
isToastOpen: false,
clicks: memberClickTimes,
});
Taro.navigateTo({
url: '/pages/user/member/member',
});
}
}
};
showLangDict: Record<string, Lang> = { showLangDict: Record<string, Lang> = {
: 'zh_CN', : 'zh_CN',
English: 'en_US', English: 'en_US',
@ -86,8 +117,16 @@ export default class UserPage extends Component {
className='at-row at-row__justify--center at-row__align--end' className='at-row at-row__justify--center at-row__align--end'
style='height:110px;' style='height:110px;'
> >
<Image style='width: 100px;height: 100px;' src={logo} /> <Image
onTap={this.onTapImage}
style='width: 100px;height: 100px;'
src={logo}
/>
</View> </View>
<AtToast
isOpened={this.state.isToastOpen}
text={this.state.toastText}
></AtToast>
<View <View
className='at-row at-row__justify--center at-row__align--center' className='at-row at-row__justify--center at-row__align--center'
style='height:60px;color:#696969;' style='height:60px;color:#696969;'

View File

@ -1,6 +1,8 @@
export interface UserPageText { export interface UserPageText {
mainTitleLine: string; memberEntry: {
subTitleLine: string; front: string;
behind: string;
};
ticketColumn: { ticketColumn: {
title: string; title: string;
note: string; note: string;
@ -24,8 +26,10 @@ export interface UserPageText {
} }
export const userPageZhCn: UserPageText = { export const userPageZhCn: UserPageText = {
mainTitleLine: '您好这里是E志者协会', memberEntry: {
subTitleLine: '维修请至【东三-204】实验室', front: '再点击 ',
behind: ' 次以进入协会成员登录页面',
},
ticketColumn: { ticketColumn: {
title: '我的工单', title: '我的工单',
note: '在这里查看历史工单!', note: '在这里查看历史工单!',
@ -49,8 +53,10 @@ export const userPageZhCn: UserPageText = {
}; };
export const userPageEnUs: UserPageText = { export const userPageEnUs: UserPageText = {
mainTitleLine: '您好这里是E志者协会', memberEntry: {
subTitleLine: '维修请至【东三-204】实验室', front: '再点击 ',
behind: ' 次以进入协会成员登录页面',
},
ticketColumn: { ticketColumn: {
title: '我的工单', title: '我的工单',
note: '在这里查看历史工单!', note: '在这里查看历史工单!',