add modal in ticketdetail-addtooreo
parent
b41498976e
commit
e7b0b3239e
|
|
@ -26,7 +26,7 @@ export default {
|
||||||
'GET /user/locale/get': {
|
'GET /user/locale/get': {
|
||||||
success: true,
|
success: true,
|
||||||
data: {
|
data: {
|
||||||
lang: 'en_US',
|
lang: 'zh_CN',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'POST /user/locale/update': {
|
'POST /user/locale/update': {
|
||||||
|
|
|
||||||
|
|
@ -2,19 +2,21 @@ import { Component, ReactNode } from 'react';
|
||||||
import { View } from '@tarojs/components';
|
import { View } from '@tarojs/components';
|
||||||
import { getCurrentInstance } from '@tarojs/runtime';
|
import { getCurrentInstance } from '@tarojs/runtime';
|
||||||
import pt from '@/plain-text';
|
import pt from '@/plain-text';
|
||||||
import { AtButton } from 'taro-ui';
|
import { AtButton, AtModal } from 'taro-ui';
|
||||||
import DetailFramework from '@/components/DetailFramework/DetailFramework';
|
import DetailFramework from '@/components/DetailFramework/DetailFramework';
|
||||||
import PageFooter from '@/components/PageFooter/PageFooter';
|
import PageFooter from '@/components/PageFooter/PageFooter';
|
||||||
|
|
||||||
interface TicketDetailState {
|
interface TicketDetailState {
|
||||||
id: number;
|
id: number;
|
||||||
isMember: boolean;
|
isMember: boolean;
|
||||||
|
showModel: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class TicketDetail extends Component<{}, TicketDetailState> {
|
export default class TicketDetail extends Component<{}, TicketDetailState> {
|
||||||
state: Readonly<TicketDetailState> = {
|
state: Readonly<TicketDetailState> = {
|
||||||
id: 0,
|
id: 0,
|
||||||
isMember: false,
|
isMember: false,
|
||||||
|
showModel: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
componentDidMount(): void {
|
componentDidMount(): void {
|
||||||
|
|
@ -27,6 +29,22 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onAddToOreo(): void {
|
||||||
|
this.setState({
|
||||||
|
showModel: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
handleCancel(): void {
|
||||||
|
this.setState({
|
||||||
|
showModel: false,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
handleConfirm(): void {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
render(): ReactNode {
|
render(): ReactNode {
|
||||||
const middleButton = this.state.isMember ? (
|
const middleButton = this.state.isMember ? (
|
||||||
<View
|
<View
|
||||||
|
|
@ -35,13 +53,20 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
|
||||||
>
|
>
|
||||||
<View
|
<View
|
||||||
className='at-col'
|
className='at-col'
|
||||||
style={{ marginLeft: 10, paddingRight: 5, width: '50%' }}
|
style={{ marginLeft: 10, paddingRight: 5, width: '33%' }}
|
||||||
|
>
|
||||||
|
<AtButton type='secondary'>{pt.get().ticketDetail.pick}</AtButton>
|
||||||
|
</View>
|
||||||
|
<View
|
||||||
|
className='at-col'
|
||||||
|
style={{ marginLeft: 10, paddingRight: 5, width: '33%' }}
|
||||||
|
onClick={this.onAddToOreo.bind(this)}
|
||||||
>
|
>
|
||||||
<AtButton type='primary'>{pt.get().ticketDetail.addToOreo}</AtButton>
|
<AtButton type='primary'>{pt.get().ticketDetail.addToOreo}</AtButton>
|
||||||
</View>
|
</View>
|
||||||
<View
|
<View
|
||||||
className='at-col'
|
className='at-col'
|
||||||
style={{ marginRight: 10, paddingLeft: 5, width: '50%' }}
|
style={{ marginRight: 10, paddingLeft: 5, width: '33%' }}
|
||||||
>
|
>
|
||||||
<AtButton type='secondary'>{pt.get().ticketDetail.addNote}</AtButton>
|
<AtButton type='secondary'>{pt.get().ticketDetail.addNote}</AtButton>
|
||||||
</View>
|
</View>
|
||||||
|
|
@ -77,6 +102,15 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View>
|
<View>
|
||||||
|
<AtModal
|
||||||
|
isOpened={this.state.showModel}
|
||||||
|
title={pt.get().modal.addToOreo.title}
|
||||||
|
cancelText={pt.get().modal.cancel}
|
||||||
|
confirmText={pt.get().modal.confirm}
|
||||||
|
onCancel={this.handleCancel.bind(this)}
|
||||||
|
onConfirm={this.handleConfirm.bind(this)}
|
||||||
|
content={pt.get().modal.addToOreo.content}
|
||||||
|
/>
|
||||||
<DetailFramework
|
<DetailFramework
|
||||||
middleButton={middleButton}
|
middleButton={middleButton}
|
||||||
id={this.state.id}
|
id={this.state.id}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
export interface ModalText {
|
||||||
|
comment: {
|
||||||
|
title: string;
|
||||||
|
content: string;
|
||||||
|
};
|
||||||
|
addToOreo: {
|
||||||
|
title: string;
|
||||||
|
content: string;
|
||||||
|
};
|
||||||
|
cancel: string;
|
||||||
|
confirm: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const modalZhCn: ModalText = {
|
||||||
|
comment: {
|
||||||
|
title: '添加评论',
|
||||||
|
content: '',
|
||||||
|
},
|
||||||
|
addToOreo: {
|
||||||
|
title: '将工单加入 Oreo',
|
||||||
|
content: '确认加入 Oreo?加入后将无法撤回!',
|
||||||
|
},
|
||||||
|
cancel: '取消',
|
||||||
|
confirm: '确认',
|
||||||
|
};
|
||||||
|
|
||||||
|
export const modalEnUs: ModalText = {
|
||||||
|
comment: {
|
||||||
|
title: 'Add comment',
|
||||||
|
content: '',
|
||||||
|
},
|
||||||
|
addToOreo: {
|
||||||
|
title: 'Add ticket to Oreo',
|
||||||
|
content: 'Once Confirmed, the change will be irrevocably!',
|
||||||
|
},
|
||||||
|
cancel: 'Cancel',
|
||||||
|
confirm: 'Confirm',
|
||||||
|
};
|
||||||
|
|
@ -13,6 +13,7 @@ export interface TicketDetailText {
|
||||||
tookAway: string;
|
tookAway: string;
|
||||||
addToOreo: string;
|
addToOreo: string;
|
||||||
addNote: string;
|
addNote: string;
|
||||||
|
pick: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ticketDetailZhCn: TicketDetailText = {
|
export const ticketDetailZhCn: TicketDetailText = {
|
||||||
|
|
@ -35,6 +36,7 @@ export const ticketDetailZhCn: TicketDetailText = {
|
||||||
tookAway: '已取回',
|
tookAway: '已取回',
|
||||||
addToOreo: '加入 Oreo',
|
addToOreo: '加入 Oreo',
|
||||||
addNote: '添加评论',
|
addNote: '添加评论',
|
||||||
|
pick: '认领',
|
||||||
};
|
};
|
||||||
|
|
||||||
export const ticketDetailEnUs: TicketDetailText = {
|
export const ticketDetailEnUs: TicketDetailText = {
|
||||||
|
|
@ -56,5 +58,6 @@ export const ticketDetailEnUs: TicketDetailText = {
|
||||||
descTitle: 'Problem description',
|
descTitle: 'Problem description',
|
||||||
tookAway: 'Already retrieved',
|
tookAway: 'Already retrieved',
|
||||||
addToOreo: 'Add to Oreo',
|
addToOreo: 'Add to Oreo',
|
||||||
addNote: 'Add a comment',
|
addNote: 'Comment',
|
||||||
|
pick: 'Pick',
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ import {
|
||||||
} from './TicketDetail';
|
} from './TicketDetail';
|
||||||
import { CommonText, commonTextEnUs, commonTextZhCn } from './common';
|
import { CommonText, commonTextEnUs, commonTextZhCn } from './common';
|
||||||
import { TipsText, tipsEnUs, tipsZhCn } from './Tips';
|
import { TipsText, tipsEnUs, tipsZhCn } from './Tips';
|
||||||
|
import { ModalText, modalEnUs, modalZhCn } from './Modal';
|
||||||
|
|
||||||
interface TextRecord {
|
interface TextRecord {
|
||||||
common: CommonText;
|
common: CommonText;
|
||||||
|
|
@ -34,6 +35,7 @@ interface TextRecord {
|
||||||
repairPage: RepairPageText;
|
repairPage: RepairPageText;
|
||||||
ticketDetail: TicketDetailText;
|
ticketDetail: TicketDetailText;
|
||||||
tips: TipsText;
|
tips: TipsText;
|
||||||
|
modal: ModalText;
|
||||||
}
|
}
|
||||||
|
|
||||||
const textZhCn: TextRecord = {
|
const textZhCn: TextRecord = {
|
||||||
|
|
@ -52,6 +54,7 @@ const textZhCn: TextRecord = {
|
||||||
repairPage: repairPageZhCn,
|
repairPage: repairPageZhCn,
|
||||||
ticketDetail: ticketDetailZhCn,
|
ticketDetail: ticketDetailZhCn,
|
||||||
tips: tipsZhCn,
|
tips: tipsZhCn,
|
||||||
|
modal: modalZhCn,
|
||||||
};
|
};
|
||||||
|
|
||||||
const textEnUs: TextRecord = {
|
const textEnUs: TextRecord = {
|
||||||
|
|
@ -70,6 +73,7 @@ const textEnUs: TextRecord = {
|
||||||
repairPage: repairPageEnUs,
|
repairPage: repairPageEnUs,
|
||||||
ticketDetail: ticketDetailEnUs,
|
ticketDetail: ticketDetailEnUs,
|
||||||
tips: tipsEnUs,
|
tips: tipsEnUs,
|
||||||
|
modal: modalEnUs,
|
||||||
};
|
};
|
||||||
|
|
||||||
// type Lang = 'zh_CN' | 'en_US' | ...;
|
// type Lang = 'zh_CN' | 'en_US' | ...;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue