add entry for AskLeave
parent
1702b5aa6a
commit
a12c69cdc0
|
|
@ -1,16 +1,23 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { View, Image } from '@tarojs/components';
|
import { View, Image } from '@tarojs/components';
|
||||||
|
import { AtButton } from 'taro-ui';
|
||||||
import pt from '@/plain-text';
|
import pt from '@/plain-text';
|
||||||
import wechatUser from '@/wechat';
|
import wechatUser from '@/wechat';
|
||||||
|
import Taro from '@tarojs/taro';
|
||||||
|
|
||||||
const logo = 'https://wiki.zjueva.net/images/evalogo_hd.png';
|
const logo = 'https://wiki.zjueva.net/images/evalogo_hd.png';
|
||||||
|
|
||||||
export default class TitleCard extends React.Component {
|
export default class TitleCard extends React.Component {
|
||||||
|
onAskLeave() {
|
||||||
|
Taro.redirectTo({
|
||||||
|
url: '/pages/AskLeave/AskLeave',
|
||||||
|
});
|
||||||
|
}
|
||||||
render(): React.ReactNode {
|
render(): React.ReactNode {
|
||||||
const mainPage = pt.get().mainPage;
|
const mainPage = pt.get().mainPage;
|
||||||
const memberPage = pt.get().memberPage;
|
const memberPage = pt.get().memberPage;
|
||||||
return (
|
return (
|
||||||
<View className='at-row at-row__align--center'>
|
<View className='at-row at-row__align--center at-row__justify--start'>
|
||||||
<View className='at-col at-col-1 at-col--auto'>
|
<View className='at-col at-col-1 at-col--auto'>
|
||||||
<Image
|
<Image
|
||||||
style='width: 100rpx; height: 100rpx; margin-left: 30rpx;'
|
style='width: 100rpx; height: 100rpx; margin-left: 30rpx;'
|
||||||
|
|
@ -18,7 +25,13 @@ export default class TitleCard extends React.Component {
|
||||||
mode='aspectFit'
|
mode='aspectFit'
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
<View className='page-title'>
|
<View
|
||||||
|
className={
|
||||||
|
wechatUser.getAccess()
|
||||||
|
? 'page-title at-col-6'
|
||||||
|
: 'page-title at-col-10'
|
||||||
|
}
|
||||||
|
>
|
||||||
<View className='at-article__h1' style={{ fontWeight: 'bold' }}>
|
<View className='at-article__h1' style={{ fontWeight: 'bold' }}>
|
||||||
{wechatUser.getAccess()
|
{wechatUser.getAccess()
|
||||||
? memberPage.titleLine.main.index + wechatUser.getInfo().name
|
? memberPage.titleLine.main.index + wechatUser.getInfo().name
|
||||||
|
|
@ -30,6 +43,15 @@ export default class TitleCard extends React.Component {
|
||||||
: mainPage.titleLine.sub}
|
: mainPage.titleLine.sub}
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
{wechatUser.getAccess() ? (
|
||||||
|
<View className='at-col at-col-3'>
|
||||||
|
<AtButton type='secondary' onClick={this.onAskLeave}>
|
||||||
|
{pt.get().mainPage.askLeave}
|
||||||
|
</AtButton>
|
||||||
|
</View>
|
||||||
|
) : (
|
||||||
|
<View></View>
|
||||||
|
)}
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ export interface MainPageText {
|
||||||
recoverTime: string;
|
recoverTime: string;
|
||||||
reason: string;
|
reason: string;
|
||||||
};
|
};
|
||||||
|
askLeave: string;
|
||||||
titleLine: {
|
titleLine: {
|
||||||
main: string;
|
main: string;
|
||||||
sub: string;
|
sub: string;
|
||||||
|
|
@ -48,6 +49,7 @@ export const mainPageZhCn: MainPageText = {
|
||||||
recoverTime: '明天 13:30',
|
recoverTime: '明天 13:30',
|
||||||
reason: '正常下班',
|
reason: '正常下班',
|
||||||
},
|
},
|
||||||
|
askLeave: '我要请假',
|
||||||
titleLine: {
|
titleLine: {
|
||||||
main: '您好,这里是E志者协会',
|
main: '您好,这里是E志者协会',
|
||||||
sub: '维修请至【东三-204】实验室',
|
sub: '维修请至【东三-204】实验室',
|
||||||
|
|
@ -117,6 +119,7 @@ export const mainPageEnUs: MainPageText = {
|
||||||
recoverTime: 'Tomorrow 13:30',
|
recoverTime: 'Tomorrow 13:30',
|
||||||
reason: 'Normal shift',
|
reason: 'Normal shift',
|
||||||
},
|
},
|
||||||
|
askLeave: 'Ask for leave',
|
||||||
titleLine: {
|
titleLine: {
|
||||||
main: 'Hi! This is EVA.',
|
main: 'Hi! This is EVA.',
|
||||||
sub: 'For maintenance, please go to [204 Lab, E3 building]',
|
sub: 'For maintenance, please go to [204 Lab, E3 building]',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue