add random tips on currentTicket card
This commit is contained in:
@@ -2,10 +2,9 @@ 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) {
|
||||
export function getCurrentTicket(that: RepairPage) {
|
||||
Taro.request({
|
||||
url: getUrl('/user/mytickets'),
|
||||
method: 'GET',
|
||||
@@ -15,14 +14,19 @@ export function getCurrentTicket(that: RepairPage, middleButton, isInfoShow) {
|
||||
})
|
||||
.then((res) => {
|
||||
const data = res.data.data;
|
||||
let newIdList: Array<number> = [];
|
||||
let newIdNameList: Array<Map<number, string>> = [];
|
||||
data.list.map((ticket: TicketListItem) => {
|
||||
if (ticket['status'] !== 5) {
|
||||
newIdList.push(ticket.id);
|
||||
newIdNameList.push(
|
||||
new Map([
|
||||
[ticket['id'], ticket['device'] + ' ' + ticket['deviceModel']],
|
||||
]),
|
||||
);
|
||||
}
|
||||
});
|
||||
console.log(newIdNameList);
|
||||
that.setState({
|
||||
currentTicketsId: newIdList,
|
||||
currentTicketsIdName: newIdNameList,
|
||||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
|
||||
Reference in New Issue
Block a user