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