123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383 |
- <template>
- <view class="driver_class">
- <view style="width: 100%;">
- <video style="width: 100%;" :src="videoUrl"></video>
- </view>
- <view class="image" v-if="images.length">
- <view v-for="(item, index) in images" :key="item">
- <image style="width: 220rpx;" @click="previewImage(item, index)" :src="item" mode="widthFix"></image>
- </view>
- </view>
- <view class="alarm-type">
- <view class="alarm-type-title">
- 报警类型
- </view>
- <view class="alarm-type-item">
- <view class="label">
- 类型:
- </view>
- <view class="" style="color: #FF3140;">
- {{ info.alarmType }}
- </view>
- </view>
- <view class="alarm-type-item">
- <view class="label">
- 等级:
- </view>
- <view style="color: #F7B500;">
- {{ info.level }}
- </view>
- </view>
- </view>
- <view class="alarm-detail">
- <view class="alarm-detail-title">
- 详细信息
- </view>
- <view class="alarm-detail-name">
- <view class="alarm-detail-image">
- <image :src="$getImages('/assetsMobile/images/alarm/touxiang.png')" style="width: 120rpx;height: 120rpx;"
- mode=""></image>
- </view>
- <view class="image-right">
- <view class="alarm-detail-form">
- <view class="label">
- 车牌号:
- </view>
- <view class="val">
- {{ info.plate }}
- </view>
- </view>
- <view class="alarm-detail-form">
- <view class="label">
- 驾驶员名称:
- </view>
- <view class="val">
- {{ info.driverName || '暂无信息' }}
- </view>
- </view>
- </view>
- </view>
- <view class="alarm-detail-form top">
- <view class="label">
- 司机电话:
- </view>
- <view class="val">
- {{ info.driverPhone }}
- </view>
- </view>
- <view class="alarm-detail-form top">
- <view class="label">
- 企业名称:
- </view>
- <view class="val">
- {{ info.deptName }}
- </view>
- </view>
- <!-- <view class="alarm-detail-form top">
- <view class="label">
- 通信号码:
- </view>
- <view class="val">
- {{ info.phone }}
- </view>
- </view> -->
- <view class="alarm-detail-form top">
- <view class="label">
- 报警类型:
- </view>
- <view class="val">
- {{ info.alarmType }}
- </view>
- </view>
- <view class="alarm-detail-form top">
- <view class="label">
- 报警时间:
- </view>
- <view class="val">
- {{ info.alarmTime }}
- </view>
- </view>
- <view class="alarm-detail-form top">
- <view class="label">
- 车速:
- </view>
- <view class="val">
- {{ info.speed }}km/h
- </view>
- </view>
- <view class="alarm-detail-form top">
- <view class="label">
- 经度:
- </view>
- <view class="val">
- {{ info.lng }}
- </view>
- </view>
- <view class="alarm-detail-form top">
- <view class="label">
- 纬度:
- </view>
- <view class="val">
- {{ info.lat }}
- </view>
- </view>
- <!-- <view class="alarm-detail-form top">
- <view class="label">
- 车辆状态:
- </view>
- <view class="val">
- {{info.phone}}
- </view>
- </view> -->
- <view class="alarm-detail-form top">
- <view class="label" style="width: 170rpx;">
- 报警地址:
- </view>
- <view class="val" style="color: #4573FC;text-decoration:underline;width: calc(100% - 170rpx);"
- @click="goHistory(info)">
- {{ info.address }}>>
- </view>
- </view>
- </view>
- <view style="height: 28rpx;">
- </view>
- <!-- <view class="exports" @click="exportZip">
- <image src="../../static/vehicle/icon_evidence_derive_24.png" style="width: 48rpx;height: 48rpx;margin-right: 16rpx;" mode=""></image>
- 证据导出
- </view> -->
- </view>
- </template>
- <script>
- import { selectByFileuuid, getAlarmDriverDetailByFileuuid, exportAlarm } from "@/api/alarm/driverBehavior.js"
- import { getToken } from '@/utils/auth'
- export default {
- components: {},
- props: {},
- data() {
- return {
- images: [], // 图片数组
- vehSpeed: 0,
- fid: '',
- page: '',
- videoUrl: '',
- info: {},
- };
- },
- onLoad(option) {
- this.fid = this.$route.query.fid;
- this.page = this.$route.query.type;
- },
- created() { },
- mounted() {
- this.$nextTick(() => {
- this.queryVideoImages();
- this.queryBasicInfo();
- });
- },
- watch: {},
- computed: {},
- methods: {
- previewImage(item, index) {
- uni.previewImage({
- current: item,
- urls: this.images,
- indicator: index
- })
- },
- async queryVideoImages() {
- // 查询视频和图片
- let videoList;
- this.images = [];
- let res = await selectByFileuuid(this.fid);
- if (res.code == "0") {
- for (let i = 0; i < res.data.length; i++) {
- if (res.data[i].fileType == "02") {
- videoList = res.data[i].fileName.replace(".h264", ".mp4");
- this.videoUrl = this.$getImages("/img/alarmvideo/" + videoList)
- console.log(this.url)
- }
- if (res.data[i].fileType == "00") {
- this.images.push(
- this.$getImages("/img/alarmvideo/" + res.data[i].fileName)
- );
- }
- }
- }
- },
- checkData(data) {
- // 检测数据
- return data == null || data == undefined ? "" : data;
- },
- async queryBasicInfo() {
- // 查询视频和图片
- let videoList;
- this.images = [];
- let res = await getAlarmDriverDetailByFileuuid(this.fid);
- if (res.code == "0") {
- this.info = {
- ...res.data,
- deptName: this.checkData(res.data.deptName),
- driverName: this.checkData(res.data.driverName),
- driverPhone: this.checkData(res.data.driverPhone),
- plate: this.checkData(res.data.plate),
- alarmType: this.checkData(res.data.alarmType),
- alarmTime: this.checkData(res.data.startTime),
- speed: this.checkData(res.data.speed),
- lng: this.checkData(res.data.lng),
- lat: this.checkData(res.data.lat),
- level: this.checkData(res.data.alarmGrade),
- vehicleId: this.checkData(res.data.vehicleId),
- address: this.checkData(res.data.location),
- }
- }
- },
- // 跳到历史轨迹
- goHistory(item) {
- let params = {
- tabStyleType: 'vehicle'
- }
- params.vehicleId = item.vehicleId
- let unixTime = this.dayjs(item.startTime).unix()
- let s_time = this.dayjs(item.startTime).format('YYYY-MM-DD HH:mm')
- let e_time = this.dayjs.unix(unixTime + 60).format('YYYY-MM-DD HH:mm')
- let startTime = s_time;
- let endTime = e_time;
- params.time = [startTime, endTime]
- console.info(params.time)
- this.$store.dispatch('setParams', params)
- uni.navigateTo({
- url: '/pagesMap/pastRoute/pastRoute',
- });
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .driver_class {
- width: 100%;
- height: 100%;
- }
- .image {
- width: 100%;
- // padding: 24rpx 24rpx 0 24rpx;
- display: flex;
- justify-content: space-around;
- margin-top: 15rpx;
- }
- .alarm-type {
- width: calc(100% - 40rpx);
- margin: 4rpx;
- border-radius: 16rpx;
- padding: 16rpx;
- display: flex;
- flex-direction: column;
- background-color: #fff;
- margin-top: 15rpx;
- }
- .alarm-type-title {
- color: #4573FC;
- font-size: 36rpx;
- font-weight: bold;
- }
- .alarm-type-item {
- display: flex;
- justify-content: space-between;
- font-size: 32rpx;
- margin-top: 28rpx;
- .label {
- color: #999999;
- }
- }
- .alarm-detail {
- width: calc(100% - 50rpx);
- padding: 20rpx;
- display: flex;
- flex-direction: column;
- border-radius: 8rpx;
- background-color: #fff;
- margin: 6rpx;
- font-size: 32rpx;
- margin-top: 20rpx;
- .alarm-detail-title {
- color: #4573FC;
- font-size: 36rpx;
- font-weight: bold;
- }
- .alarm-detail-name {
- display: flex;
- align-items: center;
- margin-top: 18rpx;
- .alarm-detail-image {
- width: 120rpx;
- height: 120rpx;
- overflow: hidden;
- border-radius: 50%;
- background-color: #C3C7CC;
- }
- }
- .image-right {
- flex: 1;
- height: 120rpx;
- margin-left: 24rpx;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- }
- .alarm-detail-form {
- display: flex;
- justify-content: space-between;
- width: 100%;
- .label {
- color: #999999;
- }
- .val {
- color: #666666;
- }
- }
- .top {
- margin-top: 28rpx;
- }
- }
- .exports {
- width: calc(100% - 48rpx);
- margin: 24rpx;
- padding: 24rpx 0;
- margin-bottom: 24rpx;
- background-color: #4573FC;
- border-radius: 20rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- color: #fff;
- font-size: 36rpx;
- }
- </style>
|