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