|
@@ -0,0 +1,254 @@
|
|
|
|
+<template>
|
|
|
|
+ <view class="wrap">
|
|
|
|
+ <view class='title'>库点监控管理</view>
|
|
|
|
+ <view class="dropdown">
|
|
|
|
+ <view class="left">仓库名称</view>
|
|
|
|
+ <view class="right" @click='show1=true'>
|
|
|
|
+ <view>{{warehouseName}}</view>
|
|
|
|
+ <u-icon name="arrow-right" color=""></u-icon>
|
|
|
|
+ <u-picker @confirm="warehousechange" range-key='warehouseName' mode="selector" v-model="show1"
|
|
|
|
+ :range="warehouseList"></u-picker>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="content">
|
|
|
|
+ <view class='title'>监控视频</view>
|
|
|
|
+ <view class="video-list">
|
|
|
|
+ <view class="video-list-item" v-for="(item,index) in videoList" :key="index">
|
|
|
|
+ <view class="img-content" v-show="!item.isPlay">
|
|
|
|
+ <image class="img play" src="../../static/img/play-btn.png" mode="" @click="playVideo(item)"></image>
|
|
|
|
+ </view>
|
|
|
|
+ <iframe class='video-iframe' v-show="item.isPlay" :src="item.src" width="" height="" allowfullscreen="true"
|
|
|
|
+ webkitallowfullscreen="true" mozallowfullscreen="true"
|
|
|
|
+ allow="autoplay; fullscreen; microphone;"></iframe>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+</template>
|
|
|
|
+<script>
|
|
|
|
+ import {
|
|
|
|
+ mapState
|
|
|
|
+ } from 'vuex';
|
|
|
|
+
|
|
|
|
+ export default {
|
|
|
|
+ components: {
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ show1: false,
|
|
|
|
+ warehouseName: '',
|
|
|
|
+ warehouseList: [],
|
|
|
|
+ monitorUrl2:'',
|
|
|
|
+ videoList:[
|
|
|
|
+ {
|
|
|
|
+ src:'123',
|
|
|
|
+ isPlay:false
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ src:'123',
|
|
|
|
+ isPlay:false
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ src:'123',
|
|
|
|
+ isPlay:false
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ src:'123',
|
|
|
|
+ isPlay:false
|
|
|
|
+ },
|
|
|
|
+ ]
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ onLoad() {
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ // #ifndef MP
|
|
|
|
+ onNavigationBarButtonTap(e) {
|
|
|
|
+ const index = e.index;
|
|
|
|
+ if (index === 0) {
|
|
|
|
+ this.navTo('/pages/set/set');
|
|
|
|
+ } else if (index === 1) {
|
|
|
|
+ // #ifdef APP-PLUS
|
|
|
|
+ const pages = getCurrentPages();
|
|
|
|
+ const page = pages[pages.length - 1];
|
|
|
|
+ const currentWebview = page.$getAppWebview();
|
|
|
|
+ currentWebview.hideTitleNViewButtonRedDot({
|
|
|
|
+ index
|
|
|
|
+ });
|
|
|
|
+ // #endif
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: '/pages/notice/notice'
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // #endif
|
|
|
|
+ computed: {
|
|
|
|
+ ...mapState(['hasLogin', 'userInfo']),
|
|
|
|
+ },
|
|
|
|
+ onShow() {
|
|
|
|
+ this.$api.doRequest('get', '/commonUser/api/checkSession').then(res => {
|
|
|
|
+ console.log("checkSession", res)
|
|
|
|
+ if (res.data.data == "INVALID") {
|
|
|
|
+ uni.showModal({
|
|
|
|
+ title: '登录提示',
|
|
|
|
+ content: '当前登入信息验证失败,是否重新登录?',
|
|
|
|
+ showCancel: true,
|
|
|
|
+ confirmText: '登录',
|
|
|
|
+ success: (e) => {
|
|
|
|
+ if (e.confirm) {
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: '/pages/public/login'
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ fail: () => {},
|
|
|
|
+ complete: () => {}
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ this.$api.doRequest('get', '/openServiceInfo/selectCommonCompany', {
|
|
|
|
+ phone: this.userInfo.phone
|
|
|
|
+ }).then(res => {
|
|
|
|
+ if (res.data.code == 200) {
|
|
|
|
+ debugger
|
|
|
|
+ this.init(res.data.data[0].compId)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ console.log("hasLogin", this.hasLogin)
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ /**
|
|
|
|
+ * 统一跳转接口,拦截未登录路由
|
|
|
|
+ * navigator标签现在默认没有转场动画,所以用view
|
|
|
|
+ */
|
|
|
|
+ navTo(url) {
|
|
|
|
+ if (!this.hasLogin) {
|
|
|
|
+ url = '/pages/public/login';
|
|
|
|
+ }
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ init(compId) {
|
|
|
|
+ console.log(this.userInfo)
|
|
|
|
+ this.$api.doRequest('get', '/warehouseBaseInfo/selectWarehouseSelf', {
|
|
|
|
+ compId: compId,
|
|
|
|
+ }).then(res => {
|
|
|
|
+ if (res.data.data.length != 0) {
|
|
|
|
+ console.log('res', res.data.data)
|
|
|
|
+ this.warehouseName = res.data.data[0].warehouseName
|
|
|
|
+ // let _showData = uni.getStorageSync("erpSelectWarehous")
|
|
|
|
+ // let _showCWData = uni.getStorageSync("erpSelectWarehousCW")
|
|
|
|
+ // this.allWarehouse = res.data.data
|
|
|
|
+ this.warehouseList = res.data.data;
|
|
|
|
+ // if (_showData) {
|
|
|
|
+ // this.warehouseName = _showData.warehouseName
|
|
|
|
+ // this.compId = _showData.compId
|
|
|
|
+ // this.agent = _showData.agent
|
|
|
|
+ // this.binNumber = _showCWData.binNumber
|
|
|
|
+ // this.warehouseCWList = _showData.positionInfos
|
|
|
|
+ // this.warehouseId = _showData.id
|
|
|
|
+ // this.baseId = _showCWData.baseId
|
|
|
|
+ // this.positionId = _showCWData.id
|
|
|
|
+ // this.personCharge = _showData.personCharge
|
|
|
|
+ // } else {
|
|
|
|
+ // this.allWarehouse = res.data.data
|
|
|
|
+ // this.warehouseName = res.data.data[0].warehouseName
|
|
|
|
+ // this.warehouseList = res.data.data;
|
|
|
|
+ // this.compId = res.data.data[0].compId
|
|
|
|
+ // this.agent = res.data.data[0].agent
|
|
|
|
+ // this.binNumber = res.data.data[0].positionInfos[0].binNumber
|
|
|
|
+ // this.warehouseCWList = res.data.data[0].positionInfos
|
|
|
|
+ // this.warehouseId = res.data.data[0].id
|
|
|
|
+ // this.baseId = res.data.data[0].positionInfos[0].baseId
|
|
|
|
+ // this.positionId = res.data.data[0].positionInfos[0].id
|
|
|
|
+ // this.personCharge = res.data.data[0].personCharge
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ this.warehouseList = []
|
|
|
|
+ this.warehouseCWList = []
|
|
|
|
+ this.warehouseName = '暂无仓库'
|
|
|
|
+ this.binNumber = '暂无'
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ warehousechange(e) {
|
|
|
|
+ this.warehouseName = this.warehouseList[e[0]].warehouseName
|
|
|
|
+ console.log(this.warehouseName)
|
|
|
|
+ },
|
|
|
|
+ playVideo(item){
|
|
|
|
+ console.log(item)
|
|
|
|
+ item.isPlay = true
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+</script>
|
|
|
|
+<style lang='scss' scoped>
|
|
|
|
+ page {
|
|
|
|
+ background: #F5F6FA;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .wrap {
|
|
|
|
+ background: #fff;
|
|
|
|
+ margin: 10px;
|
|
|
|
+ border-radius: 10px;
|
|
|
|
+ padding: 10px;
|
|
|
|
+
|
|
|
|
+ .title {
|
|
|
|
+ font-size: 16px;
|
|
|
|
+ font-weight: 700;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .dropdown {
|
|
|
|
+ display: flex;
|
|
|
|
+ margin: 20rpx 0;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ /* border-bottom: 1px solid #EEEEEE; */
|
|
|
|
+ padding-bottom: 20rpx;
|
|
|
|
+
|
|
|
|
+ .left,
|
|
|
|
+ .right {
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .video-list{
|
|
|
|
+ position: relative;
|
|
|
|
+ .video-list-item{
|
|
|
|
+ position: relative;
|
|
|
|
+ height: 400rpx;
|
|
|
|
+ margin: 20rpx 0;
|
|
|
|
+ .img-content{
|
|
|
|
+ position: relative;
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 400rpx;
|
|
|
|
+ background: green;
|
|
|
|
+ .play{
|
|
|
|
+ position: absolute;
|
|
|
|
+ width: 100rpx;
|
|
|
|
+ height: 100rpx;
|
|
|
|
+ top: 0;
|
|
|
|
+ bottom: 0;
|
|
|
|
+ left: 0;
|
|
|
|
+ right: 0;
|
|
|
|
+ margin: auto;
|
|
|
|
+ z-index: 3;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .img{
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ .video-iframe{
|
|
|
|
+ position: absolute;
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 100%;
|
|
|
|
+ z-index: 1;
|
|
|
|
+ border: 0;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+</style>
|