Browse Source

no message

devlop
xpz2018 3 years ago
parent
commit
f2fa5473ee
3 changed files with 44 additions and 29 deletions
  1. 37
      pages/camera-list/index.vue
  2. 8
      pages/digital-workshops/DeviceItem.vue
  3. 28
      pages/digital-workshops/index.vue

37
pages/camera-list/index.vue

@ -1,10 +1,11 @@
<template>
<view class="content">
<uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed title="全部摄像头"></uni-nav-bar>
<view class="flex-col section_8" v-for="camera in cameraList" :key="camera.id">
<view class="flex-col section_8" v-for="(camera, index) in cameraList" :key="index">
<view class="flex-col items-center group_12">
<image src="/static/imgs/digital-workshops/camera-tip-bg.png" class="image_2" @click="go2('video-play', { url: camera.videoUrl })" />
<text class="text_18">{{ camera.address }}</text>
<video :src="camera.hlsUrl" autoplay class="image_2"></video>
<!-- <image src="/static/imgs/digital-workshops/camera-tip-bg.png" class="image_2" @click="go2('video-play', { url: camera.videoUrl })" /> -->
<text class="text_18" style="margin-top: 8rpx;">{{ camera.name }}</text>
</view>
</view>
</view>
@ -13,6 +14,7 @@
<script>
import { go2, back } from '@/utils/hook.js'
import { getCameraListApi } from '@/apis/factoryApi'
import http from '@/utils/http/index.js'
export default {
data() {
@ -29,8 +31,11 @@ export default {
back,
//
getCameraList() {
getCameraListApi({ factoryId: this.factoryId }).then((res) => {
this.cameraList = res
var url = `https://api-ops-yyt.qniao.cn/cloud-print-cloud-factory/user/get/factory/video-machine/list?factoryId=${this.factoryId}`
http.get({ url }).then(res => {
if(res){
this.cameraList = res
}
})
}
}
@ -39,10 +44,14 @@ export default {
<style lang="scss" scoped>
.content {
width: 750rpx;
.section_8 {
display: flex;
flex-direction: column;
flex: 1;
height: 100vh;
}
.section_8 {
margin-top: 20rpx;
padding: 0 32rpx 33rpx;
padding: 20rpx 32rpx 24rpx;
background-color: rgb(255, 255, 255);
.group_11 {
padding: 19rpx 0;
@ -59,21 +68,16 @@ export default {
}
}
.group_12 {
color: rgb(255, 255, 255);
font-size: 28rpx;
// color: rgb(255, 255, 255);
font-size: 30rpx;
font-weight: 500;
line-height: 40rpx;
white-space: nowrap;
position: relative;
// position: relative;
.image_2 {
width: 91.5vw;
height: 51.5vw;
}
.text_18 {
position: absolute;
left: 24rpx;
top: 16rpx;
}
.image_3 {
width: 87rpx;
height: 87rpx;
@ -84,5 +88,4 @@ export default {
}
}
}
}
</style>

8
pages/digital-workshops/DeviceItem.vue

@ -22,7 +22,7 @@
<view class="top-group justify-between">
<text class="name text-ellipsis">{{ deviceInfo.name }}</text>
<view>
<image v-if="hasCamera" src="/static/imgs/digital-workshops/camera-icon.png" class="image_5" />
<image v-if="hasCamera" src="/static/imgs/digital-workshops/camera-icon.png" class="image_5" @click="go2('video-play', { url: deviceInfo.hlsUrl })"/>
<image v-if="hasCloudBox" src="/static/imgs/digital-workshops/cloudBox-icon.png" class="image_5" />
</view>
</view>
@ -62,6 +62,7 @@
<script>
import { deviceStatus } from '@/enums/index'
import { go2 } from '@/utils/hook.js'
export default {
props: {
deviceInfo: {
@ -86,6 +87,7 @@ export default {
emit() {
this.$emit('click', this.deviceInfo)
},
go2,
translate(time) {
if (!time) {
return ''
@ -197,8 +199,8 @@ export default {
}
.image_5 {
margin-left: 8rpx;
width: 24rpx;
height: 24rpx;
width: 32rpx;
height: 32rpx;
}
}
.equal-division {

28
pages/digital-workshops/index.vue

@ -50,13 +50,17 @@
</view>
</view>
<view class="flex-col section_8" v-if="cameraList && cameraList.length > 0">
<view class="justify-between group_11">
<text>摄像机({{ cameraList.length }})</text>
<image src="/static/imgs/digital-workshops/right-arrow-icon.png" class="image_1" @click="go2('camera-list', { id: factoryId })" />
<view class="justify-between group_11" @click="go2('camera-list', { id: factoryId })">
<view class="flex-row-center-center">
<image src="/static/imgs/digital-workshops/camera-icon.png" style="height: 32rpx;width: 32rpx;" />
<text style="margin-left: 8rpx;">摄像机({{ cameraList.length }})</text>
</view>
<image src="/static/imgs/digital-workshops/right-arrow-icon.png" class="image_1" />
</view>
<view class="flex-col items-center group_12">
<image src="/static/imgs/digital-workshops/camera-tip-bg.png" class="image_2" @click="go2('video-play', { url: cameraList[0].videoUrl })" />
<text class="text_18">{{ cameraList[0].address }}</text>
<!-- <image src="/static/imgs/digital-workshops/camera-tip-bg.png" class="image_2" @click="go2('video-play', { url: cameraList[0].videoUrl })" />
<text class="text_18">{{ cameraList[0].address }}</text> -->
<video :src="cameraList[0].hlsUrl" autoplay class="image_2"></video>
</view>
</view>
<view class="flex-col section_9">
@ -112,6 +116,7 @@ import { deviceStatus, orderStatusList, orderStatusEnum, StatusMap } from '@/enu
import { getCameraListApi, getMyFactoryList, getMachinList } from '@/apis/factoryApi'
import { dateTimeFormat } from '@/utils/index.js'
import { getProdOrderList } from '@/apis/orderApi.js'
import http from '@/utils/http/index.js'
export default {
components: {
@ -210,7 +215,6 @@ export default {
},
getList() {
getMachinList({ factoryId: this.factoryId, pageSize: 1000 }).then((res) => {
console.log(res)
let list = res.records
let data = { 所有设备: { name: '所有设备', type: {}, list: [] } }
for (let i = 0; i < list.length; i++) {
@ -294,9 +298,15 @@ export default {
},
//
getCameraList() {
getCameraListApi({ factoryId: this.factoryId }).then((res) => {
this.cameraList = res
})
// getCameraListApi({ factoryId: this.factoryId }).then((res) => {
// this.cameraList = res
// })
var url = `https://api-ops-yyt.qniao.cn/cloud-print-cloud-factory/user/get/factory/video-machine/list?factoryId=${this.factoryId}`
http.get({ url }).then(res => {
if(res){
this.cameraList = res
}
})
},
//
getFactoryList() {

Loading…
Cancel
Save