You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
72 lines
1.5 KiB
72 lines
1.5 KiB
const app = getApp<IAppOption>(); |
|
|
|
Page({ |
|
data: { |
|
pagination: { |
|
page: 1, |
|
pages: 1, |
|
count: 1, |
|
}, |
|
list: [], |
|
DoctorTitleType: {}, |
|
}, |
|
onLoad() { |
|
app.waitLogin().then(() => { |
|
this.getList(); |
|
}); |
|
}, |
|
getDoctorDict() { |
|
wx.ajax({ |
|
method: "GET", |
|
url: "?r=takeda/reg/doctor-dict", |
|
data: {}, |
|
}).then((res) => { |
|
this.setData({ |
|
DoctorTitleType: res.DoctorTitleType, |
|
}); |
|
}); |
|
}, |
|
getList(newPage = 1) { |
|
wx.ajax({ |
|
method: "GET", |
|
url: "?r=takeda/doctor/audit-list", |
|
data: { |
|
page: newPage, |
|
}, |
|
}).then((res) => { |
|
res.list.forEach((item: any) => { |
|
item.SubmitTime = item.SubmitTime.split(" ")[0]; |
|
}); |
|
const list = res.page === 1 ? res.list : [...this.data.list, ...res.list]; |
|
this.setData({ |
|
list, |
|
pagination: { |
|
page: res.page, |
|
pages: res.pages, |
|
count: res.count, |
|
}, |
|
}); |
|
}); |
|
}, |
|
onReachBottom() { |
|
const { page, pages } = this.data.pagination; |
|
if (pages > page) { |
|
this.getList(page + 1); |
|
} |
|
}, |
|
handlePreview(e) { |
|
const { url } = e.currentTarget.dataset; |
|
wx.previewImage({ |
|
urls: [url], |
|
}); |
|
}, |
|
handleDetail(e) { |
|
const { index } = e.currentTarget.dataset; |
|
const { AuditId } = this.data.list[index]; |
|
wx.navigateTo({ |
|
url: `/module1/pages/auditDoctorDetail/index?id=${AuditId}`, |
|
}); |
|
}, |
|
}); |
|
|
|
export {};
|
|
|