add ticket detail button
parent
f17bfa2a9e
commit
0120da0760
|
|
@ -3,6 +3,7 @@ import { Component, ReactNode } from 'react';
|
||||||
import { TicketNote, StatusStr } from '@/pages/TicketDetail/TicketNote';
|
import { TicketNote, StatusStr } from '@/pages/TicketDetail/TicketNote';
|
||||||
import pt from '@/plain-text';
|
import pt from '@/plain-text';
|
||||||
import { timeFormat } from '@/utils';
|
import { timeFormat } from '@/utils';
|
||||||
|
import { AtDivider } from 'taro-ui';
|
||||||
import './NoteCard.scss';
|
import './NoteCard.scss';
|
||||||
|
|
||||||
interface NoteCardProps {
|
interface NoteCardProps {
|
||||||
|
|
@ -13,6 +14,7 @@ export default class NoteCard extends Component<NoteCardProps, {}> {
|
||||||
props: Readonly<NoteCardProps> = {
|
props: Readonly<NoteCardProps> = {
|
||||||
note: new TicketNote(),
|
note: new TicketNote(),
|
||||||
};
|
};
|
||||||
|
|
||||||
render(): ReactNode {
|
render(): ReactNode {
|
||||||
var message = '';
|
var message = '';
|
||||||
const note = this.props.note;
|
const note = this.props.note;
|
||||||
|
|
@ -35,10 +37,12 @@ export default class NoteCard extends Component<NoteCardProps, {}> {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View>
|
<View>
|
||||||
<View>
|
<View className='at-article__h2'>{note.op}</View>
|
||||||
{note.op} {note.createdTime.format(timeFormat)}
|
<View className='at-article__info'>
|
||||||
|
{note.createdTime.format(timeFormat)}
|
||||||
</View>
|
</View>
|
||||||
<View>{message}</View>
|
<View className='at-article__p'>{message}</View>
|
||||||
|
<AtDivider />
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ export default class NoteList extends Component<NoteListProps, {}> {
|
||||||
return (
|
return (
|
||||||
<View>
|
<View>
|
||||||
{this.props.noteList.map((note, idx) => (
|
{this.props.noteList.map((note, idx) => (
|
||||||
<View key={idx} style={{ marginTop: 8 }}>
|
<View key={idx}>
|
||||||
<NoteCard note={note} />
|
<NoteCard note={note} />
|
||||||
</View>
|
</View>
|
||||||
))}
|
))}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import { View } from '@tarojs/components';
|
||||||
import { getCurrentInstance } from '@tarojs/runtime';
|
import { getCurrentInstance } from '@tarojs/runtime';
|
||||||
import Taro from '@tarojs/taro';
|
import Taro from '@tarojs/taro';
|
||||||
import pt from '@/plain-text';
|
import pt from '@/plain-text';
|
||||||
import { AtCard, AtSteps } from 'taro-ui';
|
import { AtCard, AtSteps, AtButton } from 'taro-ui';
|
||||||
import { RequestState } from '@/service';
|
import { RequestState } from '@/service';
|
||||||
import { getTicketInfo } from '@/service/ticketsInfo';
|
import { getTicketInfo } from '@/service/ticketsInfo';
|
||||||
import { FixStatus } from '@/common';
|
import { FixStatus } from '@/common';
|
||||||
|
|
@ -74,11 +74,11 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
|
||||||
' ' +
|
' ' +
|
||||||
this.state.ticketInfo.deviceModel}
|
this.state.ticketInfo.deviceModel}
|
||||||
</View>
|
</View>
|
||||||
<View className='at-article__h3'>
|
<View className='at-article__info'>
|
||||||
{pt.get().common.createdAtText(this.state.ticketInfo.createdTime)}
|
{pt.get().common.createdAtText(this.state.ticketInfo.createdTime)}
|
||||||
</View>
|
</View>
|
||||||
<View style={{ marginTop: 10, marginBottom: 10 }}>
|
<View style={{ marginTop: 10, marginBottom: 10 }}>
|
||||||
<AtCard title='问题描述'>
|
<AtCard title={pt.get().ticketDetail.descTitle}>
|
||||||
<View className='at-article__h3'>
|
<View className='at-article__h3'>
|
||||||
{this.state.ticketInfo.description}
|
{this.state.ticketInfo.description}
|
||||||
</View>
|
</View>
|
||||||
|
|
@ -91,6 +91,25 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
|
||||||
onChange={() => {}}
|
onChange={() => {}}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
|
<View
|
||||||
|
className='at-row'
|
||||||
|
style={{ paddingTop: 10, paddingBottom: 10, width: '100%' }}
|
||||||
|
>
|
||||||
|
<View
|
||||||
|
className='at-col'
|
||||||
|
style={{ marginLeft: 10, paddingRight: 5, width: '50%' }}
|
||||||
|
>
|
||||||
|
<AtButton type='primary'>{pt.get().ticketDetail.tookAway}</AtButton>
|
||||||
|
</View>
|
||||||
|
<View
|
||||||
|
className='at-col'
|
||||||
|
style={{ marginRight: 10, paddingLeft: 5, width: '50%' }}
|
||||||
|
>
|
||||||
|
<AtButton type='secondary'>
|
||||||
|
{pt.get().ticketDetail.addNote}
|
||||||
|
</AtButton>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
<View style={{ padding: 10 }}>
|
<View style={{ padding: 10 }}>
|
||||||
<NoteList noteList={this.state.notes} />
|
<NoteList noteList={this.state.notes} />
|
||||||
</View>
|
</View>
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,9 @@ export interface TicketDetailText {
|
||||||
createTicketMessage: string;
|
createTicketMessage: string;
|
||||||
statusModifyPrefix: string;
|
statusModifyPrefix: string;
|
||||||
statusModifyMessage: Map<StatusStr, string>;
|
statusModifyMessage: Map<StatusStr, string>;
|
||||||
|
descTitle: string;
|
||||||
|
tookAway: string;
|
||||||
|
addNote: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ticketDetailZhCn: TicketDetailText = {
|
export const ticketDetailZhCn: TicketDetailText = {
|
||||||
|
|
@ -27,6 +30,9 @@ export const ticketDetailZhCn: TicketDetailText = {
|
||||||
['4', '维修成功待取回'],
|
['4', '维修成功待取回'],
|
||||||
['5', '维修成功已取回'],
|
['5', '维修成功已取回'],
|
||||||
]),
|
]),
|
||||||
|
descTitle: '问题描述',
|
||||||
|
tookAway: '已取回',
|
||||||
|
addNote: '添加评论',
|
||||||
};
|
};
|
||||||
|
|
||||||
export const ticketDetailEnUs: TicketDetailText = {
|
export const ticketDetailEnUs: TicketDetailText = {
|
||||||
|
|
@ -45,4 +51,7 @@ export const ticketDetailEnUs: TicketDetailText = {
|
||||||
['4', 'Device to be taken home'],
|
['4', 'Device to be taken home'],
|
||||||
['5', 'Ticket finished'],
|
['5', 'Ticket finished'],
|
||||||
]),
|
]),
|
||||||
|
descTitle: 'Problem description',
|
||||||
|
tookAway: 'Already took home',
|
||||||
|
addNote: 'Add a comment',
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue