【前端】印包客app
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
2.4 KiB

<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, index) in cameraList" :key="index">
<view class="flex-col items-center group_12" @click="go2('video-play', { url: encodeURIComponent(camera.hlsUrl) })">
<image :src="getImageurl(camera)" class="image_2" />
<image src="/static/imgs/digital-workshops/icon-play.png" class="image_3" v-if="camera.defaultImg"/>
<text class="text_18" style="color: black">{{ camera.name }}</text>
</view>
</view>
</view>
</template>
<script>
import { go2, back } from '@/utils/hook.js'
import { getCameraListApi } from '@/apis/factoryApi'
import http from '@/utils/http/index.js'
export default {
data() {
return {
cameraList: []
}
},
onLoad(option) {
this.factoryId = option.id
this.getCameraList()
},
methods: {
go2,
back,
// 获取摄像头列表
getCameraList() {
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
}
})
},
getImageurl(camera){
if(!camera.defaultImg){
return '/static/imgs/digital-workshops/camera-tip-bg.png'
}
return camera.defaultImg
}
}
}
</script>
<style lang="scss" scoped>
.content {
display: flex;
flex-direction: column;
flex: 1;
height: 100vh;
}
.section_8 {
margin-top: 20rpx;
padding: 20rpx 32rpx 24rpx;
background-color: rgb(255, 255, 255);
.group_11 {
padding: 19rpx 0;
color: rgb(51, 51, 51);
font-size: 36rpx;
font-weight: 500;
line-height: 50rpx;
white-space: nowrap;
.image_1 {
margin-right: 9rpx;
align-self: center;
width: 14rpx;
height: 24rpx;
}
}
.group_12 {
color: rgb(255, 255, 255);
font-size: 30rpx;
font-weight: 500;
line-height: 40rpx;
white-space: nowrap;
position: relative;
.image_2 {
width: 91.5vw;
height: 51.5vw;
}
.image_3 {
width: 87rpx;
height: 87rpx;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
}
}
</style>