fix(物联网): 通道列表添加为空状态
This commit is contained in:
parent
a1f0f0db02
commit
ae550f1941
|
@ -1,9 +1,10 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="webview-box">
|
<view class="webview-box">
|
||||||
<view class="loading-box">
|
<view v-if="!isChanneShow" class="loading-box">
|
||||||
<u-loading size="100" :show="true"></u-loading>
|
<u-loading size="100" :show="true"></u-loading>
|
||||||
<view>加载中。。。</view>
|
<view>加载中。。。</view>
|
||||||
</view>
|
</view>
|
||||||
|
<u-empty v-if="isChanneShow" text="视频通道为空" mode="list"></u-empty>
|
||||||
<web-view v-if="isWebview" :src="webviewUrl"></web-view>
|
<web-view v-if="isWebview" :src="webviewUrl"></web-view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
@ -16,7 +17,8 @@
|
||||||
deviceObj:null,
|
deviceObj:null,
|
||||||
channeList:[],
|
channeList:[],
|
||||||
webviewHost:'',
|
webviewHost:'',
|
||||||
webviewUrl:''
|
webviewUrl:'',
|
||||||
|
isChanneShow:false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
|
@ -24,6 +26,7 @@
|
||||||
let configIndex = uni.getStorageSync('configIndex');
|
let configIndex = uni.getStorageSync('configIndex');
|
||||||
this.webviewHost = configList[configIndex].protocol + configList[configIndex].address;
|
this.webviewHost = configList[configIndex].protocol + configList[configIndex].address;
|
||||||
this.webviewUrl = configList[configIndex].protocol + configList[configIndex].address + '/video/web/h5/index.html';
|
this.webviewUrl = configList[configIndex].protocol + configList[configIndex].address + '/video/web/h5/index.html';
|
||||||
|
// this.webviewUrl = 'http://192.168.31.39:5501/index.html'
|
||||||
console.log("option",option)
|
console.log("option",option)
|
||||||
let deviceObj = JSON.parse(decodeURIComponent(option.deviceObj));
|
let deviceObj = JSON.parse(decodeURIComponent(option.deviceObj));
|
||||||
this.deviceObj = deviceObj;
|
this.deviceObj = deviceObj;
|
||||||
|
@ -34,6 +37,7 @@
|
||||||
console.log("id",id)
|
console.log("id",id)
|
||||||
this.$api.videoApi.getVideoChannelList({pid: id,page:1,pageSize:999}).then(res => {
|
this.$api.videoApi.getVideoChannelList({pid: id,page:1,pageSize:999}).then(res => {
|
||||||
if(res.code == 0){
|
if(res.code == 0){
|
||||||
|
// res.data.list = null;
|
||||||
if(res.data.list && res.data.list.length>0){
|
if(res.data.list && res.data.list.length>0){
|
||||||
let channeList = res.data.list||[];
|
let channeList = res.data.list||[];
|
||||||
// let arr = channeList.map(item=>{
|
// let arr = channeList.map(item=>{
|
||||||
|
@ -46,10 +50,12 @@
|
||||||
this.$nextTick(()=>{
|
this.$nextTick(()=>{
|
||||||
this.$set(this,'channeList',res.data.list);
|
this.$set(this,'channeList',res.data.list);
|
||||||
let url = this.webviewHost + '/video/web/h5/index.html?deviceObj=' + encodeURIComponent(JSON.stringify(this.deviceObj)) + '&channeList='+encodeURIComponent(JSON.stringify(channeList))
|
let url = this.webviewHost + '/video/web/h5/index.html?deviceObj=' + encodeURIComponent(JSON.stringify(this.deviceObj)) + '&channeList='+encodeURIComponent(JSON.stringify(channeList))
|
||||||
|
// let url = 'http://192.168.31.39:5501/index.html?deviceObj=' + encodeURIComponent(JSON.stringify(this.deviceObj)) + '&channeList='+encodeURIComponent(JSON.stringify(channeList))
|
||||||
this.$set(this,'webviewUrl',url);
|
this.$set(this,'webviewUrl',url);
|
||||||
this.isWebview = true;
|
this.isWebview = true;
|
||||||
})
|
})
|
||||||
}else{
|
}else{
|
||||||
|
this.isChanneShow = true;
|
||||||
this.$u.toast('通道为空');
|
this.$u.toast('通道为空');
|
||||||
this.$nextTick(()=>{
|
this.$nextTick(()=>{
|
||||||
this.$set(this,'channeList',[])
|
this.$set(this,'channeList',[])
|
||||||
|
|
Loading…
Reference in New Issue