This commit is contained in:
parent
f6bd08cd31
commit
9055d50097
|
@ -258,7 +258,7 @@
|
|||
landproduct
|
||||
} from '@/api/api.js'
|
||||
import {farmLists, fenceHouseData} from "@/api/index.js"
|
||||
import {farmTypeLists} from "@/api/dict.js"
|
||||
import {breedTypeLists} from "@/api/dict.js"
|
||||
import store from "@/store/index.js"
|
||||
const showPicker = ref(false)
|
||||
const showPicker1 = ref(false)
|
||||
|
@ -314,10 +314,8 @@
|
|||
|
||||
const goLive = () => {
|
||||
let system = uni.getSystemInfoSync().platform;
|
||||
userInfo.value.master_phone = "lihai_lot_land_1"
|
||||
userInfo.value.device_id = "6"
|
||||
uni.navigateTo({
|
||||
url: `/pages/live/${system == 'ios'?'liveIos':'live'}?url=${video_url.value }&user=${userInfo.value.master_phone}&device=${userInfo.value.device_id}`
|
||||
url: `/pages/live/${system == 'ios'?'liveIos':'live'}?url=${video_url.value }`
|
||||
})
|
||||
}
|
||||
const video_url = ref()
|
||||
|
@ -387,7 +385,7 @@
|
|||
const farm_types_lists = ref([]);
|
||||
|
||||
const initFarmLists = ()=>{
|
||||
farmTypeLists().then(res=>{
|
||||
breedTypeLists().then(res=>{
|
||||
farm_types_lists.value = res.data
|
||||
})
|
||||
farmLists().then(res=>{
|
||||
|
@ -408,12 +406,12 @@
|
|||
house_lists.value = res.data;
|
||||
houseList.splice(0, houseList.length, ...res.data.map((step, index) => {
|
||||
return {
|
||||
name: step.animal_name,
|
||||
name: step.fence_house_name,
|
||||
id: step.id,
|
||||
};
|
||||
}));
|
||||
if(houseInfo.value.id) return ; //如果已经选择过将不再重新选择
|
||||
if(res.data.length>0) houseInfo.value = res.data[1];
|
||||
if(res.data.length>0) houseInfo.value = res.data[0];
|
||||
else houseInfo.value = {};
|
||||
store.commit('setHouse', houseInfo.value);
|
||||
getlist();
|
||||
|
@ -436,7 +434,7 @@
|
|||
lindexist({
|
||||
fence_house_id: houseInfo.value.id
|
||||
}).then(res=>{
|
||||
video_url.value = "http://60.204.152.17:8888/live/xumu_user1.live.mp4"
|
||||
video_url.value = res.data.video_url
|
||||
monitorData.value = res.data.monitor?.datas||{};
|
||||
monitorThreshold.value = res.data.monitor?.threshold||{};
|
||||
})
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<view>
|
||||
<view :vsrc="vsrc" :change:vsrc="renderScript.getVideoImg">
|
||||
<video v-if="shwovideo" @play="playVedio" @fullscreenchange="fullscreenchange" :controls="true"
|
||||
<video v-if="true" @play="playVedio" @fullscreenchange="fullscreenchange" :controls="true"
|
||||
:autoplay="true" style="width: 100vw;height: 100vh;" :src="videoUrl" id="video"></video>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -28,7 +28,7 @@
|
|||
object_fit: 'contain', //视频样式默认包含🌟
|
||||
windowWidth: '',
|
||||
deviceId: "",
|
||||
shwovideo: false,
|
||||
shwovideo: true,
|
||||
initFailTimer: "",
|
||||
flag: true,
|
||||
SocketTask: "",
|
||||
|
@ -41,6 +41,8 @@
|
|||
this.videoUrl = option.url
|
||||
this.videoUrl = this.replaceLastThreeChars(this.videoUrl, "mp4");
|
||||
// #ifndef H5
|
||||
// this.subNvue.hide();
|
||||
// that.shwovideo = true;
|
||||
this.subNvue = uni.getSubNVueById('subNvue'); //获取
|
||||
this.subNvue.show() // 显示
|
||||
// #endif
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
|
||||
<view class="" style="display: flex;justify-content: space-between;margin-bottom: 20rpx;">
|
||||
<view class="tit" style="margin-bottom: 0;">
|
||||
栏舍监控数据
|
||||
动物数据
|
||||
</view>
|
||||
<view class="" style="display: flex;align-items: center;">
|
||||
<u-icon name="clock" style="margin-right: 10rpx;"></u-icon>
|
||||
<text style="color: #ACACAC;font-size: 25rpx;">刷新时间: {{getNowTimeFn()}} </text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="video" @click="navTo('/pages/live/live')">
|
||||
<view class="video" @click="perviewFn(dataobj.pic[0])">
|
||||
<u--image v-if="dataobj&&dataobj.pic" :src="dataobj.pic[0]" width="100%"
|
||||
height="300rpx"></u--image>
|
||||
</view>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<text style="color: #ACACAC;font-size: 25rpx;">刷新时间: {{getNowTimeFn()}} </text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="video" @click="navTo('/pages/live/live')">
|
||||
<view class="video" @click="goLive()">
|
||||
<u--image v-if="dataobj&&dataobj.pic" :src="dataobj.pic[0]" width="100%"
|
||||
height="300rpx"></u--image>
|
||||
</view>
|
||||
|
@ -209,6 +209,17 @@
|
|||
})
|
||||
}
|
||||
|
||||
const goLive = () => {
|
||||
if(!video_url.value) return uni.showToast({
|
||||
icon:'none',
|
||||
title: '该栏舍暂无监控'
|
||||
})
|
||||
let system = uni.getSystemInfoSync().platform;
|
||||
uni.navigateTo({
|
||||
url: `/pages/live/${system == 'ios'?'liveIos':'live'}?url=${video_url.value }`
|
||||
})
|
||||
}
|
||||
|
||||
onLoad((option) => {
|
||||
typeID.value = option.id;
|
||||
getFenceHouseDetail();
|
||||
|
@ -218,11 +229,13 @@
|
|||
initOperationLogIndex();
|
||||
})
|
||||
|
||||
const video_url = ref('');
|
||||
const getFenceHouseDetail = () => {
|
||||
fenceHouseDetail({
|
||||
id: typeID.value,
|
||||
}).then((res) => {
|
||||
if (res.code == 1) {
|
||||
video_url.value = res.data.video_url;
|
||||
if(res.data.pic) res.data.pic = JSON.parse(res.data.pic||'[]');
|
||||
Object.assign(dataobj, res.data);
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue