wx-program
sunmeng 2024-11-07 11:26:22 +08:00
parent 9a5a3658f4
commit 4a4eba81bf
3 changed files with 72 additions and 1 deletions

View File

@ -131,6 +131,13 @@
"navigationStyle": "custom",
"enablePullDownRefresh": true
}
},
{
"path" : "pages/videoLive/video-webView",
"style" :
{
"navigationBarTitleText" : ""
}
}
],
"globalStyle": {

View File

@ -163,7 +163,7 @@
toVideoLive(cameraSerialNumber,cameraChannelNumber) {
if(cameraSerialNumber && cameraChannelNumber){
uni.navigateTo({
url: '/pages/videoLive/videoLive?cameraSerialNumber=' + cameraSerialNumber + '&cameraChannelNumber=' + cameraChannelNumber
url: '/pages/videoLive/video-webView?cameraSerialNumber=' + cameraSerialNumber + '&cameraChannelNumber=' + cameraChannelNumber
})
}else{
uni.showToast({

View File

@ -0,0 +1,64 @@
<template>
<view class="videoLive">
<web-view v-if='src' :src="src"></web-view>
</view>
</template>
<script>
export default {
data() {
return {
token:'',
id:'',
src:'',
userid:'',
deviceId:'',
cameraSerialNumber :'',
cameraChannelNumber:'',
}
},
onLoad(options) {
if(options){
this.cameraSerialNumber = options.cameraSerialNumber;
this.cameraChannelNumber = options.cameraChannelNumber
}
let that = this
uni.getStorage({
key: 'token',
success: function(res) {
// console.log('res',res);
that.token = res.data;
uni.getStorage({
key:'userid',
success:function(res){
that.userid = res.data
// that.src = `https://portal.lihe-control.com/#/irrigateSet?id=${that.id}&token=${that.token}&userid=${that.userid}&deviceId=${that.deviceId}`
that.src = `https://portal.lihe-control.com/#/videoLive?cameraSerialNumber=${that.cameraSerialNumber}&token=${that.token}&userid=${that.userid}&cameraChannelNumber=${that.cameraChannelNumber}`
console.log(that.src,11);
}
})
},
fail:function(err){
uni.navigateTo({
url:'/pages/timeVideo/timeVideo'
});
uni.showToast({
title: "跳转失败!",
icon: 'fail',
})
}
})
},
methods: {
}
}
</script>
<style>
.videoLive{
width: 100%;
min-height: 100vh;
background-color: #F5F6FA;
}
</style>