add member page & tabbar item
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
export default definePageConfig({
|
||||
usingComponents: {},
|
||||
});
|
||||
@@ -0,0 +1,23 @@
|
||||
import { View, Text } from '@tarojs/components';
|
||||
import { Component, ReactNode } from 'react';
|
||||
import Taro from '@tarojs/taro';
|
||||
import type CustomTabBar from '../../custom-tab-bar';
|
||||
import './member.scss';
|
||||
|
||||
export default class MemberPage extends Component {
|
||||
// 以下是TabBar相关
|
||||
pageCtx = Taro.getCurrentInstance().page;
|
||||
componentDidShow() {
|
||||
const tabbar = Taro.getTabBar<CustomTabBar>(this.pageCtx);
|
||||
tabbar?.setSelected(2);
|
||||
}
|
||||
// 以上是TabBar相关
|
||||
|
||||
render(): ReactNode {
|
||||
return (
|
||||
<View>
|
||||
<Text>Member Page</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Component, ReactNode } from 'react';
|
||||
import { AtForm, AtInput, AtButton, AtMessage } from 'taro-ui';
|
||||
import { View } from '@tarojs/components';
|
||||
import { getUrl } from '@/service';
|
||||
import Taro from '@tarojs/taro';
|
||||
import pt from '@/plain-text';
|
||||
@@ -67,37 +68,39 @@ export default class InformPage extends Component {
|
||||
|
||||
render(): ReactNode {
|
||||
return (
|
||||
<AtForm onSubmit={this.onSubmit.bind(this)}>
|
||||
<AtMessage />
|
||||
<AtInput
|
||||
clear
|
||||
required
|
||||
name='phone'
|
||||
title={pt.get().informPage.phoneText.title}
|
||||
type='number'
|
||||
placeholder={pt.get().informPage.phoneText.placeholder}
|
||||
value={this.state.phone}
|
||||
onChange={this.handleChangePhone.bind(this)}
|
||||
/>
|
||||
<AtInput
|
||||
required
|
||||
clear
|
||||
name='name'
|
||||
title={pt.get().informPage.nameText.title}
|
||||
type='text'
|
||||
placeholder={pt.get().informPage.nameText.placeholder}
|
||||
value={this.state.name}
|
||||
onChange={this.handleChangeName.bind(this)}
|
||||
/>
|
||||
<AtButton
|
||||
loading={this.state.isLoading}
|
||||
formType='submit'
|
||||
type='primary'
|
||||
disabled={this.state.isDisable}
|
||||
>
|
||||
{pt.get().button.buttonText.submit}
|
||||
</AtButton>
|
||||
</AtForm>
|
||||
<View>
|
||||
<AtForm onSubmit={this.onSubmit.bind(this)}>
|
||||
<AtMessage />
|
||||
<AtInput
|
||||
clear
|
||||
required
|
||||
name='phone'
|
||||
title={pt.get().informPage.phoneText.title}
|
||||
type='number'
|
||||
placeholder={pt.get().informPage.phoneText.placeholder}
|
||||
value={this.state.phone}
|
||||
onChange={this.handleChangePhone.bind(this)}
|
||||
/>
|
||||
<AtInput
|
||||
required
|
||||
clear
|
||||
name='name'
|
||||
title={pt.get().informPage.nameText.title}
|
||||
type='text'
|
||||
placeholder={pt.get().informPage.nameText.placeholder}
|
||||
value={this.state.name}
|
||||
onChange={this.handleChangeName.bind(this)}
|
||||
/>
|
||||
<AtButton
|
||||
loading={this.state.isLoading}
|
||||
formType='submit'
|
||||
type='primary'
|
||||
disabled={this.state.isDisable}
|
||||
>
|
||||
{pt.get().button.buttonText.submit}
|
||||
</AtButton>
|
||||
</AtForm>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import type CustomTabBar from '@/custom-tab-bar';
|
||||
import PageFooter from '@/components/PageFooter/PageFooter';
|
||||
import aboutIcon from '@/assets/icons/AboutPage/about.svg';
|
||||
import pt, { Lang } from '@/plain-text';
|
||||
import wechatUser from '@/wechat';
|
||||
import logo from '@/assets/images/UserPage/logo.png';
|
||||
import './user.scss';
|
||||
|
||||
@@ -23,13 +24,14 @@ export default class UserPage extends Component {
|
||||
clicks: memberClickTimes,
|
||||
isToastOpen: false,
|
||||
toastText: '',
|
||||
haveAccess: wechatUser.getAccess(),
|
||||
};
|
||||
|
||||
// 以下是TabBar相关
|
||||
pageCtx = Taro.getCurrentInstance().page;
|
||||
componentDidShow() {
|
||||
const tabbar = Taro.getTabBar<CustomTabBar>(this.pageCtx);
|
||||
tabbar?.setSelected(2);
|
||||
tabbar?.setSelected(this.state.haveAccess ? 3 : 2);
|
||||
}
|
||||
// 以上是TabBar相关
|
||||
|
||||
|
||||
Reference in New Issue
Block a user