const app = getApp(); // pages/story/a.ts Component({ /** * 组件的属性列表 */ properties: { userInfo: Object, DoctorTitleType: Object, hospitalClassification: Object, hospitalLevel: Object, }, /** * 组件的初始数据 */ data: { take: {}, case: {} as any, doctorCount: {}, }, lifetimes: { attached() { this.getTake(); this.getCase(); this.getManageDoctor(); }, }, /** * 组件的方法列表 */ methods: { getTake() { wx.ajax({ method: "GET", url: "?r=takeda/doctor/todo", data: {}, }).then((res) => { this.setData({ take: res, }); }); }, getCase() { wx.ajax({ method: "GET", url: "?r=takeda/doctor/case", data: {}, }).then((res) => { this.setData({ case: res, }); }); }, getManageDoctor() { wx.ajax({ method: "GET", url: "?r=takeda/doctor/manage-doctor-count", data: {}, }).then((res) => { this.setData({ doctorCount: res.count, }); }); }, handleInvite() { wx.navigateTo({ url: "/module1/pages/invite/index", }); }, handleOrg() { wx.navigateTo({ url: "/module1/pages/org3/index", }); }, handleEntryCase() { wx.navigateTo({ url: "/module1/pages/entryCases/index", }); }, handlePendCase() { app.globalData.needDeal = "1"; wx.switchTab({ url: "/pages/cases/index", }); }, handleCaseUpdate() { app.globalData.newFeedback = "1"; wx.switchTab({ url: "/pages/cases/index", }); }, handleChat() { wx.switchTab({ url: "/pages/chatRoomList/index", }); }, handleAudit() { wx.navigateTo({ url: "/module1/pages/auditDoctorList/index", }); }, handleQuestion(e) { const { index } = e.currentTarget.dataset; this.triggerEvent("question", index); }, handleCase(e) { const { type } = e.currentTarget.dataset; const name = { 0: "全部", 2: "新病历", 3: "讨论中", 4: "已归档", }[type]; app.globalData.caseStatus = type === "0" ? "" : type; app.globalData.caseStatusName = name; wx.switchTab({ url: "/pages/cases/index", }); }, }, }); export {};