This commit is contained in:
weipengfei 2024-01-31 17:25:29 +08:00
parent f6bd08cd31
commit 9055d50097
5 changed files with 27 additions and 14 deletions

View File

@ -258,7 +258,7 @@
landproduct landproduct
} from '@/api/api.js' } from '@/api/api.js'
import {farmLists, fenceHouseData} from "@/api/index.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" import store from "@/store/index.js"
const showPicker = ref(false) const showPicker = ref(false)
const showPicker1 = ref(false) const showPicker1 = ref(false)
@ -314,10 +314,8 @@
const goLive = () => { const goLive = () => {
let system = uni.getSystemInfoSync().platform; let system = uni.getSystemInfoSync().platform;
userInfo.value.master_phone = "lihai_lot_land_1"
userInfo.value.device_id = "6"
uni.navigateTo({ 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() const video_url = ref()
@ -387,7 +385,7 @@
const farm_types_lists = ref([]); const farm_types_lists = ref([]);
const initFarmLists = ()=>{ const initFarmLists = ()=>{
farmTypeLists().then(res=>{ breedTypeLists().then(res=>{
farm_types_lists.value = res.data farm_types_lists.value = res.data
}) })
farmLists().then(res=>{ farmLists().then(res=>{
@ -408,12 +406,12 @@
house_lists.value = res.data; house_lists.value = res.data;
houseList.splice(0, houseList.length, ...res.data.map((step, index) => { houseList.splice(0, houseList.length, ...res.data.map((step, index) => {
return { return {
name: step.animal_name, name: step.fence_house_name,
id: step.id, id: step.id,
}; };
})); }));
if(houseInfo.value.id) return ; // 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 = {}; else houseInfo.value = {};
store.commit('setHouse', houseInfo.value); store.commit('setHouse', houseInfo.value);
getlist(); getlist();
@ -436,7 +434,7 @@
lindexist({ lindexist({
fence_house_id: houseInfo.value.id fence_house_id: houseInfo.value.id
}).then(res=>{ }).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||{}; monitorData.value = res.data.monitor?.datas||{};
monitorThreshold.value = res.data.monitor?.threshold||{}; monitorThreshold.value = res.data.monitor?.threshold||{};
}) })

View File

@ -1,7 +1,7 @@
<template> <template>
<view> <view>
<view :vsrc="vsrc" :change:vsrc="renderScript.getVideoImg"> <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> :autoplay="true" style="width: 100vw;height: 100vh;" :src="videoUrl" id="video"></video>
</view> </view>
</view> </view>
@ -28,7 +28,7 @@
object_fit: 'contain', //🌟 object_fit: 'contain', //🌟
windowWidth: '', windowWidth: '',
deviceId: "", deviceId: "",
shwovideo: false, shwovideo: true,
initFailTimer: "", initFailTimer: "",
flag: true, flag: true,
SocketTask: "", SocketTask: "",
@ -41,6 +41,8 @@
this.videoUrl = option.url this.videoUrl = option.url
this.videoUrl = this.replaceLastThreeChars(this.videoUrl, "mp4"); this.videoUrl = this.replaceLastThreeChars(this.videoUrl, "mp4");
// #ifndef H5 // #ifndef H5
// this.subNvue.hide();
// that.shwovideo = true;
this.subNvue = uni.getSubNVueById('subNvue'); // this.subNvue = uni.getSubNVueById('subNvue'); //
this.subNvue.show() // this.subNvue.show() //
// #endif // #endif

View File

@ -4,14 +4,14 @@
<view class="" style="display: flex;justify-content: space-between;margin-bottom: 20rpx;"> <view class="" style="display: flex;justify-content: space-between;margin-bottom: 20rpx;">
<view class="tit" style="margin-bottom: 0;"> <view class="tit" style="margin-bottom: 0;">
栏舍监控数据 动物数据
</view> </view>
<view class="" style="display: flex;align-items: center;"> <view class="" style="display: flex;align-items: center;">
<u-icon name="clock" style="margin-right: 10rpx;"></u-icon> <u-icon name="clock" style="margin-right: 10rpx;"></u-icon>
<text style="color: #ACACAC;font-size: 25rpx;">刷新时间: {{getNowTimeFn()}} </text> <text style="color: #ACACAC;font-size: 25rpx;">刷新时间: {{getNowTimeFn()}} </text>
</view> </view>
</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%" <u--image v-if="dataobj&&dataobj.pic" :src="dataobj.pic[0]" width="100%"
height="300rpx"></u--image> height="300rpx"></u--image>
</view> </view>

View File

@ -11,7 +11,7 @@
<text style="color: #ACACAC;font-size: 25rpx;">刷新时间: {{getNowTimeFn()}} </text> <text style="color: #ACACAC;font-size: 25rpx;">刷新时间: {{getNowTimeFn()}} </text>
</view> </view>
</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%" <u--image v-if="dataobj&&dataobj.pic" :src="dataobj.pic[0]" width="100%"
height="300rpx"></u--image> height="300rpx"></u--image>
</view> </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) => { onLoad((option) => {
typeID.value = option.id; typeID.value = option.id;
getFenceHouseDetail(); getFenceHouseDetail();
@ -218,11 +229,13 @@
initOperationLogIndex(); initOperationLogIndex();
}) })
const video_url = ref('');
const getFenceHouseDetail = () => { const getFenceHouseDetail = () => {
fenceHouseDetail({ fenceHouseDetail({
id: typeID.value, id: typeID.value,
}).then((res) => { }).then((res) => {
if (res.code == 1) { if (res.code == 1) {
video_url.value = res.data.video_url;
if(res.data.pic) res.data.pic = JSON.parse(res.data.pic||'[]'); if(res.data.pic) res.data.pic = JSON.parse(res.data.pic||'[]');
Object.assign(dataobj, res.data); Object.assign(dataobj, res.data);
} }

File diff suppressed because one or more lines are too long