doctorCase.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  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="mescroll" top="190rpx" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">
  30. <view class="cases-list">
  31. <view class="item" v-for="(item,index) in dataList" :key="index">
  32. <!-- 文字 -->
  33. <view class="dec-text ellipsis2">{{item.title}}</view>
  34. <!-- 有图 -->
  35. <view class="images-box" v-if="item.imgs!=null" >
  36. <view class="img-item" v-for="(subitem,j) in utils.photosToArr(item.imgs)" @click="showImg(item.imgs)" :key="j">
  37. <image :src="subitem" mode="aspectFill" ></image>
  38. </view>
  39. </view>
  40. <!-- 医生信息 -->
  41. <view class="doc-info">
  42. <view class="head">
  43. <image :src="item.doctorHeadImg" mode="aspectFill"></image>
  44. </view>
  45. <view class="name">{{item.doctorName}}</view>
  46. <view class="line"></view>
  47. <view class="posit">
  48. {{utils.getDictLabelName("doctorPosition",item.doctorPosition)}}
  49. </view>
  50. <view class="line"></view>
  51. <view class="address">{{item.hospitalName}}</view>
  52. </view>
  53. <view class="answer-box">
  54. <!-- 文字回答 -->
  55. <text class="text-inner" v-if="item.orderType == '1' ">{{item.replyContent}}</text>
  56. <!-- 语音回答 -->
  57. <view class="voice-inner" v-if="item.orderType == '2'">
  58. <free-audio
  59. startPic='/static/images/play.png'
  60. endPic='/static/images/pause.png'
  61. activeColor="#018C39"
  62. :audioId="'audio'+index"
  63. :url='item.replyAudioUrl'
  64. ></free-audio>
  65. </view>
  66. </view>
  67. <view class="read-box">
  68. <image src="@/static/images/eye.png" mode=""></image>
  69. <text class="text">{{item.views}}人看过</text>
  70. </view>
  71. </view>
  72. </view>
  73. </mescroll-body>
  74. </view>
  75. </template>
  76. <script>
  77. import {getDepartmentList,getDoctorCase} from '@/api/doctorOrder.js'
  78. import freeAudio from '@/components/chengpeng-audio/free-audio.vue'
  79. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  80. export default {
  81. components: { freeAudio},
  82. mixins: [MescrollMixin],
  83. data() {
  84. return {
  85. depts:[],
  86. deptId:0,
  87. searchVal:"",
  88. // tab切换
  89. casesCateChose: 1,
  90. // 上拉加载的配置
  91. mescroll:null,
  92. // 上拉加载的配置
  93. upOption: {
  94. onScroll:true,
  95. use: true, // 是否启用上拉加载; 默认true
  96. page: {
  97. num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
  98. size: 10 // 每页数据的数量,默认10
  99. },
  100. noMoreSize: 10, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
  101. empty: {
  102. icon:'/static/images/no_data.png',
  103. tip: '暂无数据'
  104. }
  105. },
  106. // 列表数据
  107. dataList: []
  108. };
  109. },
  110. onLoad() {
  111. this.getDepartmentList()
  112. },
  113. methods: {
  114. changeDept(item) {
  115. this.deptId = item.departmentId;
  116. this.mescroll.resetUpScroll()
  117. },
  118. getDepartmentList(){
  119. getDepartmentList().then(res => {
  120. if(res.code==200){
  121. var allDept={departmentId:0,departmentName:"全部"}
  122. this.depts.push(allDept);
  123. this.depts=this.depts.concat(res.data);
  124. console.log(this.depts)
  125. }else{
  126. uni.showToast({
  127. icon:'none',
  128. title: "请求失败",
  129. });
  130. }
  131. });
  132. },
  133. goSearch(){
  134. this.mescroll.resetUpScroll()
  135. },
  136. showImg(urls) {
  137. var imgArr =urls.split(',');
  138. //预览图片
  139. uni.previewImage({
  140. urls: imgArr,
  141. current: imgArr[0]
  142. });
  143. },
  144. mescrollInit(mescroll) {
  145. this.mescroll = mescroll;
  146. },
  147. /*下拉刷新的回调 */
  148. downCallback(mescroll) {
  149. mescroll.resetUpScroll()
  150. },
  151. upCallback(page) {
  152. //联网加载数据
  153. var that = this;
  154. var data = {
  155. departmentId:this.deptId,
  156. title:this.searchVal,
  157. page: page.num,
  158. pageSize: page.size
  159. };
  160. getDoctorCase(data).then(res => {
  161. if(res.code==200){
  162. //设置列表数据
  163. if (page.num == 1) {
  164. that.dataList = res.data.list;
  165. } else {
  166. that.dataList = that.dataList.concat(res.data.list);
  167. }
  168. that.mescroll.endBySize(res.data.list.length, res.data.total);
  169. }else{
  170. uni.showToast({
  171. icon:'none',
  172. title: "请求失败",
  173. });
  174. that.dataList = null;
  175. that.mescroll.endErr();
  176. }
  177. });
  178. },
  179. }
  180. }
  181. </script>
  182. <style lang="scss">
  183. .search-cont{
  184. padding: 16upx 30upx;
  185. background-color: #FFFFFF;
  186. .inner{
  187. box-sizing: border-box;
  188. width: 100%;
  189. height: 72upx;
  190. background: #F7F7F7;
  191. border-radius: 36upx;
  192. display: flex;
  193. align-items: center;
  194. padding: 0 30upx;
  195. .icon-search{
  196. width: 28upx;
  197. height: 28upx;
  198. margin-right: 20upx;
  199. }
  200. input{
  201. height: 60upx;
  202. line-height: 60upx;
  203. flex: 1;
  204. }
  205. }
  206. }
  207. .pub-tab-box{
  208. padding: 0 33upx;
  209. background-color: #FFFFFF;
  210. .tab-inner{
  211. height: 88upx;
  212. line-height: 88upx;
  213. display: flex;
  214. overflow-x: auto;
  215. }
  216. .item{
  217. font-size: 28upx;
  218. white-space: nowrap;
  219. line-height: 1;
  220. font-family: PingFang SC;
  221. font-weight: 500;
  222. color: #666666;
  223. margin-right: 60upx;
  224. display: flex;
  225. align-items: center;
  226. justify-content: center;
  227. &:last-child{
  228. margin-right: 0;
  229. }
  230. &.active{
  231. font-weight: bold;
  232. color: #333333;
  233. }
  234. .text{
  235. position: relative;
  236. z-index: 1;
  237. }
  238. .tab-bg{
  239. width: 72upx;
  240. height: 28upx;
  241. position: absolute;
  242. top: 17upx;
  243. left: 50%;
  244. transform: translateX(-36upx);
  245. z-index: -1;
  246. }
  247. }
  248. }
  249. .top-fixed{
  250. width: 100%;
  251. position: fixed;
  252. top: 0;
  253. left: 0;
  254. z-index: 10;
  255. }
  256. .top-seat{
  257. width: 100%;
  258. height: 212upx;
  259. }
  260. // 问诊案例
  261. .cases-list{
  262. padding: 20upx;
  263. .item{
  264. padding: 30upx;
  265. background: #FFFFFF;
  266. border-radius: 16upx;
  267. margin-bottom: 20upx;
  268. .dec-text{
  269. font-size: 32upx;
  270. font-family: PingFang SC;
  271. font-weight: bold;
  272. color: #111111;
  273. line-height: 48upx;
  274. }
  275. .images-box{
  276. margin-top: 10upx;
  277. display: flex;
  278. flex-wrap: wrap;
  279. .img-item{
  280. width: 155upx;
  281. height: 155upx;
  282. background: #F5F5F5;
  283. border-radius: 8upx;
  284. margin: 0 10upx 10upx 0;
  285. overflow: hidden;
  286. image{
  287. width: 100%;
  288. height: 100%;
  289. }
  290. &:nth-child(4n){
  291. margin-right: 0;
  292. }
  293. }
  294. }
  295. .doc-info{
  296. display: flex;
  297. align-items: center;
  298. margin: 30upx 0 20upx;
  299. .head{
  300. width: 60upx;
  301. height: 60upx;
  302. background: #F2F5F9;
  303. border-radius: 50%;
  304. margin-right: 20upx;
  305. overflow: hidden;
  306. image{
  307. width: 100%;
  308. height: 100%;
  309. }
  310. }
  311. .name{
  312. font-size: 28upx;
  313. line-height: 1;
  314. font-family: PingFang SC;
  315. font-weight: 500;
  316. color: #111111;
  317. }
  318. .line{
  319. width: 1px;
  320. height: 22upx;
  321. background: #DDDDDD;
  322. margin: 0 16upx;
  323. }
  324. .posit,
  325. .address{
  326. font-size: 26upx;
  327. font-family: PingFang SC;
  328. font-weight: 500;
  329. color: #999999;
  330. }
  331. }
  332. .answer-box{
  333. width: 100%;
  334. // height: 117upx;
  335. background: #F5F7F7;
  336. border-radius: 10upx;
  337. display: flex;
  338. flex-direction: column;
  339. justify-content: center;
  340. .text-inner{
  341. // height: 84upx;
  342. font-size: 28upx;
  343. font-family: PingFang SC;
  344. font-weight: 500;
  345. color: #666666;
  346. line-height: 42upx;
  347. padding: 15upx;
  348. }
  349. }
  350. .read-box{
  351. margin-top: 30upx;
  352. display: flex;
  353. align-items: center;
  354. justify-content: flex-end;
  355. image{
  356. width: 24upx;
  357. height: 19upx;
  358. margin-right: 10upx;
  359. }
  360. .text{
  361. font-size: 24upx;
  362. font-family: PingFang SC;
  363. font-weight: 500;
  364. color: #999999;
  365. }
  366. }
  367. }
  368. }
  369. </style>