This commit is contained in:
parent
792c85c05c
commit
0813c46109
|
@ -2,8 +2,8 @@
|
|||
"name": "种植溯源",
|
||||
"appid": "__UNI__D087881",
|
||||
"description": "",
|
||||
"versionName": "1.0.3",
|
||||
"versionCode": 103,
|
||||
"versionName": "1.0.4",
|
||||
"versionCode": 104,
|
||||
"transformPx": false,
|
||||
/* 5+App特有相关 */
|
||||
"app-plus": {
|
||||
|
|
|
@ -101,7 +101,7 @@
|
|||
{
|
||||
"path": "pages/live/live",
|
||||
"style": {
|
||||
"navigationBarTitleText": "苗情檢察",
|
||||
"navigationBarTitleText": "苗情监测",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationBarBackgroundColor": "#35D190",
|
||||
"navigationBarTextStyle": "white",
|
||||
|
|
|
@ -461,7 +461,7 @@
|
|||
video_url.value = res.data.video_url
|
||||
testUser()
|
||||
videoCover.value = userInfo.value.video_cover || "/static/main/index/videoCover.png"
|
||||
uni.getStorageSync('SY_VIDEO_POSTS') || "/static/main/index/videoCover.png"
|
||||
// uni.getStorageSync('SY_VIDEO_POSTS') || "/static/main/index/videoCover.png"
|
||||
threshold = res.data?.monitor?.threshold || ""
|
||||
if (Object.keys(res.data).length > 0) {
|
||||
getlist3(res.data.id)
|
||||
|
|
|
@ -12,8 +12,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="video" style="position: relative;">
|
||||
<u--image src="https://ceshi-worker-task.lihaink.cn/uploads/images/20231223/20231223092144475437017.png"
|
||||
width="100%" height="500rpx" @click="goLive" v-if="videoUrl"></u--image>
|
||||
<u--image :src="videoCover" width="100%" height="500rpx" @click="goLive" v-if="videoUrl"></u--image>
|
||||
<u--image :src="u('K')" v-else width="100%" height="510rpx"></u--image>
|
||||
<view class=""
|
||||
style="width: 100%;height: 100%;background-color: rgba(0, 0, 0, .5);position: absolute;top: 1px;"
|
||||
|
@ -191,6 +190,7 @@
|
|||
}]
|
||||
]);
|
||||
const userInfo = ref("")
|
||||
const videoCover = ref("")
|
||||
onLoad((option) => {
|
||||
typeID.value = option.id;
|
||||
lindexist({
|
||||
|
@ -198,7 +198,8 @@
|
|||
}).then(res => {
|
||||
userInfo.value = res.data
|
||||
videoUrl.value = res.data.video_url
|
||||
console.log(videoUrl.value, 25545)
|
||||
videoCover.value = userInfo.value.video_cover || "/static/main/index/videoCover.png"
|
||||
console.log(userInfo.value, 25545)
|
||||
// console.log(userInfo.value)
|
||||
})
|
||||
|
||||
|
|
|
@ -5,8 +5,6 @@
|
|||
:autoplay="true" :style="'width: '+ windowWidth +'px; height: '+ boxStyle.height +'px;'" :src="videoUrl"
|
||||
id="video"></video>
|
||||
</view>
|
||||
<!-- <image :src="imgSrc" mode=""></image> -->
|
||||
<!-- <button @click="setUrl(videoUrl)">设置链接</button> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
@ -32,6 +30,10 @@
|
|||
windowWidth: '',
|
||||
deviceId: "",
|
||||
shwovideo: false,
|
||||
shwovideoTimer: "",
|
||||
initFailTimer: "",
|
||||
flag: true
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -39,8 +41,6 @@
|
|||
this.deviceId = option.device
|
||||
this.videoUrl = option.url
|
||||
this.videoUrl = this.replaceLastThreeChars(this.videoUrl, "mp4");
|
||||
|
||||
console.log(this.videoUrl)
|
||||
this.subNvue = uni.getSubNVueById('subNvue'); //获取
|
||||
this.subNvue.show() // 显示
|
||||
let data = {
|
||||
|
@ -49,19 +49,44 @@
|
|||
scene: 'app',
|
||||
}
|
||||
this.openScoket(data)
|
||||
this.canplay(option.device)
|
||||
this.platform = uni.getSystemInfoSync().platform
|
||||
this.windowWidth = uni.getSystemInfoSync().screenWidth //获取屏幕宽度
|
||||
this.boxStyle.width = this.windowWidth + 'px' //给宽度加px
|
||||
this.wHeight = uni.getSystemInfoSync().screenHeight; //获取屏幕高度
|
||||
this.boxStyle.height = this.wHeight; //改变视频高度
|
||||
|
||||
this.initFailTimer = setTimeout(() => {
|
||||
if (this.flag) {
|
||||
uni.$u.toast("初始化失败,请重新进入")
|
||||
setTimeout(() => {
|
||||
this.shwovideo = true
|
||||
console.log("showvideo")
|
||||
}, 2000)
|
||||
uni.navigateBack()
|
||||
}, 1000)
|
||||
}
|
||||
}, 60000)
|
||||
},
|
||||
|
||||
methods: {
|
||||
canplay(id) {
|
||||
let that = this
|
||||
this.shwovideoTimer = setInterval(() => {
|
||||
uni.request({
|
||||
url: `http://rtsp.lihaink.cn/index/api/getMediaInfo?secret=YwDtp2llj80HA19JhMXL4Po99nsMAyNT&schema=rtsp&vhost=__defaultVhost__&app=live&stream=lihai_lot_walnutpi_dev_${id}`, //仅为示例,并非真实接口地址。
|
||||
success: (res) => {
|
||||
console.log("res", res.data.code);
|
||||
if (res.data.code == 0) {
|
||||
that.shwovideo = true
|
||||
clearInterval(this.shwovideoTimer)
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
console.log(err, "err")
|
||||
}
|
||||
});
|
||||
|
||||
}, 2500)
|
||||
|
||||
},
|
||||
|
||||
replaceLastThreeChars(str, replacement) {
|
||||
if (str.length < 3) {
|
||||
return replacement + str;
|
||||
|
@ -90,9 +115,7 @@
|
|||
// 接收图片的base64编码
|
||||
receiveImg(data) {
|
||||
this.imgSrc = (data.test)
|
||||
|
||||
console.log(this.imgSrc)
|
||||
console.log(this.deviceId)
|
||||
videoCover({
|
||||
device_id: this.deviceId,
|
||||
image: this.imgSrc
|
||||
|
@ -115,19 +138,13 @@
|
|||
url: 'wss://iot.lihaink.cn/test'
|
||||
});
|
||||
uni.onSocketOpen(function(res) {
|
||||
console.log("scoket打开")
|
||||
|
||||
uni.sendSocketMessage({
|
||||
data: JSON.stringify(scoketData)
|
||||
|
||||
});
|
||||
|
||||
uni.onSocketMessage(function(res) {
|
||||
console.log(res);
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
||||
uni.onSocketError(function(res) {
|
||||
console.log('WebSocket连接打开失败,请检查!');
|
||||
|
@ -138,8 +155,8 @@
|
|||
},
|
||||
playVedio() {
|
||||
this.subNvue.hide()
|
||||
this.flag = false
|
||||
uni.createVideoContext('video', this).requestFullScreen();
|
||||
|
||||
setTimeout(() => {
|
||||
this.setUrl(this.videoUrl)
|
||||
}, 2000)
|
||||
|
@ -159,6 +176,8 @@
|
|||
,
|
||||
onUnload() {
|
||||
uni.closeSocket();
|
||||
clearTimeout(this.initFailTimer)
|
||||
clearInterval(this.shwovideoTimer)
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
<template>
|
||||
|
||||
<view class="" v-if="show">
|
||||
<video :controls="true" src="http://rtsp.lihaink.cn/live/lihai_lot_walnutpi_dev_5.live.mp4" :autoplay="true"
|
||||
id="video"></video>
|
||||
</view>
|
||||
<view class="">
|
||||
sdfsdf
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref
|
||||
} from "vue"
|
||||
const show = ref(false)
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
|
@ -2,7 +2,7 @@
|
|||
<view id="subNvue">
|
||||
<view class="" style="background-color: white;width: 750rpx;height:1000px;position: relative;">
|
||||
<view class="" style="margin-top: 350px;">
|
||||
<u-loading-icon mode="semicircle" text="瘋狂加载中..." textSize="18"></u-loading-icon>
|
||||
<u-loading-icon mode="semicircle" text="疯狂加载中..." textSize="18"></u-loading-icon>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
Promise.resolve("./pages/live/live.js").then((res) => {
|
||||
Promise.resolve("./pages/addLand/select_address_n.js").then((res) => {
|
||||
res.length;
|
||||
});
|
||||
Promise.resolve("./pages/addLand/select_address_n.js").then((res) => {
|
||||
Promise.resolve("./pages/live/loading.js").then((res) => {
|
||||
res.length;
|
||||
});
|
||||
Promise.resolve("./app.css.js").then(() => {
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<div id="app"></div>
|
||||
<script src="uni-app-view.umd.js"></script>
|
||||
|
||||
|
||||
<script src="app-renderjs.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -7,8 +7,8 @@
|
|||
"id": "__UNI__D087881",
|
||||
"name": "种植溯源",
|
||||
"version": {
|
||||
"name": "1.0.3",
|
||||
"code": 103
|
||||
"name": "1.0.4",
|
||||
"code": 104
|
||||
},
|
||||
"description": "",
|
||||
"developer": {
|
||||
|
|
Loading…
Reference in New Issue