add entrance to ticket detail
parent
2920059ffa
commit
4d6a769fea
|
|
@ -8,6 +8,7 @@ export default defineAppConfig({
|
|||
'pages/user/about/about',
|
||||
'pages/user/report/report',
|
||||
'pages/user/member/member',
|
||||
'pages/TicketDetail/TicketDetail',
|
||||
],
|
||||
window: {
|
||||
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;
|
||||
|
||||
class TicketListItem {
|
||||
id: number;
|
||||
brand: string;
|
||||
model: string;
|
||||
status: FixStatus;
|
||||
|
|
@ -21,11 +22,13 @@ class TicketListItem {
|
|||
iconMap: Map<FixStatus, string>;
|
||||
|
||||
constructor(
|
||||
id: number,
|
||||
brand: string,
|
||||
model: string,
|
||||
status: FixStatus,
|
||||
createAt: moment.Moment,
|
||||
) {
|
||||
this.id = id;
|
||||
this.brand = brand;
|
||||
this.model = model;
|
||||
this.status = status;
|
||||
|
|
@ -48,6 +51,11 @@ class TicketListItem {
|
|||
extraText={tl.statusMap.get(this.status)}
|
||||
arrow='right'
|
||||
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 = {
|
||||
loading: true,
|
||||
success: false,
|
||||
fixList: [new TicketListItem('华硕', '天选3', 3, moment())],
|
||||
fixList: [new TicketListItem(0, '', '', 1, moment())],
|
||||
};
|
||||
|
||||
componentDidMount(): void {
|
||||
|
|
@ -82,6 +90,7 @@ export default class SettingsPage extends Component {
|
|||
fixList: res.data.data.list.map(
|
||||
item =>
|
||||
new TicketListItem(
|
||||
item.id,
|
||||
item.device,
|
||||
item.deviceModel,
|
||||
item.status,
|
||||
|
|
|
|||
Loading…
Reference in New Issue