123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287 |
- <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=" cu-list grid col-3 no-border">
- <view class="cu-item" style='text-align:center;' v-for="(item,index) in videoList"
- @click="gridClick(item)">
- <view style='height:40px;'>{{item.Name}}</view>
-
- <view v-if="item.Status == 'ON'">
- <image v-if="item.SnapURL" :src="'https://live.eliangeyun.com'+item.SnapURL" class="sign1">
- </image>
- </view>
- <view v-if="item.Status=='OFF'" style="background-color: #008000;margin:0 auto;" class="sign1">
- <image src="../../static/img/play-btn.png"
- style="width: 80rpx;height: 80rpx;margin-top: 40rpx;"></image>
- </view>
- </view>
- </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>
- <u-modal v-model="isShowAlert" :title-style="{fontSize: '18px',fontWeight:'500'}"
- :content-style="{fontSize: '14px',fontWeight:'400'}" confirm-color='#22C572' confirm-text='确定' title='提示'
- :showCancelButton='false' :content="content" @confirm="alertBtn" @cancel="cancelClick"></u-modal>
- </view>
- </template>
- <script>
- import {
- mapState
- } from 'vuex';
- export default {
- components: {
- },
- data() {
- return {
- isShowAlert: false,
- content: '您尚未登录,是否立即登录?',
- show1: false,
- warehouseName: '',
- warehouseList: [],
- monitorUrl2: '',
- videoList: []
- }
- },
- 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() {
- let companyName = uni.getStorageSync('compName1').company;
- console.log(companyName)
- if(companyName == '黑龙江中天昊元贸易有限公司'||companyName == '吉林昊友城元粮食贸易有限公司'){
- this.$api.doRequest('get', '/commonUser/api/checkSession').then(res => {
- console.log("checkSession", res)
- if (res.data.data == "INVALID") {
- this.isShowAlert = true;
- // uni.showModal({
- // title: '提示',
- // content: '当前登入信息验证失败,是否重新登录?',
- // showCancel: true,
- // confirmText: '登录',
- // success: (e) => {
- // if (e.confirm) {
- // uni.navigateTo({
- // url: '/pages/public/login'
- // })
- // }
- // },
- // fail: () => {},
- // complete: () => {}
- // })
- }
- })
- var that = this
- uni.request({
- url: 'https://live.eliangeyun.com/api/v1/device/channellist',
- method: 'GET',
- success: (res) => {
- if (res.statusCode === 200) {
- that.videoList = res.data.ChannelList
- }
- },
- fail: (res) => {
- console.log("fail::", res)
- }
- })
- this.$api.doRequest('get', '/openServiceInfo/selectCommonCompany', {
- phone: this.userInfo.phone
- }).then(res => {
- if (res.data.code == 200) {
- 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
- })
- },
- alertBtn() {
- uni.navigateTo({
- url: '/pages/public/login'
- })
- },
- cancelClick() {
- this.isShowAlert = false
- },
- init(compId) {
- console.log(this.userInfo)
- this.$api.doRequest('get', '/warehouseBaseInfo/selectWarehouseSelfApp', {
- 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("depotMonitoring")
- this.warehouseList = res.data.data;
- if (_showData) {
- this.warehouseName = _showData.warehouseName
- } else {
- this.warehouseName = res.data.data[0].warehouseName
- }
- } else {
- this.warehouseList = []
- this.warehouseName = '暂无仓库'
- }
- })
- },
- warehousechange(e) {
- this.warehouseName = this.warehouseList[e[0]].warehouseName
- console.log(this.warehouseName)
- uni.setStorageSync("depotMonitoring", this.warehouseList[e[0]])
- },
- gridClick(item) {
- var param = "https://live.eliangeyun.com/play.html?serial=" + item.DeviceID + "&code=" + item.ID +
- "&aspect=fullscreen"
- uni.setStorageSync("mintor", param)
- uni.navigateTo({
- url: '/pages/user/mintor'
- })
- console.log("param", param)
- }
- }
- }
- </script>
- <style lang='scss' scoped>
- page {
- background: #F5F6FA;
- }
- .cu-list>.cu-item:after {
- border: none;
- }
- .sign {
- width: 35px;
- height: 35px;
- top: 4px;
- }
- .sign1 {
- width: 76px;
- height: 76px;
- top: 4px;
- }
- .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>
|