yyghHistoryDoctor.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. const app = getApp();
  2. import yygh from "../../../../config/api/yygh/index.js";
  3. import regeneratorRuntime from "../../../../../utils/runtime.js";
  4. import common from "../../../../../utils/common.js";
  5. import apiRootUrl from "../../../../../config/api.js";
  6. import { pagesPatientFn } from '@/utils';
  7. import icon from "../../../../../utils/icon.js";
  8. Page({
  9. data: {
  10. iconUrl:icon,
  11. showNoData:false,//是否显示暂无数据
  12. noDataTip:'暂无历史预约医生信息',//暂无数据提示信息
  13. doctorList:[],//医生列表
  14. currentUser:{}
  15. },
  16. onLoad: function (options) {
  17. },
  18. onShow: function () {
  19. this.main()
  20. },
  21. async main() {
  22. let currentUser = app.globalData.currentUser
  23. let result = [], showNoData=true;
  24. let queryData = {
  25. HosId: app.globalData.districtId || app.globalData.hosId,
  26. QueryLocal: "1",
  27. MemberIds: currentUser.memberId,
  28. }
  29. let resp = await yygh.queryHistoryBaseDoctor(queryData)
  30. if(!common.isEmpty(resp)){
  31. resp.map(item=>{
  32. /**如果医生头像没有域名 添加域名 */
  33. if (item.Url && item.Url.indexOf('http') == '-1') {
  34. item.Url = apiRootUrl.ApiRootUrl + item.Url
  35. }
  36. item.Url = item.Url.replace(/\\/g, '/')
  37. })
  38. result=resp;
  39. showNoData=false
  40. }
  41. this.setData({
  42. currentUser:currentUser,
  43. doctorList:result,
  44. showNoData: showNoData
  45. })
  46. },
  47. /**
  48. * 暂无数据点击返回
  49. */
  50. back(){
  51. common.navigateBack(1)
  52. },
  53. goto(e){
  54. pagesPatientFn.handleRouter(e,'yyghClinicMsg')
  55. }
  56. })