Compare commits

..

No commits in common. "74f644b3eed06f2b2dd9a18c9778197d0e97aaa0" and "a408ac9e39dd6714262242bd17c5a11e146c9756" have entirely different histories.

17 changed files with 32 additions and 394 deletions

View File

@ -6,7 +6,6 @@ export default defineAppConfig({
'pages/user/myTicket/myTicket',
'pages/user/inform/inform',
'pages/user/settings/settings',
'pages/user/settings/about/about',
'pages/user/report/report',
],
window: {

View File

@ -3,20 +3,19 @@ import { AtTabBar } from 'taro-ui';
import Taro from '@tarojs/taro';
import 'taro-ui/dist/style/index.scss';
import './index.scss';
import pt from '@/plain-text';
const navList: Array<Taro.TabBarItem> = [
{
pagePath: '/pages/index/index',
text: pt.get().tabBar.indexText,
text: '主页',
},
{
pagePath: '/pages/repair/repair',
text: pt.get().tabBar.repairText,
text: '维修',
},
{
pagePath: '/pages/user/user',
text: pt.get().tabBar.userText,
text: '我的',
},
];
@ -25,15 +24,15 @@ export default class Index extends Component {
selected: 0,
tabList: [
{
title: pt.get().tabBar.indexText,
title: '主页',
iconType: 'home',
},
{
title: pt.get().tabBar.repairText,
title: '维修',
iconType: 'settings',
},
{
title: pt.get().tabBar.userText,
title: '我的',
iconType: 'user',
},
],

View File

@ -1,15 +1,12 @@
import { Component, ReactNode } from 'react';
import { AtForm, AtInput, AtButton, AtMessage } from 'taro-ui';
import { AtForm, AtInput, AtButton } from 'taro-ui';
import './inform.scss';
import Taro from '@tarojs/taro';
import pt from '@/plain-text';
export default class InformPage extends Component {
state = {
phone: '',
name: '',
isLoading: false,
isDisable: false,
};
handleChangePhone(phone: string) {
this.setState({
@ -26,21 +23,11 @@ export default class InformPage extends Component {
onSubmit() {
this.setState({
isLoading: true,
isDisable: true,
});
console.log(this.state.name, this.state.phone);
this.setState({
isLoading: false,
});
Taro.atMessage({
message: pt.get().informPage.submitText.success,
type: 'success',
});
setTimeout(() => {
this.setState({
isDisable: false,
});
}, 5000);
}
onReset() {
this.setState({
@ -55,21 +42,20 @@ export default class InformPage extends Component {
onSubmit={this.onSubmit.bind(this)}
onReset={this.onReset.bind(this)}
>
<AtMessage />
<AtInput
name='phone'
title={pt.get().informPage.phoneText.title}
title='手机号码'
type='text'
placeholder={pt.get().informPage.phoneText.placeholder}
placeholder='便于查询工单'
value={this.state.phone}
onChange={this.handleChangePhone.bind(this)}
/>
<AtInput
required
name='name'
title={pt.get().informPage.nameText.title}
title='真实姓名'
type='text'
placeholder={pt.get().informPage.nameText.placeholder}
placeholder='必填,与工单绑定'
value={this.state.name}
onChange={this.handleChangeName.bind(this)}
/>
@ -77,12 +63,11 @@ export default class InformPage extends Component {
loading={this.state.isLoading}
formType='submit'
type='primary'
disabled={this.state.isDisable}
>
{pt.get().informPage.buttonText.submit}
</AtButton>
<AtButton formType='reset' type='secondary'>
{pt.get().informPage.buttonText.reset}
</AtButton>
</AtForm>
);

View File

@ -1,14 +1,11 @@
import { AtTextarea, AtButton, AtForm, AtMessage } from 'taro-ui';
import { AtTextarea, AtButton, AtForm } from 'taro-ui';
import { Component, ReactNode } from 'react';
import './report.scss';
import Taro from '@tarojs/taro';
import pt from '@/plain-text';
export default class SettingsPage extends Component {
state = {
report: '',
isLoading: false,
isDisable: false,
};
handleChange(report: string) {
this.setState({
@ -18,21 +15,11 @@ export default class SettingsPage extends Component {
onSubmit() {
this.setState({
isLoading: true,
isDisable: true,
});
console.log(this.state.report);
this.setState({
isLoading: false,
});
Taro.atMessage({
message: '提交成功',
type: 'success',
});
setTimeout(() => {
this.setState({
isDisable: false,
});
}, 5000);
}
onReset() {
this.setState({
@ -45,23 +32,21 @@ export default class SettingsPage extends Component {
onSubmit={this.onSubmit.bind(this)}
onReset={this.onReset.bind(this)}
>
<AtMessage />
<AtTextarea
value={this.state.report}
onChange={this.handleChange.bind(this)}
maxLength={200}
placeholder={pt.get().reportPage.placeHolderText}
placeholder='无论是有关于小程序的建议还是关于E志者协会的建议都可以提出来哦'
/>
<AtButton
loading={this.state.isLoading}
formType='submit'
type='primary'
disabled={this.state.isDisable}
>
{pt.get().reportPage.buttonText.submit}
</AtButton>
<AtButton formType='reset' type='secondary'>
{pt.get().reportPage.buttonText.reset}
</AtButton>
</AtForm>
);

View File

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

View File

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

View File

@ -1,70 +1,16 @@
import { AtButton, AtList, AtListItem } from 'taro-ui';
import { AtButton } from 'taro-ui';
import { Component, ReactNode } from 'react';
import './settings.scss';
import Taro from '@tarojs/taro';
import { View, Picker } from '@tarojs/components';
import pt, { Lang } from '@/plain-text';
export default class SettingsPage extends Component {
showLangDict: Record<string, Lang> = {
: 'zh_CN',
English: 'en_US',
};
reversedShowLangDict: Record<Lang, string> = {
zh_CN: '简体中文',
en_US: 'English',
};
state = {
selector: ['简体中文', 'English'],
selectorChecked: this.reversedShowLangDict[pt.getCurLang()],
};
onSelect = (e: { detail: { value: string | number } }) => {
this.setState({
selectorChecked: this.state.selector[e.detail.value],
});
pt.setLang(this.showLangDict[this.state.selector[e.detail.value]]);
Taro.reLaunch({
url: '/pages/index/index',
});
};
handleQuit() {
console.log('Quit');
}
handleAbout() {
Taro.navigateTo({
url: '/pages/user/settings/about/about',
});
}
render(): ReactNode {
return (
<View>
<View>
<Picker
mode='selector'
range={this.state.selector}
onChange={this.onSelect}
>
<AtList>
<AtListItem
title='语言 / Language'
extraText={this.state.selectorChecked}
/>
</AtList>
</Picker>
</View>
<AtButton type='secondary' onClick={this.handleAbout.bind(this)}>
{pt.get().settingsPage.aboutText}
</AtButton>
<AtButton type='primary' onClick={this.handleQuit.bind(this)}>
{pt.get().settingsPage.quitText}
退
</AtButton>
</View>
);
}
}

View File

@ -4,8 +4,6 @@ import Taro from '@tarojs/taro';
import type CustomTabBar from '../../custom-tab-bar';
import './user.scss';
import { AtList, AtListItem } from 'taro-ui';
import PageFooter from '@/components/PageFooter/PageFooter';
import pt from '@/plain-text';
export default class UserPage extends Component {
// 以下是TabBar相关
@ -45,37 +43,36 @@ export default class UserPage extends Component {
<View>
<AtList>
<AtListItem
title={pt.get().userPage.ticketColumn.title}
note={pt.get().userPage.ticketColumn.note}
title='我的工单'
note='在这里查看历史工单!'
arrow='right'
iconInfo={{ size: 25, color: '#E69966', value: 'clock' }}
onClick={this.myTicketPage}
/>
<AtListItem
title={pt.get().userPage.infoColumn.title}
note={pt.get().userPage.infoColumn.note}
title='我的信息'
note='能帮助亦可更好地找到你哦!'
arrow='right'
iconInfo={{ size: 25, color: '#78A4FA', value: 'user' }}
onClick={this.informPage}
/>
<AtListItem
title={pt.get().userPage.settingsColumn.title}
note={pt.get().userPage.settingsColumn.note}
title='设置'
note='配置小程序'
extraText=''
arrow='right'
iconInfo={{ size: 25, color: '#808080', value: 'filter' }}
onClick={this.settingsPage}
/>
<AtListItem
title={pt.get().userPage.reportColumn.title}
note={pt.get().userPage.reportColumn.note}
title='意见反馈'
note='有什么想说的都可以告诉我们哦!'
extraText=''
arrow='right'
iconInfo={{ size: 25, color: '#9ACD32', value: 'message' }}
onClick={this.reportPage}
/>
</AtList>
<PageFooter />
</View>
);
}

View File

@ -1,53 +0,0 @@
export interface InformPageText {
submitText: {
success: string;
};
phoneText: {
title: string;
placeholder: string;
};
nameText: {
title: string;
placeholder: string;
};
buttonText: {
submit: string;
reset: string;
};
}
export const informPageZhCn: InformPageText = {
submitText: {
success: '提交成功',
},
phoneText: {
title: '手机号码',
placeholder: '便于查询工单',
},
nameText: {
title: '真实姓名',
placeholder: '必填,与工单绑定',
},
buttonText: {
submit: '提交',
reset: '清空',
},
};
export const informtPageEnUs: InformPageText = {
submitText: {
success: 'Success',
},
phoneText: {
title: 'Phone',
placeholder: '便于查询工单',
},
nameText: {
title: 'Real Name',
placeholder: '必填,与工单绑定',
},
buttonText: {
submit: 'Submit',
reset: 'Reset',
},
};

View File

@ -75,52 +75,3 @@ export const mainPageZhCn: MainPageText = {
},
},
};
export const mainPageEnUs: MainPageText = {
mainTitleLine: '您好这里是E志者协会',
subTitleLine: '维修请至【东三-204】实验室',
cardTitle: {
dutyInfo: '204值班情况',
stepInfo: '维修步骤',
tipsInfo: '注意事项',
},
expandTitle: {
stepInfo: '查看维修步骤',
tipsInfo: '查看注意事项',
},
stepList: [
{ title: '线上填写工单' },
{ title: '去`东三-204`实验室维修电脑' },
{ title: '等待电脑维修' },
{ title: '维修结束,取回电脑' },
],
tipsList: [
{ title: '戴尔、Surface、外星人、苹果电脑不能拆机哦~' },
{ title: '数据无价,请随时做好数据备份哦~' },
{ title: '204也是实验室请遵守实验室纪律请勿饮食~' },
{ title: '我们是志愿服务,不收任何礼物哦~' },
],
dutyCard: {
offDuty: {
title: '未值班',
reason: s => '值班停止原因:' + s,
recoverTime: t => '恢复值班时间:' + t,
},
inDuty: {
title: '值班中',
currentDutyText: c => {
switch (c) {
case 'off':
return '当前未值班';
case '1':
return '第一班 13:30-16:00';
case '2':
return '第二班 16:00-18:00';
case '3':
return '第三班 18:00-20:30';
}
},
inDutyCnt: n => '当前值班人数:' + n,
},
},
};

View File

@ -5,7 +5,3 @@ export interface PageFooterText {
export const pageFooterZhCn: PageFooterText = {
dividerText: 'EVA Notify',
};
export const pageFooterEnUs: PageFooterText = {
dividerText: 'EVA Notify',
};

View File

@ -1,25 +0,0 @@
export interface ReportPageText {
placeHolderText: string;
buttonText: {
submit: string;
reset: string;
};
}
export const reportPageZhCn: ReportPageText = {
placeHolderText:
'无论是有关于小程序的建议还是关于E志者协会的建议都可以提出来哦',
buttonText: {
submit: '提交',
reset: '清空',
},
};
export const reportPageEnUs: ReportPageText = {
placeHolderText:
'无论是有关于小程序的建议还是关于E志者协会的建议都可以提出来哦',
buttonText: {
submit: 'Submit',
reset: 'Reset',
},
};

View File

@ -1,14 +0,0 @@
export interface SettingsPageText {
aboutText: string;
quitText: string;
}
export const settingsPageZhCn: SettingsPageText = {
aboutText: '关于 EVA Notify',
quitText: '退出账号',
};
export const settingsPageEnUs: SettingsPageText = {
aboutText: 'About EVA Notify',
quitText: 'Log Out',
};

View File

@ -1,17 +0,0 @@
export interface TabBarText {
indexText: string;
repairText: string;
userText: string;
}
export const tabBarZhCn: TabBarText = {
indexText: '主页',
repairText: '维修',
userText: '我的',
};
export const tabBarEnUs: TabBarText = {
indexText: 'Home',
repairText: 'Repair',
userText: 'Account',
};

View File

@ -1,62 +0,0 @@
export interface UserPageText {
mainTitleLine: string;
subTitleLine: string;
ticketColumn: {
title: string;
note: string;
};
infoColumn: {
title: string;
note: string;
};
settingsColumn: {
title: string;
note: string;
};
reportColumn: {
title: string;
note: string;
};
}
export const userPageZhCn: UserPageText = {
mainTitleLine: '您好这里是E志者协会',
subTitleLine: '维修请至【东三-204】实验室',
ticketColumn: {
title: '我的工单',
note: '在这里查看历史工单!',
},
infoColumn: {
title: '我的信息',
note: '能帮助亦可更好地找到你哦!',
},
settingsColumn: {
title: '应用设置',
note: '在这里配置小程序',
},
reportColumn: {
title: '意见反馈',
note: '有什么想说的都可以告诉亦可哦!',
},
};
export const userPageEnUs: UserPageText = {
mainTitleLine: '您好这里是E志者协会',
subTitleLine: '维修请至【东三-204】实验室',
ticketColumn: {
title: '我的工单',
note: '在这里查看历史工单!',
},
infoColumn: {
title: '我的信息',
note: '能帮助亦可更好地找到你哦!',
},
settingsColumn: {
title: 'Settings',
note: '在这里配置小程序',
},
reportColumn: {
title: '意见反馈',
note: '有什么想说的都可以告诉亦可哦!',
},
};

View File

@ -1,56 +1,25 @@
import { PageFooterText, pageFooterZhCn, pageFooterEnUs } from './PageFooter';
import { MainPageText, mainPageZhCn, mainPageEnUs } from './MainPage';
import { UserPageText, userPageZhCn, userPageEnUs } from './UserPage';
import { TabBarText, tabBarEnUs, tabBarZhCn } from './TabBar';
import {
SettingsPageText,
settingsPageEnUs,
settingsPageZhCn,
} from './SettingsPage';
import { ReportPageText, reportPageEnUs, reportPageZhCn } from './ReportPage';
import { InformPageText, informPageZhCn, informtPageEnUs } from './InformPage';
import { PageFooterText, pageFooterZhCn } from './PageFooter';
import { MainPageText, mainPageZhCn } from './MainPage';
interface TextRecord {
pageFooter: PageFooterText;
mainPage: MainPageText;
userPage: UserPageText;
tabBar: TabBarText;
settingsPage: SettingsPageText;
reportPage: ReportPageText;
informPage: InformPageText;
}
const textZhCn: TextRecord = {
pageFooter: pageFooterZhCn,
mainPage: mainPageZhCn,
userPage: userPageZhCn,
tabBar: tabBarZhCn,
settingsPage: settingsPageZhCn,
reportPage: reportPageZhCn,
informPage: informPageZhCn,
};
const textEnUs: TextRecord = {
pageFooter: pageFooterEnUs,
mainPage: mainPageEnUs,
userPage: userPageEnUs,
tabBar: tabBarEnUs,
settingsPage: settingsPageEnUs,
reportPage: reportPageEnUs,
informPage: informtPageEnUs,
};
// type Lang = 'zh_CN' | 'en_US' | ...;
export type Lang = 'zh_CN' | 'en_US';
type Lang = 'zh_CN';
class PlainText {
private readonly textZhCn: TextRecord;
private readonly textEnUs: TextRecord;
private lang: Lang;
constructor() {
this.textZhCn = textZhCn;
this.textEnUs = textEnUs;
this.lang = 'zh_CN';
}
@ -61,15 +30,9 @@ class PlainText {
get(): TextRecord {
if (this.lang == 'zh_CN') {
return this.textZhCn;
} else if (this.lang == 'en_US') {
return this.textEnUs;
}
return this.textZhCn;
}
getCurLang(): Lang {
return this.lang;
}
}
const pt = new PlainText();