平安校园
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 
 
 

342 righe
10 KiB

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