doctorList.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  1. <template>
  2. <view>
  3. <view class="top-fixed">
  4. <!-- 搜索框 -->
  5. <view class="search-cont">
  6. <view class="inner">
  7. <image class="icon-search" src="@/static/images/search.png" mode=""></image>
  8. <input type="text" v-model="searchVal" placeholder="输入医生姓名搜索" confirm-type="搜索" @confirm="goSearch" placeholder-style="font-size:28rpx;color:#BBBBBB;font-family: PingFang SC;" />
  9. </view>
  10. </view>
  11. <!-- tab切换 -->
  12. <view class="pub-tab-box">
  13. <view class="tab-inner">
  14. <view
  15. v-for="(item,index) in depts"
  16. :key="index"
  17. :class="deptId == item.departmentId?'item active':'item'"
  18. @click="changeDept(item)"
  19. >
  20. <view class="text">
  21. {{ item.departmentName }}
  22. <image v-show="deptId == item.departmentId" class="tab-bg" src="@/static/images/tab_bg.png" mode=""></image>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. <!-- 数据列表 -->
  29. <mescroll-body ref="mescrollRef" top="190rpx" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">
  30. <view class="doc-list">
  31. <view class="item" v-for="(item,index) in dataList" :key="index" @click="showDetail(item)">
  32. <!-- 头像 -->
  33. <view class="head-box">
  34. <image :src="item.headImg" mode="aspectFill"></image>
  35. </view>
  36. <!-- 详细信息 -->
  37. <view class="info">
  38. <!-- 姓名等 -->
  39. <view class="top">
  40. <text class="name">{{ item.doctorName }}</text>
  41. <view class="line"></view>
  42. <text class="other">{{utils.getDictLabelName("doctorPosition",item.position)}}</text>
  43. <view class="line"></view>
  44. <text class="other">{{ item.departmentName }}</text>
  45. </view>
  46. <!-- 单位 -->
  47. <view class="unit-box">
  48. <!-- <view class="level">三甲</view> -->
  49. <view class="name">{{ item.hospitalName }}</view>
  50. </view>
  51. <!-- 擅长 -->
  52. <view class="expertise ellipsis2">
  53. 擅长:{{ item.doctorDesc }}
  54. </view>
  55. <!-- 评分 -->
  56. <!-- <view class="rate-box">
  57. <view class="star">
  58. <image src="@/static/images/star.png" mode=""></image>
  59. <text>{{ item.pings }}</text>
  60. </view>
  61. <view class="line"></view>
  62. <view class="num-box">
  63. <text class="label">接诊数</text>
  64. <text class="num">{{ item.orders }}</text>
  65. </view>
  66. <view class="line"></view>
  67. <view class="num-box">
  68. <text class="label">响应速度</text>
  69. <text class="num">{{ item.speed }}分钟</text>
  70. </view>
  71. </view> -->
  72. <!-- 价格 -->
  73. <view class="price-box" v-if="item.price!=null&&item.price.length>0">
  74. <view class="btn-item" v-for="(subitme) in item.price">
  75. <text class="label" >{{subitme.priceType==1?'图文':'语音'}}</text>
  76. <text class="num">¥{{subitme.price.toFixed(2)}}</text>
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. </mescroll-body>
  83. </view>
  84. </template>
  85. <script>
  86. import {getDepartmentList,getDoctorList} from '@/api/doctorOrder.js'
  87. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  88. export default {
  89. mixins: [MescrollMixin],
  90. data() {
  91. return {
  92. searchVal:"",
  93. depts:[],
  94. deptId:0,
  95. doctorType:0,
  96. // tab切换
  97. mescroll:null,
  98. // 上拉加载的配置
  99. upOption: {
  100. onScroll:true,
  101. use: true, // 是否启用上拉加载; 默认true
  102. page: {
  103. num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
  104. size: 10 // 每页数据的数量,默认10
  105. },
  106. noMoreSize: 10, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
  107. empty: {
  108. icon:'/static/images/no_data.png',
  109. tip: '暂无数据'
  110. }
  111. },
  112. // 列表数据
  113. dataList: []
  114. };
  115. },
  116. onLoad(option) {
  117. if(option.doctorType!=null){
  118. this.doctorType=option.doctorType
  119. }
  120. this.getDepartmentList();
  121. },
  122. methods: {
  123. getDepartmentList(){
  124. getDepartmentList().then(res => {
  125. if(res.code==200){
  126. var allDept={departmentId:0,departmentName:"全部"}
  127. this.depts.push(allDept);
  128. this.depts=this.depts.concat(res.data);
  129. }else{
  130. uni.showToast({
  131. icon:'none',
  132. title: "请求失败",
  133. });
  134. }
  135. });
  136. },
  137. // tab切换
  138. changeDept(item) {
  139. this.deptId = item.departmentId;
  140. this.mescroll.resetUpScroll()
  141. },
  142. mescrollInit(mescroll) {
  143. this.mescroll = mescroll;
  144. },
  145. /*下拉刷新的回调 */
  146. downCallback(mescroll) {
  147. mescroll.resetUpScroll()
  148. },
  149. upCallback(page) {
  150. //联网加载数据
  151. var that = this;
  152. var data = {
  153. doctorType:this.doctorType,
  154. departmentId:this.deptId,
  155. doctorName:this.searchVal,
  156. page: page.num,
  157. pageSize: page.size
  158. };
  159. getDoctorList(data).then(res => {
  160. if(res.code==200){
  161. //设置列表数据
  162. if (page.num == 1) {
  163. that.dataList = res.data.list;
  164. } else {
  165. that.dataList = that.dataList.concat(res.data.list);
  166. }
  167. that.mescroll.endBySize(res.data.list.length, res.data.total);
  168. }else{
  169. uni.showToast({
  170. icon:'none',
  171. title: "请求失败",
  172. });
  173. that.dataList = null;
  174. that.mescroll.endErr();
  175. }
  176. });
  177. },
  178. goSearch(){
  179. this.mescroll.resetUpScroll()
  180. },
  181. // 查看医生资料详情
  182. showDetail(item) {
  183. uni.navigateTo({
  184. url: './doctorDetail?doctorId=' + item.doctorId
  185. })
  186. }
  187. }
  188. }
  189. </script>
  190. <style lang="scss">
  191. .top-fixed{
  192. width: 100%;
  193. position: fixed;
  194. top: 0;
  195. left: 0;
  196. z-index: 10;
  197. }
  198. .search-cont{
  199. padding: 16upx 30upx;
  200. background-color: #FFFFFF;
  201. .inner{
  202. box-sizing: border-box;
  203. width: 100%;
  204. height: 72upx;
  205. background: #F7F7F7;
  206. border-radius: 36upx;
  207. display: flex;
  208. align-items: center;
  209. padding: 0 30upx;
  210. .icon-search{
  211. width: 28upx;
  212. height: 28upx;
  213. margin-right: 20upx;
  214. }
  215. input{
  216. flex: 1;
  217. height: 60upx;
  218. line-height: 60upx;
  219. }
  220. }
  221. }
  222. .pub-tab-box{
  223. padding: 0 33upx;
  224. background-color: #FFFFFF;
  225. .tab-inner{
  226. height: 88upx;
  227. line-height: 88upx;
  228. display: flex;
  229. overflow-x: auto;
  230. }
  231. .item{
  232. font-size: 28upx;
  233. white-space: nowrap;
  234. line-height: 1;
  235. font-family: PingFang SC;
  236. font-weight: 500;
  237. color: #666666;
  238. margin-right: 60upx;
  239. display: flex;
  240. align-items: center;
  241. justify-content: center;
  242. &:last-child{
  243. margin-right: 0;
  244. }
  245. &.active{
  246. font-weight: bold;
  247. color: #333333;
  248. }
  249. .text{
  250. position: relative;
  251. z-index: 1;
  252. }
  253. .tab-bg{
  254. width: 72upx;
  255. height: 28upx;
  256. position: absolute;
  257. top: 17upx;
  258. left: 50%;
  259. transform: translateX(-36upx);
  260. z-index: -1;
  261. }
  262. }
  263. }
  264. .top-seat{
  265. width: 100%;
  266. height: 192upx;
  267. }
  268. .doc-list{
  269. padding: 20upx;
  270. .item{
  271. box-sizing: border-box;
  272. // height: 433upx;
  273. background: #FFFFFF;
  274. border: 4upx solid #FFFFFF;
  275. border-radius: 16upx;
  276. padding: 40upx 30upx;
  277. display: flex;
  278. margin-bottom: 20upx;
  279. .head-box{
  280. width: 120upx;
  281. height: 120upx;
  282. background: #EDF1F4;
  283. border-radius: 50%;
  284. overflow: hidden;
  285. margin-right: 30upx;
  286. image{
  287. width: 100%;
  288. height: 100%;
  289. }
  290. }
  291. .info{
  292. width: calc(100% - 150upx);
  293. .top{
  294. display: flex;
  295. align-items: center;
  296. font-family: PingFang SC;
  297. line-height: 1;
  298. .name{
  299. font-size: 34upx;
  300. font-weight: bold;
  301. color: #111111;
  302. }
  303. .line{
  304. width: 1px;
  305. height: 26upx;
  306. background: #DDDDDD;
  307. margin: 0 20upx;
  308. }
  309. .other{
  310. font-size: 28upx;
  311. font-weight: 500;
  312. color: #333333;
  313. }
  314. }
  315. .unit-box{
  316. display: flex;
  317. margin-top: 24upx;
  318. .level{
  319. padding: 0 10upx;
  320. height: 30upx;
  321. line-height: 30upx;
  322. font-size: 22upx;
  323. font-family: PingFang SC;
  324. font-weight: 500;
  325. color: #FFFFFF;
  326. background: #018C39;
  327. border-radius: 10upx 4upx 10upx 4upx;
  328. margin-right: 12upx;
  329. }
  330. .name{
  331. font-size: 28upx;
  332. font-family: PingFang SC;
  333. font-weight: 500;
  334. color: #333333;
  335. line-height: 30upx;
  336. }
  337. }
  338. .expertise{
  339. font-size: 26upx;
  340. font-family: PingFang SC;
  341. font-weight: 500;
  342. color: #666666;
  343. line-height: 42upx;
  344. margin: 22upx 0 0upx;
  345. }
  346. .rate-box{
  347. display: flex;
  348. align-items: center;
  349. .star{
  350. display: flex;
  351. align-items: center;
  352. image{
  353. width: 22upx;
  354. height: 22upx;
  355. margin-right: 10upx;
  356. }
  357. text{
  358. font-size: 26upx;
  359. font-family: PingFang SC;
  360. font-weight: bold;
  361. color: #CEA764;
  362. line-height: 1;
  363. }
  364. }
  365. .line{
  366. width: 1px;
  367. height: 20upx;
  368. background: #DDDDDD;
  369. margin: 0 20upx;
  370. }
  371. .num-box{
  372. display: flex;
  373. align-items: center;
  374. font-family: PingFang SC;
  375. .label{
  376. font-size: 24upx;
  377. font-weight: 500;
  378. color: #999999;
  379. line-height: 1;
  380. margin-right: 7px;
  381. }
  382. .num{
  383. font-size: 26upx;
  384. font-weight: bold;
  385. color: #CEA764;
  386. line-height: 1;
  387. }
  388. }
  389. }
  390. .price-box{
  391. display: flex;
  392. align-items: center;
  393. margin-top: 38upx;
  394. .btn-item{
  395. display: flex;
  396. align-items: center;
  397. justify-content: center;
  398. width: 164upx;
  399. height: 56upx;
  400. line-height: 56upx;
  401. border: 1px solid rgba(43, 199, 185, 0.5);
  402. border-radius: 28upx;
  403. font-family: PingFang SC;
  404. margin-right: 30upx;
  405. &:last-child{
  406. margin-right: 0;
  407. }
  408. .label{
  409. font-size: 26upx;
  410. font-weight: 500;
  411. color: #018C39;
  412. margin-right: 5upx;
  413. }
  414. .num{
  415. font-size: 28upx;
  416. font-weight: bold;
  417. color: #018C39;
  418. }
  419. }
  420. }
  421. }
  422. }
  423. }
  424. </style>