index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490
  1. <template>
  2. <view>
  3. <view class="top-fixed">
  4. <!-- 这里是状态栏 -->
  5. <view class="status_bar" :style="{height: statusBarHeight}"></view>
  6. <view class="top-title">在线问诊</view>
  7. <!-- 搜索框 -->
  8. <view class="search-cont">
  9. <view class="inner">
  10. <image class="icon-search" src="../../static/images/search.png" mode=""></image>
  11. <input type="text" :value="searchValue" placeholder="输入关键字" placeholder-style="font-size:28rpx;color:#BBBBBB;font-family: PingFang SC;" />
  12. </view>
  13. </view>
  14. </view>
  15. <!-- 快速问诊、找医生 -->
  16. <view class="online-inquiry" :style="{marginTop:top}">
  17. <view class="item" @click="navTo('./postConsult')">
  18. <image class="bg-img" src="../../static/images/online_treat.png" mode=""></image>
  19. <view class="inner">
  20. <text class="title">快速问诊</text>
  21. <text class="sub-title">智能科室 快速匹配</text>
  22. <image src="../../static/images/fast_ask.png" mode=""></image>
  23. </view>
  24. </view>
  25. <view class="item" @click="navTo('./doctorList')">
  26. <image class="bg-img" src="../../static/images/chu_query.png" mode=""></image>
  27. <view class="inner">
  28. <text class="title">找医生</text>
  29. <text class="sub-title">全国60万医生任你选</text>
  30. <image src="../../static/images/doctor_blue.png" mode=""></image>
  31. </view>
  32. </view>
  33. </view>
  34. <!-- 专家问诊 -->
  35. <view class="index-cont" >
  36. <view class="pub-item">
  37. <view class="pub-title-box">
  38. <text class="left">专家问诊</text>
  39. </view>
  40. <view class="inner">
  41. <!-- tab切换 -->
  42. <view class="pub-tab-box">
  43. <view class="tab-inner">
  44. <view
  45. v-for="(item,index) in orderTypes"
  46. :key="index"
  47. :class="item.id == param.orderType?'item cases active':'item cases'"
  48. @click="orderTypeChange(item)"
  49. >
  50. <view class="text">
  51. {{ item.name }}
  52. <image v-show="item.id == param.orderType" class="tab-bg" src="../../static/images/tab_bg.png" mode=""></image>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. <!-- 案例列表 -->
  58. <view class="cases-list">
  59. <view class="item" v-for="(item,index) in list" :key="index">
  60. <!-- 文字 -->
  61. <view class="dec-text ellipsis2">{{item.title}}</view>
  62. <!-- 有图 -->
  63. <view class="images-box" v-if="item.imgs!=null" >
  64. <view class="img-item" v-for="(subitem,j) in utils.photosToArr(item.imgs)" @click="showImg(item.imgs)" :key="j">
  65. <image :src="subitem" mode="aspectFill" ></image>
  66. </view>
  67. </view>
  68. <!-- 医生信息 -->
  69. <view class="doc-info">
  70. <view class="head">
  71. <image :src="item.doctorHeadImg" mode="aspectFill"></image>
  72. </view>
  73. <view class="name">{{item.doctorName}}</view>
  74. <view class="line"></view>
  75. <view class="posit">
  76. {{utils.getDictLabelName("doctorPosition",item.doctorPosition)}}
  77. </view>
  78. <view class="line"></view>
  79. <view class="address">{{item.hospitalName}}</view>
  80. </view>
  81. <view class="answer-box">
  82. <!-- 文字回答 -->
  83. <text class="text-inner" v-if="item.orderType == '1' ">{{item.replyContent}}</text>
  84. <!-- 语音回答 -->
  85. <view class="voice-inner" v-if="item.orderType == '2'">
  86. <free-audio
  87. startPic='/static/images/play.png'
  88. endPic='/static/images/pause.png'
  89. activeColor="#018C39"
  90. :audioId="'audio'+index"
  91. :url='item.replyAudioUrl'
  92. ></free-audio>
  93. </view>
  94. </view>
  95. <view class="read-box">
  96. <image src="../../static/images/eye.png" mode=""></image>
  97. <text class="text">{{item.views}}人看过</text>
  98. </view>
  99. </view>
  100. </view>
  101. <Loading :loaded="loaded" :loading="loading"></Loading>
  102. </view>
  103. </view>
  104. </view>
  105. </view>
  106. </template>
  107. <script>
  108. import {getDepartmentList,getDoctorCase} from '@/api/doctorOrder.js'
  109. import Loading from "@/components/Loading";
  110. import tabBg from "@/static/images/tab_bg.png"
  111. import freeAudio from '@/components/chengpeng-audio/free-audio.vue'
  112. export default {
  113. components: {freeAudio,Loading},
  114. data() {
  115. return {
  116. doctorOrderList:[],
  117. orderTypes: [{name:'全部',id:0,},{name:'图文',id:1,},{name:'语音',id:2,}],
  118. top:'0px',
  119. // 状态栏的高度
  120. statusBarHeight: uni.getStorageSync('menuInfo').statusBarHeight,
  121. searchValue: '',
  122. tabBg: tabBg, // tab切换背景
  123. current: 0,
  124. param: {
  125. orderType:0,
  126. page: 1,
  127. pageSize: 10
  128. },
  129. list: [],
  130. loaded: false,
  131. loading: false
  132. };
  133. },
  134. onShow() {
  135. var that=this;
  136. let info = uni.createSelectorQuery().select(".top-fixed");
  137.     info.boundingClientRect(function(data) { //data - 各种参数
  138. console.log(data.height)
  139. that.top=data.height+"px";
  140.    }).exec()
  141. this.getDoctorCase()
  142. },
  143. methods:{
  144. showImg(urls) {
  145. var imgArr =urls.split(',');
  146. //预览图片
  147. uni.previewImage({
  148. urls: imgArr,
  149. current: imgArr[0]
  150. });
  151. },
  152. getDoctorCase(){
  153. let that = this;
  154. if (that.loaded == true || that.loading == true) return;
  155. that.loading = true;
  156. uni.showLoading({
  157. title:"加载中..."
  158. })
  159. getDoctorCase(this.param).then(
  160. res => {
  161. that.loading = false;
  162. that.loaded = res.data.list.length < that.param.pageSize;
  163. that.param.page = that.param.page + 1;
  164. that.list.push.apply(that.list, res.data.list);
  165. uni.hideLoading()
  166. },
  167. err => {
  168. uni.hideLoading()
  169. uni.showToast({
  170. title: err.msg ,
  171. icon: 'none',
  172. duration: 2000
  173. });
  174. }
  175. );
  176. },
  177. orderTypeChange(item) {
  178. this.param.orderType = item.id;
  179. this.param.page=1;
  180. this.list=[];
  181. this.loaded=false;
  182. this.loading=false;
  183. this.getDoctorCase();
  184. },
  185. // 访问新页面
  186. navTo(url){
  187. uni.navigateTo({
  188. url: url
  189. })
  190. },
  191. }
  192. }
  193. </script>
  194. <style lang="scss">
  195. .top-fixed{
  196. background: #fff;
  197. width: 100%;
  198. position: fixed;
  199. top: 0;
  200. left: 0;
  201. z-index: 10;
  202. }
  203. .top-title{
  204. height: 88upx;
  205. line-height: 88upx;
  206. font-size: 42upx;
  207. font-family: Source Han Sans CN;
  208. font-weight: bold;
  209. color: #222222;
  210. padding-left: 41upx;
  211. background-color: #FFFFFF;
  212. }
  213. .search-cont{
  214. padding: 16upx 30upx;
  215. background-color: #FFFFFF;
  216. .inner{
  217. box-sizing: border-box;
  218. width: 100%;
  219. height: 72upx;
  220. background: #F7F7F7;
  221. border-radius: 36upx;
  222. display: flex;
  223. align-items: center;
  224. padding: 0 30upx;
  225. .icon-search{
  226. width: 28upx;
  227. height: 28upx;
  228. margin-right: 20upx;
  229. }
  230. input{
  231. height: 60upx;
  232. line-height: 60upx;
  233. flex: 1;
  234. }
  235. }
  236. }
  237. .online-inquiry{
  238. box-sizing: border-box;
  239. width: 100%;
  240. padding: 20upx;
  241. background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 59%, rgba(255, 255, 255, 0) 100%);
  242. display: flex;
  243. justify-content: space-between;
  244. .item{
  245. width: 346upx;
  246. height: 150upx;
  247. position: relative;
  248. .bg-img,
  249. .inner{
  250. width: 100%;
  251. height: 100%;
  252. position: absolute;
  253. top: 0;
  254. left: 0;
  255. z-index: 1;
  256. }
  257. .inner{
  258. box-sizing: border-box;
  259. z-index: 2;
  260. display: flex;
  261. flex-direction: column;
  262. justify-content: center;
  263. padding-left: 32upx;
  264. .title{
  265. font-size: 30upx;
  266. line-height: 1;
  267. font-family: PingFang SC;
  268. font-weight: bold;
  269. color: #111111;
  270. margin-bottom: 20upx;
  271. }
  272. .sub-title{
  273. font-size: 24upx;
  274. font-family: PingFang SC;
  275. font-weight: 500;
  276. color: #666666;
  277. }
  278. image{
  279. width: 80upx;
  280. height: 90upx;
  281. position: absolute;
  282. right: 7upx;
  283. bottom: 7upx;
  284. }
  285. }
  286. }
  287. }
  288. .index-cont{
  289. box-sizing: border-box;
  290. padding: 0 20upx;
  291. .pub-item{
  292. background: #FFFFFF;
  293. border-radius: 16upx;
  294. margin-bottom: 20upx;
  295. .pub-title-box{
  296. box-sizing: border-box;
  297. padding: 36upx 30upx;
  298. display: flex;
  299. align-items: center;
  300. justify-content: space-between;
  301. .left{
  302. font-size: 36upx;
  303. line-height: 1;
  304. font-family: PingFang SC;
  305. font-weight: bold;
  306. color: #111111;
  307. }
  308. .right{
  309. display: flex;
  310. align-items: center;
  311. justify-content: center;
  312. .text{
  313. font-size: 26upx;
  314. line-height: 1;
  315. font-family: PingFang SC;
  316. font-weight: 500;
  317. color: #999999;
  318. margin-right: 10upx;
  319. }
  320. image{
  321. width: 14upx;
  322. height: 24upx;
  323. margin-top: 5upx;
  324. }
  325. }
  326. }
  327. .inner{
  328. padding: 0 30upx;
  329. }
  330. // 健康知识
  331. .pub-tab-box{
  332. position: relative;
  333. .tab-inner{
  334. padding: 14upx 0 30upx;
  335. display: flex;
  336. overflow-x: auto;
  337. }
  338. .item{
  339. font-size: 28upx;
  340. white-space: nowrap;
  341. line-height: 1;
  342. font-family: PingFang SC;
  343. font-weight: 500;
  344. color: #666666;
  345. margin-right: 40upx;
  346. position: relative;
  347. &:last-child{
  348. margin-right: 0;
  349. }
  350. &.active{
  351. font-weight: bold;
  352. color: #333333;
  353. }
  354. &.cases{
  355. margin-right: 60upx;
  356. }
  357. .text{
  358. position: relative;
  359. z-index: 1;
  360. }
  361. .tab-bg{
  362. width: 72upx;
  363. height: 28upx;
  364. position: absolute;
  365. top: 17upx;
  366. left: 50%;
  367. transform: translateX(-36upx);
  368. z-index: -1;
  369. }
  370. }
  371. }
  372. // 问诊案例
  373. .cases-list{
  374. padding-bottom: 10upx;
  375. .item{
  376. padding: 30upx 0;
  377. border-bottom: 1px solid #F0F0F0;
  378. &:last-child{
  379. border-bottom: none;
  380. }
  381. .dec-text{
  382. font-size: 32upx;
  383. font-family: PingFang SC;
  384. font-weight: bold;
  385. color: #111111;
  386. line-height: 48upx;
  387. }
  388. .images-box{
  389. margin-top: 10upx;
  390. display: flex;
  391. flex-wrap: wrap;
  392. .img-item{
  393. width: 155upx;
  394. height: 155upx;
  395. background: #F5F5F5;
  396. border-radius: 8upx;
  397. margin: 0 10upx 10upx 0;
  398. overflow: hidden;
  399. image{
  400. width: 100%;
  401. height: 100%;
  402. }
  403. &:nth-child(4n){
  404. margin-right: 0;
  405. }
  406. }
  407. }
  408. .doc-info{
  409. display: flex;
  410. align-items: center;
  411. margin: 30upx 0 20upx;
  412. .head{
  413. width: 60upx;
  414. height: 60upx;
  415. background: #F2F5F9;
  416. border-radius: 50%;
  417. margin-right: 20upx;
  418. overflow: hidden;
  419. image{
  420. width: 100%;
  421. height: 100%;
  422. }
  423. }
  424. .name{
  425. font-size: 28upx;
  426. line-height: 1;
  427. font-family: PingFang SC;
  428. font-weight: 500;
  429. color: #111111;
  430. }
  431. .line{
  432. width: 1px;
  433. height: 22upx;
  434. background: #DDDDDD;
  435. margin: 0 16upx;
  436. }
  437. .posit,
  438. .address{
  439. font-size: 26upx;
  440. font-family: PingFang SC;
  441. font-weight: 500;
  442. color: #999999;
  443. }
  444. }
  445. .answer-box{
  446. width: 100%;
  447. // height: 117upx;
  448. background: #F5F7F7;
  449. border-radius: 10upx;
  450. display: flex;
  451. flex-direction: column;
  452. justify-content: center;
  453. .text-inner{
  454. // height: 84upx;
  455. font-size: 28upx;
  456. font-family: PingFang SC;
  457. font-weight: 500;
  458. color: #666666;
  459. line-height: 42upx;
  460. padding: 15upx;
  461. }
  462. }
  463. .read-box{
  464. margin-top: 30upx;
  465. display: flex;
  466. align-items: center;
  467. justify-content: flex-end;
  468. image{
  469. width: 24upx;
  470. height: 19upx;
  471. margin-right: 10upx;
  472. }
  473. .text{
  474. font-size: 24upx;
  475. font-family: PingFang SC;
  476. font-weight: 500;
  477. color: #999999;
  478. }
  479. }
  480. }
  481. }
  482. }
  483. }
  484. </style>