doctorDetail.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583
  1. <template>
  2. <view>
  3. <view class="top-cont">
  4. <!-- 背景图片 -->
  5. <image class="bg" src="/static/images/doctordetail_top_bg.png" mode=""></image>
  6. <view class="top-inner">
  7. <!-- 这里是状态栏 -->
  8. <view class="status_bar" :style="{height: statusBarHeight}"></view>
  9. <view class="back-box" @click="back">
  10. <image src="../../static/images/back.png" mode=""></image>
  11. </view>
  12. <!-- 医生信息 -->
  13. <view class="doctor-info">
  14. <view class="inner">
  15. <!-- 头像 -->
  16. <view class="head-img">
  17. <image :src="doctor.headImg" mode="aspectFill"></image>
  18. </view>
  19. <!-- 姓名 -->
  20. <view class="name-box">
  21. <text class="name">{{doctor.doctorName}}</text>
  22. <view class="line"></view>
  23. <text class="other">
  24. {{utils.getDictLabelName("doctorPosition",doctor.position)}}
  25. </text>
  26. <view class="line"></view>
  27. <text class="other">{{doctor.departmentName}}</text>
  28. <view class="line"></view>
  29. <view class="years">从业1年</view>
  30. </view>
  31. <!-- 单位 -->
  32. <view class="unit-box">
  33. <!-- <view class="level">三甲</view> -->
  34. <view class="name">{{doctor.hospitalName}}</view>
  35. </view>
  36. <!-- 评分等 -->
  37. <!-- <view class="param-box">
  38. <view class="item">
  39. <view class="top">
  40. <text class="num">{{doctor.pings}}</text>
  41. <text class="unit">分</text>
  42. </view>
  43. <view class="label">评分</view>
  44. </view>
  45. <view class="item">
  46. <view class="top">
  47. <text class="num">{{doctor.orders}}</text>
  48. <text class="unit">人</text>
  49. </view>
  50. <view class="label">接诊数</view>
  51. </view>
  52. <view class="item">
  53. <view class="top">
  54. <text class="num">{{doctor.speed}}</text>
  55. <text class="unit">分钟</text>
  56. </view>
  57. <view class="label">响应速度</view>
  58. </view>
  59. </view> -->
  60. </view>
  61. </view>
  62. <view class="content">
  63. <!-- 擅长 -->
  64. <view class="expertise">
  65. <image class="label-img" src="../../static/images/sc_word.png" mode=""></image>
  66. <text :class="showExpert?'text':'text ellipsis3'" id="expert">{{doctor.doctorDesc}}</text>
  67. <!-- 查看更多按钮 -->
  68. <view v-if="!showExpert" class="show-more" @click="showMoreExpert">
  69. <image class="mask" src="../../static/images/mask.png" mode=""></image>
  70. <view class="inner">
  71. <text class="btn">查看全部</text>
  72. <image src="../../static/images/arrow3.png" mode=""></image>
  73. </view>
  74. </view>
  75. </view>
  76. <!-- 问诊方式 -->
  77. <view class="mode-box">
  78. <view v-for="(price,index) in prices" :class="price.priceId == priceId?'item active':'item'" @click="choseMode(price)">
  79. <image v-if="price.priceType==1" class="img" src="../../static/images/picture_ask.png" mode=""></image>
  80. <image v-if="price.priceType==2" class="img" src="../../static/images/phone_ask.png" mode=""></image>
  81. <view class="info">
  82. <text v-if="price.priceType==1" class="label">图文问诊</text>
  83. <text v-if="price.priceType==2" class="label">电话问诊</text>
  84. <view class="price" v-if="price.priceType==1">
  85. <text class="num">{{price.price}}</text>
  86. <text class="unit">元</text>
  87. <text class="gray">/次</text>
  88. </view>
  89. <view class="price" v-if="price.priceType==2">
  90. <text class="num">{{price.price}}</text>
  91. <text class="unit">元</text>
  92. <text class="gray">{{price.times}}分</text>
  93. </view>
  94. </view>
  95. <!-- 选中的角标 -->
  96. <image v-if="price.priceId == priceId" class="active-img" src="../../static/images/sel_right50.png" mode=""></image>
  97. </view>
  98. </view>
  99. </view>
  100. </view>
  101. </view>
  102. <!-- 底部去支付按钮 -->
  103. <view class="btn-foot">
  104. <view class="menu-box">
  105. <view class="item" @click="goHome">
  106. <image src="../../static/images/back_home.png" mode=""></image>
  107. <text>首页</text>
  108. </view>
  109. <view class="item" @click="changeFollow">
  110. <image v-if="!isFollow" src="../../static/images/focus.png" mode=""></image>
  111. <image v-show="isFollow" src="../../static/images/focus_sel.png" mode=""></image>
  112. <text>关注</text>
  113. </view>
  114. </view>
  115. <!-- <view class="btn" @click="submitOrder()">问诊</view> -->
  116. </view>
  117. </view>
  118. </template>
  119. <script>
  120. import {uploadOSS} from '@/api/common.js'
  121. import {getDoctorDetail,create} from '@/api/doctorOrder.js'
  122. export default {
  123. data() {
  124. return {
  125. doctorId:null,
  126. doctor:{},
  127. prices:[],
  128. priceId:null,
  129. // 状态栏的高度
  130. statusBarHeight: uni.getStorageSync('menuInfo').statusBarHeight,
  131. // 是否显示全擅长文字
  132. showExpert: true,
  133. // 是否关注
  134. isFollow: false
  135. };
  136. },
  137. onLoad(option) {
  138. this.doctorId=option.doctorId;
  139. },
  140. onShow() {
  141. this.getDoctorDetail()
  142. },
  143. methods: {
  144. getDoctorDetail(){
  145. let data = {doctorId:this.doctorId};
  146. var that=this;
  147. getDoctorDetail(data).then(
  148. res => {
  149. if(res.code==200){
  150. this.doctor=res.doctor;
  151. this.prices=res.prices;
  152. setTimeout(function(){
  153. that.getExpertHeight()
  154. },200)
  155. }else{
  156. uni.showToast({
  157. icon:'none',
  158. title: "请求失败",
  159. });
  160. }
  161. },
  162. rej => {}
  163. );
  164. },
  165. back() {
  166. uni.navigateBack()
  167. },
  168. // 获取擅长文字是否超过三行,超过三行显示“查看全部”
  169. getExpertHeight() {
  170. const query = uni.createSelectorQuery().in(this);
  171. query.select('#expert').boundingClientRect(data => {
  172. let containerLength = data.height // 文本内容高度
  173. console.log(containerLength)
  174. let lineHeight = 24 // 行高
  175. if(containerLength / lineHeight > 3){
  176. // 执行代码
  177. this.showExpert = false
  178. } else {
  179. this.showExpert = true
  180. }
  181. }).exec();
  182. },
  183. // 查看更多擅长文字
  184. showMoreExpert() {
  185. this.showExpert = true
  186. },
  187. // 选择问诊方式
  188. choseMode(item) {
  189. this.priceId = item.priceId
  190. },
  191. // 回到首页
  192. goHome() {
  193. uni.switchTab({
  194. url: '/pages/home/index'
  195. })
  196. },
  197. // 关注,取消关注
  198. changeFollow() {
  199. let that = this
  200. if(that.isFollow) {
  201. uni.showModal({
  202. title: '提示',
  203. content: '确定要取消关注吗?',
  204. cancelText: '取消',
  205. confirmText: '确定',
  206. success: res => {
  207. if (res.confirm) {
  208. that.isFollow = false
  209. }
  210. },
  211. })
  212. } else {
  213. that.isFollow = true
  214. }
  215. },
  216. submitOrder() {
  217. if(this.priceId==null){
  218. uni.showToast({
  219. icon:'none',
  220. title: '请选择问诊类型',
  221. });
  222. return;
  223. }
  224. uni.navigateTo({
  225. url:"submitOrder?doctorId="+this.doctorId+"&priceId="+this.priceId
  226. })
  227. return;
  228. },
  229. }
  230. }
  231. </script>
  232. <style lang="scss">
  233. .top-cont{
  234. width: 100%;
  235. height: 400upx;
  236. position: relative;
  237. .bg{
  238. width: 100%;
  239. height: 100%;
  240. position: absolute;
  241. top: 0;
  242. left: 0;
  243. z-index: 1;
  244. }
  245. .top-inner{
  246. width: 100%;
  247. height: 100%;
  248. position: absolute;
  249. top: 0;
  250. left: 0;
  251. z-index: 2;
  252. .back-box{
  253. height: 88upx;
  254. padding-left: 22upx;
  255. display: flex;
  256. align-items: center;
  257. image{
  258. width: 40upx;
  259. height: 40upx;
  260. }
  261. }
  262. .doctor-info{
  263. box-sizing: border-box;
  264. padding: 0 20upx;
  265. margin-top: 70upx;
  266. .inner{
  267. box-sizing: border-box;
  268. // height: 347upx;
  269. background: #FFFFFF;
  270. border-radius: 16upx;
  271. position: relative;
  272. padding: 90upx 30upx 0;
  273. .head-img{
  274. width: 128upx;
  275. height: 128upx;
  276. background: #EDF1F4;
  277. border: 4upx solid #FFFFFF;
  278. border-radius: 50%;
  279. overflow: hidden;
  280. position: absolute;
  281. left: 26upx;
  282. top: -63upx;
  283. image{
  284. width: 100%;
  285. height: 100%;
  286. }
  287. }
  288. .name-box{
  289. display: flex;
  290. align-items: center;
  291. line-height: 1;
  292. font-family: PingFang SC;
  293. .name{
  294. font-size: 36upx;
  295. font-weight: bold;
  296. color: #111111;
  297. }
  298. .line{
  299. width: 1px;
  300. height: 26upx;
  301. background: #DDDDDD;
  302. margin: 0 20upx;
  303. }
  304. .other{
  305. font-size: 30upx;
  306. font-weight: 500;
  307. color: #333333;
  308. }
  309. .years{
  310. padding: 0 10upx;
  311. height: 36upx;
  312. line-height: 36upx;
  313. font-size: 24upx;
  314. font-weight: 500;
  315. color: #CEA764;
  316. background: #FFF1DD;
  317. border-radius: 6upx;
  318. }
  319. }
  320. .unit-box{
  321. display: flex;
  322. margin-top: 30upx;
  323. .level{
  324. padding: 0 10upx;
  325. height: 30upx;
  326. line-height: 30upx;
  327. font-size: 22upx;
  328. font-family: PingFang SC;
  329. font-weight: 500;
  330. color: #FFFFFF;
  331. background: #018C39;
  332. border-radius: 10upx 4upx 10upx 4upx;
  333. margin-right: 12upx;
  334. }
  335. .name{
  336. font-size: 30upx;
  337. font-family: PingFang SC;
  338. font-weight: 500;
  339. color: #333333;
  340. line-height: 30upx;
  341. }
  342. }
  343. .param-box{
  344. padding: 0 50upx;
  345. display: flex;
  346. align-items: center;
  347. justify-content: space-between;
  348. margin-top: 50upx;
  349. .item{
  350. display: flex;
  351. flex-direction: column;
  352. line-height: 1;
  353. font-family: PingFang SC;
  354. .top{
  355. display: flex;
  356. align-items: flex-end;
  357. color: #CEA764;
  358. margin-bottom: 18upx;
  359. .num{
  360. font-size: 36upx;
  361. font-weight: bold;
  362. }
  363. .unit{
  364. font-size: 24upx;
  365. }
  366. }
  367. .label{
  368. font-size: 24upx;
  369. font-weight: 500;
  370. color: #666666;
  371. text-align: center;
  372. }
  373. }
  374. }
  375. }
  376. }
  377. }
  378. }
  379. .content{
  380. padding: 0 20upx;
  381. margin-bottom: 141rpx;
  382. }
  383. .expertise{
  384. box-sizing: border-box;
  385. min-height: 207upx;
  386. background: #FFFFFF;
  387. border: 4upx solid #FFFFFF;
  388. border-radius: 16upx;
  389. padding: 30upx 30upx;
  390. display: flex;
  391. position: relative;
  392. .label-img{
  393. width: 56upx;
  394. height: 26upx;
  395. flex-shrink: 0;
  396. position: absolute;
  397. top: 42upx;
  398. left: 30upx;
  399. }
  400. .text{
  401. font-size: 30upx;
  402. font-family: PingFang SC;
  403. font-weight: 500;
  404. color: #666666;
  405. line-height: 48upx;
  406. text-indent: 70upx;
  407. &.ellipsis3{
  408. overflow:hidden;
  409. text-overflow:ellipsis;
  410. display:-webkit-box;
  411. -webkit-box-orient:vertical;
  412. -webkit-line-clamp: 3;
  413. }
  414. }
  415. .show-more{
  416. display: flex;
  417. align-items: center;
  418. position: absolute;
  419. right: 25upx;
  420. bottom: 35upx;
  421. .mask{
  422. width: 56upx;
  423. height: 34upx;
  424. }
  425. .inner{
  426. background-color: #FFFFFF;
  427. display: flex;
  428. align-items: center;
  429. .btn{
  430. font-size: 28upx;
  431. font-family: PingFang SC;
  432. font-weight: 500;
  433. color: #018C39;
  434. }
  435. image{
  436. width: 14upx;
  437. height: 25upx;
  438. margin-left: 10upx;
  439. }
  440. }
  441. }
  442. }
  443. .mode-box{
  444. display: flex;
  445. align-items: center;
  446. justify-content: space-between;
  447. margin-top: 20upx;
  448. .item{
  449. box-sizing: border-box;
  450. width: 345upx;
  451. height: 150upx;
  452. background: #FFFFFF;
  453. border: 2upx solid #FFFFFF;
  454. border-radius: 16upx;
  455. padding: 33upx 40upx;
  456. display: flex;
  457. align-items: center;
  458. .img{
  459. width: 84upx;
  460. height: 84upx;
  461. margin-right: 26upx;
  462. }
  463. .active-img{
  464. width: 51upx;
  465. height: 51upx;
  466. position: absolute;
  467. right: 0;
  468. bottom: 0;
  469. z-index: 1;
  470. display: none;
  471. }
  472. &.active{
  473. position: relative;
  474. border: 2upx solid #018C39;
  475. .active-img{
  476. display: block;
  477. }
  478. }
  479. .info{
  480. box-sizing: border-box;
  481. height: 84upx;
  482. display: flex;
  483. flex-direction: column;
  484. justify-content: space-between;
  485. padding: 5upx 0 4upx;
  486. font-family: PingFang SC;
  487. .label{
  488. font-size: 32upx;
  489. line-height: 1;
  490. font-weight: bold;
  491. color: #333333;
  492. }
  493. .price{
  494. display: flex;
  495. align-items: flex-end;
  496. color: #018C39;
  497. .num{
  498. font-size: 30upx;
  499. font-weight: bold;
  500. line-height: 1;
  501. }
  502. .unit{
  503. font-size: 24upx;
  504. line-height: 26upx;
  505. }
  506. .gray{
  507. font-size: 24upx;
  508. color: #999999;
  509. line-height: 26upx;
  510. }
  511. }
  512. }
  513. }
  514. }
  515. .btn-foot{
  516. width: 100%;
  517. position: fixed;
  518. left: 0;
  519. bottom: 0;
  520. z-index: 99;
  521. height: 121upx;
  522. background: #FFFFFF;
  523. display: flex;
  524. align-items: center;
  525. justify-content: space-between;
  526. .menu-box{
  527. margin-left: 32rpx;
  528. display: flex;
  529. align-items: center;
  530. .item{
  531. display: flex;
  532. align-items: center;
  533. flex-direction: column;
  534. margin-right: 50upx;
  535. &:last-child{
  536. margin-right: 0;
  537. }
  538. image{
  539. width: 36upx;
  540. height: 36upx;
  541. margin-bottom: 10upx;
  542. }
  543. text{
  544. font-size: 20upx;
  545. font-family: PingFang SC;
  546. font-weight: 500;
  547. color: #666666;
  548. text-align: center;
  549. }
  550. }
  551. }
  552. .btn{
  553. margin-right: 32rpx;
  554. width: 527upx;
  555. height: 88upx;
  556. line-height: 88upx;
  557. font-size: 30upx;
  558. font-family: PingFang SC;
  559. font-weight: bold;
  560. color: #FFFFFF;
  561. background: #018C39;
  562. border-radius: 44upx;
  563. text-align: center;
  564. }
  565. }
  566. </style>