doctorList.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  1. <template>
  2. <view class="container" :hidden="!showCon">
  3. <view class="content">
  4. <view class="search">
  5. <view class="search_box">
  6. <input :class="[isFocus ? 'search_input' : 'search_input_none']"
  7. placeholder="请输入医生名称搜索"
  8. :placeholder-class="isFocus ? 'placeholder' : 'placeholder_none'"
  9. v-model="searchValue"
  10. @focus="focusFn('focus')" />
  11. <image :class="['search_icon', isFocus ? 'search_icon_none' : '']" :src="iconUrl.search"></image>
  12. <image class="remove_icon" v-if="isFocus" :src="iconUrl.cha" @click.stop="focusFn('blur')"></image>
  13. <view v-if="isFocus" :class="['search_confirm', 'backgroundCustom_F08', isFocus ? 'search_confirm_active' : '']" @click="searchClick">搜索</view>
  14. </view>
  15. </view>
  16. <view class="doctorList" v-if="doctorList.length > 0">
  17. <view class="doctor_list">
  18. <view class="doctor_item" v-for="(doctorItem, doctorIndex) in doctorList" :key="doctorIndex">
  19. <view class="doctor_item_nav displayFlexLeft" @click="doctorInfoClick(doctorItem)">
  20. <view class="doctor_item_nav_img">
  21. <image :src="doctorItem.DoctorPhotoUrl || iconUrl.icon_doctor" mode="widthFix"></image>
  22. </view>
  23. <view class="doctor_item_nav_tit">
  24. <view class="doctor_item_nav_subtit">
  25. <text class="doctor_item_nav_subtit_val">{{doctorItem.DoctorName}}</text>
  26. <text v-if="doctorItem.DoctorTitle || doctorItem.Title || doctorItem.LczcName" class="doctor_item_nav_subtit_txt">
  27. {{doctorItem.DoctorTitle || doctorItem.Title || doctorItem.LczcName}}
  28. </text>
  29. </view>
  30. <view v-if="doctorItem.Spec || doctorItem.DoctorSkill" class="doctor_itemStyle">
  31. <view class="doctor_item_nav_info">
  32. {{doctorItem.Spec || doctorItem.DoctorSkill}}
  33. </view>
  34. <view class="doctor_item_list colorCustom">
  35. 详情
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. <view class="noData" v-if="doctorList.length == 0">
  44. <noData value="暂无数据"></noData>
  45. </view>
  46. </view>
  47. <doctorInfo v-model:doctorInfoIsShow="doctorInfoIsShow" :doctorInfo="doctorInfoData"></doctorInfo>
  48. </view>
  49. </template>
  50. <script setup lang="ts">
  51. import { ref } from 'vue';
  52. import { onLoad } from '@dcloudio/uni-app';
  53. import { common } from '@/utils';
  54. import icon from '@/utils/icon';
  55. import { deptAndDocApiList } from '@/pagesPatient/service/new/index';
  56. import noData from '@/pages/st1/components/noData/noData.vue';
  57. import doctorInfo from '@/pagesPatient/st1/components/doctorInfo/doctorInfo.vue';
  58. const iconUrl = icon;
  59. const isFocus = ref(false);
  60. const searchValue = ref('');
  61. const doctorList = ref<any[]>([]);
  62. const showCon = ref(false);
  63. const doctorInfoIsShow = ref(false);
  64. const doctorInfoData = ref({});
  65. const queryBean = ref<any>({});
  66. const app = getApp();
  67. onLoad((options: any) => {
  68. let qb = options.queryBean ? JSON.parse(options.queryBean) : { HospitalId: app.globalData.hosId, DeptId: '' };
  69. queryBean.value = qb;
  70. uni.setNavigationBarTitle({
  71. title: qb.DeptName ? qb.DeptName : '专家介绍'
  72. });
  73. main();
  74. });
  75. const main = () => {
  76. queryUserListV2();
  77. };
  78. const queryUserListV2 = async (sv: string = '') => {
  79. let list: any[] = [];
  80. let queryData = {
  81. Hospitalid: queryBean.value.HospitalId,
  82. DeptId: queryBean.value.DeptId,
  83. DoctorName: sv,
  84. };
  85. let res = await deptAndDocApiList(queryData);
  86. if (common.isNotEmpty(res)) {
  87. list = res;
  88. }
  89. doctorList.value = list;
  90. showCon.value = true;
  91. };
  92. const doctorInfoClick = (item: any) => {
  93. doctorInfoIsShow.value = true;
  94. doctorInfoData.value = item;
  95. };
  96. const focusFn = (type: string) => {
  97. if (type === 'focus') {
  98. isFocus.value = true;
  99. } else {
  100. isFocus.value = false;
  101. searchValue.value = '';
  102. queryUserListV2();
  103. }
  104. };
  105. const searchClick = () => {
  106. if (common.isEmpty(searchValue.value)) {
  107. common.showModal('请输入搜索科室或医生');
  108. return;
  109. }
  110. queryUserListV2(searchValue.value);
  111. };
  112. </script>
  113. <style lang="scss" scoped>
  114. @import '@/pagesPatient/st1/static/css/search.wxss';
  115. .content{
  116. height: 100%;
  117. }
  118. .content {
  119. padding-top: 110upx;
  120. position: relative;
  121. z-index: 10;
  122. }
  123. .search_con {
  124. width: 100%;
  125. position: fixed;
  126. height: 100%;
  127. background-color: rgba(0, 0, 0, 0.6);
  128. top: 0;
  129. left: 0;
  130. z-index: 1;
  131. overflow: auto;
  132. -webkit-overflow-scrolling: touch;
  133. }
  134. .search_con_inner {
  135. width: 100%;
  136. background-color: #fff;
  137. padding: 0 0 10upx 30upx;
  138. }
  139. .search_con_list {
  140. overflow: auto;
  141. padding-top: 110upx;
  142. -webkit-overflow-scrolling: touch;
  143. }
  144. .search_con_list_inner {
  145. width: 100%;
  146. display: inline-block;
  147. margin-top: -1px;
  148. }
  149. .search_con_item {
  150. font-size: 32upx;
  151. padding: 36upx 0;
  152. color: #222326;
  153. }
  154. .date_list {
  155. background-color: #fff;
  156. padding: 20upx 6upx 20upx 30upx;
  157. white-space: nowrap;
  158. overflow: auto;
  159. -webkit-overflow-scrolling: touch;
  160. position: relative;
  161. z-index: 2;
  162. }
  163. .date_item {
  164. width: 140upx;
  165. height: 144upx;
  166. display: inline-flex;
  167. flex-direction: column;
  168. justify-content: center;
  169. align-items: center;
  170. background: #F1F1F6;
  171. color: #222326;
  172. border-radius: 24upx;
  173. margin-right:24upx;
  174. font-size: 32upx;
  175. vertical-align: middle;
  176. }
  177. .month {
  178. margin-top: 10upx;
  179. }
  180. .date_item_all {
  181. font-size: 32upx;
  182. }
  183. .doctor_list {
  184. padding: 0 30upx;
  185. display: inline-block;
  186. width: 100%;
  187. }
  188. .doctor_item {
  189. background: #fff;
  190. border-radius: 24upx;
  191. margin: 30upx 0;
  192. padding: 20upx 30upx 32upx;
  193. }
  194. .doctor_item_nav {
  195. display: flex;
  196. position: relative;
  197. padding: 17upx 0;
  198. }
  199. .doctor_item_nav_img {
  200. width: 88.3upx;
  201. height: 88.3upx;
  202. border-radius: 50%;
  203. margin-right: 25upx;
  204. overflow: hidden;
  205. }
  206. .doctor_item_nav_tit {
  207. width: 82%;
  208. }
  209. .doctor_item_nav_subtit_val {
  210. font-size: 32upx;
  211. font-family: PingFang SC;
  212. font-weight: 800;
  213. color: #222326;
  214. margin-right: 12upx;
  215. }
  216. .doctor_item_nav_subtit_txt {
  217. height: 36upx;
  218. line-height: 28upx;
  219. font-size: 24upx;
  220. font-family: PingFang SC;
  221. padding: 0upx 7upx;
  222. position: relative;
  223. display: inline-block;
  224. background: #FFFBF4;
  225. }
  226. .doctor_item_list{
  227. font-size: 28upx;
  228. font-family: Source Han Sans CN;
  229. font-weight: 500;
  230. line-height: 40upx;
  231. text-align: end;
  232. display: flex;
  233. justify-content: right;
  234. align-items: flex-end;
  235. }
  236. .doctor_item_nav_info {
  237. font-size: 28upx;
  238. font-family: Source Han Sans CN;
  239. font-weight: 500;
  240. color: #62626D;
  241. line-height: 40upx;
  242. overflow: hidden;
  243. text-overflow: ellipsis;
  244. display: -webkit-box;
  245. -webkit-line-clamp: 2;
  246. line-clamp: 2;
  247. -webkit-box-orient: vertical;
  248. width: 450upx;
  249. }
  250. .time_list {
  251. display: flex;
  252. flex-wrap: wrap;
  253. align-items: center;
  254. }
  255. .time_item {
  256. margin: 23upx 25upx 0 0;
  257. width: 196upx;
  258. height: 110upx;
  259. line-height: 110upx;
  260. background: #F1F1F6;
  261. border-radius: 20upx;
  262. font-size: 28upx;
  263. color: #222326;
  264. text-align: center;
  265. position: relative;
  266. }
  267. .time_item:nth-child(3n){
  268. margin-right: 0;
  269. }
  270. .nav {
  271. height: 100upx;
  272. padding:0 30upx;
  273. background-color: #fff;
  274. border-radius: 0 0 30upx 30upx;
  275. font-size: 30upx;
  276. color: #43434A;
  277. position: relative;
  278. z-index: 2;
  279. }
  280. .nav_val {
  281. margin-right: 30upx;
  282. }
  283. .nav_inner {
  284. display: flex;
  285. align-items: center;
  286. justify-content: space-between;
  287. height: 100%;
  288. }
  289. .nav_tit_val {
  290. white-space: nowrap;
  291. }
  292. .bottom {
  293. width: 16upx;
  294. height: 16upx;
  295. margin-left: 16upx;
  296. }
  297. .time_item_img {
  298. width: 61upx;
  299. height: 54upx;
  300. position: absolute;
  301. right: 0;
  302. top: 0;
  303. }
  304. .time_item_stop view{
  305. color: #8A8A99;
  306. }
  307. .doctorList{
  308. overflow: auto;
  309. height: 100%;
  310. }
  311. .doctor_itemStyle{
  312. display: flex;
  313. flex-direction: row;
  314. font-size: 28upx;
  315. font-family: Source Han Sans CN;
  316. font-weight: 500;
  317. color: #62626D;
  318. line-height: 40upx;
  319. margin-top: 10upx;
  320. }
  321. .search_icon{
  322. left:32%
  323. }
  324. .search_icon_none {
  325. left: 20upx;
  326. }
  327. </style>