平安校园
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 
 

324 wiersze
9.5 KiB

  1. <template>
  2. <view class="warningDetail">
  3. <view class="title cli">
  4. {{detailData.alarmTypeDesc ? detailData.alarmTypeDesc + '-' + detailData.tick : ''}}
  5. </view>
  6. <image style="width: 100%;height:422rpx;" :src="detailData.snapshotUrl" mode="aspectFit"></image>
  7. <view class="cli">
  8. <view class="labelBox">
  9. 所属学校:
  10. </view>
  11. <view class="valueBox">
  12. 演示学校
  13. </view>
  14. </view>
  15. <view class="cli">
  16. <view class="labelBox">
  17. 班级:
  18. </view>
  19. <view class="valueBox">
  20. --
  21. </view>
  22. </view>
  23. <view class="cli">
  24. <view class="labelBox">
  25. 姓名:
  26. </view>
  27. <view class="valueBox">
  28. {{ detailData.personName || "--" }}
  29. </view>
  30. </view>
  31. <view class="cli">
  32. <view class="labelBox">
  33. 预警摄像头:
  34. </view>
  35. <view class="valueBox">
  36. {{ detailData.cameraName || "--" }}
  37. </view>
  38. </view>
  39. <view class="cli">
  40. <view class="labelBox">
  41. 预警类型:
  42. </view>
  43. <view class="valueBox">
  44. {{ detailData.alarmTypeDesc || "--" }}
  45. </view>
  46. </view>
  47. <view class="cli">
  48. <view class="labelBox">
  49. 预警时间:
  50. </view>
  51. <view class="valueBox">
  52. {{ detailData.tick || "--" }}
  53. </view>
  54. </view>
  55. <view class="cli">
  56. <view class="labelBox">
  57. 复核视频:
  58. </view>
  59. <view class="valueBox">
  60. <text v-if="detailData.videoUrl" style="color: #2388FF;" @click="seeVideo(detailData.videoUrl)">查看视频</text>
  61. <text v-else>--</text>
  62. </view>
  63. </view>
  64. <view class="cli2">
  65. <view class="labelBox">
  66. 备注信息:
  67. </view>
  68. <view class="valueBox">
  69. {{ detailData.extend || '--' }}
  70. </view>
  71. </view>
  72. <view class="cli2">
  73. <view class="labelBox">
  74. 处理意见:
  75. </view>
  76. <view class="valueBox">
  77. {{ detailData.remark || '--' }}
  78. </view>
  79. </view>
  80. <u-popup :show="showVideo" :closeable="true" @close="close" @open="open" mode="center">
  81. <!-- <view class="">
  82. 视频
  83. </view> -->
  84. <view class="poupBox">
  85. <view style="width: 750rpx;height: 400rpx;">
  86. <DomVideoPlayer ref="domVideoPlayer" object-fit='contain' :controls="controls" :autoplay="autoplay"
  87. :loop="loop" :src="urlsrc" :playback-rate="playbackRate" :is-loading="isLoading" @play="onPlay"
  88. @pause="onPause" @ended="onEnded" @durationchange="onDurationChange" @timeupdate="onTimeUpdate"
  89. @ratechange="onRateChange" @fullscreenchange="onFullscreenChange" />
  90. </view>
  91. </view>
  92. </u-popup>
  93. </view>
  94. </template>
  95. <script>
  96. import DomVideoPlayer from '@/components/DomVideoPlayer/DomVideoPlayer.vue'
  97. import {
  98. detail, //详情
  99. warnType, //获取预警类型
  100. } from '@/api/warn/index.js'
  101. // 将xx秒转为 xx:xx 分秒格式
  102. const formatSec2Time = (time) => {
  103. const min = Math.floor(time / 60)
  104. const sec = Math.floor(time % 60)
  105. return `${min}:${sec < 10 ? '0' + sec : sec}`
  106. }
  107. export default {
  108. components: {
  109. DomVideoPlayer
  110. },
  111. data() {
  112. return {
  113. detailData: {},
  114. showVideo: false,
  115. // 视频参数
  116. urlsrc: '',
  117. // src: 'http://deepvision.oss-cn-zhangjiakou.aliyuncs.com/acp/quanjiang/DEMO00001/20240708/video/wander/SXT001__quanjiang__DEMO00001_video_wm_1720400435638.mp4?Expires=1724745909&OSSAccessKeyId=STS.NV49VEGSbWMNi7Wp4e76VrWKk&Signature=wXTdiWQHGNp%2FtbtezUBmD%2Fziy1E%3D&security-token=CAIS0wN1q6Ft5B2yfSjIr5WBcuzxqoxD4I%2BlaxHmlDQwO7l6nZLgiTz2IHFMf3huCeodsv8%2BlGxS5%2FgelrpqVpZDR03Na8RHwrly1lv5O9KY4zIJb0D10s%2FLI3OaLjKm9hi7AYygPgK0GJqEb1TDiVUto9%2FTfimjWFqIKICAjYUdAP0cQgi%2Fa0gwZrJRPRAwh8IGEnHTOP2xUHvtmXGCNFd0nQB%2BhGhjk7TdpPeR8R3Dllb35%2FYIroDqWPieYtJrIY10XqWBvqx%2FfbGT1zVLuVoYtvV6gaFc5zbcv9abRFVf4hiCP6%2Ff6MBuNw5%2Fae94efZNp%2BOukuZj6K6B1db7xhtVI%2BBOUiPZA4mr2IzdBeqvNNcwc7m8F1no9YjXbsGs9EEGGStLaVgVI4F8dyAhWEd9FWjgR%2FX5qAyQUGCKULOY1aw6651xwmjz8MCCT1r1GOTBindGasVnMxh5Z0JMjDK9aNkKfgFUbVJ8BrGTCIh%2FYx0bsq7yowDIEyp71TRMo%2Bbu%2FDBhIifKpO4VN7AxMup1DPwu2wNCxKRpnrU0rgxd8uAx9DyyfH1x3TObqd7jjqzaKs3NYdtswV4BUlvK5CGWEjhzQEO8mJtNIDT39ax%2Bf3elrfsIeBqAAaamZEcVMZBN29tT2k9jMRQfJjNJzZRtx5Z4sYbOwDoRAq%2F4qEv07jBx5PUAAB3q9IqDapPoeUw8Yccvlo9q5VG8AsY%2BZkidTAw%2B7s7%2BTKuJC93tJfdSUYdycPZ%2BZneA%2BlZqpdvfhTtZCteGsdnoQU4H7x%2B9ph9K%2Bg3HGMQrtuFdIAA%3D',
  118. playing: false,
  119. loop: false,
  120. controls: true,
  121. autoplay: false,
  122. isLoading: true,
  123. playbackRate: 1,
  124. currentTime: 0,
  125. duration: 0,
  126. }
  127. },
  128. computed: {
  129. // 播放进度
  130. // progress() {
  131. // const percent = this.currentTime / this.duration * 100
  132. // return percent.toFixed(2) + '%'
  133. // },
  134. // // 显示当前时间
  135. // showPlayTime() {
  136. // const curr = formatSec2Time(this.currentTime)
  137. // const dur = formatSec2Time(this.duration)
  138. // return `${curr} / ${dur}`
  139. // },
  140. },
  141. onLoad(options) {
  142. console.log(options)
  143. if(options.id) {
  144. this.id = options.id;
  145. }
  146. this.getInfo();
  147. },
  148. methods: {
  149. getInfo() {
  150. detail({ id: this.id }).then(res=>{
  151. if(res.code == 200) {
  152. this.detailData = res.data;
  153. }
  154. })
  155. },
  156. seeVideo(url) {
  157. this.showVideo = true;
  158. this.urlsrc = url;
  159. },
  160. open() {
  161. // console.log('open');
  162. setTimeout(() => {
  163. this.src =
  164. 'http://deepvision.oss-cn-zhangjiakou.aliyuncs.com/acp/quanjiang/DEMO00001/20240708/video/wander/SXT001__quanjiang__DEMO00001_video_wm_1720400435638.mp4?Expires=1724748181&OSSAccessKeyId=STS.NTwCzwCtwDDYeE7RAhHue5mDb&Signature=qY%2F82lk1K9VJEX95ImeNH9wMHiw%3D&security-token=CAIS0wN1q6Ft5B2yfSjIr5fCCMDDrqtW84ayZ2OGtkE9RPpJ2qjvgDz2IHFMf3huCeodsv8%2BlGxS5%2FgelrpqVpZDR03Na8RHwrly1lv5O9KY4z1YIkL10s%2FLI3OaLjKm9hi7AYygPgK0GJqEb1TDiVUto9%2FTfimjWFqIKICAjYUdAP0cQgi%2Fa0gwZrJRPRAwh8IGEnHTOP2xUHvtmXGCNFd0nQB%2BhGhjk7TdpPeR8R3Dllb35%2FYIroDqWPieYtJrIY10XqWBvqx%2FfbGT1zVLuVoYtvV6gaFc5zbcv9abRFVf4hiCP6%2Ff6MBuNw5%2Fae94efZNp%2BOukuZj6K6B1db7xhtVI%2BBOUiPZA4mr2IzdBeqvNNcwc7m8F1no9YjXbsGs9EEGGStLaVgVI4F8dyAhWEd9FWjgR%2FX5qAyQUGCKULOY1aw6651xwmjz8MCCT1r1GOTBindGasVnMxh5Z0JMjDK9aNkKfgFUbVJ8BrGTCIh%2FYx0bsq7yowDIEyp71TRMo%2Bbu%2FDBhIifKpO4VN7AxMup1DPwu2wNCxKQmwS5Se2k%2BwM10kxsnMbhsSH5O0sXx5M%2B5TxBoZB5p9PtUj15fgYQDR12uT0nToulHQz7%2BX6zfLqvSrfsIeBqAAUdgBEBn%2BksEpfpynILn8V8z3O5GaZcm3NmplGe%2F2XtD9%2FbnSWWTEzR1JJ45DnANEEIGzfjd6UvxpIcrk5Ggr0I52UqVdGUhcovTegZXYeBMsXYze8OLsu0UOhtpHsy8nCCJzpNnrwUBZOfUdZtwsCYHC4Bs8BRQ9JORs4ECvUnyIAA%3D'
  165. }, 1000)
  166. },
  167. close() {
  168. this.showVideo = false;
  169. // console.log('close');
  170. },
  171. // 播放 - 事件
  172. onPlay() {
  173. console.log('onPlay')
  174. this.playing = true
  175. },
  176. // 暂停 - 事件
  177. onPause() {
  178. console.log('onPause')
  179. this.playing = false
  180. },
  181. // 播放完毕 - 事件
  182. onEnded() {
  183. console.log('onEnded')
  184. this.playing = false
  185. },
  186. // 总时长变化 - 事件
  187. onDurationChange(e) {
  188. console.log('onDurationChange', e)
  189. this.duration = e
  190. },
  191. // 播放时间更新 - 事件
  192. onTimeUpdate(e) {
  193. // console.log('onTimeUpdate', e)
  194. this.currentTime = e
  195. },
  196. // 倍速变化 - 事件
  197. onRateChange(e) {
  198. console.log('onRateChange', e)
  199. this.playbackRate = e
  200. },
  201. // 进入/退出全屏 - 事件
  202. onFullscreenChange(e) {
  203. console.log('onFullScreenChange', e)
  204. },
  205. // // 切换播放/暂停 - 函数
  206. // doPlaying() {
  207. // const domVideoPlayer = this.$refs.domVideoPlayer
  208. // if (domVideoPlayer.playing) {
  209. // this.doPause()
  210. // } else {
  211. // this.doPlay()
  212. // }
  213. // },
  214. // // 播放 - 函数
  215. // doPlay() {
  216. // const domVideoPlayer = this.$refs.domVideoPlayer
  217. // domVideoPlayer.play()
  218. // },
  219. // // 暂停 - 函数
  220. // doPause() {
  221. // const domVideoPlayer = this.$refs.domVideoPlayer
  222. // domVideoPlayer.pause()
  223. // },
  224. // // 快退/快进 - 函数
  225. // doSeek(time) {
  226. // const domVideoPlayer = this.$refs.domVideoPlayer
  227. // time += domVideoPlayer.currentTime
  228. // domVideoPlayer.toSeek(time)
  229. // },
  230. // // 全屏播放 - 函数
  231. // doFullScreen() {
  232. // const domVideoPlayer = this.$refs.domVideoPlayer
  233. // domVideoPlayer.fullScreen()
  234. // },
  235. // // 移除视频 - 函数
  236. // doRemove() {
  237. // this.src = ''
  238. // const domVideoPlayer = this.$refs.domVideoPlayer
  239. // domVideoPlayer.remove()
  240. // },
  241. // // 更换src - 函数
  242. // doUpdateSrc() {
  243. // this.src = 'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/create-schema2code-video.mp4'
  244. // },
  245. // doUpdateSrcToSeek() {
  246. // // 切换视频
  247. // this.src = 'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/create-schema2code-video.mp4'
  248. // setTimeout(() => {
  249. // const domVideoPlayer = this.$refs.domVideoPlayer
  250. // // 视频加载完后,延迟调用toSeek()方法,跳转到第60s位置
  251. // domVideoPlayer.toSeek(60, true)
  252. // }, 100)
  253. // },
  254. // // 切换倍速 - 函数
  255. // switchRate() {
  256. // this.playbackRate = this.playbackRate === 1 ? 2 : 1
  257. // },
  258. // // 切换视频控制栏 - 函数
  259. // switchControls() {
  260. // this.controls = !this.controls
  261. // },
  262. }
  263. }
  264. </script>
  265. <style lang="scss" scoped>
  266. .warningDetail {
  267. // height: 100%;
  268. background: #fff;
  269. .title {
  270. color: #2388FF;
  271. font-size: 30rpx;
  272. height: 88rpx;
  273. line-height: 88rpx;
  274. background: rgba(35, 136, 255, 0.06);
  275. }
  276. .cli {
  277. font-size: 30rpx;
  278. padding: 20rpx 30rpx;
  279. display: flex;
  280. justify-content: space-between;
  281. align-items: center;
  282. .labelBox {
  283. color: #333333;
  284. }
  285. .valueBox {
  286. color: #333333;
  287. font-weight: 700;
  288. }
  289. }
  290. .cli2 {
  291. font-size: 30rpx;
  292. padding: 20rpx 30rpx;
  293. .labelBox {
  294. color: #333333;
  295. }
  296. .valueBox {
  297. margin-top: 20rpx;
  298. color: #333333;
  299. font-weight: 700;
  300. min-height: 50rpx;
  301. word-break: break-all;
  302. }
  303. }
  304. .poupBox {
  305. width: 100%;
  306. padding: 80rpx 20rpx 20rpx 20rpx;
  307. box-sizing: border-box;
  308. }
  309. }
  310. </style>