index.vue 8.5 KB

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