add entry for AskLeave

mgy
Dawn_Ocean 2024-04-11 16:14:01 +08:00
parent 1702b5aa6a
commit a12c69cdc0
2 changed files with 27 additions and 2 deletions

View File

@ -1,16 +1,23 @@
import React from 'react';
import { View, Image } from '@tarojs/components';
import { AtButton } from 'taro-ui';
import pt from '@/plain-text';
import wechatUser from '@/wechat';
import Taro from '@tarojs/taro';
const logo = 'https://wiki.zjueva.net/images/evalogo_hd.png';
export default class TitleCard extends React.Component {
onAskLeave() {
Taro.redirectTo({
url: '/pages/AskLeave/AskLeave',
});
}
render(): React.ReactNode {
const mainPage = pt.get().mainPage;
const memberPage = pt.get().memberPage;
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'>
<Image
style='width: 100rpx; height: 100rpx; margin-left: 30rpx;'
@ -18,7 +25,13 @@ export default class TitleCard extends React.Component {
mode='aspectFit'
/>
</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' }}>
{wechatUser.getAccess()
? memberPage.titleLine.main.index + wechatUser.getInfo().name
@ -30,6 +43,15 @@ export default class TitleCard extends React.Component {
: mainPage.titleLine.sub}
</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 File

@ -3,6 +3,7 @@ export interface MainPageText {
recoverTime: string;
reason: string;
};
askLeave: string;
titleLine: {
main: string;
sub: string;
@ -48,6 +49,7 @@ export const mainPageZhCn: MainPageText = {
recoverTime: '明天 13:30',
reason: '正常下班',
},
askLeave: '我要请假',
titleLine: {
main: '您好这里是E志者协会',
sub: '维修请至【东三-204】实验室',
@ -117,6 +119,7 @@ export const mainPageEnUs: MainPageText = {
recoverTime: 'Tomorrow 13:30',
reason: 'Normal shift',
},
askLeave: 'Ask for leave',
titleLine: {
main: 'Hi! This is EVA.',
sub: 'For maintenance, please go to [204 Lab, E3 building]',