detail.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  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, getAlarmBlindSpotDetailByFileuuid, exportAlarm } from "@/api/alarm/blindSpot.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 getAlarmBlindSpotDetailByFileuuid(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. this.$store.dispatch('setParams', params)
  247. uni.navigateTo({
  248. url: '/pagesMap/pastRoute/pastRoute',
  249. });
  250. },
  251. },
  252. };
  253. </script>
  254. <style lang="scss" scoped>
  255. .driver_class {
  256. width: 100%;
  257. height: 100%;
  258. }
  259. .image {
  260. width: 100%;
  261. // padding: 24rpx 24rpx 0 24rpx;
  262. display: flex;
  263. justify-content: space-around;
  264. margin-top: 15rpx;
  265. }
  266. .alarm-type {
  267. width: calc(100% - 110rpx);
  268. margin: 16rpx 20rpx;
  269. border-radius: 16rpx;
  270. padding: 36rpx;
  271. display: flex;
  272. flex-direction: column;
  273. background-color: #fff;
  274. margin-top: 16rpx;
  275. }
  276. .alarm-type-title {
  277. color: #4573FC;
  278. font-size: 36rpx;
  279. font-weight: bold;
  280. }
  281. .alarm-type-item {
  282. display: flex;
  283. justify-content: space-between;
  284. font-size: 32rpx;
  285. margin-top: 28rpx;
  286. .label {
  287. color: #999999;
  288. }
  289. }
  290. .alarm-detail {
  291. width: calc(100% - 116rpx);
  292. padding: 38rpx;
  293. display: flex;
  294. flex-direction: column;
  295. border-radius: 8rpx;
  296. background-color: #fff;
  297. margin: 16rpx 20rpx;
  298. font-size: 32rpx;
  299. margin-top: 20rpx;
  300. .alarm-detail-title {
  301. color: #4573FC;
  302. font-size: 36rpx;
  303. font-weight: bold;
  304. }
  305. .alarm-detail-name {
  306. display: flex;
  307. align-items: center;
  308. margin-top: 18rpx;
  309. .alarm-detail-image {
  310. width: 120rpx;
  311. height: 120rpx;
  312. overflow: hidden;
  313. border-radius: 50%;
  314. background-color: #C3C7CC;
  315. }
  316. }
  317. .image-right {
  318. flex: 1;
  319. height: 120rpx;
  320. margin-left: 24rpx;
  321. display: flex;
  322. flex-direction: column;
  323. justify-content: space-between;
  324. }
  325. .alarm-detail-form {
  326. display: flex;
  327. justify-content: space-between;
  328. width: 100%;
  329. .label {
  330. color: #999999;
  331. }
  332. .val {
  333. color: #666666;
  334. }
  335. }
  336. .top {
  337. margin-top: 28rpx;
  338. }
  339. }
  340. .exports {
  341. width: calc(100% - 48rpx);
  342. margin: 24rpx;
  343. padding: 24rpx 0;
  344. margin-bottom: 24rpx;
  345. background-color: #4573FC;
  346. border-radius: 20rpx;
  347. display: flex;
  348. align-items: center;
  349. justify-content: center;
  350. color: #fff;
  351. font-size: 36rpx;
  352. }
  353. </style>