add entrance to ticket detail
parent
2920059ffa
commit
4d6a769fea
|
|
@ -8,6 +8,7 @@ export default defineAppConfig({
|
||||||
'pages/user/about/about',
|
'pages/user/about/about',
|
||||||
'pages/user/report/report',
|
'pages/user/report/report',
|
||||||
'pages/user/member/member',
|
'pages/user/member/member',
|
||||||
|
'pages/TicketDetail/TicketDetail',
|
||||||
],
|
],
|
||||||
window: {
|
window: {
|
||||||
backgroundTextStyle: 'light',
|
backgroundTextStyle: 'light',
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
export default definePageConfig({
|
||||||
|
usingComponents: {},
|
||||||
|
});
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
import { Component, ReactNode } from 'react';
|
||||||
|
import { View } from '@tarojs/components';
|
||||||
|
import { getCurrentInstance } from '@tarojs/runtime';
|
||||||
|
import Taro from '@tarojs/taro';
|
||||||
|
|
||||||
|
export default class TicketDetail extends Component {
|
||||||
|
state = {
|
||||||
|
id: 0,
|
||||||
|
};
|
||||||
|
componentDidMount(): void {
|
||||||
|
Taro.setNavigationBarTitle({
|
||||||
|
title: '工单详情',
|
||||||
|
});
|
||||||
|
const { router } = getCurrentInstance();
|
||||||
|
const id = router?.params.id;
|
||||||
|
this.setState({
|
||||||
|
id: id,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
render(): ReactNode {
|
||||||
|
return <View>TicketDetail: {this.state.id}</View>;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -14,6 +14,7 @@ import './myTicket.scss';
|
||||||
type FixStatus = 1 | 2 | 3 | 4 | 5;
|
type FixStatus = 1 | 2 | 3 | 4 | 5;
|
||||||
|
|
||||||
class TicketListItem {
|
class TicketListItem {
|
||||||
|
id: number;
|
||||||
brand: string;
|
brand: string;
|
||||||
model: string;
|
model: string;
|
||||||
status: FixStatus;
|
status: FixStatus;
|
||||||
|
|
@ -21,11 +22,13 @@ class TicketListItem {
|
||||||
iconMap: Map<FixStatus, string>;
|
iconMap: Map<FixStatus, string>;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
id: number,
|
||||||
brand: string,
|
brand: string,
|
||||||
model: string,
|
model: string,
|
||||||
status: FixStatus,
|
status: FixStatus,
|
||||||
createAt: moment.Moment,
|
createAt: moment.Moment,
|
||||||
) {
|
) {
|
||||||
|
this.id = id;
|
||||||
this.brand = brand;
|
this.brand = brand;
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this.status = status;
|
this.status = status;
|
||||||
|
|
@ -48,6 +51,11 @@ class TicketListItem {
|
||||||
extraText={tl.statusMap.get(this.status)}
|
extraText={tl.statusMap.get(this.status)}
|
||||||
arrow='right'
|
arrow='right'
|
||||||
thumb={this.iconMap.get(this.status)}
|
thumb={this.iconMap.get(this.status)}
|
||||||
|
onClick={() => {
|
||||||
|
Taro.navigateTo({
|
||||||
|
url: '/pages/TicketDetail/TicketDetail?id=' + this.id,
|
||||||
|
});
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -57,7 +65,7 @@ export default class SettingsPage extends Component {
|
||||||
state = {
|
state = {
|
||||||
loading: true,
|
loading: true,
|
||||||
success: false,
|
success: false,
|
||||||
fixList: [new TicketListItem('华硕', '天选3', 3, moment())],
|
fixList: [new TicketListItem(0, '', '', 1, moment())],
|
||||||
};
|
};
|
||||||
|
|
||||||
componentDidMount(): void {
|
componentDidMount(): void {
|
||||||
|
|
@ -82,6 +90,7 @@ export default class SettingsPage extends Component {
|
||||||
fixList: res.data.data.list.map(
|
fixList: res.data.data.list.map(
|
||||||
item =>
|
item =>
|
||||||
new TicketListItem(
|
new TicketListItem(
|
||||||
|
item.id,
|
||||||
item.device,
|
item.device,
|
||||||
item.deviceModel,
|
item.deviceModel,
|
||||||
item.status,
|
item.status,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue