hospitalDetails.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454
  1. <template>
  2. <view class="content">
  3. <view class="bg"></view>
  4. <view class="cont">
  5. <view class="hos-box">
  6. <view class="left">
  7. <image :src="hospital.imgUrl" mode="aspectFit"></image>
  8. </view>
  9. <view class="right">
  10. <view class="hos-name-box">
  11. <view class="hos-name">
  12. {{hospital.hospitalName}}
  13. </view>
  14. </view>
  15. <view class="hos-desc-box">
  16. {{hospital.hospitalType}}
  17. </view>
  18. <view class="hos-address-box" @click="goMap()">
  19. <view class="address-left">
  20. <view class="address one-t">{{hospital.address}}</view>
  21. </view>
  22. <view class="address-right">
  23. <image src="../../static/images/icon_arrow_r.png"></image>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="desc-box">
  29. <view class="title-box">
  30. <view class="line"></view>
  31. <view class="title">医院介绍</view>
  32. </view>
  33. <view class="desc" >
  34. {{hospital.descs}}
  35. </view>
  36. </view>
  37. <view class="doctor-box">
  38. <view class="title-box">
  39. <view class="line"></view>
  40. <view class="title">医院专家</view>
  41. </view>
  42. <view class="doctors" v-if="doctors.length>0">
  43. <view class="doctor" @click="navTo('/pages/doctor/doctorDetails?doctorId='+item.doctorId)" v-for="(item,index) in doctors">
  44. <view class="item">
  45. <image mode="aspectFill" class="doc-img" :src="item.avatar" ></image>
  46. <view class="right">
  47. <view class="doc-box">
  48. <view class="doc-name">
  49. {{item.doctorName}}
  50. </view>
  51. <view class="doc-position">{{item.position}}</view>
  52. </view>
  53. <view class="hospital">
  54. {{item.hospitalName}} {{item.deptName}}
  55. </view>
  56. <view class="doc-spec">
  57. <view class="title">擅长:</view>
  58. <view class="spec ellipsis">{{item.speciality}}</view>
  59. </view>
  60. <view class="doc-ping">
  61. <view class="ping">好评率:{{item.pingStar}}%</view>
  62. <view class="count">咨询量:{{item.orderNumber}}</view>
  63. </view>
  64. <view class="doc-price">
  65. <view class="left">¥
  66. <text v-for="(price,index) in item.prices">
  67. {{price.price.toFixed(2)}} <text v-if="index==0">/</text>
  68. </text>
  69. </view>
  70. <view class="btns">
  71. <view class="btn">
  72. 咨询医生
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. </template>
  84. <script>
  85. import {getHospitalById} from '@/api/hospital.js'
  86. import {getDoctorList} from '@/api/doctor.js'
  87. export default {
  88. data() {
  89. return {
  90. hospitalId:null,
  91. hospital:null,
  92. doctors:[]
  93. }
  94. },
  95. onLoad(options) {
  96. this.hospitalId=options.hospitalId;
  97. this.getHospitalById();
  98. this.getDoctorList();
  99. },
  100. methods: {
  101. goMap(){
  102. uni.openLocation({
  103. latitude: parseFloat(this.hospital.lat),
  104. longitude: parseFloat(this.hospital.lng),
  105. scale:18,
  106. name:this.hospital.hospitalName,
  107. address:this.hospital.address,
  108. success:()=> {
  109. console.log('导航success');
  110. }
  111. });
  112. },
  113. getHospitalById() {
  114. //联网加载数据
  115. var that = this;
  116. var data = {
  117. hospitalId: this.hospitalId
  118. };
  119. getHospitalById(data).then(res => {
  120. if(res.code==200){
  121. this.hospital=res.data;
  122. }else{
  123. uni.showToast({
  124. icon:'none',
  125. title: "请求失败",
  126. });
  127. }
  128. });
  129. },
  130. getDoctorList() {
  131. //联网加载数据
  132. var that = this;
  133. var data = {
  134. hospitalId: this.hospitalId,
  135. pageNum: 1,
  136. pageSize: 10
  137. };
  138. getDoctorList(data).then(res => {
  139. if(res.code==200){
  140. res.data.list.forEach(function(value,index,array){
  141. value.prices=JSON.parse(value.priceJson)
  142. });
  143. this.doctors=res.data.list;
  144. }else{
  145. uni.showToast({
  146. icon:'none',
  147. title: "请求失败",
  148. });
  149. }
  150. });
  151. },
  152. navTo(url){
  153. uni.navigateTo({
  154. url: url
  155. })
  156. }
  157. }
  158. }
  159. </script>
  160. <style scoped lang="scss">
  161. .content{
  162. height: 100%;
  163. position: relative;
  164. .bg{
  165. width: 100%;
  166. height:280rpx;
  167. background-color: #C39A58;
  168. background: linear-gradient(#C39A58, #E2C99E);
  169. border-radius: 0rpx 0rpx 100rpx 100rpx;
  170. position: fixed;
  171. // z-index: 1;
  172. }
  173. .cont{
  174. top:50rpx;
  175. position: relative;
  176. padding: 0rpx 20rpx;
  177. z-index: 999;
  178. width: 100%;
  179. display: flex;
  180. flex-direction: column;
  181. .hos-box{
  182. margin-bottom: 20rpx;
  183. padding: 30rpx;
  184. box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.05);
  185. background-color: #fff;
  186. border-radius: 15rpx;
  187. display: flex;
  188. align-items: center;
  189. justify-content: flex-start;
  190. .left{
  191. width: 190upx;
  192. height: 190upx;
  193. border-radius: 8upx;
  194. image{
  195. width: 190upx;
  196. height: 190upx;
  197. }
  198. }
  199. .right{
  200. display: flex;
  201. flex-direction: column;
  202. justify-content: space-between;
  203. margin-left: 20rpx;
  204. height:190upx;
  205. width: calc(100% - 210rpx);
  206. .hos-name-box{
  207. display: flex;
  208. align-items: center;
  209. justify-content: flex-start;
  210. .hos-name{
  211. font-size: 32rpx;
  212. font-weight: bold;
  213. }
  214. }
  215. .hos-desc-box{
  216. display: flex;
  217. align-items: center;
  218. justify-content: flex-start;
  219. font-size: 28upx;
  220. font-family: PingFang SC;
  221. color: #2d2b36;
  222. }
  223. .hos-address-box{
  224. display: flex;
  225. align-items: center;
  226. justify-content: flex-start;
  227. .address-left{
  228. width: calc(100% - 30rpx);
  229. display: flex;
  230. align-items: center;
  231. justify-content: flex-start;
  232. .address{
  233. font-size: 28upx;
  234. font-family: PingFang SC;
  235. color: #9a9a9c;
  236. }
  237. }
  238. .address-right{
  239. image{
  240. width: 30upx;
  241. height: 30upx;
  242. }
  243. }
  244. }
  245. }
  246. }
  247. .desc-box{
  248. margin-bottom: 20rpx;
  249. padding: 15rpx;
  250. box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.05);
  251. background-color: #fff;
  252. border-radius: 15rpx;
  253. .title-box{
  254. display: flex;
  255. flex-direction: row;
  256. align-items: center;
  257. justify-content: flex-start;
  258. .title{
  259. font-size: 32upx;
  260. font-family: PingFang SC;
  261. font-weight: bold;
  262. color: #111111;
  263. }
  264. .line{
  265. margin-right: 15rpx;
  266. height: 30rpx;
  267. width: 6rpx;
  268. background-color: #C39A58;
  269. }
  270. }
  271. .desc{
  272. margin-top: 15rpx;
  273. font-size: 28upx;
  274. font-family: PingFang SC;
  275. color: #111;
  276. }
  277. }
  278. .doctor-box{
  279. margin-bottom: 20rpx;
  280. padding: 15rpx;
  281. box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.05);
  282. background-color: #fff;
  283. border-radius: 15rpx;
  284. .title-box{
  285. display: flex;
  286. flex-direction: row;
  287. align-items: center;
  288. justify-content: flex-start;
  289. .title{
  290. font-size: 32upx;
  291. font-family: PingFang SC;
  292. font-weight: bold;
  293. color: #111111;
  294. }
  295. .line{
  296. margin-right: 15rpx;
  297. height: 30rpx;
  298. width: 6rpx;
  299. background-color: #C39A58;
  300. }
  301. }
  302. .doctors{
  303. margin-top: 15rpx;
  304. width: 100%;
  305. padding: 20rpx 0rpx;
  306. box-sizing: border-box;
  307. display: flex;
  308. flex-direction: column;
  309. align-items: flex-start;
  310. justify-content: flex-start;
  311. .doctor{
  312. width: 100%;
  313. margin-bottom: 15rpx;
  314. background: #f9f8fe;
  315. padding: 15rpx;
  316. display: flex;
  317. flex-direction: column;
  318. align-items: flex-start;
  319. justify-content: flex-start;
  320. &:last-child{
  321. margin-bottom: 0rpx;
  322. }
  323. .item{
  324. width: 100%;
  325. display: flex;
  326. align-items: flex-start;
  327. justify-content: flex-start;
  328. .doc-img{
  329. width:80rpx;
  330. height:80rpx;
  331. border-radius: 50%;
  332. }
  333. .right{
  334. width: calc(100% - 100rpx);
  335. margin-left: 20rpx;
  336. display: flex;
  337. flex-direction: column;
  338. align-items: flex-start;
  339. justify-content: flex-start;
  340. .doc-box{
  341. display: flex;
  342. align-items: center;
  343. justify-content: space-between;
  344. .doc-name{
  345. font-size: 28upx;
  346. font-family: PingFang SC;
  347. font-weight: bold;
  348. color: #111111;
  349. }
  350. .doc-position{
  351. margin-left: 50rpx;
  352. font-size: 26upx;
  353. font-family: PingFang SC;
  354. color: #2d2b36;
  355. }
  356. }
  357. .hospital{
  358. margin-top: 10rpx;
  359. font-size: 24upx;
  360. font-family: PingFang SC;
  361. color: #9a9a9c;
  362. }
  363. .doc-spec{
  364. width: 100%;
  365. display: flex;
  366. align-items: center;
  367. justify-content: flex-start;
  368. margin-top: 15rpx;
  369. .title{
  370. min-width: 55rpx;
  371. font-size: 24upx;
  372. font-family: PingFang SC;
  373. color: #2d2b36;
  374. }
  375. .spec{
  376. margin-left: 10rpx;
  377. font-size: 24upx;
  378. font-family: PingFang SC;
  379. color: #9a9a9c;
  380. }
  381. }
  382. .doc-ping{
  383. margin-top: 15rpx;
  384. display: flex;
  385. align-items: center;
  386. justify-content: flex-start;
  387. .ping{
  388. font-size: 24upx;
  389. font-family: PingFang SC;
  390. color: #2d2b36;
  391. }
  392. .count{
  393. margin-left: 10rpx;
  394. font-size: 24upx;
  395. font-family: PingFang SC;
  396. color: #9a9a9c;
  397. }
  398. }
  399. .doc-price{
  400. width: 100%;
  401. margin-top: 15rpx;
  402. display: flex;
  403. align-items: center;
  404. justify-content: space-between;
  405. .left{
  406. flex: 1;
  407. font-size: 32upx;
  408. font-family: PingFang SC;
  409. color: #C39A58;
  410. }
  411. .btns{
  412. margin-right: 10rpx;
  413. .btn{
  414. display: flex;
  415. align-items: center;
  416. justify-content: center;
  417. border: 2rpx solid #C39A58;
  418. padding: 15rpx 30rpx;
  419. border-radius: 30rpx;
  420. font-size: 24upx;
  421. font-family: PingFang SC;
  422. color: #C39A58;
  423. }
  424. }
  425. }
  426. }
  427. }
  428. }
  429. }
  430. }
  431. }
  432. }
  433. </style>