wx-program
pangdundun 2024-01-27 17:51:50 +08:00
parent 55bf3e4e1a
commit acb91f7eda
4 changed files with 46 additions and 47 deletions

View File

@ -11,8 +11,9 @@
</view>
<view class="video" >
<video v-if="item.ezopen" style="width: 100%;height: 100%;border-radius: 8rpx;" :src="item.ezopen" :controls='false' :autoplay='false' :show-play-btn='false' :show-center-play-btn='false' object-fit='fill' :is-live='true'></video>
<image v-else src="../../static/video1.png" mode=""></image>
<!-- <video v-if="item.ezopen" style="width: 100%;height: 100%;border-radius: 8rpx;" :src="item.ezopen" :controls='false' :autoplay='false' :show-play-btn='false' :show-center-play-btn='false' object-fit='fill' :is-live='true'></video>
<image v-else src="../../static/video1.png" mode=""></image> -->
<image :src="item.hls" mode="" style="border-radius: 8rpx;"></image>
</view>
<view class="timer">
<view class="left">
@ -78,26 +79,26 @@
uni.hideLoading()
uni.stopPullDownRefresh();
this.deviceList = res.data;
this.deviceList = this.deviceList.map(el=>{
return {
...el,
ezopen:''
}
})
this.deviceList.forEach(el=>{
this.$http({
url: this.api.camera_getphonehls,
method: 'GET',
data: {
cameraid: el.cameraSerialNumber,
channelid: el.cameraChannelNumber,
}
}).then(res => {
if (res.code == 200) {
el.ezopen = res.data.ezopen
}
})
})
// this.deviceList = this.deviceList.map(el=>{
// return {
// ...el,
// ezopen:''
// }
// })
// this.deviceList.forEach(el=>{
// this.$http({
// url: this.api.camera_getphonehls,
// method: 'GET',
// data: {
// cameraid: el.cameraSerialNumber,
// channelid: el.cameraChannelNumber,
// }
// }).then(res => {
// if (res.code == 200) {
// el.ezopen = res.data.ezopen
// }
// })
// })
// console.log(this.deviceList,'0000');
} else {
this.$refs.uToast.show({

File diff suppressed because one or more lines are too long

View File

@ -160,14 +160,11 @@ __webpack_require__.r(__webpack_exports__);
"use strict";
/* WEBPACK VAR INJECTION */(function(uni) {
var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
//
//
//
//
@ -246,25 +243,26 @@ var _default = {
uni.hideLoading();
uni.stopPullDownRefresh();
_this2.deviceList = res.data;
_this2.deviceList = _this2.deviceList.map(function (el) {
return _objectSpread(_objectSpread({}, el), {}, {
ezopen: ''
});
});
_this2.deviceList.forEach(function (el) {
_this2.$http({
url: _this2.api.camera_getphonehls,
method: 'GET',
data: {
cameraid: el.cameraSerialNumber,
channelid: el.cameraChannelNumber
}
}).then(function (res) {
if (res.code == 200) {
el.ezopen = res.data.ezopen;
}
});
});
// this.deviceList = this.deviceList.map(el=>{
// return {
// ...el,
// ezopen:''
// }
// })
// this.deviceList.forEach(el=>{
// this.$http({
// url: this.api.camera_getphonehls,
// method: 'GET',
// data: {
// cameraid: el.cameraSerialNumber,
// channelid: el.cameraChannelNumber,
// }
// }).then(res => {
// if (res.code == 200) {
// el.ezopen = res.data.ezopen
// }
// })
// })
// console.log(this.deviceList,'0000');
} else {
_this2.$refs.uToast.show({

View File

@ -1 +1 @@
<view class="timeVideo data-v-dd7dcdb8"><u-navbar vue-id="d23ae73c-1" background="{{background}}" is-back="{{true}}" back-icon-color="#FFFFFF" border-bottom="{{false}}" title="实时视频" title-color="#FFFFFF" title-bold="{{true}}" title-size="32" class="data-v-dd7dcdb8" bind:__l="__l"></u-navbar><view class="content data-v-dd7dcdb8"><block wx:for="{{deviceList}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view class="item data-v-dd7dcdb8"><view class="nav data-v-dd7dcdb8"><image src="../../static/video.png" mode class="data-v-dd7dcdb8"></image><text class="data-v-dd7dcdb8">{{item.deviceTypeName+"-摄像机#2"}}</text></view><view class="video data-v-dd7dcdb8"><block wx:if="{{item.ezopen}}"><video style="width:100%;height:100%;border-radius:8rpx;" src="{{item.ezopen}}" controls="{{false}}" autoplay="{{false}}" show-play-btn="{{false}}" show-center-play-btn="{{false}}" object-fit="fill" is-live="{{true}}" class="data-v-dd7dcdb8"></video></block><block wx:else><image src="../../static/video1.png" mode class="data-v-dd7dcdb8"></image></block></view><view class="timer data-v-dd7dcdb8"><view class="left data-v-dd7dcdb8"><image src="../../static/timer.png" mode class="data-v-dd7dcdb8"></image><text class="data-v-dd7dcdb8">{{time}}</text></view><view data-event-opts="{{[['tap',[['toVideoLive',['$0','$1'],[[['deviceList','',index,'cameraSerialNumber']],[['deviceList','',index,'cameraChannelNumber']]]]]]]}}" class="right data-v-dd7dcdb8" bindtap="__e"><image src="../../static/play.png" mode class="data-v-dd7dcdb8"></image><text class="data-v-dd7dcdb8">现场实况</text></view></view></view></block></view></view>
<view class="timeVideo data-v-dd7dcdb8"><u-navbar vue-id="d23ae73c-1" background="{{background}}" is-back="{{true}}" back-icon-color="#FFFFFF" border-bottom="{{false}}" title="实时视频" title-color="#FFFFFF" title-bold="{{true}}" title-size="32" class="data-v-dd7dcdb8" bind:__l="__l"></u-navbar><view class="content data-v-dd7dcdb8"><block wx:for="{{deviceList}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view class="item data-v-dd7dcdb8"><view class="nav data-v-dd7dcdb8"><image src="../../static/video.png" mode class="data-v-dd7dcdb8"></image><text class="data-v-dd7dcdb8">{{item.deviceTypeName+"-摄像机#2"}}</text></view><view class="video data-v-dd7dcdb8"><image style="border-radius:8rpx;" src="{{item.hls}}" mode class="data-v-dd7dcdb8"></image></view><view class="timer data-v-dd7dcdb8"><view class="left data-v-dd7dcdb8"><image src="../../static/timer.png" mode class="data-v-dd7dcdb8"></image><text class="data-v-dd7dcdb8">{{time}}</text></view><view data-event-opts="{{[['tap',[['toVideoLive',['$0','$1'],[[['deviceList','',index,'cameraSerialNumber']],[['deviceList','',index,'cameraChannelNumber']]]]]]]}}" class="right data-v-dd7dcdb8" bindtap="__e"><image src="../../static/play.png" mode class="data-v-dd7dcdb8"></image><text class="data-v-dd7dcdb8">现场实况</text></view></view></view></block></view></view>