Browse Source

修改记忆上一次选择

wangchao 3 years ago
parent
commit
3cadc23f31
1 changed files with 57 additions and 80 deletions
  1. 57 80
      pages/user/depotMonitoring.vue

+ 57 - 80
pages/user/depotMonitoring.vue

@@ -14,24 +14,26 @@
 		<view class="content" v-if="warehouseName=='山东诸城迈饶库'">
 		<view class="content" v-if="warehouseName=='山东诸城迈饶库'">
 			<view class='title'>监控视频</view>
 			<view class='title'>监控视频</view>
 			<view class="video-list">
 			<view class="video-list">
-					<view  class=" cu-list grid col-4 no-border">
-						<view class="cu-item" style='text-align:center;' v-for="(item,index) in videoList" 
-							@click="gridClick(item)"  >
-							<view v-if="item.Status == 'ON'">
-								<image v-if="item.SnapURL" :src="'https://live.eliangeyun.com'+item.SnapURL" class="sign1"></image>
-								<view v-else style="background-color: #008000;" class="sign1">
-									<image  src="../../static/img/play-btn.png" style="width: 80rpx;height: 80rpx;margin-top: 40rpx;"  ></image>
-								</view>
+				<view class=" cu-list grid col-4 no-border">
+					<view class="cu-item" style='text-align:center;' v-for="(item,index) in videoList"
+						@click="gridClick(item)">
+						<view v-if="item.Status == 'ON'">
+							<image v-if="item.SnapURL" :src="'https://live.eliangeyun.com'+item.SnapURL" class="sign1">
+							</image>
+							<view v-else style="background-color: #008000;" class="sign1">
+								<image src="../../static/img/play-btn.png"
+									style="width: 80rpx;height: 80rpx;margin-top: 40rpx;"></image>
 							</view>
 							</view>
 						</view>
 						</view>
 					</view>
 					</view>
-					<!-- <iframe class='video-iframe' v-show="item.isPlay"  :src="item.src" width="" height="" allowfullscreen="true"
+				</view>
+				<!-- <iframe class='video-iframe' v-show="item.isPlay"  :src="item.src" width="" height="" allowfullscreen="true"
 						webkitallowfullscreen="true" mozallowfullscreen="true"
 						webkitallowfullscreen="true" mozallowfullscreen="true"
 						allow="autoplay; fullscreen; microphone;"></iframe> -->
 						allow="autoplay; fullscreen; microphone;"></iframe> -->
-				</view>
 			</view>
 			</view>
 		</view>
 		</view>
 	</view>
 	</view>
+	</view>
 </template>
 </template>
 <script>
 <script>
 	import {
 	import {
@@ -47,25 +49,8 @@
 				show1: false,
 				show1: false,
 				warehouseName: '',
 				warehouseName: '',
 				warehouseList: [],
 				warehouseList: [],
-				monitorUrl2:'',
-				videoList:[
-					{
-					src:'123',
-					isPlay:false
-				},
-				{
-					src:'123',
-					isPlay:false
-				},
-				{
-					src:'123',
-					isPlay:false
-				},
-				{
-					src:'123',
-					isPlay:false
-				},
-				]
+				monitorUrl2: '',
+				videoList: []
 			}
 			}
 		},
 		},
 
 
@@ -95,7 +80,8 @@
 		computed: {
 		computed: {
 			...mapState(['hasLogin', 'userInfo']),
 			...mapState(['hasLogin', 'userInfo']),
 		},
 		},
-		onShow() {debugger
+		onShow() {
+			debugger
 			this.$api.doRequest('get', '/commonUser/api/checkSession').then(res => {
 			this.$api.doRequest('get', '/commonUser/api/checkSession').then(res => {
 				console.log("checkSession", res)
 				console.log("checkSession", res)
 				if (res.data.data == "INVALID") {
 				if (res.data.data == "INVALID") {
@@ -118,15 +104,15 @@
 			})
 			})
 			var that = this
 			var that = this
 			uni.request({
 			uni.request({
-			    url:  'https://live.eliangeyun.com/api/v1/device/channellist',
-			    method: 'GET',
-			    success: (res) => {		
-			    	if (res.statusCode === 200) {
+				url: 'https://live.eliangeyun.com/api/v1/device/channellist',
+				method: 'GET',
+				success: (res) => {
+					if (res.statusCode === 200) {
 						that.videoList = res.data.ChannelList
 						that.videoList = res.data.ChannelList
-			    	}
-			    },
-				fail:(res)=> {
-					console.log("fail::",res)
+					}
+				},
+				fail: (res) => {
+					console.log("fail::", res)
 				}
 				}
 			})
 			})
 			this.$api.doRequest('get', '/openServiceInfo/selectCommonCompany', {
 			this.$api.doRequest('get', '/openServiceInfo/selectCommonCompany', {
@@ -159,33 +145,16 @@
 					if (res.data.data.length != 0) {
 					if (res.data.data.length != 0) {
 						console.log('res', res.data.data)
 						console.log('res', res.data.data)
 						this.warehouseName = res.data.data[0].warehouseName
 						this.warehouseName = res.data.data[0].warehouseName
-						// 			let _showData = uni.getStorageSync("erpSelectWarehous")
+						let _showData = uni.getStorageSync("depotMonitoring")
 						// 			let _showCWData = uni.getStorageSync("erpSelectWarehousCW")
 						// 			let _showCWData = uni.getStorageSync("erpSelectWarehousCW")
 						// 			this.allWarehouse = res.data.data
 						// 			this.allWarehouse = res.data.data
 						this.warehouseList = 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
-						// 			}
+						if (_showData) {
+							this.warehouseName = _showData.warehouseName
+						} else {
+							this.warehouseName = res.data.data[0].warehouseName
+							this.warehouseList = res.data.data;
+						}
 
 
 					} else {
 					} else {
 						this.warehouseList = []
 						this.warehouseList = []
@@ -194,19 +163,21 @@
 						this.binNumber = '暂无'
 						this.binNumber = '暂无'
 					}
 					}
 				})
 				})
-				
+
 			},
 			},
 			warehousechange(e) {
 			warehousechange(e) {
 				this.warehouseName = this.warehouseList[e[0]].warehouseName
 				this.warehouseName = this.warehouseList[e[0]].warehouseName
 				console.log(this.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)
+			gridClick(item) {
+				var param = "https://live.eliangeyun.com/play.html?serial=" + item.DeviceID + "&code=" + item.ID +
+					"&aspect=fullscreen"
+				uni.setStorageSync("mintor", param)
 				uni.navigateTo({
 				uni.navigateTo({
-					url:'/pages/user/mintor'
+					url: '/pages/user/mintor'
 				})
 				})
-				console.log("param",param)
+				console.log("param", param)
 			}
 			}
 		}
 		}
 	}
 	}
@@ -215,22 +186,23 @@
 	page {
 	page {
 		background: #F5F6FA;
 		background: #F5F6FA;
 	}
 	}
-	
+
 	.cu-list>.cu-item:after {
 	.cu-list>.cu-item:after {
 		border: none;
 		border: none;
 	}
 	}
-	
+
 	.sign {
 	.sign {
 		width: 35px;
 		width: 35px;
 		height: 35px;
 		height: 35px;
 		top: 4px;
 		top: 4px;
 	}
 	}
-	
+
 	.sign1 {
 	.sign1 {
 		width: 76px;
 		width: 76px;
 		height: 76px;
 		height: 76px;
 		top: 4px;
 		top: 4px;
 	}
 	}
+
 	.wrap {
 	.wrap {
 		background: #fff;
 		background: #fff;
 		margin: 10px;
 		margin: 10px;
@@ -256,18 +228,22 @@
 			}
 			}
 		}
 		}
 	}
 	}
-	.video-list{
+
+	.video-list {
 		position: relative;
 		position: relative;
-		.video-list-item{
+
+		.video-list-item {
 			position: relative;
 			position: relative;
 			height: 400rpx;
 			height: 400rpx;
 			margin: 20rpx 0;
 			margin: 20rpx 0;
-			.img-content{
+
+			.img-content {
 				position: relative;
 				position: relative;
 				width: 100%;
 				width: 100%;
 				height: 400rpx;
 				height: 400rpx;
 				background: green;
 				background: green;
-				.play{
+
+				.play {
 					position: absolute;
 					position: absolute;
 					width: 100rpx;
 					width: 100rpx;
 					height: 100rpx;
 					height: 100rpx;
@@ -279,10 +255,10 @@
 					z-index: 3;
 					z-index: 3;
 				}
 				}
 			}
 			}
-			.img{
-				
-			}
-			.video-iframe{
+
+			.img {}
+
+			.video-iframe {
 				position: absolute;
 				position: absolute;
 				width: 100%;
 				width: 100%;
 				height: 100%;
 				height: 100%;
@@ -291,7 +267,8 @@
 			}
 			}
 		}
 		}
 	}
 	}
-	.no-content{
+
+	.no-content {
 		text-align: center;
 		text-align: center;
 	}
 	}
 </style>
 </style>