Compare commits
8 Commits
7810cbaca1
...
0dac2ad185
| Author | SHA1 | Date |
|---|---|---|
|
|
0dac2ad185 | |
|
|
e1c3b464a6 | |
|
|
e11a58dbb5 | |
|
|
5bafff52ad | |
|
|
d83136a69c | |
|
|
b243fc5e4c | |
|
|
2f6b98b43f | |
|
|
6cd27cce10 |
|
|
@ -5,7 +5,7 @@
|
||||||
"semi": true,
|
"semi": true,
|
||||||
"singleQuote": true,
|
"singleQuote": true,
|
||||||
"proseWrap": "preserve",
|
"proseWrap": "preserve",
|
||||||
"arrowParens": "avoid",
|
"arrowParens": "always",
|
||||||
"bracketSpacing": true,
|
"bracketSpacing": true,
|
||||||
"jsxSingleQuote": true,
|
"jsxSingleQuote": true,
|
||||||
"endOfLine": "auto"
|
"endOfLine": "auto"
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import mytickets from './mytickets.json';
|
import mytickets from './mytickets.json';
|
||||||
import ticketInfo from './ticketInfo.json';
|
import ticketInfo from './ticketInfo.json';
|
||||||
|
import uncompleted from './uncompleted.json';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
'GET /dutyinfo': {
|
'GET /dutyinfo': {
|
||||||
|
|
@ -51,4 +52,8 @@ export default {
|
||||||
'POST /member/login': {
|
'POST /member/login': {
|
||||||
data: {},
|
data: {},
|
||||||
},
|
},
|
||||||
|
'GET /member/tickets/uncompleted': {
|
||||||
|
success: true,
|
||||||
|
data: uncompleted,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
"list": [
|
||||||
|
{
|
||||||
|
"id": 6830,
|
||||||
|
"type": 1,
|
||||||
|
"status": 2,
|
||||||
|
"device": "ROG",
|
||||||
|
"deviceModel": "幻 14 2022",
|
||||||
|
"owner": "晓洋",
|
||||||
|
"phone": "18888888887",
|
||||||
|
"createdTime": "2024-03-07T11:45:14.191981",
|
||||||
|
"isConfirmed": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1710232513408" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4296" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="24"><path d="M816.672 937.344c-8.192 0-16.384-3.136-22.624-9.376l-213.952-213.952c-12.512-12.512-12.512-32.736 0-45.248s32.736-12.512 45.248 0l191.328 191.328 33.408-33.376-190.848-190.848c-12.512-12.512-12.512-32.736 0-45.248s32.736-12.512 45.248 0l213.472 213.472c6.016 6.016 9.376 14.112 9.376 22.624s-3.36 16.64-9.376 22.624l-78.656 78.624C833.024 934.208 824.832 937.344 816.672 937.344z" fill="#5C636E" p-id="4297"></path><path d="M590.752 128c0-0.032 0-0.064 0-0.064 1.472-4.16 2.048-8.352 1.792-12.512 0 0 0 0 0 0 0 0-0.032-0.064-0.032-0.096-0.256-4.128-1.312-8.096-3.104-11.776-0.352-0.704-0.896-1.248-1.28-1.92-1.632-2.848-3.456-5.472-5.952-7.712-0.928-0.864-2.08-1.376-3.136-2.112-1.92-1.376-3.616-3.008-5.888-3.968-0.608-0.256-1.248-0.384-1.888-0.608-0.032 0-0.064-0.032-0.096-0.032-114.144-46.624-243.808-20.704-331.072 66.592C239.328 154.528 239.04 155.584 238.336 156.416 237.472 157.12 236.448 157.408 235.648 158.208L73.664 319.552c-6.016 6.016-9.408 14.144-9.408 22.656s3.36 16.64 9.376 22.656l98.304 98.304c6.016 6.016 14.144 9.376 22.624 9.376s16.64-3.36 22.624-9.376l56.032-56.032 68.192 68.224c6.24 6.24 14.432 9.376 22.624 9.376s16.384-3.136 22.624-9.376c12.512-12.48 12.512-32.736 0-45.248l-90.816-90.848c-12.512-12.512-32.736-12.512-45.248 0L194.56 395.296l-52.992-53.024 139.264-138.72c0.832-0.8 1.12-1.888 1.824-2.752 0.864-0.704 1.92-0.992 2.72-1.824 40-39.936 91.296-63.072 144.864-68.768-2.208 1.664-4.384 3.392-6.56 5.12-8.96 6.784-17.632 14.016-25.664 22.048-0.544 0.544-0.736 1.248-1.216 1.824-19.232 19.36-35.936 41.024-49.568 64.512-2.464 4.224-4.768 8.448-7.008 12.736l0.416 0.224c-12.288 24.64-12.288 53.664 0.48 78.144 1.536 2.944 3.52 5.504 5.76 7.744 0.768 0.96 1.088 2.112 1.984 2.976l70.432 70.464c6.24 6.24 14.432 9.376 22.624 9.376s16.384-3.136 22.624-9.376c12.512-12.48 12.512-32.736 0-45.248l-67.072-67.072c-2.624-6.112-2.688-13.024 0.448-18.976 0.16-0.288 0.128-0.608 0.256-0.896 1.44-2.656 2.848-5.344 4.384-7.968 11.008-18.944 24.48-36.448 40.064-52.032 4.096-4.096 8.608-7.648 12.96-11.456 30.144-25.28 67.232-40.864 106.816-43.136 0.576-0.032 1.056-0.352 1.632-0.416 3.616-0.384 7.104-1.184 10.368-2.72 0.512-0.256 0.896-0.64 1.376-0.896 3.168-1.696 6.048-3.776 8.512-6.496 0.256-0.288 0.384-0.64 0.608-0.928 2.08-2.464 4.128-4.928 5.44-8.064C590.624 129.12 590.528 128.544 590.752 128z" fill="#5C636E" p-id="4298"></path><path d="M289.536 960.032c-28.384 0-56.928-6.368-82.624-18.432-9.408-4.448-16.096-13.184-17.888-23.456-1.792-10.24 1.504-20.736 8.896-28.128l88.064-88.096-33.056-33.024-87.52 87.488c-7.424 7.424-18.048 10.848-28.384 8.832-10.336-1.888-19.104-8.704-23.392-18.304-32.736-72.64-17.088-159.072 38.944-215.104 50.048-50.08 126.048-68.384 193.952-47.04l238.688-238.72c-21.28-67.712-3.648-143.264 47.04-193.952 36.128-36.16 84.256-56.064 135.456-56.064 27.264 0 54.816 5.92 79.648 17.12 9.568 4.32 16.448 13.056 18.304 23.392 1.92 10.336-1.408 20.96-8.832 28.384l-88.8 88.8 33.024 33.056 89.376-89.344c7.392-7.392 17.92-10.72 28.128-8.896 10.272 1.792 19.04 8.48 23.456 17.888 34.496 73.376 19.424 160.96-37.536 217.92-36.096 36.096-84.128 56-135.296 56-20.704 0-41.536-3.392-61.216-9.952l-237.12 237.12c22.688 68.48 5.44 145.024-46.048 196.544C388.736 940.16 340.672 960.032 289.536 960.032zM282.592 895.84c36.352 2.112 71.36-11.392 96.992-37.024 37.952-37.952 47.936-96.384 24.864-145.408-5.76-12.224-3.232-26.72 6.336-36.256l266.816-266.848c9.536-9.536 24.032-12.032 36.256-6.336 47.936 22.56 108 12.544 145.408-24.864 25.952-25.92 38.784-61.408 36.992-96.96l-72.576 72.544c-6.016 6.016-14.112 9.376-22.624 9.376l0 0c-8.512 0-16.64-3.36-22.624-9.376L700.16 276.416c-12.512-12.512-12.512-32.736 0-45.248l71.04-71.04c-35.072-0.896-68.8 12.384-93.696 37.28-37.92 37.92-48.064 94.272-25.856 143.552 5.44 12.128 2.848 26.368-6.56 35.776l-267.936 267.968c-9.376 9.376-23.648 11.936-35.776 6.56-47.68-21.504-106.624-11.104-143.584 25.856-25.504 25.536-38.464 59.392-37.408 93.856l69.92-69.92c12.512-12.512 32.736-12.512 45.248 0l78.304 78.272c6.016 6.016 9.376 14.112 9.376 22.624 0 8.48-3.36 16.64-9.376 22.624L282.592 895.84z" fill="#5C636E" p-id="4299"></path></svg>
|
||||||
|
After Width: | Height: | Size: 4.3 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 52 KiB |
|
|
@ -0,0 +1,3 @@
|
||||||
|
export default {
|
||||||
|
component: true,
|
||||||
|
};
|
||||||
|
|
@ -0,0 +1,113 @@
|
||||||
|
import { View } from '@tarojs/components';
|
||||||
|
import { AtCard, AtSteps } from 'taro-ui';
|
||||||
|
import { Component, ReactNode } from 'react';
|
||||||
|
import Taro from '@tarojs/taro';
|
||||||
|
import { TicketInfo, TicketNote } from '@/pages/TicketDetail/TicketNote';
|
||||||
|
import NoteList from '@/components/NoteList/NoteList';
|
||||||
|
import PageFooter from '@/components/PageFooter/PageFooter';
|
||||||
|
import pt from '@/plain-text';
|
||||||
|
import { RequestState } from '@/service';
|
||||||
|
import { getTicketInfo } from '@/service/ticketsInfo';
|
||||||
|
import { FixStatus } from '@/common';
|
||||||
|
|
||||||
|
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 DetailFrameworkState {
|
||||||
|
current: number;
|
||||||
|
items: Array<StepItemData>;
|
||||||
|
ticketInfo: TicketInfo;
|
||||||
|
notes: Array<TicketNote>;
|
||||||
|
rs: RequestState;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface DetailFrameworkProps {
|
||||||
|
middleButton: JSX.Element;
|
||||||
|
id: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
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,
|
||||||
|
});
|
||||||
|
const items = pt.get().ticketDetail.stepItems;
|
||||||
|
this.setState({
|
||||||
|
items: items,
|
||||||
|
});
|
||||||
|
getTicketInfo(this, this.props.id);
|
||||||
|
}
|
||||||
|
|
||||||
|
props: Readonly<DetailFrameworkProps> = {
|
||||||
|
middleButton: <View></View>,
|
||||||
|
id: 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
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,
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View>
|
||||||
|
<View className='at-article__h1'>
|
||||||
|
{this.state.ticketInfo.device +
|
||||||
|
' ' +
|
||||||
|
this.state.ticketInfo.deviceModel}
|
||||||
|
</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>
|
||||||
|
|
||||||
|
{this.props.middleButton}
|
||||||
|
|
||||||
|
<View style={{ padding: 10 }}>
|
||||||
|
<NoteList noteList={this.state.notes} />
|
||||||
|
</View>
|
||||||
|
<PageFooter />
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,96 +1,29 @@
|
||||||
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 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>;
|
|
||||||
} else if (!this.state.rs.success) {
|
|
||||||
return <View>Request failed</View>;
|
|
||||||
}
|
|
||||||
|
|
||||||
const status = this.state.ticketInfo.status;
|
|
||||||
this.setState({
|
|
||||||
current: mapStatusStep.get(status) || 0,
|
|
||||||
});
|
|
||||||
|
|
||||||
return (
|
|
||||||
<View>
|
|
||||||
<View className='at-article__h1'>
|
|
||||||
{this.state.ticketInfo.device +
|
|
||||||
' ' +
|
|
||||||
this.state.ticketInfo.deviceModel}
|
|
||||||
</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
|
<View
|
||||||
className='at-row'
|
className='at-row'
|
||||||
style={{ paddingTop: 10, paddingBottom: 10, width: '100%' }}
|
style={{ paddingTop: 10, paddingBottom: 10, width: '100%' }}
|
||||||
|
|
@ -105,15 +38,14 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
|
||||||
className='at-col'
|
className='at-col'
|
||||||
style={{ marginRight: 10, paddingLeft: 5, width: '50%' }}
|
style={{ marginRight: 10, paddingLeft: 5, width: '50%' }}
|
||||||
>
|
>
|
||||||
<AtButton type='secondary'>
|
<AtButton type='secondary'>{pt.get().ticketDetail.addNote}</AtButton>
|
||||||
{pt.get().ticketDetail.addNote}
|
|
||||||
</AtButton>
|
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View style={{ padding: 10 }}>
|
);
|
||||||
<NoteList noteList={this.state.notes} />
|
|
||||||
</View>
|
return (
|
||||||
<PageFooter />
|
<View>
|
||||||
|
<DetailFramework middleButton={middleButton} id={this.state.id} />
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,8 @@ class Card extends Component {
|
||||||
<View
|
<View
|
||||||
style={{
|
style={{
|
||||||
marginLeft: 10,
|
marginLeft: 10,
|
||||||
fontSize: 36,
|
fontSize: 30,
|
||||||
|
fontWeight: 'bold',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{title}
|
{title}
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,26 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { View } from '@tarojs/components';
|
import { View, Image } from '@tarojs/components';
|
||||||
import pt from '@/plain-text';
|
import pt from '@/plain-text';
|
||||||
|
import logo from '@/assets/images/UserPage/logo.png';
|
||||||
|
|
||||||
export default class TitleCard extends React.Component {
|
export default class TitleCard extends React.Component {
|
||||||
render(): React.ReactNode {
|
render(): React.ReactNode {
|
||||||
const mainPage = pt.get().mainPage;
|
const mainPage = pt.get().mainPage;
|
||||||
return (
|
return (
|
||||||
|
<View className='at-row at-row__align--center'>
|
||||||
|
<View className='at-col at-col-1 at-col--auto'>
|
||||||
|
<Image
|
||||||
|
style='width: 50px; height: 50px; margin-left: 15px;'
|
||||||
|
src={logo}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
<View className='page-title'>
|
<View className='page-title'>
|
||||||
<View className='at-article__h1'>{mainPage.mainTitleLine}</View>
|
<View className='at-article__h1' style={{ fontWeight: 'bold' }}>
|
||||||
|
{mainPage.mainTitleLine}
|
||||||
|
</View>
|
||||||
<View className='at-article__h2'>{mainPage.subTitleLine}</View>
|
<View className='at-article__h2'>{mainPage.subTitleLine}</View>
|
||||||
</View>
|
</View>
|
||||||
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -69,20 +69,20 @@ export default class MainPage extends Component<{}, MainPageState> {
|
||||||
dutyData: new DutyData(),
|
dutyData: new DutyData(),
|
||||||
dutyInfoCard: {
|
dutyInfoCard: {
|
||||||
title: pt.get().mainPage.cardTitle.dutyInfo,
|
title: pt.get().mainPage.cardTitle.dutyInfo,
|
||||||
note: 'Tips',
|
note: pt.get().mainPage.cardTips.dutyInfo,
|
||||||
extra: '额外信息',
|
extra: pt.get().mainPage.extraInfo.dutyInfo,
|
||||||
content: () => <DutyInfo data={this.state.dutyData} />,
|
content: () => <DutyInfo data={this.state.dutyData} />,
|
||||||
},
|
},
|
||||||
stepInfoCard: {
|
stepInfoCard: {
|
||||||
title: pt.get().mainPage.cardTitle.stepInfo,
|
title: pt.get().mainPage.cardTitle.stepInfo,
|
||||||
note: 'Tips 请在20:30以前取走自己的物品哦',
|
note: pt.get().mainPage.cardTips.stepInfo,
|
||||||
extra: '额外信息',
|
extra: pt.get().mainPage.extraInfo.dutyInfo,
|
||||||
content: () => <StepInfo />,
|
content: () => <StepInfo />,
|
||||||
},
|
},
|
||||||
tipsInfoCard: {
|
tipsInfoCard: {
|
||||||
title: pt.get().mainPage.cardTitle.tipsInfo,
|
title: pt.get().mainPage.cardTitle.tipsInfo,
|
||||||
note: 'Tips',
|
note: pt.get().mainPage.cardTips.tipsInfo,
|
||||||
extra: '额外信息',
|
extra: pt.get().mainPage.extraInfo.dutyInfo,
|
||||||
content: () => <TipsInfo />,
|
content: () => <TipsInfo />,
|
||||||
},
|
},
|
||||||
// rs: new RequestState(),
|
// rs: new RequestState(),
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,20 @@
|
||||||
import { View } from '@tarojs/components';
|
import { View } from '@tarojs/components';
|
||||||
import { Component, ReactNode } from 'react';
|
import { Component, ReactNode } from 'react';
|
||||||
import Taro from '@tarojs/taro';
|
import Taro from '@tarojs/taro';
|
||||||
import { AtForm, AtInput, AtButton, AtRadio, AtCheckbox } from 'taro-ui';
|
import {
|
||||||
|
AtForm,
|
||||||
|
AtInput,
|
||||||
|
AtButton,
|
||||||
|
AtCheckbox,
|
||||||
|
AtCard,
|
||||||
|
AtSegmentedControl,
|
||||||
|
AtMessage,
|
||||||
|
} from 'taro-ui';
|
||||||
import pt from '@/plain-text';
|
import pt from '@/plain-text';
|
||||||
import PageFooter from '@/components/PageFooter/PageFooter';
|
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 './repair.scss';
|
import './repair.scss';
|
||||||
|
|
||||||
interface RepairPageState {
|
interface RepairPageState {
|
||||||
|
|
@ -20,6 +29,8 @@ interface RepairPageState {
|
||||||
checkedList: Array<number>;
|
checkedList: Array<number>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const submitInterval = 5000;
|
||||||
|
|
||||||
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,
|
||||||
|
|
@ -29,9 +40,18 @@ export default class RepairPage extends Component<{}, RepairPageState> {
|
||||||
phone: '',
|
phone: '',
|
||||||
description: '',
|
description: '',
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
isDisable: false,
|
isDisable: true,
|
||||||
checkedList: [0],
|
checkedList: [0],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
componentDidMount(): void {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.setState({
|
||||||
|
isDisable: false,
|
||||||
|
});
|
||||||
|
}, submitInterval);
|
||||||
|
}
|
||||||
|
|
||||||
// 以下是TabBar相关
|
// 以下是TabBar相关
|
||||||
pageCtx = Taro.getCurrentInstance().page;
|
pageCtx = Taro.getCurrentInstance().page;
|
||||||
componentDidShow() {
|
componentDidShow() {
|
||||||
|
|
@ -114,20 +134,33 @@ export default class RepairPage extends Component<{}, RepairPageState> {
|
||||||
}
|
}
|
||||||
|
|
||||||
onSubmit() {
|
onSubmit() {
|
||||||
|
this.setState({
|
||||||
|
isLoading: true,
|
||||||
|
isDisable: true,
|
||||||
|
});
|
||||||
submitTicket(this);
|
submitTicket(this);
|
||||||
|
Taro.reLaunch({
|
||||||
|
url: '/pages/repair/repair',
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
render(): ReactNode {
|
render(): ReactNode {
|
||||||
return (
|
return (
|
||||||
<View>
|
<View>
|
||||||
|
<AtMessage />
|
||||||
|
<AtCard
|
||||||
|
note={pt.get().repairPage.cardText.note}
|
||||||
|
title={pt.get().repairPage.cardText.title}
|
||||||
|
thumb={repairLogo}
|
||||||
|
>
|
||||||
<AtForm onSubmit={this.onSubmit.bind(this)}>
|
<AtForm onSubmit={this.onSubmit.bind(this)}>
|
||||||
<AtRadio
|
<AtSegmentedControl
|
||||||
options={[
|
values={[
|
||||||
{ label: pt.get().repairPage.typeText.appliance, value: 0 },
|
pt.get().repairPage.typeText.appliance,
|
||||||
{ label: pt.get().repairPage.typeText.computer, value: 1 },
|
pt.get().repairPage.typeText.computer,
|
||||||
]}
|
]}
|
||||||
value={this.state.type}
|
|
||||||
onClick={this.handleTypeChange.bind(this)}
|
onClick={this.handleTypeChange.bind(this)}
|
||||||
|
current={this.state.type}
|
||||||
/>
|
/>
|
||||||
<AtInput
|
<AtInput
|
||||||
clear
|
clear
|
||||||
|
|
@ -143,9 +176,9 @@ export default class RepairPage extends Component<{}, RepairPageState> {
|
||||||
clear
|
clear
|
||||||
required
|
required
|
||||||
name='deviceModel'
|
name='deviceModel'
|
||||||
title={pt.get().repairPage.deviceText.title}
|
title={pt.get().repairPage.deviceModelText.title}
|
||||||
type='text'
|
type='text'
|
||||||
placeholder={pt.get().repairPage.deviceText.placeholder}
|
placeholder={pt.get().repairPage.deviceModelText.placeholder}
|
||||||
value={this.state.deviceModel}
|
value={this.state.deviceModel}
|
||||||
onChange={this.handleDeviceModelChange.bind(this)}
|
onChange={this.handleDeviceModelChange.bind(this)}
|
||||||
/>
|
/>
|
||||||
|
|
@ -193,6 +226,7 @@ export default class RepairPage extends Component<{}, RepairPageState> {
|
||||||
{pt.get().button.buttonText.submit}
|
{pt.get().button.buttonText.submit}
|
||||||
</AtButton>
|
</AtButton>
|
||||||
</AtForm>
|
</AtForm>
|
||||||
|
</AtCard>
|
||||||
<PageFooter />
|
<PageFooter />
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -46,14 +46,14 @@ export default class MemberPage extends Component {
|
||||||
passwd: this.state.passwd,
|
passwd: this.state.passwd,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then((res) => {
|
||||||
console.log(res.data);
|
console.log(res.data);
|
||||||
Taro.atMessage({
|
Taro.atMessage({
|
||||||
message: pt.get().button.loginText.success,
|
message: pt.get().button.loginText.success,
|
||||||
type: 'success',
|
type: 'success',
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch((err) => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
Taro.atMessage({
|
Taro.atMessage({
|
||||||
message: pt.get().button.loginText.error + err.toString(),
|
message: pt.get().button.loginText.error + err.toString(),
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ export default class MyTicketPage extends Component<{}, MyTicketState> {
|
||||||
if (!this.state.rs.success) {
|
if (!this.state.rs.success) {
|
||||||
return <View>Failed</View>;
|
return <View>Failed</View>;
|
||||||
}
|
}
|
||||||
const fixListRenderer = this.state.fixList.map(item => item.render());
|
const fixListRenderer = this.state.fixList.map((item) => item.render());
|
||||||
return (
|
return (
|
||||||
<View>
|
<View>
|
||||||
<AtList>{fixListRenderer}</AtList>
|
<AtList>{fixListRenderer}</AtList>
|
||||||
|
|
|
||||||
|
|
@ -39,14 +39,14 @@ export default class ReportPage extends Component {
|
||||||
report: this.state.report,
|
report: this.state.report,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then((res) => {
|
||||||
console.log(res.data);
|
console.log(res.data);
|
||||||
Taro.atMessage({
|
Taro.atMessage({
|
||||||
message: pt.get().button.submitText.success,
|
message: pt.get().button.submitText.success,
|
||||||
type: 'success',
|
type: 'success',
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch((err) => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
Taro.atMessage({
|
Taro.atMessage({
|
||||||
message: pt.get().button.submitText.error + err.toString(),
|
message: pt.get().button.submitText.error + err.toString(),
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,16 @@ export interface MainPageText {
|
||||||
stepInfo: string;
|
stepInfo: string;
|
||||||
tipsInfo: string;
|
tipsInfo: string;
|
||||||
};
|
};
|
||||||
|
cardTips: {
|
||||||
|
dutyInfo: string;
|
||||||
|
stepInfo: string;
|
||||||
|
tipsInfo: string;
|
||||||
|
};
|
||||||
|
extraInfo: {
|
||||||
|
dutyInfo: string;
|
||||||
|
stepInfo: string;
|
||||||
|
tipsInfo: string;
|
||||||
|
};
|
||||||
expandTitle: {
|
expandTitle: {
|
||||||
stepInfo: string;
|
stepInfo: string;
|
||||||
tipsInfo: string;
|
tipsInfo: string;
|
||||||
|
|
@ -35,31 +45,41 @@ export const mainPageZhCn: MainPageText = {
|
||||||
stepInfo: '维修步骤',
|
stepInfo: '维修步骤',
|
||||||
tipsInfo: '注意事项',
|
tipsInfo: '注意事项',
|
||||||
},
|
},
|
||||||
|
cardTips: {
|
||||||
|
dutyInfo: '提示:可以先前往【维修】页面在线上预填写工单!',
|
||||||
|
stepInfo: '提示:请在 20:30 之前取走自己的物品哦!',
|
||||||
|
tipsInfo: '',
|
||||||
|
},
|
||||||
|
extraInfo: {
|
||||||
|
dutyInfo: '',
|
||||||
|
stepInfo: '',
|
||||||
|
tipsInfo: '',
|
||||||
|
},
|
||||||
expandTitle: {
|
expandTitle: {
|
||||||
stepInfo: '查看维修步骤',
|
stepInfo: '查看维修步骤',
|
||||||
tipsInfo: '查看注意事项',
|
tipsInfo: '查看注意事项',
|
||||||
},
|
},
|
||||||
stepList: [
|
stepList: [
|
||||||
{ title: '线上填写工单' },
|
{ title: '线上填写工单' },
|
||||||
{ title: '去`东三-204`实验室维修电脑' },
|
{ title: '去【东三-204】实验室维修电脑' },
|
||||||
{ title: '等待电脑维修' },
|
{ title: '等待电脑维修' },
|
||||||
{ title: '维修结束,取回电脑' },
|
{ title: '维修结束,取回电脑' },
|
||||||
],
|
],
|
||||||
tipsList: [
|
tipsList: [
|
||||||
{ title: '戴尔、Surface、外星人、苹果电脑不能拆机哦~' },
|
{ title: '戴尔/外星人、Surface、苹果电脑不能拆机哦~' },
|
||||||
{ title: '数据无价,请随时做好数据备份哦~' },
|
{ title: '数据无价,请随时做好数据备份哦~' },
|
||||||
{ title: '204也是实验室,请遵守实验室纪律,请勿饮食~' },
|
{ title: '204 也是实验室,请勿在内饮食~' },
|
||||||
{ title: '我们是志愿服务,不收任何礼物哦~' },
|
{ title: '我们是志愿服务,不收取任何礼物哦~' },
|
||||||
],
|
],
|
||||||
dutyCard: {
|
dutyCard: {
|
||||||
offDuty: {
|
offDuty: {
|
||||||
title: '未值班',
|
title: '未值班',
|
||||||
reason: s => '值班停止原因:' + s,
|
reason: (s) => '值班停止原因:' + s,
|
||||||
recoverTime: t => '恢复值班时间:' + t,
|
recoverTime: (t) => '恢复值班时间:' + t,
|
||||||
},
|
},
|
||||||
inDuty: {
|
inDuty: {
|
||||||
title: '值班中',
|
title: '值班中',
|
||||||
currentDutyText: c => {
|
currentDutyText: (c) => {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'off':
|
case 'off':
|
||||||
return '当前未值班';
|
return '当前未值班';
|
||||||
|
|
@ -71,7 +91,7 @@ export const mainPageZhCn: MainPageText = {
|
||||||
return '第三班 18:00-20:30';
|
return '第三班 18:00-20:30';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
inDutyCnt: n => '当前值班人数:' + n,
|
inDutyCnt: (n) => '当前值班人数:' + n,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
@ -84,31 +104,41 @@ export const mainPageEnUs: MainPageText = {
|
||||||
stepInfo: '维修步骤',
|
stepInfo: '维修步骤',
|
||||||
tipsInfo: '注意事项',
|
tipsInfo: '注意事项',
|
||||||
},
|
},
|
||||||
|
cardTips: {
|
||||||
|
dutyInfo: '提示:可以先前往【维修】页面,在线上预填写工单!',
|
||||||
|
stepInfo: '提示:请在 20:30 之前取走自己的物品哦!',
|
||||||
|
tipsInfo: '',
|
||||||
|
},
|
||||||
expandTitle: {
|
expandTitle: {
|
||||||
stepInfo: '查看维修步骤',
|
stepInfo: '查看维修步骤',
|
||||||
tipsInfo: '查看注意事项',
|
tipsInfo: '查看注意事项',
|
||||||
},
|
},
|
||||||
|
extraInfo: {
|
||||||
|
dutyInfo: '',
|
||||||
|
stepInfo: '',
|
||||||
|
tipsInfo: '',
|
||||||
|
},
|
||||||
stepList: [
|
stepList: [
|
||||||
{ title: '线上填写工单' },
|
{ title: '线上填写工单' },
|
||||||
{ title: '去`东三-204`实验室维修电脑' },
|
{ title: '去【东三-204】实验室维修电脑' },
|
||||||
{ title: '等待电脑维修' },
|
{ title: '等待电脑维修' },
|
||||||
{ title: '维修结束,取回电脑' },
|
{ title: '维修结束,取回电脑' },
|
||||||
],
|
],
|
||||||
tipsList: [
|
tipsList: [
|
||||||
{ title: '戴尔、Surface、外星人、苹果电脑不能拆机哦~' },
|
{ title: '戴尔/外星人、Surface、苹果电脑不能拆机哦~' },
|
||||||
{ title: '数据无价,请随时做好数据备份哦~' },
|
{ title: '数据无价,请随时做好数据备份哦~' },
|
||||||
{ title: '204也是实验室,请遵守实验室纪律,请勿饮食~' },
|
{ title: '204 也是实验室,请勿在内饮食~' },
|
||||||
{ title: '我们是志愿服务,不收任何礼物哦~' },
|
{ title: '我们是志愿服务,不收取任何礼物哦~' },
|
||||||
],
|
],
|
||||||
dutyCard: {
|
dutyCard: {
|
||||||
offDuty: {
|
offDuty: {
|
||||||
title: '未值班',
|
title: '未值班',
|
||||||
reason: s => '值班停止原因:' + s,
|
reason: (s) => '值班停止原因:' + s,
|
||||||
recoverTime: t => '恢复值班时间:' + t,
|
recoverTime: (t) => '恢复值班时间:' + t,
|
||||||
},
|
},
|
||||||
inDuty: {
|
inDuty: {
|
||||||
title: '值班中',
|
title: '值班中',
|
||||||
currentDutyText: c => {
|
currentDutyText: (c) => {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'off':
|
case 'off':
|
||||||
return '当前未值班';
|
return '当前未值班';
|
||||||
|
|
@ -120,7 +150,7 @@ export const mainPageEnUs: MainPageText = {
|
||||||
return '第三班 18:00-20:30';
|
return '第三班 18:00-20:30';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
inDutyCnt: n => '当前值班人数:' + n,
|
inDutyCnt: (n) => '当前值班人数:' + n,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ export interface NavBarTitle {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export const navBarTitleZhCh: NavBarTitle = {
|
export const navBarTitleZhCn: NavBarTitle = {
|
||||||
ticketDetail: '工单详情',
|
ticketDetail: '工单详情',
|
||||||
user: {
|
user: {
|
||||||
myTicket: '我的工单',
|
myTicket: '我的工单',
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,10 @@ export interface RepairPageText {
|
||||||
desc: string;
|
desc: string;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
cardText: {
|
||||||
|
note: string;
|
||||||
|
title: string;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export const repairPageZhCn: RepairPageText = {
|
export const repairPageZhCn: RepairPageText = {
|
||||||
|
|
@ -70,6 +74,10 @@ export const repairPageZhCn: RepairPageText = {
|
||||||
desc: '请于评论中详述',
|
desc: '请于评论中详述',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
cardText: {
|
||||||
|
note: '工单描述请尽量简短哦!',
|
||||||
|
title: '预填写工单',
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const repairPageEnUs: RepairPageText = {
|
export const repairPageEnUs: RepairPageText = {
|
||||||
|
|
@ -107,4 +115,8 @@ export const repairPageEnUs: RepairPageText = {
|
||||||
desc: '请于评论中详述',
|
desc: '请于评论中详述',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
cardText: {
|
||||||
|
note: '工单描述请尽量简短哦!',
|
||||||
|
title: '预填写工单',
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -37,10 +37,10 @@ export const ticketDetailZhCn: TicketDetailText = {
|
||||||
|
|
||||||
export const ticketDetailEnUs: TicketDetailText = {
|
export const ticketDetailEnUs: TicketDetailText = {
|
||||||
stepItems: [
|
stepItems: [
|
||||||
{ title: 'Ticket created' },
|
{ title: 'Created' },
|
||||||
{ title: 'Repairing' },
|
{ title: 'Repairing' },
|
||||||
{ title: 'Take home' },
|
|
||||||
{ title: 'Finished' },
|
{ title: 'Finished' },
|
||||||
|
{ title: 'Retrived' },
|
||||||
],
|
],
|
||||||
createTicketMessage: 'Created ticket',
|
createTicketMessage: 'Created ticket',
|
||||||
statusModifyPrefix: 'Modified repair status to: ',
|
statusModifyPrefix: 'Modified repair status to: ',
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ export interface TicketListText {
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ticketListZhCn: TicketListText = {
|
export const ticketListZhCn: TicketListText = {
|
||||||
createdAt: time => {
|
createdAt: (time) => {
|
||||||
return '创建于' + ' ' + time;
|
return '创建于' + ' ' + time;
|
||||||
},
|
},
|
||||||
statusMap: new Map([
|
statusMap: new Map([
|
||||||
|
|
@ -19,7 +19,7 @@ export const ticketListZhCn: TicketListText = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const ticketListEnUs: TicketListText = {
|
export const ticketListEnUs: TicketListText = {
|
||||||
createdAt: time => {
|
createdAt: (time) => {
|
||||||
return '创建于' + ' ' + time;
|
return '创建于' + ' ' + time;
|
||||||
},
|
},
|
||||||
statusMap: new Map([
|
statusMap: new Map([
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import { AboutPageText, aboutPageEnUs, aboutPageZhCn } from './AboutPage';
|
||||||
import { ButtonText, buttonEnUs, buttonZhCn } from './Button';
|
import { ButtonText, buttonEnUs, buttonZhCn } from './Button';
|
||||||
import { MemberPageText, memberPageEnUs, memberPageZhCn } from './MemberPage';
|
import { MemberPageText, memberPageEnUs, memberPageZhCn } from './MemberPage';
|
||||||
import { TicketListText, ticketListEnUs, ticketListZhCn } from './TicketList';
|
import { TicketListText, ticketListEnUs, ticketListZhCn } from './TicketList';
|
||||||
import { NavBarTitle, navBarTitleEnUs, navBarTitleZhCh } from './NavBarTitle';
|
import { NavBarTitle, navBarTitleEnUs, navBarTitleZhCn } from './NavBarTitle';
|
||||||
import { RepairPageText, repairPageEnUs, repairPageZhCn } from './RepairPage';
|
import { RepairPageText, repairPageEnUs, repairPageZhCn } from './RepairPage';
|
||||||
import {
|
import {
|
||||||
TicketDetailText,
|
TicketDetailText,
|
||||||
|
|
@ -46,7 +46,7 @@ const textZhCn: TextRecord = {
|
||||||
button: buttonZhCn,
|
button: buttonZhCn,
|
||||||
memberPage: memberPageZhCn,
|
memberPage: memberPageZhCn,
|
||||||
ticketList: ticketListZhCn,
|
ticketList: ticketListZhCn,
|
||||||
navBar: navBarTitleZhCh,
|
navBar: navBarTitleZhCn,
|
||||||
repairPage: repairPageZhCn,
|
repairPage: repairPageZhCn,
|
||||||
ticketDetail: ticketDetailZhCn,
|
ticketDetail: ticketDetailZhCn,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ export function getDutyInfo(that: MainPage) {
|
||||||
token: 'token_test',
|
token: 'token_test',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then((res) => {
|
||||||
const data = res.data.data;
|
const data = res.data.data;
|
||||||
if (data.isInDuty) {
|
if (data.isInDuty) {
|
||||||
that.setState({
|
that.setState({
|
||||||
|
|
@ -30,7 +30,7 @@ export function getDutyInfo(that: MainPage) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch((err) => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
that.setState({
|
that.setState({
|
||||||
dutyData: {
|
dutyData: {
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ export function setLocaleData(lang: Lang) {
|
||||||
token: 'token_test',
|
token: 'token_test',
|
||||||
lang: lang,
|
lang: lang,
|
||||||
},
|
},
|
||||||
}).then(res => {
|
}).then((res) => {
|
||||||
console.log(res.data);
|
console.log(res.data);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -22,7 +22,7 @@ export function getLocaleData() {
|
||||||
data: {
|
data: {
|
||||||
token: 'token_test',
|
token: 'token_test',
|
||||||
},
|
},
|
||||||
}).then(res => {
|
}).then((res) => {
|
||||||
console.log(res.data);
|
console.log(res.data);
|
||||||
pt.setLang(res.data.data.lang);
|
pt.setLang(res.data.data.lang);
|
||||||
Taro.reLaunch({
|
Taro.reLaunch({
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ export function getMyTicketList(that: MyTicketPage) {
|
||||||
token: 'token_test',
|
token: 'token_test',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then((res) => {
|
||||||
if (!res.data.success) {
|
if (!res.data.success) {
|
||||||
that.setState({
|
that.setState({
|
||||||
rs: {
|
rs: {
|
||||||
|
|
@ -28,7 +28,7 @@ export function getMyTicketList(that: MyTicketPage) {
|
||||||
success: true,
|
success: true,
|
||||||
},
|
},
|
||||||
fixList: res.data.data.list.map(
|
fixList: res.data.data.list.map(
|
||||||
item =>
|
(item) =>
|
||||||
new TicketListItem(
|
new TicketListItem(
|
||||||
item.id,
|
item.id,
|
||||||
item.device,
|
item.device,
|
||||||
|
|
@ -39,7 +39,7 @@ export function getMyTicketList(that: MyTicketPage) {
|
||||||
),
|
),
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch(reason => {
|
.catch((reason) => {
|
||||||
that.setState({
|
that.setState({
|
||||||
rs: {
|
rs: {
|
||||||
loading: false,
|
loading: false,
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ export function submitTicket(that: RepairPage) {
|
||||||
accessories: that.state.checkedList,
|
accessories: that.state.checkedList,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then((res) => {
|
||||||
console.log(res.data);
|
console.log(res.data);
|
||||||
that.setState({
|
that.setState({
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
|
|
@ -31,7 +31,7 @@ export function submitTicket(that: RepairPage) {
|
||||||
type: 'success',
|
type: 'success',
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch((err) => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
that.setState({
|
that.setState({
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
|
|
|
||||||
|
|
@ -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',
|
||||||
|
|
@ -12,7 +12,7 @@ export function getTicketInfo(that: TicketDetail, id: number) {
|
||||||
id: id,
|
id: id,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then((res) => {
|
||||||
let former = that.state.rs;
|
let former = that.state.rs;
|
||||||
if (!res.data.success) {
|
if (!res.data.success) {
|
||||||
that.setState({
|
that.setState({
|
||||||
|
|
@ -30,7 +30,7 @@ export function getTicketInfo(that: TicketDetail, id: number) {
|
||||||
status: data.status,
|
status: data.status,
|
||||||
};
|
};
|
||||||
const notes: Array<TicketNote> = [];
|
const notes: Array<TicketNote> = [];
|
||||||
data.notes.map(item => {
|
data.notes.map((item) => {
|
||||||
notes.push({
|
notes.push({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
op: item.op,
|
op: item.op,
|
||||||
|
|
@ -46,7 +46,7 @@ export function getTicketInfo(that: TicketDetail, id: number) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(reason => {
|
.catch((reason) => {
|
||||||
let former = that.state.rs;
|
let former = that.state.rs;
|
||||||
that.setState({
|
that.setState({
|
||||||
rs: former.trans(false),
|
rs: former.trans(false),
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,9 @@ import pt from '@/plain-text';
|
||||||
import { getUrl } from '.';
|
import { getUrl } from '.';
|
||||||
|
|
||||||
export function updateUserInfo(that: InformPage) {
|
export function updateUserInfo(that: InformPage) {
|
||||||
|
that.setState({
|
||||||
|
isLoading: true,
|
||||||
|
});
|
||||||
Taro.request({
|
Taro.request({
|
||||||
url: getUrl('/user/update'),
|
url: getUrl('/user/update'),
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
|
|
@ -13,7 +16,7 @@ export function updateUserInfo(that: InformPage) {
|
||||||
phone: that.state.phone,
|
phone: that.state.phone,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then((res) => {
|
||||||
console.log(res.data);
|
console.log(res.data);
|
||||||
that.setState({
|
that.setState({
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
|
|
@ -23,7 +26,7 @@ export function updateUserInfo(that: InformPage) {
|
||||||
type: 'success',
|
type: 'success',
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch((err) => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
that.setState({
|
that.setState({
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue