Compare commits
4 Commits
0baf91fadf
...
a7fd2b2856
| Author | SHA1 | Date |
|---|---|---|
|
|
a7fd2b2856 | |
|
|
c756e74778 | |
|
|
133d60375a | |
|
|
bea23f4705 |
3
.env.dev
3
.env.dev
|
|
@ -1,4 +1,3 @@
|
||||||
# 配置文档参考 https://taro-docs.jd.com/docs/next/env-mode-config
|
# 配置文档参考 https://taro-docs.jd.com/docs/next/env-mode-config
|
||||||
TARO_APP_ID="wx636eb7cf2b84f305"
|
TARO_APP_ID="wx636eb7cf2b84f305"
|
||||||
TARO_APP_API="http://127.0.0.1:9527"
|
TARO_APP_API="http://127.0.0.1:9527"
|
||||||
TARO_APP_API_OREO="http://127.0.0.1:9527"
|
|
||||||
|
|
@ -1,3 +1,2 @@
|
||||||
TARO_APP_ID="wx636eb7cf2b84f305"
|
TARO_APP_ID="wx636eb7cf2b84f305"
|
||||||
TARO_APP_API=""
|
TARO_APP_API=""
|
||||||
TARO_APP_API_OREO=""
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
.eslintignore
|
||||||
**/.gitignore
|
**/.gitignore
|
||||||
dist/
|
dist/
|
||||||
deploy_versions/
|
deploy_versions/
|
||||||
|
|
|
||||||
|
|
@ -97,6 +97,7 @@
|
||||||
"webpack": "5.78.0"
|
"webpack": "5.78.0"
|
||||||
},
|
},
|
||||||
"lint-staged": {
|
"lint-staged": {
|
||||||
"*": "prettier --write"
|
"*.ts": "prettier --write",
|
||||||
|
"*.tsx": "prettier --write"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,7 @@ export default defineAppConfig({
|
||||||
'pages/user/user',
|
'pages/user/user',
|
||||||
'pages/user/myTicket/myTicket',
|
'pages/user/myTicket/myTicket',
|
||||||
'pages/user/inform/inform',
|
'pages/user/inform/inform',
|
||||||
'pages/user/settings/settings',
|
'pages/user/about/about',
|
||||||
'pages/user/settings/about/about',
|
|
||||||
'pages/user/report/report',
|
'pages/user/report/report',
|
||||||
],
|
],
|
||||||
window: {
|
window: {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1709817911051" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4420" width="24" height="24" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M523.52 965.12a448 448 0 1 1 448-448 448 448 0 0 1-448 448z m0-832a384 384 0 1 0 384 384 384 384 0 0 0-384-384z" p-id="4421" fill="#c89bc7"></path><path d="M523.52 772.16a32 32 0 0 1-32-32V448a32 32 0 0 1 64 0v292.8a32 32 0 0 1-32 31.36z" p-id="4422" fill="#c89bc7"></path><path d="M523.52 293.12m-48 0a48 48 0 1 0 96 0 48 48 0 1 0-96 0Z" p-id="4423" fill="#c89bc7"></path></svg>
|
||||||
|
After Width: | Height: | Size: 710 B |
|
|
@ -1,6 +1,6 @@
|
||||||
import { Component, ReactNode } from 'react';
|
import { Component, ReactNode } from 'react';
|
||||||
import './about.scss';
|
|
||||||
import { View } from '@tarojs/components';
|
import { View } from '@tarojs/components';
|
||||||
|
import './about.scss';
|
||||||
|
|
||||||
export default class SettingsPage extends Component {
|
export default class SettingsPage extends Component {
|
||||||
render(): ReactNode {
|
render(): ReactNode {
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
export default definePageConfig({
|
|
||||||
navigationBarTitleText: '设置',
|
|
||||||
usingComponents: {},
|
|
||||||
});
|
|
||||||
|
|
@ -1,68 +0,0 @@
|
||||||
import { AtButton, AtList, AtListItem } from 'taro-ui';
|
|
||||||
import { Component, ReactNode } from 'react';
|
|
||||||
import Taro from '@tarojs/taro';
|
|
||||||
import { View, Picker } from '@tarojs/components';
|
|
||||||
import pt, { Lang } from '@/plain-text';
|
|
||||||
import './settings.scss';
|
|
||||||
|
|
||||||
export default class SettingsPage extends Component {
|
|
||||||
state = {
|
|
||||||
selector: ['简体中文', 'English'],
|
|
||||||
selectorChecked: {
|
|
||||||
zh_CN: '简体中文',
|
|
||||||
en_US: 'English',
|
|
||||||
}[pt.getCurLang()],
|
|
||||||
};
|
|
||||||
|
|
||||||
showLangDict: Record<string, Lang> = {
|
|
||||||
简体中文: 'zh_CN',
|
|
||||||
English: 'en_US',
|
|
||||||
};
|
|
||||||
|
|
||||||
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>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,13 +1,22 @@
|
||||||
import { View } from '@tarojs/components';
|
import { AtList, AtListItem } from 'taro-ui';
|
||||||
import { Component, ReactNode } from 'react';
|
import { Component, ReactNode } from 'react';
|
||||||
|
import { View, Picker } from '@tarojs/components';
|
||||||
import Taro from '@tarojs/taro';
|
import Taro from '@tarojs/taro';
|
||||||
import type CustomTabBar from '@/custom-tab-bar';
|
import type CustomTabBar from '@/custom-tab-bar';
|
||||||
import { AtList, AtListItem } from 'taro-ui';
|
|
||||||
import PageFooter from '@/components/PageFooter/PageFooter';
|
import PageFooter from '@/components/PageFooter/PageFooter';
|
||||||
import pt from '@/plain-text';
|
import aboutIcon from '@/assets/icons/AboutPage/about.svg';
|
||||||
|
import pt, { Lang } from '@/plain-text';
|
||||||
import './user.scss';
|
import './user.scss';
|
||||||
|
|
||||||
export default class UserPage extends Component {
|
export default class UserPage extends Component {
|
||||||
|
state = {
|
||||||
|
selector: ['简体中文', 'English'],
|
||||||
|
selectorChecked: {
|
||||||
|
zh_CN: '简体中文',
|
||||||
|
en_US: 'English',
|
||||||
|
}[pt.getCurLang()],
|
||||||
|
};
|
||||||
|
|
||||||
// 以下是TabBar相关
|
// 以下是TabBar相关
|
||||||
pageCtx = Taro.getCurrentInstance().page;
|
pageCtx = Taro.getCurrentInstance().page;
|
||||||
componentDidShow() {
|
componentDidShow() {
|
||||||
|
|
@ -16,6 +25,21 @@ export default class UserPage extends Component {
|
||||||
}
|
}
|
||||||
// 以上是TabBar相关
|
// 以上是TabBar相关
|
||||||
|
|
||||||
|
showLangDict: Record<string, Lang> = {
|
||||||
|
简体中文: 'zh_CN',
|
||||||
|
English: 'en_US',
|
||||||
|
};
|
||||||
|
|
||||||
|
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/user/user',
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
myTicketPage() {
|
myTicketPage() {
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
url: '/pages/user/myTicket/myTicket',
|
url: '/pages/user/myTicket/myTicket',
|
||||||
|
|
@ -28,18 +52,18 @@ export default class UserPage extends Component {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
settingsPage() {
|
|
||||||
Taro.navigateTo({
|
|
||||||
url: '/pages/user/settings/settings',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
reportPage() {
|
reportPage() {
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
url: '/pages/user/report/report',
|
url: '/pages/user/report/report',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
aboutPage() {
|
||||||
|
Taro.navigateTo({
|
||||||
|
url: '/pages/user/about/about',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
render(): ReactNode {
|
render(): ReactNode {
|
||||||
return (
|
return (
|
||||||
<View>
|
<View>
|
||||||
|
|
@ -48,32 +72,44 @@ export default class UserPage extends Component {
|
||||||
title={pt.get().userPage.ticketColumn.title}
|
title={pt.get().userPage.ticketColumn.title}
|
||||||
note={pt.get().userPage.ticketColumn.note}
|
note={pt.get().userPage.ticketColumn.note}
|
||||||
arrow='right'
|
arrow='right'
|
||||||
iconInfo={{ size: 25, color: '#E69966', value: 'clock' }}
|
iconInfo={{ color: '#E69966', value: 'clock' }}
|
||||||
onClick={this.myTicketPage}
|
onClick={this.myTicketPage}
|
||||||
/>
|
/>
|
||||||
<AtListItem
|
<AtListItem
|
||||||
title={pt.get().userPage.infoColumn.title}
|
title={pt.get().userPage.infoColumn.title}
|
||||||
note={pt.get().userPage.infoColumn.note}
|
note={pt.get().userPage.infoColumn.note}
|
||||||
arrow='right'
|
arrow='right'
|
||||||
iconInfo={{ size: 25, color: '#78A4FA', value: 'user' }}
|
iconInfo={{ color: '#78A4FA', value: 'user' }}
|
||||||
onClick={this.informPage}
|
onClick={this.informPage}
|
||||||
/>
|
/>
|
||||||
<AtListItem
|
|
||||||
title={pt.get().userPage.settingsColumn.title}
|
|
||||||
note={pt.get().userPage.settingsColumn.note}
|
|
||||||
extraText=''
|
|
||||||
arrow='right'
|
|
||||||
iconInfo={{ size: 25, color: '#808080', value: 'filter' }}
|
|
||||||
onClick={this.settingsPage}
|
|
||||||
/>
|
|
||||||
<AtListItem
|
<AtListItem
|
||||||
title={pt.get().userPage.reportColumn.title}
|
title={pt.get().userPage.reportColumn.title}
|
||||||
note={pt.get().userPage.reportColumn.note}
|
note={pt.get().userPage.reportColumn.note}
|
||||||
extraText=''
|
extraText=''
|
||||||
arrow='right'
|
arrow='right'
|
||||||
iconInfo={{ size: 25, color: '#9ACD32', value: 'message' }}
|
iconInfo={{ color: '#9ACD32', value: 'message' }}
|
||||||
onClick={this.reportPage}
|
onClick={this.reportPage}
|
||||||
/>
|
/>
|
||||||
|
<AtListItem
|
||||||
|
title={pt.get().userPage.aboutColumn.title}
|
||||||
|
note={pt.get().userPage.aboutColumn.note}
|
||||||
|
extraText=''
|
||||||
|
arrow='right'
|
||||||
|
thumb={aboutIcon}
|
||||||
|
onClick={this.aboutPage}
|
||||||
|
/>
|
||||||
|
<Picker
|
||||||
|
mode='selector'
|
||||||
|
range={this.state.selector}
|
||||||
|
onChange={this.onSelect}
|
||||||
|
>
|
||||||
|
<AtList>
|
||||||
|
<AtListItem
|
||||||
|
title='语言 / Language'
|
||||||
|
extraText={this.state.selectorChecked}
|
||||||
|
/>
|
||||||
|
</AtList>
|
||||||
|
</Picker>
|
||||||
</AtList>
|
</AtList>
|
||||||
<PageFooter />
|
<PageFooter />
|
||||||
</View>
|
</View>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
export interface AboutPageText {}
|
||||||
|
|
||||||
|
export const aboutPageZhCn: AboutPageText = {};
|
||||||
|
|
||||||
|
export const aboutPageEnUs: AboutPageText = {};
|
||||||
|
|
@ -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',
|
|
||||||
};
|
|
||||||
|
|
@ -17,6 +17,10 @@ export interface UserPageText {
|
||||||
title: string;
|
title: string;
|
||||||
note: string;
|
note: string;
|
||||||
};
|
};
|
||||||
|
aboutColumn: {
|
||||||
|
title: string;
|
||||||
|
note: string;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export const userPageZhCn: UserPageText = {
|
export const userPageZhCn: UserPageText = {
|
||||||
|
|
@ -38,6 +42,10 @@ export const userPageZhCn: UserPageText = {
|
||||||
title: '意见反馈',
|
title: '意见反馈',
|
||||||
note: '有什么想说的都可以告诉亦可哦!',
|
note: '有什么想说的都可以告诉亦可哦!',
|
||||||
},
|
},
|
||||||
|
aboutColumn: {
|
||||||
|
title: '关于我们',
|
||||||
|
note: '查看开发者信息',
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const userPageEnUs: UserPageText = {
|
export const userPageEnUs: UserPageText = {
|
||||||
|
|
@ -59,4 +67,8 @@ export const userPageEnUs: UserPageText = {
|
||||||
title: '意见反馈',
|
title: '意见反馈',
|
||||||
note: '有什么想说的都可以告诉亦可哦!',
|
note: '有什么想说的都可以告诉亦可哦!',
|
||||||
},
|
},
|
||||||
|
aboutColumn: {
|
||||||
|
title: '关于我们',
|
||||||
|
note: '查看开发者信息',
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,22 +2,18 @@ import { PageFooterText, pageFooterZhCn, pageFooterEnUs } from './PageFooter';
|
||||||
import { MainPageText, mainPageZhCn, mainPageEnUs } from './MainPage';
|
import { MainPageText, mainPageZhCn, mainPageEnUs } from './MainPage';
|
||||||
import { UserPageText, userPageZhCn, userPageEnUs } from './UserPage';
|
import { UserPageText, userPageZhCn, userPageEnUs } from './UserPage';
|
||||||
import { TabBarText, tabBarEnUs, tabBarZhCn } from './TabBar';
|
import { TabBarText, tabBarEnUs, tabBarZhCn } from './TabBar';
|
||||||
import {
|
|
||||||
SettingsPageText,
|
|
||||||
settingsPageEnUs,
|
|
||||||
settingsPageZhCn,
|
|
||||||
} from './SettingsPage';
|
|
||||||
import { ReportPageText, reportPageEnUs, reportPageZhCn } from './ReportPage';
|
import { ReportPageText, reportPageEnUs, reportPageZhCn } from './ReportPage';
|
||||||
import { InformPageText, informPageZhCn, informtPageEnUs } from './InformPage';
|
import { InformPageText, informPageZhCn, informtPageEnUs } from './InformPage';
|
||||||
|
import { AboutPageText, aboutPageEnUs, aboutPageZhCn } from './AboutPage';
|
||||||
|
|
||||||
interface TextRecord {
|
interface TextRecord {
|
||||||
pageFooter: PageFooterText;
|
pageFooter: PageFooterText;
|
||||||
mainPage: MainPageText;
|
mainPage: MainPageText;
|
||||||
userPage: UserPageText;
|
userPage: UserPageText;
|
||||||
tabBar: TabBarText;
|
tabBar: TabBarText;
|
||||||
settingsPage: SettingsPageText;
|
|
||||||
reportPage: ReportPageText;
|
reportPage: ReportPageText;
|
||||||
informPage: InformPageText;
|
informPage: InformPageText;
|
||||||
|
aboutPage: AboutPageText;
|
||||||
}
|
}
|
||||||
|
|
||||||
const textZhCn: TextRecord = {
|
const textZhCn: TextRecord = {
|
||||||
|
|
@ -25,9 +21,9 @@ const textZhCn: TextRecord = {
|
||||||
mainPage: mainPageZhCn,
|
mainPage: mainPageZhCn,
|
||||||
userPage: userPageZhCn,
|
userPage: userPageZhCn,
|
||||||
tabBar: tabBarZhCn,
|
tabBar: tabBarZhCn,
|
||||||
settingsPage: settingsPageZhCn,
|
|
||||||
reportPage: reportPageZhCn,
|
reportPage: reportPageZhCn,
|
||||||
informPage: informPageZhCn,
|
informPage: informPageZhCn,
|
||||||
|
aboutPage: aboutPageZhCn,
|
||||||
};
|
};
|
||||||
|
|
||||||
const textEnUs: TextRecord = {
|
const textEnUs: TextRecord = {
|
||||||
|
|
@ -35,9 +31,9 @@ const textEnUs: TextRecord = {
|
||||||
mainPage: mainPageEnUs,
|
mainPage: mainPageEnUs,
|
||||||
userPage: userPageEnUs,
|
userPage: userPageEnUs,
|
||||||
tabBar: tabBarEnUs,
|
tabBar: tabBarEnUs,
|
||||||
settingsPage: settingsPageEnUs,
|
|
||||||
reportPage: reportPageEnUs,
|
reportPage: reportPageEnUs,
|
||||||
informPage: informtPageEnUs,
|
informPage: informtPageEnUs,
|
||||||
|
aboutPage: aboutPageEnUs,
|
||||||
};
|
};
|
||||||
|
|
||||||
// type Lang = 'zh_CN' | 'en_US' | ...;
|
// type Lang = 'zh_CN' | 'en_US' | ...;
|
||||||
|
|
|
||||||
|
|
@ -39,22 +39,3 @@ export function getUrl(path: string): string {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get URL of Oreo backend
|
|
||||||
* @param path Relative path to base url, begins with `/`
|
|
||||||
* @returns Full url
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
* // see example of `getUrl`
|
|
||||||
*/
|
|
||||||
export function getUrlOreo(path: string): string {
|
|
||||||
const baseUrlOreo = process.env.TARO_APP_API_OREO;
|
|
||||||
// console.log('buo:', baseUrlOreo);
|
|
||||||
if (baseUrlOreo) {
|
|
||||||
return baseUrlOreo + path;
|
|
||||||
} else {
|
|
||||||
console.log('env TARO_APP_API_OREO is undefined');
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue