wrap up detailframework in atcard in repair page
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
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) {
|
||||
export function getCurrentTicket(that: RepairPage, middleButton, isInfoShow) {
|
||||
Taro.request({
|
||||
url: getUrl('/user/mytickets'),
|
||||
method: 'GET',
|
||||
@@ -13,17 +15,21 @@ export function getCurrentTicket(that: RepairPage) {
|
||||
})
|
||||
.then((res) => {
|
||||
const data = res.data.data;
|
||||
const currentTicket: Array<TicketListItem> = [];
|
||||
data.list.array.forEach((ticket: TicketListItem) => {
|
||||
if (ticket['status'] != 5) {
|
||||
currentTicket.push(ticket);
|
||||
let newIdList: Array<number> = [];
|
||||
data.list.map((ticket: TicketListItem) => {
|
||||
if (ticket['status'] !== 5) {
|
||||
newIdList.push(ticket.id);
|
||||
}
|
||||
});
|
||||
that.setState({
|
||||
currentTicket: currentTicket,
|
||||
currentTicketsId: newIdList,
|
||||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
Taro.atMessage({
|
||||
message: pt.get().button.submitText.error + err.toString(),
|
||||
type: 'error',
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user