yyghHistoryDoctor.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <template>
  2. <view class="container">
  3. <view class="content">
  4. <view class="userInfoTopFixe">
  5. <userInfo :userInfo="currentUser" type="member" bgClass="bgLinGra"></userInfo>
  6. </view>
  7. <view class="doctor_list" v-if="!showNoData">
  8. <view class="doctor_item displayFlexLeft" v-for="(item, index) in doctorList" :key="index">
  9. <view class="doctor_item_img">
  10. <image :src="item.Url || iconUrl.icon_doctor" mode="widthFix"></image>
  11. </view>
  12. <view class="doctor_item_nav displayFlexLeft">
  13. <view class="displayFlexBetween" style="width: 100%;">
  14. <view class="doctor_item_nav_tit">
  15. <view class="doctor_item_nav_subtit displayFlexLeft">
  16. <text class="doctor_item_nav_subtit_val">{{ item.DoctorName }}</text>
  17. <text class="doctor_item_nav_subtit_txt boderColorCustom_F08 colorCustom_F08">{{ item.DoctorTitle }}</text>
  18. </view>
  19. <text class="doctor_item_nav_subtit_dept">科室:{{ item.DeptName }}</text>
  20. </view>
  21. <view class="colorCustom boderColorCustom goBtn" @click="goto(item)">去预约</view>
  22. </view>
  23. <view class="doctor_item_info">擅长:{{ item.Spec || '-' }}</view>
  24. </view>
  25. </view>
  26. </view>
  27. <view v-else class="noData displayFlexCol">
  28. <noData :value="noDataTip"></noData>
  29. </view>
  30. </view>
  31. </view>
  32. </template>
  33. <script setup lang="ts">
  34. import { ref } from 'vue';
  35. import { onLoad } from '@dcloudio/uni-app';
  36. import { common, pagesPatientFn } from '@/utils';
  37. import icon from '@/utils/icon';
  38. import { REQUEST_CONFIG } from '@/config';
  39. import { queryHistoryBaseDoctor } from '@/pagesPatient/service/yygh';
  40. import userInfo from '@/pagesPersonal/st1/components/userInfo/userInfo.vue';
  41. import noData from '@/pages/st1/components/noData/noData.vue';
  42. const app = getApp();
  43. const iconUrl = ref(icon);
  44. const showNoData = ref(false); // 是否显示暂无数据
  45. const noDataTip = ref('暂无历史预约医生信息'); // 暂无数据提示信息
  46. const doctorList = ref<any[]>([]); // 医生列表
  47. const currentUser = ref({});
  48. onLoad(() => {
  49. main();
  50. });
  51. const main = async () => {
  52. let cUser = app.globalData.currentUser;
  53. let result: any[] = [];
  54. let isShowNoData = true;
  55. let queryData = {
  56. HosId: app.globalData.districtId || app.globalData.hosId,
  57. QueryLocal: "1",
  58. MemberIds: cUser.memberId,
  59. };
  60. let resp = await queryHistoryBaseDoctor(queryData);
  61. if (!common.isEmpty(resp)) {
  62. resp.map((item: any) => {
  63. /**如果医生头像没有域名 添加域名 */
  64. if (item.Url && item.Url.indexOf('http') == '-1') {
  65. item.Url = REQUEST_CONFIG.BASE_URL + item.Url;
  66. }
  67. if (item.Url) {
  68. item.Url = item.Url.replace(/\\/g, '/');
  69. }
  70. });
  71. result = resp;
  72. isShowNoData = false;
  73. }
  74. currentUser.value = cUser;
  75. doctorList.value = result;
  76. showNoData.value = isShowNoData;
  77. };
  78. const goto = (item: any) => {
  79. const mockEvent = {
  80. currentTarget: {
  81. dataset: {
  82. item: item
  83. }
  84. }
  85. };
  86. pagesPatientFn.handleRouter(mockEvent, 'yyghClinicMsg');
  87. };
  88. const back = () => {
  89. common.navigateBack(1);
  90. };
  91. </script>
  92. <style scoped>
  93. @import "@/pagesPatient/st1/static/css/yyghHistoryDoctor.css";
  94. </style>