Compare commits
5 Commits
2920059ffa
...
d5b8af7d7b
| Author | SHA1 | Date |
|---|---|---|
|
|
d5b8af7d7b | |
|
|
aa334d3f93 | |
|
|
7aaad7563f | |
|
|
4d6a769fea | |
|
|
afdedea344 |
|
|
@ -3,6 +3,7 @@
|
||||||
"projectname": "EVA-Notify",
|
"projectname": "EVA-Notify",
|
||||||
"setting": {
|
"setting": {
|
||||||
"compileHotReLoad": true,
|
"compileHotReLoad": true,
|
||||||
"urlCheck": false
|
"urlCheck": false,
|
||||||
|
"bigPackageSizeSupport": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2,12 +2,14 @@ export default defineAppConfig({
|
||||||
pages: [
|
pages: [
|
||||||
'pages/index/index',
|
'pages/index/index',
|
||||||
'pages/repair/repair',
|
'pages/repair/repair',
|
||||||
|
'pages/member/member',
|
||||||
'pages/user/user',
|
'pages/user/user',
|
||||||
'pages/user/myTicket/myTicket',
|
'pages/user/myTicket/myTicket',
|
||||||
'pages/user/inform/inform',
|
'pages/user/inform/inform',
|
||||||
'pages/user/about/about',
|
'pages/user/about/about',
|
||||||
'pages/user/report/report',
|
'pages/user/report/report',
|
||||||
'pages/user/member/member',
|
'pages/user/member/member',
|
||||||
|
'pages/TicketDetail/TicketDetail',
|
||||||
],
|
],
|
||||||
window: {
|
window: {
|
||||||
backgroundTextStyle: 'light',
|
backgroundTextStyle: 'light',
|
||||||
|
|
@ -26,6 +28,10 @@ export default defineAppConfig({
|
||||||
pagePath: 'pages/repair/repair',
|
pagePath: 'pages/repair/repair',
|
||||||
text: '维修',
|
text: '维修',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
pagePath: 'pages/member/member',
|
||||||
|
text: '管理',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
pagePath: 'pages/user/user',
|
pagePath: 'pages/user/user',
|
||||||
text: '我的',
|
text: '我的',
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,9 @@ function App({ children }: PropsWithChildren<any>) {
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
console.log(res.data);
|
console.log(res.data);
|
||||||
pt.setLang(res.data.data.lang);
|
pt.setLang(res.data.data.lang);
|
||||||
|
Taro.reLaunch({
|
||||||
|
url: '/pages/index/index',
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import { Component, ReactNode } from 'react';
|
||||||
import { AtTabBar } from 'taro-ui';
|
import { AtTabBar } from 'taro-ui';
|
||||||
import Taro from '@tarojs/taro';
|
import Taro from '@tarojs/taro';
|
||||||
import pt from '@/plain-text';
|
import pt from '@/plain-text';
|
||||||
|
import wechatUser from '@/wechat';
|
||||||
import 'taro-ui/dist/style/index.scss';
|
import 'taro-ui/dist/style/index.scss';
|
||||||
import './index.scss';
|
import './index.scss';
|
||||||
|
|
||||||
|
|
@ -14,6 +15,10 @@ const navList: Array<Taro.TabBarItem> = [
|
||||||
pagePath: '/pages/repair/repair',
|
pagePath: '/pages/repair/repair',
|
||||||
text: pt.get().tabBar.repairText,
|
text: pt.get().tabBar.repairText,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
pagePath: '/pages/member/member',
|
||||||
|
text: pt.get().tabBar.memberText,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
pagePath: '/pages/user/user',
|
pagePath: '/pages/user/user',
|
||||||
text: pt.get().tabBar.userText,
|
text: pt.get().tabBar.userText,
|
||||||
|
|
@ -23,20 +28,39 @@ const navList: Array<Taro.TabBarItem> = [
|
||||||
export default class Index extends Component {
|
export default class Index extends Component {
|
||||||
state = {
|
state = {
|
||||||
selected: 0,
|
selected: 0,
|
||||||
tabList: [
|
tabList: wechatUser.getAccess()
|
||||||
{
|
? [
|
||||||
title: pt.get().tabBar.indexText,
|
{
|
||||||
iconType: 'home',
|
title: pt.get().tabBar.indexText,
|
||||||
},
|
iconType: 'home',
|
||||||
{
|
},
|
||||||
title: pt.get().tabBar.repairText,
|
{
|
||||||
iconType: 'settings',
|
title: pt.get().tabBar.repairText,
|
||||||
},
|
iconType: 'settings',
|
||||||
{
|
},
|
||||||
title: pt.get().tabBar.userText,
|
{
|
||||||
iconType: 'user',
|
title: pt.get().tabBar.memberText,
|
||||||
},
|
iconType: 'sketch',
|
||||||
],
|
},
|
||||||
|
{
|
||||||
|
title: pt.get().tabBar.userText,
|
||||||
|
iconType: 'user',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
: [
|
||||||
|
{
|
||||||
|
title: pt.get().tabBar.indexText,
|
||||||
|
iconType: 'home',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: pt.get().tabBar.repairText,
|
||||||
|
iconType: 'settings',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: pt.get().tabBar.userText,
|
||||||
|
iconType: 'user',
|
||||||
|
},
|
||||||
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
handleClick(idx: number) {
|
handleClick(idx: number) {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
export default definePageConfig({
|
||||||
|
usingComponents: {},
|
||||||
|
});
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
import { Component, ReactNode } from 'react';
|
||||||
|
import { View } from '@tarojs/components';
|
||||||
|
import { getCurrentInstance } from '@tarojs/runtime';
|
||||||
|
import Taro from '@tarojs/taro';
|
||||||
|
import pt from '@/plain-text';
|
||||||
|
|
||||||
|
export default class TicketDetail extends Component {
|
||||||
|
state = {
|
||||||
|
id: 0,
|
||||||
|
};
|
||||||
|
componentDidMount(): void {
|
||||||
|
const navBar = pt.get().navBar;
|
||||||
|
Taro.setNavigationBarTitle({
|
||||||
|
title: navBar.ticketDetail,
|
||||||
|
});
|
||||||
|
const { router } = getCurrentInstance();
|
||||||
|
const id = router?.params.id;
|
||||||
|
this.setState({
|
||||||
|
id: id,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
render(): ReactNode {
|
||||||
|
return <View>TicketDetail: {this.state.id}</View>;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -5,6 +5,7 @@ import { AtCard, AtAccordion } from 'taro-ui';
|
||||||
import type CustomTabBar from '@/custom-tab-bar';
|
import type CustomTabBar from '@/custom-tab-bar';
|
||||||
import PageFooter from '@/components/PageFooter/PageFooter';
|
import PageFooter from '@/components/PageFooter/PageFooter';
|
||||||
import pt from '@/plain-text';
|
import pt from '@/plain-text';
|
||||||
|
import { getUrl } from '@/service';
|
||||||
import './index.scss';
|
import './index.scss';
|
||||||
import TitleCard from './TitleCard';
|
import TitleCard from './TitleCard';
|
||||||
import { DutyInfo, DutyData } from './DutyInfo';
|
import { DutyInfo, DutyData } from './DutyInfo';
|
||||||
|
|
@ -78,6 +79,46 @@ export default class Index extends Component {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
componentDidMount(): void {
|
||||||
|
Taro.request({
|
||||||
|
url: getUrl('/dutyinfo'),
|
||||||
|
method: 'GET',
|
||||||
|
data: {
|
||||||
|
token: 'token_test',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.then(res => {
|
||||||
|
const data = res.data.data;
|
||||||
|
if (data.isInDuty) {
|
||||||
|
this.setState({
|
||||||
|
dutyData: {
|
||||||
|
isInDuty: data.isInDuty,
|
||||||
|
inDutyCnt: data.inDutyCnt,
|
||||||
|
currentDuty: data.currentDuty,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.setState({
|
||||||
|
dutyData: {
|
||||||
|
isInDuty: data.isInDuty,
|
||||||
|
offDutyReason: data.offDutyReason,
|
||||||
|
dutyRecoverTime: data.dutyRecoverTime,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.log(err);
|
||||||
|
this.setState({
|
||||||
|
dutyData: {
|
||||||
|
isInDuty: false,
|
||||||
|
offDutyReason: '获取失败!Network Error!',
|
||||||
|
dutyRecoverTime: '获取失败!Network Error!',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// 以下是TabBar相关
|
// 以下是TabBar相关
|
||||||
pageCtx = Taro.getCurrentInstance().page;
|
pageCtx = Taro.getCurrentInstance().page;
|
||||||
componentDidShow() {
|
componentDidShow() {
|
||||||
|
|
|
||||||
|
|
@ -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,8 +1,15 @@
|
||||||
import { Component, ReactNode } from 'react';
|
import { Component, ReactNode } from 'react';
|
||||||
import { View } from '@tarojs/components';
|
import { View } from '@tarojs/components';
|
||||||
|
import Taro from '@tarojs/taro';
|
||||||
|
import pt from '@/plain-text';
|
||||||
import './about.scss';
|
import './about.scss';
|
||||||
|
|
||||||
export default class SettingsPage extends Component {
|
export default class SettingsPage extends Component {
|
||||||
|
componentDidMount(): void {
|
||||||
|
Taro.setNavigationBarTitle({
|
||||||
|
title: pt.get().navBar.user.about,
|
||||||
|
});
|
||||||
|
}
|
||||||
render(): ReactNode {
|
render(): ReactNode {
|
||||||
return <View></View>;
|
return <View></View>;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import { Component, ReactNode } from 'react';
|
import { Component, ReactNode } from 'react';
|
||||||
import { AtForm, AtInput, AtButton, AtMessage } from 'taro-ui';
|
import { AtForm, AtInput, AtButton, AtMessage } from 'taro-ui';
|
||||||
|
import { View } from '@tarojs/components';
|
||||||
import { getUrl } from '@/service';
|
import { getUrl } from '@/service';
|
||||||
import Taro from '@tarojs/taro';
|
import Taro from '@tarojs/taro';
|
||||||
import pt from '@/plain-text';
|
import pt from '@/plain-text';
|
||||||
|
|
@ -14,6 +15,13 @@ export default class InformPage extends Component {
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
isDisable: false,
|
isDisable: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
componentDidMount(): void {
|
||||||
|
Taro.setNavigationBarTitle({
|
||||||
|
title: pt.get().navBar.user.inform,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
handleChangePhone(phone: string) {
|
handleChangePhone(phone: string) {
|
||||||
this.setState({
|
this.setState({
|
||||||
phone: phone,
|
phone: phone,
|
||||||
|
|
@ -67,37 +75,39 @@ export default class InformPage extends Component {
|
||||||
|
|
||||||
render(): ReactNode {
|
render(): ReactNode {
|
||||||
return (
|
return (
|
||||||
<AtForm onSubmit={this.onSubmit.bind(this)}>
|
<View>
|
||||||
<AtMessage />
|
<AtForm onSubmit={this.onSubmit.bind(this)}>
|
||||||
<AtInput
|
<AtMessage />
|
||||||
clear
|
<AtInput
|
||||||
required
|
clear
|
||||||
name='phone'
|
required
|
||||||
title={pt.get().informPage.phoneText.title}
|
name='phone'
|
||||||
type='number'
|
title={pt.get().informPage.phoneText.title}
|
||||||
placeholder={pt.get().informPage.phoneText.placeholder}
|
type='number'
|
||||||
value={this.state.phone}
|
placeholder={pt.get().informPage.phoneText.placeholder}
|
||||||
onChange={this.handleChangePhone.bind(this)}
|
value={this.state.phone}
|
||||||
/>
|
onChange={this.handleChangePhone.bind(this)}
|
||||||
<AtInput
|
/>
|
||||||
required
|
<AtInput
|
||||||
clear
|
required
|
||||||
name='name'
|
clear
|
||||||
title={pt.get().informPage.nameText.title}
|
name='name'
|
||||||
type='text'
|
title={pt.get().informPage.nameText.title}
|
||||||
placeholder={pt.get().informPage.nameText.placeholder}
|
type='text'
|
||||||
value={this.state.name}
|
placeholder={pt.get().informPage.nameText.placeholder}
|
||||||
onChange={this.handleChangeName.bind(this)}
|
value={this.state.name}
|
||||||
/>
|
onChange={this.handleChangeName.bind(this)}
|
||||||
<AtButton
|
/>
|
||||||
loading={this.state.isLoading}
|
<AtButton
|
||||||
formType='submit'
|
loading={this.state.isLoading}
|
||||||
type='primary'
|
formType='submit'
|
||||||
disabled={this.state.isDisable}
|
type='primary'
|
||||||
>
|
disabled={this.state.isDisable}
|
||||||
{pt.get().button.buttonText.submit}
|
>
|
||||||
</AtButton>
|
{pt.get().button.buttonText.submit}
|
||||||
</AtForm>
|
</AtButton>
|
||||||
|
</AtForm>
|
||||||
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,11 @@ export default class MemberPage extends Component {
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
isDisable: false,
|
isDisable: false,
|
||||||
};
|
};
|
||||||
|
componentDidMount(): void {
|
||||||
|
Taro.setNavigationBarTitle({
|
||||||
|
title: pt.get().navBar.user.member,
|
||||||
|
});
|
||||||
|
}
|
||||||
handleChangeStuid(stuid: string) {
|
handleChangeStuid(stuid: string) {
|
||||||
this.setState({
|
this.setState({
|
||||||
stuid: stuid,
|
stuid: stuid,
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ import './myTicket.scss';
|
||||||
type FixStatus = 1 | 2 | 3 | 4 | 5;
|
type FixStatus = 1 | 2 | 3 | 4 | 5;
|
||||||
|
|
||||||
class TicketListItem {
|
class TicketListItem {
|
||||||
|
id: number;
|
||||||
brand: string;
|
brand: string;
|
||||||
model: string;
|
model: string;
|
||||||
status: FixStatus;
|
status: FixStatus;
|
||||||
|
|
@ -21,11 +22,13 @@ class TicketListItem {
|
||||||
iconMap: Map<FixStatus, string>;
|
iconMap: Map<FixStatus, string>;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
id: number,
|
||||||
brand: string,
|
brand: string,
|
||||||
model: string,
|
model: string,
|
||||||
status: FixStatus,
|
status: FixStatus,
|
||||||
createAt: moment.Moment,
|
createAt: moment.Moment,
|
||||||
) {
|
) {
|
||||||
|
this.id = id;
|
||||||
this.brand = brand;
|
this.brand = brand;
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this.status = status;
|
this.status = status;
|
||||||
|
|
@ -48,6 +51,11 @@ class TicketListItem {
|
||||||
extraText={tl.statusMap.get(this.status)}
|
extraText={tl.statusMap.get(this.status)}
|
||||||
arrow='right'
|
arrow='right'
|
||||||
thumb={this.iconMap.get(this.status)}
|
thumb={this.iconMap.get(this.status)}
|
||||||
|
onClick={() => {
|
||||||
|
Taro.navigateTo({
|
||||||
|
url: '/pages/TicketDetail/TicketDetail?id=' + this.id,
|
||||||
|
});
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -57,10 +65,13 @@ export default class SettingsPage extends Component {
|
||||||
state = {
|
state = {
|
||||||
loading: true,
|
loading: true,
|
||||||
success: false,
|
success: false,
|
||||||
fixList: [new TicketListItem('华硕', '天选3', 3, moment())],
|
fixList: [new TicketListItem(0, '', '', 1, moment())],
|
||||||
};
|
};
|
||||||
|
|
||||||
componentDidMount(): void {
|
componentDidMount(): void {
|
||||||
|
Taro.setNavigationBarTitle({
|
||||||
|
title: pt.get().navBar.user.myTicket,
|
||||||
|
});
|
||||||
Taro.request({
|
Taro.request({
|
||||||
url: getUrl('/user/mytickets'),
|
url: getUrl('/user/mytickets'),
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
|
|
@ -82,6 +93,7 @@ export default class SettingsPage extends Component {
|
||||||
fixList: res.data.data.list.map(
|
fixList: res.data.data.list.map(
|
||||||
item =>
|
item =>
|
||||||
new TicketListItem(
|
new TicketListItem(
|
||||||
|
item.id,
|
||||||
item.device,
|
item.device,
|
||||||
item.deviceModel,
|
item.deviceModel,
|
||||||
item.status,
|
item.status,
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,13 @@ export default class SettingsPage extends Component {
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
isDisable: false,
|
isDisable: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
componentDidMount(): void {
|
||||||
|
Taro.setNavigationBarTitle({
|
||||||
|
title: pt.get().navBar.user.report,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
handleChange(report: string) {
|
handleChange(report: string) {
|
||||||
this.setState({
|
this.setState({
|
||||||
report,
|
report,
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import type CustomTabBar from '@/custom-tab-bar';
|
||||||
import PageFooter from '@/components/PageFooter/PageFooter';
|
import PageFooter from '@/components/PageFooter/PageFooter';
|
||||||
import aboutIcon from '@/assets/icons/AboutPage/about.svg';
|
import aboutIcon from '@/assets/icons/AboutPage/about.svg';
|
||||||
import pt, { Lang } from '@/plain-text';
|
import pt, { Lang } from '@/plain-text';
|
||||||
|
import wechatUser from '@/wechat';
|
||||||
import logo from '@/assets/images/UserPage/logo.png';
|
import logo from '@/assets/images/UserPage/logo.png';
|
||||||
import './user.scss';
|
import './user.scss';
|
||||||
|
|
||||||
|
|
@ -23,13 +24,14 @@ export default class UserPage extends Component {
|
||||||
clicks: memberClickTimes,
|
clicks: memberClickTimes,
|
||||||
isToastOpen: false,
|
isToastOpen: false,
|
||||||
toastText: '',
|
toastText: '',
|
||||||
|
haveAccess: wechatUser.getAccess(),
|
||||||
};
|
};
|
||||||
|
|
||||||
// 以下是TabBar相关
|
// 以下是TabBar相关
|
||||||
pageCtx = Taro.getCurrentInstance().page;
|
pageCtx = Taro.getCurrentInstance().page;
|
||||||
componentDidShow() {
|
componentDidShow() {
|
||||||
const tabbar = Taro.getTabBar<CustomTabBar>(this.pageCtx);
|
const tabbar = Taro.getTabBar<CustomTabBar>(this.pageCtx);
|
||||||
tabbar?.setSelected(2);
|
tabbar?.setSelected(this.state.haveAccess ? 3 : 2);
|
||||||
}
|
}
|
||||||
// 以上是TabBar相关
|
// 以上是TabBar相关
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
export interface NavBarTitle {
|
||||||
|
ticketDetail: string;
|
||||||
|
user: {
|
||||||
|
myTicket: string;
|
||||||
|
report: string;
|
||||||
|
member: string;
|
||||||
|
inform: string;
|
||||||
|
about: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export const navBarTitleZhCh: NavBarTitle = {
|
||||||
|
ticketDetail: '工单详情',
|
||||||
|
user: {
|
||||||
|
myTicket: '我的工单',
|
||||||
|
report: '意见反馈',
|
||||||
|
inform: '我的信息',
|
||||||
|
about: '关于我们',
|
||||||
|
member: '协会成员登录',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export const navBarTitleEnUs: NavBarTitle = {
|
||||||
|
ticketDetail: 'Ticket Detail',
|
||||||
|
user: {
|
||||||
|
myTicket: 'My Tickets',
|
||||||
|
report: 'Report',
|
||||||
|
inform: 'Information',
|
||||||
|
about: 'About us',
|
||||||
|
member: 'Member login',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
@ -2,16 +2,19 @@ export interface TabBarText {
|
||||||
indexText: string;
|
indexText: string;
|
||||||
repairText: string;
|
repairText: string;
|
||||||
userText: string;
|
userText: string;
|
||||||
|
memberText: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const tabBarZhCn: TabBarText = {
|
export const tabBarZhCn: TabBarText = {
|
||||||
indexText: '主页',
|
indexText: '主页',
|
||||||
repairText: '维修',
|
repairText: '维修',
|
||||||
userText: '我的',
|
userText: '我的',
|
||||||
|
memberText: '管理',
|
||||||
};
|
};
|
||||||
|
|
||||||
export const tabBarEnUs: TabBarText = {
|
export const tabBarEnUs: TabBarText = {
|
||||||
indexText: 'Home',
|
indexText: 'Home',
|
||||||
repairText: 'Repair',
|
repairText: 'Repair',
|
||||||
userText: 'Account',
|
userText: 'Account',
|
||||||
|
memberText: 'Member',
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import { AboutPageText, aboutPageEnUs, aboutPageZhCn } from './AboutPage';
|
||||||
import { ButtonText, buttonEnUs, buttonZhCn } from './Button';
|
import { ButtonText, buttonEnUs, buttonZhCn } from './Button';
|
||||||
import { MemberPageText, memberPageEnUs, memberPageZhCn } from './MemberPage';
|
import { MemberPageText, memberPageEnUs, memberPageZhCn } from './MemberPage';
|
||||||
import { TicketListText, ticketListEnUs, ticketListZhCn } from './TicketList';
|
import { TicketListText, ticketListEnUs, ticketListZhCn } from './TicketList';
|
||||||
|
import { NavBarTitle, navBarTitleEnUs, navBarTitleZhCh } from './NavBarTitle';
|
||||||
|
|
||||||
interface TextRecord {
|
interface TextRecord {
|
||||||
pageFooter: PageFooterText;
|
pageFooter: PageFooterText;
|
||||||
|
|
@ -20,6 +21,7 @@ interface TextRecord {
|
||||||
button: ButtonText;
|
button: ButtonText;
|
||||||
memberPage: MemberPageText;
|
memberPage: MemberPageText;
|
||||||
ticketList: TicketListText;
|
ticketList: TicketListText;
|
||||||
|
navBar: NavBarTitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
const textZhCn: TextRecord = {
|
const textZhCn: TextRecord = {
|
||||||
|
|
@ -33,6 +35,7 @@ const textZhCn: TextRecord = {
|
||||||
button: buttonZhCn,
|
button: buttonZhCn,
|
||||||
memberPage: memberPageZhCn,
|
memberPage: memberPageZhCn,
|
||||||
ticketList: ticketListZhCn,
|
ticketList: ticketListZhCn,
|
||||||
|
navBar: navBarTitleZhCh,
|
||||||
};
|
};
|
||||||
|
|
||||||
const textEnUs: TextRecord = {
|
const textEnUs: TextRecord = {
|
||||||
|
|
@ -46,6 +49,7 @@ const textEnUs: TextRecord = {
|
||||||
button: buttonEnUs,
|
button: buttonEnUs,
|
||||||
memberPage: memberPageEnUs,
|
memberPage: memberPageEnUs,
|
||||||
ticketList: ticketListEnUs,
|
ticketList: ticketListEnUs,
|
||||||
|
navBar: navBarTitleEnUs,
|
||||||
};
|
};
|
||||||
|
|
||||||
// type Lang = 'zh_CN' | 'en_US' | ...;
|
// type Lang = 'zh_CN' | 'en_US' | ...;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
class WechatUser {
|
||||||
|
private userInfo: any;
|
||||||
|
private isMember: boolean;
|
||||||
|
hasUserInfo: boolean;
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
this.userInfo = '';
|
||||||
|
this.hasUserInfo = false;
|
||||||
|
this.isMember = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
getAccess() {
|
||||||
|
return this.isMember;
|
||||||
|
}
|
||||||
|
|
||||||
|
getInfo() {
|
||||||
|
return this.userInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
setInfo(userInfo: any) {
|
||||||
|
this.userInfo = userInfo;
|
||||||
|
this.hasUserInfo = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
setAccess(isMember: boolean) {
|
||||||
|
this.isMember = isMember;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const wechatUser = new WechatUser();
|
||||||
|
|
||||||
|
export default wechatUser;
|
||||||
Loading…
Reference in New Issue