武田小程序
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.
 
 
 

200 lines
4.2 KiB

const app = getApp<IAppOption>();
// pages/story/a.ts
Component({
/**
* 组件的属性列表
*/
properties: {
userInfo: Object,
DoctorTitleType: Object,
hospitalClassification: Object,
hospitalLevel: Object,
},
/**
* 组件的初始数据
*/
data: {
take: {},
case: {} as any,
doctorCount: {},
tips: {},
guide: 0,
guideShow: false,
guideList: ["3-1", "1-2", "3-3"],
},
lifetimes: {
attached() {
app.waitLogin(true).then(() => {
this.getTake();
this.getCase();
this.getManageDoctor();
this.getTips();
this.getGuide();
});
},
},
/**
* 组件的方法列表
*/
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() {
app.mpBehavior({ PageName: "BTN_QRCODEPOSTER" });
wx.navigateTo({
url: "/module1/pages/invite/index",
});
},
handleOrg() {
app.mpBehavior({ PageName: "BTN_ALLMANAGEDDOCTORS" });
wx.navigateTo({
url: "/module1/pages/org3/index",
});
},
handleEntryCase() {
app.mpBehavior({ PageName: "BTN_SUBMITEMPTYCASE" });
wx.navigateTo({
url: "/module1/pages/entryCases/index",
});
},
handlePendCase() {
app.mpBehavior({ PageName: "BTN_PENDINGCASES" });
app.globalData.needDeal = "1";
wx.switchTab({
url: "/pages/cases/index",
});
},
handleCaseUpdate(e) {
const { type } = e.currentTarget.dataset;
app.mpBehavior({ PageName: type });
app.globalData.newFeedback = "1";
wx.switchTab({
url: "/pages/cases/index",
});
},
handleChat() {
app.mpBehavior({ PageName: "BTN_LEARNINGMESSAGE" });
wx.switchTab({
url: "/pages/chatRoomList/index",
});
},
handleAudit() {
app.mpBehavior({ PageName: "BTN_DOCTORAPPLICATION" });
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];
const PageName = {
0: "BTN_MANAGEDCASESALL",
2: "BTN_MANAGEDCASESNEW",
3: "BTN_MANAGEDCASESDISCUSSING",
4: "BTN_MANAGEDCASESCLOSED",
}[type];
app.mpBehavior({ PageName });
app.globalData.caseStatus = type === "0" ? "" : type;
app.globalData.caseStatusName = name;
wx.switchTab({
url: "/pages/cases/index",
});
},
getTips() {
wx.ajax({
method: "GET",
url: "?r=takeda/doctor/get-tips",
data: {},
}).then((res) => {
this.setData({
tips: res,
});
});
},
getGuide() {
wx.ajax({
method: "GET",
url: "?r=takeda/account/get-guide",
data: {},
}).then((res) => {
this.setData({
guideShow: res.tipStatus === 2,
});
});
},
touchmovePreview() {
return false;
},
handleTapPreview() {
if (this.data.guide === this.data.guideList.length - 1) {
this.setData({
guideShow: false,
});
this.handleGuideClose();
}
this.setData({
guide: Number(this.data.guide) + 1,
});
},
handleGuideClose() {
this.setData({
guideShow: false,
});
wx.ajax({
method: "POST",
url: "?r=takeda/account/close-guide",
data: {},
});
},
},
});
export {};