beautify ui; fix current ticket card title display bug
parent
31d7aea480
commit
f20a38af9b
|
|
@ -3,7 +3,6 @@ import { Component, ReactNode } from 'react';
|
|||
import { TicketNote, StatusStr } from '@/pages/TicketDetail/TicketNote';
|
||||
import pt from '@/plain-text';
|
||||
import { timeFormat } from '@/utils';
|
||||
import { AtDivider } from 'taro-ui';
|
||||
import './NoteCard.scss';
|
||||
|
||||
interface NoteCardProps {
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import NoteCard from '@/components/NoteCard/NoteCard';
|
|||
import { TicketNote } from '@/pages/TicketDetail/TicketNote';
|
||||
import { View } from '@tarojs/components';
|
||||
import { AtDivider } from 'taro-ui';
|
||||
import pt from '@/plain-text';
|
||||
|
||||
interface NoteListProps {
|
||||
noteList: Array<TicketNote>;
|
||||
|
|
@ -15,7 +16,11 @@ export default class NoteList extends Component<NoteListProps, {}> {
|
|||
render(): ReactNode {
|
||||
return (
|
||||
<View>
|
||||
<AtDivider height={40} />
|
||||
<AtDivider
|
||||
fontColor='#CCC'
|
||||
content={pt.get().ticketDetail.divider}
|
||||
height={40}
|
||||
/>
|
||||
{this.props.noteList.map((note, idx) => (
|
||||
<View key={idx}>
|
||||
<NoteCard note={note} />
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class CardContent {
|
|||
|
||||
function mainPageCard(c: CardContent): JSX.Element {
|
||||
return (
|
||||
<View style={{ marginTop: 10 }}>
|
||||
<View style={{ marginTop: 10, marginBottom: 20 }}>
|
||||
<AtCard note={c.note} extra={c.extra} title={c.title}>
|
||||
{c.content()}
|
||||
</AtCard>
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ const submitInterval = 5000;
|
|||
const middleButton = <View></View>;
|
||||
|
||||
const isInfoShow = {
|
||||
device: true,
|
||||
device: false,
|
||||
createdTime: true,
|
||||
description: false,
|
||||
current: true,
|
||||
|
|
@ -183,29 +183,34 @@ export default class RepairPage extends Component<{}, RepairPageState> {
|
|||
}
|
||||
|
||||
render(): ReactNode {
|
||||
const ticketsRenderer = this.state.currentTicketsIdName.map((pair, idx) => (
|
||||
<AtCard
|
||||
key={idx}
|
||||
title={pair.get(pair.keys()[0])} //pair.keys()[0] == id
|
||||
extra={pt.get().repairPage.currentTicket.extra}
|
||||
onClick={() => {
|
||||
Taro.navigateTo({
|
||||
url: '/pages/TicketDetail/TicketDetail?id=' + pair.keys()[0],
|
||||
});
|
||||
}}
|
||||
note={
|
||||
pt.get().tips.tipsText[
|
||||
randomInt(0, pt.get().tips.tipsText.length - 1)
|
||||
]
|
||||
}
|
||||
>
|
||||
<DetailFramework
|
||||
id={pair.keys()[0]}
|
||||
isInfoShow={isInfoShow}
|
||||
middleButton={middleButton}
|
||||
/>
|
||||
</AtCard>
|
||||
));
|
||||
const ticketsRenderer =
|
||||
this.state.currentTicketsIdName.length !== 0 ? (
|
||||
this.state.currentTicketsIdName.map((pair, idx) => (
|
||||
<AtCard
|
||||
key={idx}
|
||||
title={pair.get(pair.keys().next().value)} //pair.keys().next().value == id
|
||||
extra={pt.get().repairPage.currentTicket.extra}
|
||||
onClick={() => {
|
||||
Taro.navigateTo({
|
||||
url: '/pages/TicketDetail/TicketDetail?id=' + pair.keys()[0],
|
||||
});
|
||||
}}
|
||||
note={
|
||||
pt.get().tips.tipsText[
|
||||
randomInt(0, pt.get().tips.tipsText.length - 1)
|
||||
]
|
||||
}
|
||||
>
|
||||
<DetailFramework
|
||||
id={pair.keys()[0]}
|
||||
isInfoShow={isInfoShow}
|
||||
middleButton={middleButton}
|
||||
/>
|
||||
</AtCard>
|
||||
))
|
||||
) : (
|
||||
<View></View>
|
||||
);
|
||||
return (
|
||||
<View style={{ width: '94%', marginLeft: '3%' }}>
|
||||
<AtMessage />
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ export const mainPageZhCn: MainPageText = {
|
|||
{ title: '维修结束,取回电脑' },
|
||||
],
|
||||
tipsList: [
|
||||
{ title: '戴尔/外星人、Surface、苹果电脑不能拆机哦~' },
|
||||
{ title: '戴尔/外星人、Surface、苹果电脑不能拆哦~' },
|
||||
{ title: '数据无价,请随时做好数据备份哦~' },
|
||||
{ title: '204 也是实验室,请勿在内饮食~' },
|
||||
{ title: '我们是志愿服务,不收取任何礼物哦~' },
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ export interface TicketDetailText {
|
|||
statusModifyPrefix: string;
|
||||
statusModifyMessage: Map<StatusStr, string>;
|
||||
descTitle: string;
|
||||
divider: string;
|
||||
info: {
|
||||
title: string;
|
||||
extra: string;
|
||||
|
|
@ -45,7 +46,7 @@ export const ticketDetailZhCn: TicketDetailText = {
|
|||
{ title: '工单完成' },
|
||||
],
|
||||
createTicketMessage: '创建了维修',
|
||||
statusModifyPrefix: '将维修状态更改为:',
|
||||
statusModifyPrefix: '将维修状态改为:',
|
||||
statusModifyMessage: new Map<StatusStr, string>([
|
||||
['0', '已创建/交接中'],
|
||||
['1', '维修中'],
|
||||
|
|
@ -57,6 +58,7 @@ export const ticketDetailZhCn: TicketDetailText = {
|
|||
['7', '维修翻车已取回'],
|
||||
]),
|
||||
descTitle: '问题描述',
|
||||
divider: '评论 / 状态',
|
||||
info: {
|
||||
title: '机主姓名',
|
||||
extra: '联系方式',
|
||||
|
|
@ -104,6 +106,7 @@ export const ticketDetailEnUs: TicketDetailText = {
|
|||
['7', 'Retrieved (Failed)'],
|
||||
]),
|
||||
descTitle: 'Description',
|
||||
divider: 'Comment / Status',
|
||||
info: {
|
||||
title: 'Name',
|
||||
extra: 'Contact',
|
||||
|
|
|
|||
|
|
@ -16,7 +16,11 @@ export function getCurrentTicket(that: RepairPage) {
|
|||
const data = res.data.data;
|
||||
let newIdNameList: Array<Map<number, string>> = [];
|
||||
data.list.map((ticket: TicketListItem) => {
|
||||
if (ticket['status'] !== 5) {
|
||||
if (
|
||||
ticket['status'] !== 3 &&
|
||||
ticket['status'] !== 5 &&
|
||||
ticket['status'] !== 7
|
||||
) {
|
||||
newIdNameList.push(
|
||||
new Map([
|
||||
[ticket['id'], ticket['device'] + ' ' + ticket['deviceModel']],
|
||||
|
|
|
|||
Loading…
Reference in New Issue