add member login entry in user page

This commit is contained in:
Dawn_Ocean
2024-03-11 11:58:12 +08:00
parent dd770b8ece
commit 36a9a35886
5 changed files with 65 additions and 8 deletions
+3
View File
@@ -0,0 +1,3 @@
export default definePageConfig({
usingComponents: {},
});
View File
+9
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>;
}
}
+41 -2
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 { View, Picker, Image, Text } from '@tarojs/components';
import { getUrl } from '@/service';
@@ -11,6 +11,7 @@ import logo from '@/assets/images/UserPage/logo.png';
import './user.scss';
const listLangInterval = 20;
const memberClickTimes = 7;
export default class UserPage extends Component {
state = {
@@ -19,6 +20,12 @@ export default class UserPage extends Component {
zh_CN: '简体中文',
en_US: 'English',
}[pt.getCurLang()],
clicks: memberClickTimes,
isToastOpen: false,
toastText:
pt.get().userPage.memberEntry.front +
memberClickTimes.toString() +
pt.get().userPage.memberEntry.behind,
};
// 以下是TabBar相关
@@ -29,6 +36,30 @@ export default class UserPage extends Component {
}
// 以上是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> = {
简体中文: 'zh_CN',
English: 'en_US',
@@ -86,8 +117,16 @@ export default class UserPage extends Component {
className='at-row at-row__justify--center at-row__align--end'
style='height:110px;'
>
<Image style='width: 100px;height: 100px;' src={logo} />
<Image
onTap={this.onTapImage}
style='width: 100px;height: 100px;'
src={logo}
/>
</View>
<AtToast
isOpened={this.state.isToastOpen}
text={this.state.toastText}
></AtToast>
<View
className='at-row at-row__justify--center at-row__align--center'
style='height:60px;color:#696969;'