details.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <template>
  2. <div>
  3. <van-nav-bar title="随访记录" @click-left="$router.back()" left-arrow fixed placeholder safe-area-inset-top />
  4. <div class="message">
  5. <van-row class="topBox">
  6. <van-col span="18">
  7. <van-row class="row">
  8. <van-col span="9">姓名:{{dataList.name}}</van-col>
  9. <van-col span="6">性别:{{dataList.sex}}</van-col>
  10. <van-col span="9">年龄:{{dataList.age}}</van-col>
  11. </van-row>
  12. <van-row class="row">
  13. <van-col span="24">儿童类型:{{dataList.childTypeName}}</van-col>
  14. </van-row>
  15. <van-row class="row">
  16. <van-col span="24">教育情况:{{dataList.name}}</van-col>
  17. </van-row>
  18. <van-row class="row">
  19. <van-col span="24">健康情况:{{dataList.healthStatus}}</van-col>
  20. </van-row>
  21. </van-col>
  22. <van-col span="6">
  23. <img class="tx" :src="dataList.url?dataList.url:require('../../assets/tx.png')" alt="">
  24. </van-col>
  25. <van-row class="row">
  26. <van-col span="10">监护人:{{dataList.guardianName}}</van-col>
  27. <van-col span="14">联系方式:{{dataList.guardianPhone}}</van-col>
  28. </van-row>
  29. <van-row class="row">
  30. <van-col span="24">居住地址:{{dataList.address}}</van-col>
  31. </van-row>
  32. </van-row>
  33. </div>
  34. <div class="main">
  35. <div>
  36. <p>随访详情:</p>
  37. <div class="box">
  38. {{dataList.remark}}
  39. </div>
  40. </div>
  41. <div>
  42. <p>照片:</p>
  43. <div class="boximg">
  44. <div v-for="(item,index) in picsArr" :key="index">
  45. <van-image lazy-load fit="contain" :src="item" alt="" @click="showPopup,startPosition=index" />
  46. </div>
  47. </div>
  48. <van-image-preview closeable :startPosition="startPosition" v-model="show" :images="pics"></van-image-preview>
  49. </div>
  50. <div>
  51. <p>视频:</p>
  52. <div class="boximg">
  53. <div v-for="(item,index) in videos" :key="index">
  54. <video @click="showvideoplay=true,videourl=item" style="object-fit:cover;" :src="item" poster='../../assets/video.png'></video>
  55. </div>
  56. </div>
  57. </div>
  58. </div>
  59. <van-dialog style="width:100%;border-radius:0;height:200px" v-model="showvideoplay" :show-cancel-button="false" :show-confirm-button="false" closeOnClickOverlay>
  60. <video controls preload="auto" style="width:100%;height:200px;object-fit: contain;" :src="videourl" v-if="videourl"></video>
  61. </van-dialog>
  62. </div>
  63. </template>
  64. <script>
  65. import { followUpHistoryDetail } from '../../api/index.js'
  66. export default {
  67. data() {
  68. return {
  69. show: false,
  70. fileList: [],
  71. showvideoplay: false,
  72. startPosition: 0,
  73. index: 0,
  74. videourl: '',
  75. images: [],
  76. dataList: '',
  77. appendFile: '',
  78. pics: [],
  79. picsArr: [],
  80. videos: [],
  81. }
  82. },
  83. created() {
  84. this.id = this.$route.query.id
  85. this.followUpHistoryDetail()
  86. },
  87. methods: {
  88. async followUpHistoryDetail() {
  89. const res = await followUpHistoryDetail({ id: this.id })
  90. this.dataList = res.data
  91. this.pics = res.data.pics.split(',')
  92. this.pics.forEach((item) => {
  93. console.log(item)
  94. if (item.indexOf('.jpg') || item.indexOf('.png')) {
  95. this.picsArr.push(item.replace('/cgpimage/', '/cgpimage/240x240/'))
  96. }
  97. })
  98. if (!res.data.videos) return
  99. this.videos = res.data.videos.split(',')
  100. },
  101. showPopup() {
  102. this.show = true
  103. },
  104. onChange(index) {
  105. this.index = index
  106. },
  107. },
  108. }
  109. </script>
  110. <style lang="scss" scoped>
  111. .tx {
  112. width: 160px;
  113. height: 160px;
  114. }
  115. .message {
  116. padding: 0 30px;
  117. }
  118. .topBox {
  119. padding: 24px 0;
  120. border-bottom: 1px solid #eee;
  121. }
  122. .van-row {
  123. font-size: 30px;
  124. text-align: left;
  125. }
  126. .row {
  127. .van-col {
  128. line-height: 60px;
  129. }
  130. }
  131. .main {
  132. padding: 0 30px;
  133. font-size: 30px;
  134. text-align: left;
  135. .box {
  136. min-height: 200px;
  137. border: 1px solid #eee;
  138. padding: 20px;
  139. font-size: 26px;
  140. color: #999;
  141. }
  142. .boximg {
  143. min-height: 100px;
  144. border: 1px solid #eee;
  145. padding: 20px 0;
  146. font-size: 26px;
  147. color: #999;
  148. display: flex;
  149. flex-wrap: wrap;
  150. // justify-content: space-between;
  151. ::v-deep .van-image {
  152. max-width: 200px;
  153. // max-height: 200px;
  154. margin: 0 10px;
  155. // margin-right: 16px;
  156. margin-bottom: 16px;
  157. img {
  158. max-width: 200px;
  159. max-height: 200px;
  160. margin: 0 10px;
  161. // margin-right: 16px;
  162. margin-bottom: 16px;
  163. }
  164. }
  165. video {
  166. width: 180px;
  167. height: 180px;
  168. margin: 0 10px;
  169. // margin-right: 16px;
  170. margin-bottom: 16px;
  171. }
  172. }
  173. }
  174. ::v-deep .van-overlay {
  175. background-color: rgba(0, 0, 0, 0.75);
  176. }
  177. </style>