const app = getApp(); import yygh from "../../../../config/api/yygh/index.js"; import regeneratorRuntime from "../../../../../utils/runtime.js"; import common from "../../../../../utils/common.js"; import apiRootUrl from "../../../../../config/api.js"; import { pagesPatientFn } from '@/utils'; import icon from "../../../../../utils/icon.js"; Page({ data: { iconUrl:icon, showNoData:false,//是否显示暂无数据 noDataTip:'暂无历史预约医生信息',//暂无数据提示信息 doctorList:[],//医生列表 currentUser:{} }, onLoad: function (options) { }, onShow: function () { this.main() }, async main() { let currentUser = app.globalData.currentUser let result = [], showNoData=true; let queryData = { HosId: app.globalData.districtId || app.globalData.hosId, QueryLocal: "1", MemberIds: currentUser.memberId, } let resp = await yygh.queryHistoryBaseDoctor(queryData) if(!common.isEmpty(resp)){ resp.map(item=>{ /**如果医生头像没有域名 添加域名 */ if (item.Url && item.Url.indexOf('http') == '-1') { item.Url = apiRootUrl.ApiRootUrl + item.Url } item.Url = item.Url.replace(/\\/g, '/') }) result=resp; showNoData=false } this.setData({ currentUser:currentUser, doctorList:result, showNoData: showNoData }) }, /** * 暂无数据点击返回 */ back(){ common.navigateBack(1) }, goto(e){ pagesPatientFn.handleRouter(e,'yyghClinicMsg') } })