Compare commits
6
Commits
e82225ecbc
...
yhy
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9931b23337 | ||
|
|
84507f7214 | ||
|
|
802d008767 | ||
|
|
c070b356fe | ||
|
|
b1c0e5d8b1 | ||
|
|
0dac2ad185 |
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
{
|
{
|
||||||
"id": 6830,
|
"id": 6830,
|
||||||
"type": 1,
|
"type": 1,
|
||||||
"status": 5,
|
"status": 2,
|
||||||
"device": "主机",
|
"device": "主机",
|
||||||
"deviceModel": "技嘉",
|
"deviceModel": "技嘉",
|
||||||
"owner": "武技栏",
|
"owner": "武技栏",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"id": 6847,
|
"id": 6830,
|
||||||
"type": 1,
|
"type": 1,
|
||||||
"device": "华硕",
|
"device": "华硕",
|
||||||
"deviceModel": "灵耀X14",
|
"deviceModel": "灵耀X14",
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
"description": "清灰",
|
"description": "清灰",
|
||||||
"workers": [],
|
"workers": [],
|
||||||
"createdTime": "2024-03-07T19:52:48.523303",
|
"createdTime": "2024-03-07T19:52:48.523303",
|
||||||
"status": 5,
|
"status": 2,
|
||||||
"isConfirmed": false,
|
"isConfirmed": false,
|
||||||
"notes": [
|
"notes": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"list": [
|
"list": [
|
||||||
{
|
{
|
||||||
"id": 6830,
|
"id": 6832,
|
||||||
"type": 1,
|
"type": 1,
|
||||||
"status": 2,
|
"status": 2,
|
||||||
"device": "ROG",
|
"device": "ROG",
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
export default {
|
||||||
|
component: true,
|
||||||
|
};
|
||||||
@@ -0,0 +1,155 @@
|
|||||||
|
import { View } from '@tarojs/components';
|
||||||
|
import { Component, ReactNode } from 'react';
|
||||||
|
import Taro from '@tarojs/taro';
|
||||||
|
import {
|
||||||
|
ShowElements,
|
||||||
|
TicketInfo,
|
||||||
|
TicketNote,
|
||||||
|
} from '@/pages/TicketDetail/TicketNote';
|
||||||
|
import pt from '@/plain-text';
|
||||||
|
import { RequestState } from '@/service';
|
||||||
|
import { getTicketInfo } from '@/service/ticketsInfo';
|
||||||
|
import { FixStatus } from '@/common';
|
||||||
|
import { AtCard, AtSteps } from 'taro-ui';
|
||||||
|
import NoteList from '../NoteList/NoteList';
|
||||||
|
|
||||||
|
interface StepItemData {
|
||||||
|
title: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const mapStatusStep: Map<FixStatus, 0 | 1 | 2 | 3> = new Map([
|
||||||
|
[1, 0],
|
||||||
|
[2, 1],
|
||||||
|
[3, 2],
|
||||||
|
[4, 2],
|
||||||
|
[5, 3],
|
||||||
|
]);
|
||||||
|
|
||||||
|
interface DetailFrameworkState {
|
||||||
|
current: number;
|
||||||
|
items: Array<StepItemData>;
|
||||||
|
ticketInfo: TicketInfo;
|
||||||
|
notes: Array<TicketNote>;
|
||||||
|
rs: RequestState;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface DetailFrameworkProps {
|
||||||
|
middleButton: JSX.Element;
|
||||||
|
id: number;
|
||||||
|
isInfoShow: { [key: string]: boolean };
|
||||||
|
}
|
||||||
|
|
||||||
|
export default class DetailFramework extends Component<
|
||||||
|
DetailFrameworkProps,
|
||||||
|
DetailFrameworkState
|
||||||
|
> {
|
||||||
|
state = {
|
||||||
|
current: 0,
|
||||||
|
items: [],
|
||||||
|
ticketInfo: new TicketInfo(),
|
||||||
|
notes: [new TicketNote()],
|
||||||
|
rs: new RequestState(),
|
||||||
|
};
|
||||||
|
|
||||||
|
componentDidMount(): void {
|
||||||
|
const navBar = pt.get().navBar;
|
||||||
|
Taro.setNavigationBarTitle({
|
||||||
|
title: navBar.ticketDetail,
|
||||||
|
});
|
||||||
|
getTicketInfo(this, this.props.id);
|
||||||
|
}
|
||||||
|
|
||||||
|
props: Readonly<DetailFrameworkProps> = {
|
||||||
|
middleButton: <View></View>,
|
||||||
|
id: 0,
|
||||||
|
isInfoShow: {
|
||||||
|
device: true,
|
||||||
|
createdTime: true,
|
||||||
|
description: true,
|
||||||
|
current: true,
|
||||||
|
notelist: true,
|
||||||
|
showAllNotes: true,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
render(): ReactNode {
|
||||||
|
if (this.state.rs.loading) {
|
||||||
|
return <View>Loading</View>;
|
||||||
|
} else if (!this.state.rs.success) {
|
||||||
|
return <View>Request failed</View>;
|
||||||
|
}
|
||||||
|
|
||||||
|
const status = this.state.ticketInfo.status;
|
||||||
|
this.setState({
|
||||||
|
current: mapStatusStep.get(status) || 0,
|
||||||
|
items: pt.get().ticketDetail.stepItems,
|
||||||
|
});
|
||||||
|
|
||||||
|
const elements: ShowElements = {
|
||||||
|
device: this.props.isInfoShow['device'] ? (
|
||||||
|
<View className='at-article__h1'>
|
||||||
|
{this.state.ticketInfo.device +
|
||||||
|
' ' +
|
||||||
|
this.state.ticketInfo.deviceModel}
|
||||||
|
</View>
|
||||||
|
) : (
|
||||||
|
<View></View>
|
||||||
|
),
|
||||||
|
createdTime: this.props.isInfoShow['createdTime'] ? (
|
||||||
|
<View className='at-article__info'>
|
||||||
|
{pt.get().common.createdAtText(this.state.ticketInfo.createdTime)}
|
||||||
|
</View>
|
||||||
|
) : (
|
||||||
|
<View></View>
|
||||||
|
),
|
||||||
|
description: this.props.isInfoShow['description'] ? (
|
||||||
|
<View style={{ marginTop: 10, marginBottom: 10 }}>
|
||||||
|
<AtCard title={pt.get().ticketDetail.descTitle}>
|
||||||
|
<View className='at-article__h3'>
|
||||||
|
{this.state.ticketInfo.description}
|
||||||
|
</View>
|
||||||
|
</AtCard>
|
||||||
|
</View>
|
||||||
|
) : (
|
||||||
|
<View></View>
|
||||||
|
),
|
||||||
|
current: this.props.isInfoShow['current'] ? (
|
||||||
|
<View style={{ padding: 10 }}>
|
||||||
|
<AtSteps
|
||||||
|
items={this.state.items}
|
||||||
|
current={this.state.current}
|
||||||
|
onChange={() => {}}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
) : (
|
||||||
|
<View></View>
|
||||||
|
),
|
||||||
|
notelist: this.props.isInfoShow['notelist'] ? (
|
||||||
|
this.props.isInfoShow['showAllNotes'] ? (
|
||||||
|
<View style={{ padding: 10 }}>
|
||||||
|
<NoteList noteList={this.state.notes} />
|
||||||
|
</View>
|
||||||
|
) : (
|
||||||
|
<View style={{ padding: 10 }}>
|
||||||
|
<NoteList
|
||||||
|
noteList={[this.state.notes[this.state.notes.length - 1]]}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
) : (
|
||||||
|
<View></View>
|
||||||
|
),
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View>
|
||||||
|
{elements.device}
|
||||||
|
{elements.createdTime}
|
||||||
|
{elements.description}
|
||||||
|
{elements.current}
|
||||||
|
{this.props.middleButton}
|
||||||
|
{elements.notelist}
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
export default {
|
||||||
|
component: true,
|
||||||
|
};
|
||||||
@@ -1,118 +1,65 @@
|
|||||||
import { Component, ReactNode } from 'react';
|
import { Component, ReactNode } from 'react';
|
||||||
import { View } from '@tarojs/components';
|
import { View } from '@tarojs/components';
|
||||||
import { getCurrentInstance } from '@tarojs/runtime';
|
import { getCurrentInstance } from '@tarojs/runtime';
|
||||||
import Taro from '@tarojs/taro';
|
|
||||||
import pt from '@/plain-text';
|
import pt from '@/plain-text';
|
||||||
import { AtCard, AtSteps, AtButton } from 'taro-ui';
|
import { AtButton } from 'taro-ui';
|
||||||
import { RequestState } from '@/service';
|
import DetailFramework from '@/components/DetailFramework/DetailFramework';
|
||||||
import { getTicketInfo } from '@/service/ticketsInfo';
|
|
||||||
import { FixStatus } from '@/common';
|
|
||||||
import PageFooter from '@/components/PageFooter/PageFooter';
|
import PageFooter from '@/components/PageFooter/PageFooter';
|
||||||
import NoteList from '@/components/NoteList/NoteList';
|
|
||||||
import { TicketNote, TicketInfo } from './TicketNote';
|
|
||||||
|
|
||||||
const mapStatusStep: Map<FixStatus, 0 | 1 | 2 | 3> = new Map([
|
|
||||||
[1, 0],
|
|
||||||
[2, 1],
|
|
||||||
[3, 2],
|
|
||||||
[4, 2],
|
|
||||||
[5, 3],
|
|
||||||
]);
|
|
||||||
|
|
||||||
interface StepItemData {
|
|
||||||
title: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface TicketDetailState {
|
interface TicketDetailState {
|
||||||
current: number;
|
id: number;
|
||||||
items: Array<StepItemData>;
|
|
||||||
ticketInfo: TicketInfo;
|
|
||||||
notes: Array<TicketNote>;
|
|
||||||
rs: RequestState;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class TicketDetail extends Component<{}, TicketDetailState> {
|
export default class TicketDetail extends Component<{}, TicketDetailState> {
|
||||||
state = {
|
state: Readonly<TicketDetailState> = {
|
||||||
current: 0,
|
id: 0,
|
||||||
items: [],
|
|
||||||
ticketInfo: new TicketInfo(),
|
|
||||||
notes: [new TicketNote()],
|
|
||||||
rs: new RequestState(),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
componentDidMount(): void {
|
componentDidMount(): void {
|
||||||
const navBar = pt.get().navBar;
|
|
||||||
Taro.setNavigationBarTitle({
|
|
||||||
title: navBar.ticketDetail,
|
|
||||||
});
|
|
||||||
const { router } = getCurrentInstance();
|
const { router } = getCurrentInstance();
|
||||||
const id = router?.params.id as number;
|
const id = router?.params.id as number;
|
||||||
const items = pt.get().ticketDetail.stepItems;
|
|
||||||
this.setState({
|
this.setState({
|
||||||
items: items,
|
id: id,
|
||||||
});
|
});
|
||||||
|
|
||||||
getTicketInfo(this, id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
render(): ReactNode {
|
render(): ReactNode {
|
||||||
if (this.state.rs.loading) {
|
const middleButton = (
|
||||||
return <View>Loading</View>;
|
<View
|
||||||
} else if (!this.state.rs.success) {
|
className='at-row'
|
||||||
return <View>Request failed</View>;
|
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>
|
||||||
|
);
|
||||||
|
|
||||||
const status = this.state.ticketInfo.status;
|
const isInfoShow = {
|
||||||
this.setState({
|
device: true,
|
||||||
current: mapStatusStep.get(status) || 0,
|
createdTime: true,
|
||||||
});
|
description: true,
|
||||||
|
current: true,
|
||||||
|
notelist: true,
|
||||||
|
showAllNotes: true,
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View>
|
<View>
|
||||||
<View className='at-article__h1'>
|
<DetailFramework
|
||||||
{this.state.ticketInfo.device +
|
middleButton={middleButton}
|
||||||
' ' +
|
id={this.state.id}
|
||||||
this.state.ticketInfo.deviceModel}
|
isInfoShow={isInfoShow}
|
||||||
</View>
|
/>
|
||||||
<View className='at-article__info'>
|
|
||||||
{pt.get().common.createdAtText(this.state.ticketInfo.createdTime)}
|
|
||||||
</View>
|
|
||||||
<View style={{ marginTop: 10, marginBottom: 10 }}>
|
|
||||||
<AtCard title={pt.get().ticketDetail.descTitle}>
|
|
||||||
<View className='at-article__h3'>
|
|
||||||
{this.state.ticketInfo.description}
|
|
||||||
</View>
|
|
||||||
</AtCard>
|
|
||||||
</View>
|
|
||||||
<View style={{ padding: 10 }}>
|
|
||||||
<AtSteps
|
|
||||||
items={this.state.items}
|
|
||||||
current={this.state.current}
|
|
||||||
onChange={() => {}}
|
|
||||||
/>
|
|
||||||
</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 }}>
|
|
||||||
<NoteList noteList={this.state.notes} />
|
|
||||||
</View>
|
|
||||||
<PageFooter />
|
<PageFooter />
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -18,4 +18,12 @@ export class TicketNote {
|
|||||||
createdTime: moment.Moment;
|
createdTime: moment.Moment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class ShowElements {
|
||||||
|
device: JSX.Element;
|
||||||
|
createdTime: JSX.Element;
|
||||||
|
description: JSX.Element;
|
||||||
|
current: JSX.Element;
|
||||||
|
notelist: JSX.Element;
|
||||||
|
}
|
||||||
|
|
||||||
export type StatusStr = '1' | '2' | '3' | '4' | '5';
|
export type StatusStr = '1' | '2' | '3' | '4' | '5';
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ import PageFooter from '@/components/PageFooter/PageFooter';
|
|||||||
import { submitTicket } from '@/service/submitTicket';
|
import { submitTicket } from '@/service/submitTicket';
|
||||||
import type CustomTabBar from '@/custom-tab-bar';
|
import type CustomTabBar from '@/custom-tab-bar';
|
||||||
import repairLogo from '@/assets/icons/RepairPage/repair.svg';
|
import repairLogo from '@/assets/icons/RepairPage/repair.svg';
|
||||||
|
import DetailFramework from '@/components/DetailFramework/DetailFramework';
|
||||||
|
import { getCurrentTicket } from '@/service/currentTicket';
|
||||||
import './repair.scss';
|
import './repair.scss';
|
||||||
|
|
||||||
interface RepairPageState {
|
interface RepairPageState {
|
||||||
@@ -27,10 +29,22 @@ interface RepairPageState {
|
|||||||
isLoading: boolean;
|
isLoading: boolean;
|
||||||
isDisable: boolean;
|
isDisable: boolean;
|
||||||
checkedList: Array<number>;
|
checkedList: Array<number>;
|
||||||
|
currentTicketsId: Array<number>;
|
||||||
}
|
}
|
||||||
|
|
||||||
const submitInterval = 5000;
|
const submitInterval = 5000;
|
||||||
|
|
||||||
|
const middleButton = <View></View>;
|
||||||
|
|
||||||
|
const isInfoShow = {
|
||||||
|
device: true,
|
||||||
|
createdTime: true,
|
||||||
|
description: false,
|
||||||
|
current: true,
|
||||||
|
notelist: true,
|
||||||
|
showAllNotes: false,
|
||||||
|
};
|
||||||
|
|
||||||
export default class RepairPage extends Component<{}, RepairPageState> {
|
export default class RepairPage extends Component<{}, RepairPageState> {
|
||||||
state = {
|
state = {
|
||||||
type: 1 as 0 | 1,
|
type: 1 as 0 | 1,
|
||||||
@@ -42,9 +56,12 @@ export default class RepairPage extends Component<{}, RepairPageState> {
|
|||||||
isLoading: false,
|
isLoading: false,
|
||||||
isDisable: true,
|
isDisable: true,
|
||||||
checkedList: [0],
|
checkedList: [0],
|
||||||
|
currentTicketsId: [] as Array<number>,
|
||||||
};
|
};
|
||||||
|
|
||||||
componentDidMount(): void {
|
componentDidMount(): void {
|
||||||
|
getCurrentTicket(this, middleButton, isInfoShow);
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.setState({
|
this.setState({
|
||||||
isDisable: false,
|
isDisable: false,
|
||||||
@@ -145,9 +162,20 @@ export default class RepairPage extends Component<{}, RepairPageState> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render(): ReactNode {
|
render(): ReactNode {
|
||||||
|
const ticketsRenderer = this.state.currentTicketsId.map((id, idx) => (
|
||||||
|
<AtCard key={idx}>
|
||||||
|
<DetailFramework
|
||||||
|
id={id}
|
||||||
|
isInfoShow={isInfoShow}
|
||||||
|
middleButton={middleButton}
|
||||||
|
/>
|
||||||
|
</AtCard>
|
||||||
|
));
|
||||||
|
console.log(ticketsRenderer);
|
||||||
return (
|
return (
|
||||||
<View>
|
<View>
|
||||||
<AtMessage />
|
<AtMessage />
|
||||||
|
{ticketsRenderer}
|
||||||
<AtCard
|
<AtCard
|
||||||
note={pt.get().repairPage.cardText.note}
|
note={pt.get().repairPage.cardText.note}
|
||||||
title={pt.get().repairPage.cardText.title}
|
title={pt.get().repairPage.cardText.title}
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import moment from 'moment';
|
|||||||
import pt from '@/plain-text';
|
import pt from '@/plain-text';
|
||||||
import { RequestState } from '@/service';
|
import { RequestState } from '@/service';
|
||||||
import { getMyTicketList } from '@/service/myTicket';
|
import { getMyTicketList } from '@/service/myTicket';
|
||||||
|
import { TicketListItem } from '@/components/TicketListItem/TicketListItem';
|
||||||
import './myTicket.scss';
|
import './myTicket.scss';
|
||||||
import { TicketListItem } from './TicketListItem';
|
|
||||||
|
|
||||||
interface MyTicketState {
|
interface MyTicketState {
|
||||||
fixList: Array<TicketListItem>;
|
fixList: Array<TicketListItem>;
|
||||||
|
|||||||
@@ -1,4 +1,10 @@
|
|||||||
export interface RepairPageText {
|
export interface RepairPageText {
|
||||||
|
currentTicket: {
|
||||||
|
errorMessage: string;
|
||||||
|
title: string;
|
||||||
|
note: string;
|
||||||
|
extra: string;
|
||||||
|
};
|
||||||
typeText: {
|
typeText: {
|
||||||
computer: string;
|
computer: string;
|
||||||
appliance: string;
|
appliance: string;
|
||||||
@@ -40,6 +46,12 @@ export interface RepairPageText {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const repairPageZhCn: RepairPageText = {
|
export const repairPageZhCn: RepairPageText = {
|
||||||
|
currentTicket: {
|
||||||
|
errorMessage: '未获取到工单!',
|
||||||
|
title: '',
|
||||||
|
note: '',
|
||||||
|
extra: '',
|
||||||
|
},
|
||||||
typeText: {
|
typeText: {
|
||||||
computer: '电脑',
|
computer: '电脑',
|
||||||
appliance: '电器',
|
appliance: '电器',
|
||||||
@@ -81,6 +93,12 @@ export const repairPageZhCn: RepairPageText = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const repairPageEnUs: RepairPageText = {
|
export const repairPageEnUs: RepairPageText = {
|
||||||
|
currentTicket: {
|
||||||
|
errorMessage: '未获取到工单!',
|
||||||
|
title: '',
|
||||||
|
note: '',
|
||||||
|
extra: '',
|
||||||
|
},
|
||||||
typeText: {
|
typeText: {
|
||||||
computer: 'Computer',
|
computer: 'Computer',
|
||||||
appliance: 'Appliance',
|
appliance: 'Appliance',
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
import RepairPage from '@/pages/repair/repair';
|
||||||
|
import Taro from '@tarojs/taro';
|
||||||
|
import { TicketListItem } from '@/components/TicketListItem/TicketListItem';
|
||||||
|
import pt from '@/plain-text';
|
||||||
|
import DetailFramework from '@/components/DetailFramework/DetailFramework';
|
||||||
|
import { getUrl } from '.';
|
||||||
|
|
||||||
|
export function getCurrentTicket(that: RepairPage, middleButton, isInfoShow) {
|
||||||
|
Taro.request({
|
||||||
|
url: getUrl('/user/mytickets'),
|
||||||
|
method: 'GET',
|
||||||
|
data: {
|
||||||
|
token: 'token_test',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
const data = res.data.data;
|
||||||
|
let newIdList: Array<number> = [];
|
||||||
|
data.list.map((ticket: TicketListItem) => {
|
||||||
|
if (ticket['status'] !== 5) {
|
||||||
|
newIdList.push(ticket.id);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
that.setState({
|
||||||
|
currentTicketsId: newIdList,
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err);
|
||||||
|
Taro.atMessage({
|
||||||
|
message: pt.get().button.submitText.error + err.toString(),
|
||||||
|
type: 'error',
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
+6
-13
@@ -1,5 +1,5 @@
|
|||||||
import MyTicketPage from '@/pages/user/myTicket/myTicket';
|
import MyTicketPage from '@/pages/user/myTicket/myTicket';
|
||||||
import { TicketListItem } from '@/pages/user/myTicket/TicketListItem';
|
import { TicketListItem } from '@/components/TicketListItem/TicketListItem';
|
||||||
import Taro from '@tarojs/taro';
|
import Taro from '@tarojs/taro';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import { getUrl } from '.';
|
import { getUrl } from '.';
|
||||||
@@ -13,20 +13,15 @@ export function getMyTicketList(that: MyTicketPage) {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
let former = that.state.rs;
|
||||||
if (!res.data.success) {
|
if (!res.data.success) {
|
||||||
that.setState({
|
that.setState({
|
||||||
rs: {
|
rs: former.trans(false),
|
||||||
loading: false,
|
|
||||||
success: false,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
that.setState({
|
that.setState({
|
||||||
rs: {
|
rs: former.trans(true),
|
||||||
loading: false,
|
|
||||||
success: true,
|
|
||||||
},
|
|
||||||
fixList: res.data.data.list.map(
|
fixList: res.data.data.list.map(
|
||||||
(item) =>
|
(item) =>
|
||||||
new TicketListItem(
|
new TicketListItem(
|
||||||
@@ -40,11 +35,9 @@ export function getMyTicketList(that: MyTicketPage) {
|
|||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch((reason) => {
|
.catch((reason) => {
|
||||||
|
let former = that.state.rs;
|
||||||
that.setState({
|
that.setState({
|
||||||
rs: {
|
rs: former.trans(false),
|
||||||
loading: false,
|
|
||||||
success: false,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
console.log(reason);
|
console.log(reason);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import TicketDetail from '@/pages/TicketDetail/TicketDetail';
|
|
||||||
import { TicketInfo, TicketNote } from '@/pages/TicketDetail/TicketNote';
|
import { TicketInfo, TicketNote } from '@/pages/TicketDetail/TicketNote';
|
||||||
|
import DetailFramework from '@/components/DetailFramework/DetailFramework';
|
||||||
import Taro from '@tarojs/taro';
|
import Taro from '@tarojs/taro';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import { getUrl } from '.';
|
import { getUrl } from '.';
|
||||||
|
|
||||||
export function getTicketInfo(that: TicketDetail, id: number) {
|
export function getTicketInfo(that: DetailFramework, id: number) {
|
||||||
Taro.request({
|
Taro.request({
|
||||||
url: getUrl('/tickets/info'),
|
url: getUrl('/tickets/info'),
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
|
|||||||
Reference in New Issue
Block a user