Compare commits
No commits in common. "d5b8af7d7b162d327dce67e61edc983dfba2e27b" and "aa334d3f93dc255fe9690b55ced5eb08edbbbb9d" have entirely different histories.
d5b8af7d7b
...
aa334d3f93
|
|
@ -2,7 +2,6 @@ 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',
|
||||||
|
|
@ -28,10 +27,6 @@ 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,9 +17,6 @@ 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,7 +2,6 @@ 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';
|
||||||
|
|
||||||
|
|
@ -15,10 +14,6 @@ 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,
|
||||||
|
|
@ -28,26 +23,7 @@ const navList: Array<Taro.TabBarItem> = [
|
||||||
export default class Index extends Component {
|
export default class Index extends Component {
|
||||||
state = {
|
state = {
|
||||||
selected: 0,
|
selected: 0,
|
||||||
tabList: wechatUser.getAccess()
|
tabList: [
|
||||||
? [
|
|
||||||
{
|
|
||||||
title: pt.get().tabBar.indexText,
|
|
||||||
iconType: 'home',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: pt.get().tabBar.repairText,
|
|
||||||
iconType: 'settings',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: pt.get().tabBar.memberText,
|
|
||||||
iconType: 'sketch',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: pt.get().tabBar.userText,
|
|
||||||
iconType: 'user',
|
|
||||||
},
|
|
||||||
]
|
|
||||||
: [
|
|
||||||
{
|
{
|
||||||
title: pt.get().tabBar.indexText,
|
title: pt.get().tabBar.indexText,
|
||||||
iconType: 'home',
|
iconType: 'home',
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ 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';
|
||||||
|
|
@ -79,46 +78,6 @@ 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() {
|
||||||
|
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
export default definePageConfig({
|
|
||||||
usingComponents: {},
|
|
||||||
});
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
||||||
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,6 +1,5 @@
|
||||||
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';
|
||||||
|
|
@ -75,7 +74,6 @@ export default class InformPage extends Component {
|
||||||
|
|
||||||
render(): ReactNode {
|
render(): ReactNode {
|
||||||
return (
|
return (
|
||||||
<View>
|
|
||||||
<AtForm onSubmit={this.onSubmit.bind(this)}>
|
<AtForm onSubmit={this.onSubmit.bind(this)}>
|
||||||
<AtMessage />
|
<AtMessage />
|
||||||
<AtInput
|
<AtInput
|
||||||
|
|
@ -107,7 +105,6 @@ export default class InformPage extends Component {
|
||||||
{pt.get().button.buttonText.submit}
|
{pt.get().button.buttonText.submit}
|
||||||
</AtButton>
|
</AtButton>
|
||||||
</AtForm>
|
</AtForm>
|
||||||
</View>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ 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';
|
||||||
|
|
||||||
|
|
@ -24,14 +23,13 @@ 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(this.state.haveAccess ? 3 : 2);
|
tabbar?.setSelected(2);
|
||||||
}
|
}
|
||||||
// 以上是TabBar相关
|
// 以上是TabBar相关
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,19 +2,16 @@ 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',
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
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