123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258 |
- <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 no-content" v-if="warehouseName!='山东诸城迈饶库'">暂无视频</view>
- <view class="content" v-if="warehouseName=='山东诸城迈饶库'">
- <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() {debugger
- 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;
- }
- }
- }
- .no-content{
- text-align: center;
- }
- </style>
|