Compare commits
2 Commits
5bafff52ad
...
e1c3b464a6
| Author | SHA1 | Date |
|---|---|---|
|
|
e1c3b464a6 | |
|
|
e11a58dbb5 |
|
|
@ -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"
|
||||||
|
|
|
||||||
|
|
@ -12,5 +12,4 @@
|
||||||
"isConfirmed": false
|
"isConfirmed": false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -176,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)}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -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(),
|
||||||
|
|
|
||||||
|
|
@ -74,12 +74,12 @@ export const mainPageZhCn: MainPageText = {
|
||||||
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 '当前未值班';
|
||||||
|
|
@ -91,7 +91,7 @@ export const mainPageZhCn: MainPageText = {
|
||||||
return '第三班 18:00-20:30';
|
return '第三班 18:00-20:30';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
inDutyCnt: n => '当前值班人数:' + n,
|
inDutyCnt: (n) => '当前值班人数:' + n,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
@ -133,12 +133,12 @@ export const mainPageEnUs: MainPageText = {
|
||||||
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 '当前未值班';
|
||||||
|
|
@ -150,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: '我的工单',
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
|
|
|
||||||
|
|
@ -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),
|
||||||
|
|
|
||||||
|
|
@ -16,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,
|
||||||
|
|
@ -26,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