26 changed files with 1728 additions and 849 deletions
@ -1,26 +1,86 @@ |
|||||||
const _app = getApp<IAppOption>() |
const _app = getApp<IAppOption>(); |
||||||
|
|
||||||
// pages/story/a.ts
|
// pages/story/a.ts
|
||||||
Component({ |
Component({ |
||||||
/** |
/** |
||||||
* 组件的属性列表 |
* 组件的属性列表 |
||||||
*/ |
*/ |
||||||
properties: {}, |
properties: { |
||||||
|
userInfo: Object, |
||||||
|
DoctorTitleType: Object, |
||||||
|
hospitalClassification: Object, |
||||||
|
hospitalLevel: Object, |
||||||
|
}, |
||||||
|
|
||||||
/** |
/** |
||||||
* 组件的初始数据 |
* 组件的初始数据 |
||||||
*/ |
*/ |
||||||
data: {}, |
data: { |
||||||
|
take: {}, |
||||||
|
case: {}, |
||||||
|
doctorCount: {}, |
||||||
|
}, |
||||||
|
|
||||||
attached() {}, |
lifetimes: { |
||||||
|
attached() { |
||||||
|
this.getTake(); |
||||||
|
this.getCase(); |
||||||
|
this.getManageDoctor(); |
||||||
|
}, |
||||||
|
}, |
||||||
/** |
/** |
||||||
* 组件的方法列表 |
* 组件的方法列表 |
||||||
*/ |
*/ |
||||||
methods: { |
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() { |
handleOrg() { |
||||||
wx.navigateTo({ |
wx.navigateTo({ |
||||||
url: '/module1/pages/org3/index', |
url: "/module1/pages/org3/index", |
||||||
}) |
}); |
||||||
|
}, |
||||||
|
handleEntryCase() { |
||||||
|
wx.navigateTo({ |
||||||
|
url: "/module1/pages/entryCases/index", |
||||||
|
}); |
||||||
}, |
}, |
||||||
}, |
}, |
||||||
}) |
}); |
||||||
|
|
||||||
|
export {}; |
||||||
|
After Width: | Height: | Size: 7.4 KiB |
After Width: | Height: | Size: 7.5 KiB |
After Width: | Height: | Size: 17 KiB |
@ -1,5 +1,7 @@ |
|||||||
{ |
{ |
||||||
"navigationBarTitleText": "医院活跃排行榜", |
"navigationBarTitleText": "医院活跃排行榜", |
||||||
"navigationStyle": "default", |
"navigationStyle": "default", |
||||||
"usingComponents": {} |
"usingComponents": { |
||||||
|
"pagination": "/components/pagination/index" |
||||||
|
} |
||||||
} |
} |
||||||
|
@ -1,6 +1,45 @@ |
|||||||
const _app = getApp<IAppOption>(); |
const app = getApp<IAppOption>(); |
||||||
|
|
||||||
Page({ |
Page({ |
||||||
data: {}, |
data: { |
||||||
onLoad() {}, |
list: [], |
||||||
|
pagination: { |
||||||
|
page: 1, |
||||||
|
pages: 1, |
||||||
|
count: 1, |
||||||
|
}, |
||||||
|
}, |
||||||
|
onLoad() { |
||||||
|
app.waitLogin().then(() => { |
||||||
|
this.getList(); |
||||||
}); |
}); |
||||||
|
}, |
||||||
|
getList(newPage = 1) { |
||||||
|
wx.ajax({ |
||||||
|
method: "GET", |
||||||
|
url: "?r=takeda/stat/hospital-doctor-rank-list", |
||||||
|
data: { |
||||||
|
page: newPage, |
||||||
|
count: 20, |
||||||
|
}, |
||||||
|
}).then((res) => { |
||||||
|
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); |
||||||
|
} |
||||||
|
}, |
||||||
|
}); |
||||||
|
|
||||||
|
export {}; |
||||||
|
@ -1,6 +1,43 @@ |
|||||||
const _app = getApp<IAppOption>(); |
const app = getApp<IAppOption>(); |
||||||
|
|
||||||
Page({ |
Page({ |
||||||
|
data: { |
||||||
|
doctorCount: {}, |
||||||
|
tree: [], |
||||||
|
}, |
||||||
|
onLoad() { |
||||||
|
app.waitLogin().then(() => { |
||||||
|
this.getManageDoctor(); |
||||||
|
this.getTree(); |
||||||
|
}); |
||||||
|
}, |
||||||
|
getManageDoctor() { |
||||||
|
wx.ajax({ |
||||||
|
method: "GET", |
||||||
|
url: "?r=takeda/doctor/manage-doctor-count", |
||||||
|
data: {}, |
||||||
|
}).then((res) => { |
||||||
|
this.setData({ |
||||||
|
doctorCount: res.count, |
||||||
|
}); |
||||||
|
}); |
||||||
|
}, |
||||||
|
getTree() { |
||||||
|
wx.ajax({ |
||||||
|
method: "GET", |
||||||
|
url: "?r=takeda/doctor/doctor-tree-list", |
||||||
data: {}, |
data: {}, |
||||||
onLoad() {}, |
}).then((res) => { |
||||||
|
this.setData({ |
||||||
|
tree: res.tree, |
||||||
}); |
}); |
||||||
|
}); |
||||||
|
}, |
||||||
|
handleInvite() { |
||||||
|
wx.navigateTo({ |
||||||
|
url: "/module1/pages/invite/index", |
||||||
|
}); |
||||||
|
}, |
||||||
|
}); |
||||||
|
|
||||||
|
export {}; |
||||||
|
@ -1,6 +1,130 @@ |
|||||||
const _app = getApp<IAppOption>(); |
const app = getApp<IAppOption>(); |
||||||
|
|
||||||
Page({ |
Page({ |
||||||
data: {}, |
data: { |
||||||
onLoad() {}, |
DepartmentId: "", |
||||||
|
DepartmentName: "", |
||||||
|
Department: [], |
||||||
|
|
||||||
|
doctorCount: {}, |
||||||
|
|
||||||
|
tree: [] as any, |
||||||
|
search: "", |
||||||
|
|
||||||
|
userInfo: {} as any, |
||||||
|
}, |
||||||
|
onLoad() { |
||||||
|
app.waitLogin().then(() => { |
||||||
|
app.getUserInfo(this, (userInfo) => { |
||||||
|
const { DepartmentId, DepartmentName } = userInfo.Department[0]; |
||||||
|
this.setData({ |
||||||
|
Department: userInfo.Department, |
||||||
|
DepartmentId, |
||||||
|
DepartmentName, |
||||||
|
}); |
||||||
|
this.getManageDoctor(); |
||||||
|
this.getTree(); |
||||||
|
}); |
||||||
|
}); |
||||||
|
}, |
||||||
|
getManageDoctor() { |
||||||
|
wx.ajax({ |
||||||
|
method: "GET", |
||||||
|
url: "?r=takeda/doctor/manage-doctor-count", |
||||||
|
data: { DepartmentId: this.data.DepartmentId }, |
||||||
|
}).then((res) => { |
||||||
|
this.setData({ |
||||||
|
doctorCount: res.count, |
||||||
|
}); |
||||||
|
}); |
||||||
|
}, |
||||||
|
getTree() { |
||||||
|
wx.ajax({ |
||||||
|
method: "GET", |
||||||
|
url: "?r=takeda/doctor/doctor-tree-list", |
||||||
|
data: { DepartmentId: this.data.DepartmentId }, |
||||||
|
}).then((res) => { |
||||||
|
this.setData({ |
||||||
|
tree: res.tree, |
||||||
|
}); |
||||||
|
}); |
||||||
|
}, |
||||||
|
handleChange(e) { |
||||||
|
const index = e.detail.value; |
||||||
|
const { DepartmentId, DepartmentName } = this.data.Department[index]; |
||||||
|
this.setData({ |
||||||
|
DepartmentId, |
||||||
|
DepartmentName, |
||||||
}); |
}); |
||||||
|
}, |
||||||
|
handleInvite() { |
||||||
|
wx.navigateTo({ |
||||||
|
url: "/module1/pages/invite/index", |
||||||
|
}); |
||||||
|
}, |
||||||
|
handleSearch() { |
||||||
|
const { tree, search } = this.data; |
||||||
|
let newTree: any = null; |
||||||
|
if (search) { |
||||||
|
newTree = this.sourceTree(tree, search); |
||||||
|
} else { |
||||||
|
newTree = this.clearTree(tree, search); |
||||||
|
} |
||||||
|
this.setData({ |
||||||
|
tree: newTree, |
||||||
|
}); |
||||||
|
}, |
||||||
|
sourceTree(tree: any[], search: string): any[] { |
||||||
|
return tree.map((item) => { |
||||||
|
if (item.Children?.length) { |
||||||
|
this.sourceTree(item.Children, search); |
||||||
|
} |
||||||
|
if (item.DoctorInfo.doctorName.includes(search)) { |
||||||
|
item.active = true; |
||||||
|
} else { |
||||||
|
item.active = false; |
||||||
|
} |
||||||
|
return item; |
||||||
|
}); |
||||||
|
}, |
||||||
|
clearTree(tree: any[], search: string): any[] { |
||||||
|
return tree.map((item) => { |
||||||
|
if (item.Children?.length) { |
||||||
|
this.clearTree(item.Children, search); |
||||||
|
} |
||||||
|
item.active = false; |
||||||
|
return item; |
||||||
|
}); |
||||||
|
}, |
||||||
|
handleFold(e) { |
||||||
|
const { index } = e.currentTarget.dataset; |
||||||
|
const { tree } = this.data; |
||||||
|
tree[index].fold = !tree[index].fold; |
||||||
|
this.setData({ |
||||||
|
tree, |
||||||
|
}); |
||||||
|
}, |
||||||
|
handleSubFold(e) { |
||||||
|
const { index, subindex } = e.currentTarget.dataset; |
||||||
|
const { tree } = this.data; |
||||||
|
tree[index].Children[subindex].fold = !tree[index].Children[subindex].fold; |
||||||
|
this.setData({ |
||||||
|
tree, |
||||||
|
}); |
||||||
|
}, |
||||||
|
handleFoldAll() { |
||||||
|
const { tree } = this.data; |
||||||
|
this.toggleFoldAll(tree); |
||||||
|
}, |
||||||
|
toggleFoldAll(tree) { |
||||||
|
return tree.map((item) => { |
||||||
|
if (item.Children?.length) { |
||||||
|
this.toggleFoldAll(item.Children); |
||||||
|
} |
||||||
|
item.fold = !item.fold; |
||||||
|
return item; |
||||||
|
}); |
||||||
|
}, |
||||||
|
}); |
||||||
|
|
||||||
|
export {}; |
||||||
|
Loading…
Reference in new issue