detail.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383
  1. <template>
  2. <view class="driver_class">
  3. <view style="width: 100%;">
  4. <video style="width: 100%;" :src="videoUrl"></video>
  5. </view>
  6. <view class="image" v-if="images.length">
  7. <view v-for="(item, index) in images" :key="item">
  8. <image style="width: 220rpx;" @click="previewImage(item, index)" :src="item" mode="widthFix"></image>
  9. </view>
  10. </view>
  11. <view class="alarm-type">
  12. <view class="alarm-type-title">
  13. 报警类型
  14. </view>
  15. <view class="alarm-type-item">
  16. <view class="label">
  17. 类型:
  18. </view>
  19. <view class="" style="color: #FF3140;">
  20. {{ info.alarmType }}
  21. </view>
  22. </view>
  23. <view class="alarm-type-item">
  24. <view class="label">
  25. 等级:
  26. </view>
  27. <view style="color: #F7B500;">
  28. {{ info.level }}
  29. </view>
  30. </view>
  31. </view>
  32. <view class="alarm-detail">
  33. <view class="alarm-detail-title">
  34. 详细信息
  35. </view>
  36. <view class="alarm-detail-name">
  37. <view class="alarm-detail-image">
  38. <image :src="$getImages('/assetsMobile/images/alarm/touxiang.png')" style="width: 120rpx;height: 120rpx;"
  39. mode=""></image>
  40. </view>
  41. <view class="image-right">
  42. <view class="alarm-detail-form">
  43. <view class="label">
  44. 车牌号:
  45. </view>
  46. <view class="val">
  47. {{ info.plate }}
  48. </view>
  49. </view>
  50. <view class="alarm-detail-form">
  51. <view class="label">
  52. 驾驶员名称:
  53. </view>
  54. <view class="val">
  55. {{ info.driverName || '暂无信息' }}
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. <view class="alarm-detail-form top">
  61. <view class="label">
  62. 司机电话:
  63. </view>
  64. <view class="val">
  65. {{ info.driverPhone }}
  66. </view>
  67. </view>
  68. <view class="alarm-detail-form top">
  69. <view class="label">
  70. 企业名称:
  71. </view>
  72. <view class="val">
  73. {{ info.deptName }}
  74. </view>
  75. </view>
  76. <!-- <view class="alarm-detail-form top">
  77. <view class="label">
  78. 通信号码:
  79. </view>
  80. <view class="val">
  81. {{ info.phone }}
  82. </view>
  83. </view> -->
  84. <view class="alarm-detail-form top">
  85. <view class="label">
  86. 报警类型:
  87. </view>
  88. <view class="val">
  89. {{ info.alarmType }}
  90. </view>
  91. </view>
  92. <view class="alarm-detail-form top">
  93. <view class="label">
  94. 报警时间:
  95. </view>
  96. <view class="val">
  97. {{ info.alarmTime }}
  98. </view>
  99. </view>
  100. <view class="alarm-detail-form top">
  101. <view class="label">
  102. 车速:
  103. </view>
  104. <view class="val">
  105. {{ info.speed }}km/h
  106. </view>
  107. </view>
  108. <view class="alarm-detail-form top">
  109. <view class="label">
  110. 经度:
  111. </view>
  112. <view class="val">
  113. {{ info.lng }}
  114. </view>
  115. </view>
  116. <view class="alarm-detail-form top">
  117. <view class="label">
  118. 纬度:
  119. </view>
  120. <view class="val">
  121. {{ info.lat }}
  122. </view>
  123. </view>
  124. <!-- <view class="alarm-detail-form top">
  125. <view class="label">
  126. 车辆状态:
  127. </view>
  128. <view class="val">
  129. {{info.phone}}
  130. </view>
  131. </view> -->
  132. <view class="alarm-detail-form top">
  133. <view class="label" style="width: 170rpx;">
  134. 报警地址:
  135. </view>
  136. <view class="val" style="color: #4573FC;text-decoration:underline;width: calc(100% - 170rpx);"
  137. @click="goHistory(info)">
  138. {{ info.address }}>>
  139. </view>
  140. </view>
  141. </view>
  142. <view style="height: 28rpx;">
  143. </view>
  144. <!-- <view class="exports" @click="exportZip">
  145. <image src="../../static/vehicle/icon_evidence_derive_24.png" style="width: 48rpx;height: 48rpx;margin-right: 16rpx;" mode=""></image>
  146. 证据导出
  147. </view> -->
  148. </view>
  149. </template>
  150. <script>
  151. import { selectByFileuuid, getAlarmDriverDetailByFileuuid, exportAlarm } from "@/api/alarm/driverBehavior.js"
  152. import { getToken } from '@/utils/auth'
  153. export default {
  154. components: {},
  155. props: {},
  156. data() {
  157. return {
  158. images: [], // 图片数组
  159. vehSpeed: 0,
  160. fid: '',
  161. page: '',
  162. videoUrl: '',
  163. info: {},
  164. };
  165. },
  166. onLoad(option) {
  167. this.fid = this.$route.query.fid;
  168. this.page = this.$route.query.type;
  169. },
  170. created() { },
  171. mounted() {
  172. this.$nextTick(() => {
  173. this.queryVideoImages();
  174. this.queryBasicInfo();
  175. });
  176. },
  177. watch: {},
  178. computed: {},
  179. methods: {
  180. previewImage(item, index) {
  181. uni.previewImage({
  182. current: item,
  183. urls: this.images,
  184. indicator: index
  185. })
  186. },
  187. async queryVideoImages() {
  188. // 查询视频和图片
  189. let videoList;
  190. this.images = [];
  191. let res = await selectByFileuuid(this.fid);
  192. if (res.code == "0") {
  193. for (let i = 0; i < res.data.length; i++) {
  194. if (res.data[i].fileType == "02") {
  195. videoList = res.data[i].fileName.replace(".h264", ".mp4");
  196. this.videoUrl = this.$getImages("/img/alarmvideo/" + videoList)
  197. console.log(this.url)
  198. }
  199. if (res.data[i].fileType == "00") {
  200. this.images.push(
  201. this.$getImages("/img/alarmvideo/" + res.data[i].fileName)
  202. );
  203. }
  204. }
  205. }
  206. },
  207. checkData(data) {
  208. // 检测数据
  209. return data == null || data == undefined ? "" : data;
  210. },
  211. async queryBasicInfo() {
  212. // 查询视频和图片
  213. let videoList;
  214. this.images = [];
  215. let res = await getAlarmDriverDetailByFileuuid(this.fid);
  216. if (res.code == "0") {
  217. this.info = {
  218. ...res.data,
  219. deptName: this.checkData(res.data.deptName),
  220. driverName: this.checkData(res.data.driverName),
  221. driverPhone: this.checkData(res.data.driverPhone),
  222. plate: this.checkData(res.data.plate),
  223. alarmType: this.checkData(res.data.alarmType),
  224. alarmTime: this.checkData(res.data.startTime),
  225. speed: this.checkData(res.data.speed),
  226. lng: this.checkData(res.data.lng),
  227. lat: this.checkData(res.data.lat),
  228. level: this.checkData(res.data.alarmGrade),
  229. vehicleId: this.checkData(res.data.vehicleId),
  230. address: this.checkData(res.data.location),
  231. }
  232. }
  233. },
  234. // 跳到历史轨迹
  235. goHistory(item) {
  236. let params = {
  237. tabStyleType: 'vehicle'
  238. }
  239. params.vehicleId = item.vehicleId
  240. let unixTime = this.dayjs(item.startTime).unix()
  241. let s_time = this.dayjs(item.startTime).format('YYYY-MM-DD HH:mm')
  242. let e_time = this.dayjs.unix(unixTime + 60).format('YYYY-MM-DD HH:mm')
  243. let startTime = s_time;
  244. let endTime = e_time;
  245. params.time = [startTime, endTime]
  246. console.info(params.time)
  247. this.$store.dispatch('setParams', params)
  248. uni.navigateTo({
  249. url: '/pagesMap/pastRoute/pastRoute',
  250. });
  251. },
  252. },
  253. };
  254. </script>
  255. <style lang="scss" scoped>
  256. .driver_class {
  257. width: 100%;
  258. height: 100%;
  259. }
  260. .image {
  261. width: 100%;
  262. // padding: 24rpx 24rpx 0 24rpx;
  263. display: flex;
  264. justify-content: space-around;
  265. margin-top: 15rpx;
  266. }
  267. .alarm-type {
  268. width: calc(100% - 40rpx);
  269. margin: 4rpx;
  270. border-radius: 16rpx;
  271. padding: 16rpx;
  272. display: flex;
  273. flex-direction: column;
  274. background-color: #fff;
  275. margin-top: 15rpx;
  276. }
  277. .alarm-type-title {
  278. color: #4573FC;
  279. font-size: 36rpx;
  280. font-weight: bold;
  281. }
  282. .alarm-type-item {
  283. display: flex;
  284. justify-content: space-between;
  285. font-size: 32rpx;
  286. margin-top: 28rpx;
  287. .label {
  288. color: #999999;
  289. }
  290. }
  291. .alarm-detail {
  292. width: calc(100% - 50rpx);
  293. padding: 20rpx;
  294. display: flex;
  295. flex-direction: column;
  296. border-radius: 8rpx;
  297. background-color: #fff;
  298. margin: 6rpx;
  299. font-size: 32rpx;
  300. margin-top: 20rpx;
  301. .alarm-detail-title {
  302. color: #4573FC;
  303. font-size: 36rpx;
  304. font-weight: bold;
  305. }
  306. .alarm-detail-name {
  307. display: flex;
  308. align-items: center;
  309. margin-top: 18rpx;
  310. .alarm-detail-image {
  311. width: 120rpx;
  312. height: 120rpx;
  313. overflow: hidden;
  314. border-radius: 50%;
  315. background-color: #C3C7CC;
  316. }
  317. }
  318. .image-right {
  319. flex: 1;
  320. height: 120rpx;
  321. margin-left: 24rpx;
  322. display: flex;
  323. flex-direction: column;
  324. justify-content: space-between;
  325. }
  326. .alarm-detail-form {
  327. display: flex;
  328. justify-content: space-between;
  329. width: 100%;
  330. .label {
  331. color: #999999;
  332. }
  333. .val {
  334. color: #666666;
  335. }
  336. }
  337. .top {
  338. margin-top: 28rpx;
  339. }
  340. }
  341. .exports {
  342. width: calc(100% - 48rpx);
  343. margin: 24rpx;
  344. padding: 24rpx 0;
  345. margin-bottom: 24rpx;
  346. background-color: #4573FC;
  347. border-radius: 20rpx;
  348. display: flex;
  349. align-items: center;
  350. justify-content: center;
  351. color: #fff;
  352. font-size: 36rpx;
  353. }
  354. </style>