Browse Source

权限 验证码倒计时

ming 4 years ago
parent
commit
a2f9b3d518

+ 8 - 8
common/common.scss

@@ -3,14 +3,14 @@ body {
 	font-size: 32rpx;
 }
 
-*:not(input) {
-    -webkit-touch-callout: none;
-    -webkit-user-select: none;
-    -khtml-user-select: none;
-    -moz-user-select: none;
-    -ms-user-select: none;
-    user-select: none;
-}
+// *:not(input) {
+//     -webkit-touch-callout: none;
+//     -webkit-user-select: none;
+//     -khtml-user-select: none;
+//     -moz-user-select: none;
+//     -ms-user-select: none;
+//     user-select: none;
+// }
 
 radio,checkbox {
 			transform: scale(0.7)

+ 11 - 4
components/list-test/list-test.vue

@@ -7,10 +7,10 @@
 				<view class="search-form round bg-white">
 					<text class="cuIcon-search"></text>
 					<input class="" @focus="InputFocus" @blur="InputBlur" :adjust-position="false" type="text" placeholder="请输入站点名称"
-					 confirm-type="search" v-model="bindModel"></input>
+					 confirm-type="search" v-model="nowSiteName"></input>
 				</view>
 				<view class="action">
-					<button class="cu-btn bg-blue round">查询</button>
+					<button class="cu-btn bg-blue round" @click="searchData">查询</button>
 				</view>
 			</view>
 		</view>
@@ -87,7 +87,7 @@
 				type:String,
 				default: ''
 			},
-			bindModel:{
+			bindSiteName:{
 				type:String,
 				default: ''
 			}
@@ -101,7 +101,7 @@
 				nowIcon:this.bindIcon,
 				nowNum:this.bindNum,
 				nowType:this.bindType,
-				nowModal:this.bindModel,
+				nowSiteName:this.bindSiteName,
 				
 			};
 		},
@@ -133,6 +133,13 @@
 		},
 		methods:{
 			
+			searchData(){
+				// console.log("a: "+val, oldVal);
+				this.$parent.getDataList({
+					"siteName":this.nowSiteName
+				})
+			},
+			
 			
 			// 隐藏显示
 			showDetail(e) {

+ 150 - 150
data/json.js

@@ -1,8 +1,8 @@
 // 本地模拟json数据
 let siteListData = [{
 		"id": 1,
-		"siteName": '测试站点一',
-		
+		"siteName": '测试站点一',
+
 	},
 	{
 		"id": 2,
@@ -14,8 +14,8 @@ let siteListData = [{
 	},
 	{
 		"id": 4,
-		"siteName": '测试站点四',
-		"iconUrl":"../../static/site-icon-alarm.png",
+		"siteName": '测试站点四',
+		"iconUrl": "../../static/site-icon-alarm.png",
 	},
 	{
 		"id": 5,
@@ -52,160 +52,160 @@ let siteListData = [{
 ];
 // 本地模拟json数据
 let cuIconList = [{
-		imgUrl: '../../static/square1.png',
-		badge: 120,
-		name: '综合报警',
-		redirectUrl: '/pages/siteList/siteList?type=1'
+	imgUrl: '../../static/square1.png',
+	badge: 120,
+	name: '综合报警',
+	redirectUrl: '/pages/siteList/siteList?type=1'
+}, {
+	imgUrl: '../../static/square2.png',
+	badge: 100,
+	name: '运行监测',
+	redirectUrl: '/pages/siteList/siteList?type=2'
+}, {
+	imgUrl: '../../static/square-wb.png',
+	badge: 0,
+	name: '维保',
+	redirectUrl: ''
+}, {
+	imgUrl: '../../static/square-bx.png',
+	badge: 0,
+	name: '报修',
+	redirectUrl: ''
+}, {
+	imgUrl: '../../static/square-rl.png',
+	badge: 0,
+	name: '人脸识别',
+	redirectUrl: ''
+}, {
+	imgUrl: '../../static/square-xj.png',
+	badge: 0,
+	badge: 0,
+	name: '巡检',
+	redirectUrl: ''
+}, {
+	imgUrl: '../../static/square-bz.png',
+	badge: 0,
+	badge: 0,
+	name: '风险保障',
+	redirectUrl: ''
+}];
+let unprocessList = [{
+		title: '母线停电',
+		subTitle: '动作',
+		status: '未处理',
+		time: '2020-01-08 15:15:12'
+	}, {
+		title: '母线停电2',
+		subTitle: '复归',
+		status: '未处理',
+		time: '2020-01-08 15:15:12'
+	}, {
+		title: '母线停电3',
+		subTitle: '动作',
+		status: '未处理',
+		time: '2020-01-08 15:15:12'
 	}, {
-		imgUrl: '../../static/square2.png',
-		badge: 100,
-		name: '运行监测',
-		redirectUrl: '/pages/siteList/siteList?type=2'
+		title: '母线停电4',
+		subTitle: '复归',
+		status: '未处理',
+		time: '2020-01-08 15:15:12'
+	}, {
+		title: '母线停电5',
+		subTitle: '复归',
+		status: '未处理',
+		time: '2020-01-08 15:15:12'
+	}, {
+		title: '母线停电6',
+		subTitle: '复归',
+		status: '未处理',
+		time: '2020-01-08 15:15:12'
+	},
+	{
+		title: '母线停电',
+		subTitle: '复归',
+		status: '未处理',
+		time: '2020-01-08 15:15:12'
+	},
+	{
+		title: '母线停电',
+		subTitle: '事件未处理测试',
+		status: '未处理',
+		time: '2020-01-08 15:15:12'
+	},
+	{
+		title: '母线停电',
+		subTitle: '事件未处理测试',
+		status: '未处理',
+		time: '2020-01-08 15:15:12'
+	},
+	{
+		title: '母线停电',
+		subTitle: '事件未处理测试',
+		status: '未处理',
+		time: '2020-01-08 15:15:12'
+	}
+];
+let processedList = [{
+		title: '母线停电',
+		subTitle: '事件已处理测试',
+		status: '已处理',
+		time: '2020-01-08 15:15:12'
 	}, {
-		imgUrl: '../../static/square-wb.png',
-		badge: 0,
-		name: '维保',
-		redirectUrl: ''
+		title: '母线停电2',
+		subTitle: '事件已处理测试',
+		status: '已处理',
+		time: '2020-01-08 15:15:12'
 	}, {
-		imgUrl: '../../static/square-bx.png',
-		badge: 0,
-		name: '报修',
-		redirectUrl: ''
+		title: '母线停电3',
+		subTitle: '事件已处理测试',
+		status: '已处理',
+		time: '2020-01-08 15:15:12'
 	}, {
-		imgUrl: '../../static/square-rl.png',
-		badge: 0,
-		name: '人脸识别',
-		redirectUrl: ''
+		title: '母线停电4',
+		subTitle: '事件已处理测试',
+		status: '已处理',
+		time: '2020-01-08 15:15:12'
 	}, {
-		imgUrl: '../../static/square-xj.png',
-		badge: 0,
-		badge: 0,
-		name: '巡检',
-		redirectUrl: ''
+		title: '母线停电5',
+		subTitle: '事件已处理测试',
+		status: '已处理',
+		time: '2020-01-08 15:15:12'
 	}, {
-		imgUrl: '../../static/square-bz.png',
-		badge: 0,
-		badge: 0,
-		name: '风险保障',
-		redirectUrl: ''
-	}];
-	let unprocessList = [{
-			title: '母线停电',
-			subTitle: '动作',
-			status: '未处理',
-			time: '2020-01-08 15:15:12'
-		}, {
-			title: '母线停电2',
-			subTitle: '复归',
-			status: '未处理',
-			time: '2020-01-08 15:15:12'
-		}, {
-			title: '母线停电3',
-			subTitle: '动作',
-			status: '未处理',
-			time: '2020-01-08 15:15:12'
-		}, {
-			title: '母线停电4',
-			subTitle: '复归',
-			status: '未处理',
-			time: '2020-01-08 15:15:12'
-		}, {
-			title: '母线停电5',
-			subTitle: '复归',
-			status: '未处理',
-			time: '2020-01-08 15:15:12'
-		}, {
-			title: '母线停电6',
-			subTitle: '复归',
-			status: '未处理',
-			time: '2020-01-08 15:15:12'
-		},
-		{
-			title: '母线停电',
-			subTitle: '复归',
-			status: '未处理',
-			time: '2020-01-08 15:15:12'
-		},
-		{
-			title: '母线停电',
-			subTitle: '事件未处理测试',
-			status: '未处理',
-			time: '2020-01-08 15:15:12'
-		},
-		{
-			title: '母线停电',
-			subTitle: '事件未处理测试',
-			status: '未处理',
-			time: '2020-01-08 15:15:12'
-		},
-		{
-			title: '母线停电',
-			subTitle: '事件未处理测试',
-			status: '未处理',
-			time: '2020-01-08 15:15:12'
-		}
-	];
-	let processedList=[{
-						title: '母线停电',
-						subTitle: '事件已处理测试',
-						status: '已处理',
-						time: '2020-01-08 15:15:12'
-					}, {
-						title: '母线停电2',
-						subTitle: '事件已处理测试',
-						status: '已处理',
-						time: '2020-01-08 15:15:12'
-					}, {
-						title: '母线停电3',
-						subTitle: '事件已处理测试',
-						status: '已处理',
-						time: '2020-01-08 15:15:12'
-					}, {
-						title: '母线停电4',
-						subTitle: '事件已处理测试',
-						status: '已处理',
-						time: '2020-01-08 15:15:12'
-					}, {
-						title: '母线停电5',
-						subTitle: '事件已处理测试',
-						status: '已处理',
-						time: '2020-01-08 15:15:12'
-					}, {
-						title: '母线停电6',
-						subTitle: '事件已处理测试',
-						status: '已处理',
-						time: '2020-01-08 15:15:12'
-					},
-					{
-						title: '母线停电',
-						subTitle: '事件已处理测试',
-						status: '已处理',
-						time: '2020-01-08 15:15:12'
-					},
-					{
-						title: '母线停电',
-						subTitle: '事件已处理测试',
-						status: '已处理',
-						time: '2020-01-08 15:15:12'
-					},
-					{
-						title: '母线停电',
-						subTitle: '事件已处理测试',
-						status: '已处理',
-						time: '2020-01-08 15:15:12'
-					},
-					{
-						title: '母线停电',
-						subTitle: '事件已处理测试',
-						status: '已处理',
-						time: '2020-01-08 15:15:12'
-					}
-				]
+		title: '母线停电6',
+		subTitle: '事件已处理测试',
+		status: '已处理',
+		time: '2020-01-08 15:15:12'
+	},
+	{
+		title: '母线停电',
+		subTitle: '事件已处理测试',
+		status: '已处理',
+		time: '2020-01-08 15:15:12'
+	},
+	{
+		title: '母线停电',
+		subTitle: '事件已处理测试',
+		status: '已处理',
+		time: '2020-01-08 15:15:12'
+	},
+	{
+		title: '母线停电',
+		subTitle: '事件已处理测试',
+		status: '已处理',
+		time: '2020-01-08 15:15:12'
+	},
+	{
+		title: '母线停电',
+		subTitle: '事件已处理测试',
+		status: '已处理',
+		time: '2020-01-08 15:15:12'
+	}
+]
 
 // 定义数据出口
 module.exports = {
 	siteListData: siteListData,
-	cuIconList: cuIconList,
-	unprocessList:unprocessList,
-	processedList:processedList
+	cuIconList: cuIconList,
+	unprocessList: unprocessList,
+	processedList: processedList
 }

+ 6 - 6
pages.json

@@ -357,12 +357,12 @@
 				"text": "首页"
 			},
 
-			{
-				"pagePath": "pages/info/info",
-				"iconPath": "static/info.png",
-				"selectedIconPath": "static/info-selected.png",
-				"text": "消息"
-			},
+			// {
+			// 	"pagePath": "pages/info/info",
+			// 	"iconPath": "static/info.png",
+			// 	"selectedIconPath": "static/info-selected.png",
+			// 	"text": "消息"
+			// },
 			{
 				"pagePath": "pages/analyse/analyse",
 				"iconPath": "static/analyse.png",

+ 1 - 1
pages/deviceAdd/deviceAdd.vue

@@ -91,7 +91,7 @@
 					<option value="-4">楼层B4</option>
 					<option value="-3">楼层B3</option>
 					<option value="-2">楼层B2</option>
-					<option value="-1">楼层B1</option>
+					<option value="-1">楼层B1</option>
 					<option :value=index+1 v-for="(item,index) in 60">楼层{{item}}</option>
 				</select>
 			</view>

+ 0 - 147
pages/deviceManage/deviceDetail/deviceDetail.vue

@@ -1,147 +0,0 @@
-<template>
-	<view class="wrapper flex justify-between padding-lr-lg">
-		<view class="device-items">
-			<view class="device-item">
-				<text class="text-yellow">Uab</text>
-				<text>{{deviceDetail.Uab>1000?deviceDetail.Uab/1000:deviceDetail.Uab}}</text>
-				<text v-if="deviceDetail.Uab>1000">KV</text>
-				<text v-else>V</text>
-			</view>
-			<view class="device-item">
-				<text class="text-green">Ubc</text>
-				<text>{{deviceDetail.Ubc>1000?deviceDetail.Ubc/1000:deviceDetail.Ubc}}</text>
-				<text v-if="deviceDetail.Ubc>1000">KV</text>
-				<text v-else>V</text>
-			</view>
-			<view class="device-item">
-				<text class="text-red">Uca</text>
-				<text>{{deviceDetail.Uca}}</text>
-				<text>V</text>
-			</view>
-			<view class="device-item">
-				<text class="text-red">F</text>
-				<text>{{deviceDetail.F}}</text>
-				<text>V</text>
-			</view>
-		</view>
-
-		<view class="device-items">
-			<view class="device-item">
-				<text class="text-yellow">La</text>
-				<text>{{deviceDetail.Ia}}</text>
-				<text>A</text>
-			</view>
-			<view class="device-item">
-				<text class="text-green">Lb</text>
-				<text>{{deviceDetail.Ib}}</text>
-				<text>A</text>
-			</view>
-			<view class="device-item">
-				<text class="text-red">Lc</text>
-				<text>{{deviceDetail.Ic}}</text>
-				<text>A</text>
-			</view>
-			<view class="device-item">
-				<text class="text-yellow">P</text>
-				<text>{{deviceDetail.P}}</text>
-				<text>kW</text>
-			</view>
-			<view class="device-item">
-				<text class="text-green">Q</text>
-				<text>{{deviceDetail.Q}}</text>
-				<text>kvar</text>
-			</view>
-			<view class="device-item">
-				<text class="text-red">cos</text>
-				<text>{{deviceDetail.COS}}</text>
-				<text>V</text>
-			</view>
-		</view>
-	</view>
-</template>
-<script>
-	export default {
-		data() {
-			return {
-				deviceDetail:''
-			}
-		},
-	
-		
-		onLoad:function(option){
-			
-			uni.setNavigationBarColor({
-				frontColor: "#ffffff", //文字颜色
-				backgroundColor: "#000033", //底部背景色
-			})
-			console.log(111)
-			console.log(option.companyCode)
-			this.companyCode=option.companyCode
-			this.deviceType=option.deviceType
-			this.getDeviceDetail({"companyCode":option.companyCode,"deviceType":option.deviceType,"deviceCode":option.deviceCode})
-		},
-		
-		
-		methods: {
-			
-			async getDeviceDetail(ming={}) {
-				const res= await this.$myRequest({
-					url:'OperationMonitoring/getMonitoringScreen',
-					data:ming,
-					showLoading:true
-				})
-				console.log(res.data.data[0])
-				this.deviceDetail=res.data.data[0]
-				// this.powerDeviceCount= res.data.data[0].powerDeviceCount
-				// this.videoDeviceCount= res.data.data[0].videoDeviceCount
-				
-			},
-		}
-	}
-</script>
-
-<style lang="scss">
-	page {
-		height: 100% !important
-	}
-
-	.wrapper {
-		width: 100%;
-		height: 100%;
-		background-color: #000033;
-		background-image: url(../../../static/device-bg.png);
-		background-position: center center;
-		background-size: cover;
-		position: relative;
-
-		.device-items {
-			font-family: FANDOLFANG-REGULAR;
-			margin-top: 150rpx;
-			color: #fff;
-			.device-item text{
-				vertical-align:top
-			}
-
-			.device-item text:first-child {
-				width: 50rpx;
-				display: inline-block;
-				font-size: 28rpx;
-			}
-			.device-item text:nth-child(2) {
-				display: inline-block;
-				width: 100rpx;
-				margin: 0 15rpx 30rpx 15rpx;
-				height: 42rpx;
-				background: #FFFFCC;
-				font-size: 28rpx;
-				text-align: left;
-				padding-left: 10rpx;
-				line-height: 42rpx;
-				color: #333;
-			}
-		}
-		.device-item:nth-child(3) {
-			margin-bottom: 94rpx;
-		}
-	}
-</style>

+ 12 - 10
pages/index/components/chart/chart.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="content" 	>
+	<view class="content">
 		<view @click="echarts.onClick" :prop="option" :change:prop="echarts.updateEcharts" id="echarts" class="echarts"></view>
 
 	</view>
@@ -21,13 +21,13 @@
 	// }, 0);
 
 
-	export default {
-		 name: 'chart',
-		props:{
-			bindData:{
-				type:Object,
-				default: ''
-			}
+	export default {
+		name: 'chart',
+		props: {
+			bindData: {
+				type: Object,
+				default: ''
+			}
 		},
 		data() {
 			return {
@@ -99,7 +99,7 @@
 							},
 							{
 								name: "视频监测",
-								value:  this.bindData.videoMonitoringCount
+								value: this.bindData.videoMonitoringCount
 							},
 
 						],
@@ -165,7 +165,9 @@
 			}
 		},
 		methods: {
-			initEcharts() {
+			initEcharts() {
+				
+				
 				myChart = echarts.init(document.getElementById('echarts'))
 				// 观测更新的数据在 view 层可以直接访问到
 				myChart.setOption(this.option)

+ 226 - 180
pages/index/index.vue

@@ -88,10 +88,48 @@
 			return {
 				componentKey: 0,
 				arr: [],
-				searchInput: '',
+				searchInput: '',
+				alarmCount:'',
 				flag: false,
 				// 宫格列表数据
-				cuIconList: json.cuIconList,
+				cuIconList: [{
+					imgUrl: '../../static/square1.png',
+					badge: 111,
+					name: '综合报警',
+					redirectUrl: '/pages/siteList/siteList?type=1'
+				}, {
+					imgUrl: '../../static/square2.png',
+					badge: 100,
+					name: '运行监测',
+					redirectUrl: '/pages/siteList/siteList?type=2'
+				}, {
+					imgUrl: '../../static/square-wb.png',
+					badge: 0,
+					name: '维保',
+					redirectUrl: ''
+				}, {
+					imgUrl: '../../static/square-bx.png',
+					badge: 0,
+					name: '报修',
+					redirectUrl: ''
+				}, {
+					imgUrl: '../../static/square-rl.png',
+					badge: 0,
+					name: '人脸识别',
+					redirectUrl: ''
+				}, {
+					imgUrl: '../../static/square-xj.png',
+					badge: 0,
+					badge: 0,
+					name: '巡检',
+					redirectUrl: ''
+				}, {
+					imgUrl: '../../static/square-bz.png',
+					badge: 0,
+					badge: 0,
+					name: '风险保障',
+					redirectUrl: ''
+				}],
 				Inv: 0,
 				searchList: [],
 				searchList2: [],
@@ -129,20 +167,26 @@
 			}
 		},
 
-		onLoad(option) {
-			let ua = navigator.userAgent.toLowerCase();
-			
-			if (ua.match(/MicroMessenger/i) == "micromessenger"){
-				//是
-				this.init();
-			}else{
+		onLoad(option) {
+
+			let ua = navigator.userAgent.toLowerCase();
+			if (ua.match(/MicroMessenger/i) == "micromessenger"){
+				//是
+				this.init();
+			}else{
 				//不是
-				uni.navigateTo({
-					url: '/pages/login/login',
-				});
-				
-			}
-			
+				// uni.navigateTo({
+				// 	url: '/pages/login/login',
+				// });
+				setTimeout(function() {
+					uni.navigateTo({
+						url: '/pages/login/login',
+					});
+				}, 2000);
+				
+
+			}
+
 
 			this.hackReset = false;
 			this.$nextTick(() => {
@@ -154,7 +198,6 @@
 		methods: {
 
 			// start
-
 			getUrlCode() {
 				var url = location.search
 				this.winUrl = url
@@ -177,176 +220,179 @@
 				}
 				return context;
 			},
-			async init() {
-			    var appId = "wx4eab2e3b5531d58b";
-			    var params = {};
-			    var CODE = this.getUrlCode();
-			    var code = CODE['code'];
-			    // alert("CODE="+code);
-			    if (code) {
-			     // console.log("打印参数",JSON.stringify(params));
-			     params.code=code;
-			     // alert(code);
-			     // alert(JSON.stringify(params));
-			   
-			     //使用code请求服务器接口,换取用户用户openID
-			     const res = await this.$myRequest({
-			      url: 'Com/getPageAuthorization',
-			      data:params
-			     })
-			     // alert(res.data.flag);
-			     if(res.data.flag==3000){
-			      alert("授权失败,请重新登录");
-			      uni.navigateTo({
-			       url: '/pages/login/login',
-			      });
-			     }
-			     if(res.data.flag==3002){
-			      alert("授权失败,请重新登录");
-			      uni.navigateTo({
-			       url: '/pages/login/login',
-			      });
-			     }
-			     return "ok";
-			    }
-			    // alert("授权开始");
-			    var cs = {};
-			    var curl=window.location.href;
-			    cs.curl=curl;
-			    // alert("当前页面路径"+curl);
-			    const res1 = await this.$myRequest({
-			     url: 'Com/getAuthorizationUrl',
-			     data:cs
-			    })
-			    // alert(res1.data);
-			    var turl=res1.data.turl;
-			    // alert(turl)
-			    window.location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx4eab2e3b5531d58b&redirect_uri='+turl+'&response_type=code&scope=snsapi_base&state=abc123#wechat_redirect';
-			   },
-
-				// end
-				
-				
-				
-				//首页初始化授权
-				async getPageAuthorization(ming = {}) {
-						const res = await this.$myRequest({
-							url: 'Com/getPageAuthorization',
-							data: ming
-						})
-						alert(res.data.flag)
-
-						console.log('res.data');
-						console.log(res.data);
-
-						if (res.data.flag == 3000) {
-							uni.navigateTo({
-								url: '/pages/login/login',
-							});
-						}
-						if (res.data.flag == 3002) {
-							uni.navigateTo({
-								url: 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx4eab2e3b5531d58b&redirect_uri=' + res.data
-									.tourl + '&response_type=code&scope=snsapi_base&state=abc123#wechat_redirect',
-							});
+			async init() {
+				var appId = "wx4eab2e3b5531d58b";
+				var params = {};
+				var CODE = this.getUrlCode();
+				var code = CODE['code'];
+				// alert("CODE="+code);
+				if (code) {
+					// console.log("打印参数",JSON.stringify(params));
+					params.code = code;
+					// alert(code);
+					// alert(JSON.stringify(params));
+
+					//使用code请求服务器接口,换取用户用户openID
+					const res = await this.$myRequest({
+						url: 'Com/getPageAuthorization',
+						data: params
+					})
+					// alert(res.data.flag);
+					if (res.data.flag == 3000) {
+						alert("授权失败,请重新登录");
+						
+						window.location.href ='https://qhome.usky.cn/index.html#/';
+						// uni.navigateTo({
+						// 	url: '/pages/login/login',
+						// });
+					}
+					if (res.data.flag == 3002) {
+						alert("授权失败,请重新登录");
+						window.location.href ='https://qhome.usky.cn/index.html#/';
+						// uni.navigateTo({
+						// 	url: '/pages/login/login',
+						// });
+					}
+					return "ok";
+				}
+				// alert("授权开始");
+				var cs = {};
+				var curl = window.location.href;
+				cs.curl = curl;
+				// alert("当前页面路径"+curl);
+				const res1 = await this.$myRequest({
+					url: 'Com/getAuthorizationUrl',
+					data: cs
+				})
+				// alert(res1.data);
+				var turl = res1.data.turl;
+				// alert(turl)
+				window.location.href =
+					'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx4eab2e3b5531d58b&redirect_uri=' + turl +
+					'&response_type=code&scope=snsapi_base&state=abc123#wechat_redirect';
+			},
+			// end
+
+
+
+			//首页初始化授权
+			async getPageAuthorization(ming = {}) {
+				const res = await this.$myRequest({
+					url: 'Com/getPageAuthorization',
+					data: ming
+				})
+				alert(res.data.flag)
+
+				console.log('res.data');
+				console.log(res.data);
+
+				if (res.data.flag == 3000) {
+					uni.navigateTo({
+						url: '/pages/login/login',
+					});
+				}
+				if (res.data.flag == 3002) {
+					uni.navigateTo({
+						url: 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx4eab2e3b5531d58b&redirect_uri=' + res.data
+							.tourl + '&response_type=code&scope=snsapi_base&state=abc123#wechat_redirect',
+					});
+				}
+
+			},
+
+			async getData() {
+				const res = await this.$myRequest({
+					url: 'Index/getDataStatistics',
+					showLoading: true
+				})
+				this.staticData = res.data.data[0]
+				this.alarmCount=this.staticData.alarmCount
+				// console.log(this.staticData.alarmCount)
+			},
+
+
+			async getSearchList(ming = {}) {
+				const res = await this.$myRequest({
+					url: 'Index/getSiteDropDownBox',
+					data: ming
+				})
+				res.data.data.forEach(item => {
+					this.searchList.push(item.siteName)
+					this.searchList2.push(item.siteName)
+				});
+			},
+
+			clickSelectItem(item, index) {
+				// alert(index);
+				alert(item);
+				this.getSearchList({
+					"siteName": item
+				});
+				this.flag = false
+			},
+
+			handleInput() {
+				// this.searchList = this.searchList.filter(item => item.indexOf(this.searchInput) > -1);
+
+				var newlist = this.searchList2.filter(item => item.indexOf(this.searchInput) > -1)
+				this.searchList = newlist
+			},
+
+			navItemClick(index) {
+				// log(index)
+				let url = "";
+				switch (index) {
+					case 0:
+						url = "/pages/siteListAlarming/siteListAlarming"
+						break;
+					case 1:
+						url = "/pages/siteList/siteList"
+						break;
+					default:
+						break;
+				}
+				if (url) {
+					uni.navigateTo({
+						url: url
+					})
+				} else {
+					// uni.showToast({
+					// 	title: '此模块开发中~',
+					// 	icon: 'none'
+					// });
+					uni.showModal({
+						title: 'Tips',
+						content: '此模块开发中~',
+						showCancel: false,
+						success: function(res) {
+							if (res.confirm) {
+								console.log('用户点击确定');
+							} else if (res.cancel) {
+								console.log('用户点击取消');
+							}
 						}
+					});
+				}
+			},
 
-					},
+			showTag() {
+				this.flag = !this.flag;
+			},
 
-					async getData() {
-							const res = await this.$myRequest({
-								url: 'Index/getDataStatistics',
-								showLoading: true
-							})
+			InputFocus(e) {
+				this.InputBottom = e.detail.height
+			},
+			InputBlur(e) {
+				this.InputBottom = 0
+			},
 
-							// alert(res.data.flag);
-
-							this.staticData = res.data.data[0]
-						},
-
-
-						async getSearchList(ming = {}) {
-								const res = await this.$myRequest({
-									url: 'Index/getSiteDropDownBox',
-									data: ming
-								})
-								res.data.data.forEach(item => {
-									this.searchList.push(item.siteName)
-									this.searchList2.push(item.siteName)
-								});
-							},
-
-							clickSelectItem(item, index) {
-								// alert(index);
-								alert(item);
-								this.getSearchList({
-									"siteName": item
-								});
-								this.flag = false
-							},
-
-							handleInput() {
-								// this.searchList = this.searchList.filter(item => item.indexOf(this.searchInput) > -1);
-
-								var newlist = this.searchList2.filter(item => item.indexOf(this.searchInput) > -1)
-								this.searchList = newlist
-							},
-
-							navItemClick(index) {
-								// log(index)
-								let url = "";
-								switch (index) {
-									case 0:
-										url = "/pages/siteListAlarming/siteListAlarming"
-										break;
-									case 1:
-										url = "/pages/siteList/siteList"
-										break;
-									default:
-										break;
-								}
-								if (url) {
-									uni.navigateTo({
-										url: url
-									})
-								} else {
-									// uni.showToast({
-									// 	title: '此模块开发中~',
-									// 	icon: 'none'
-									// });
-									uni.showModal({
-										title: 'Tips',
-										content: '此模块开发中~',
-										showCancel: false,
-										success: function(res) {
-											if (res.confirm) {
-												console.log('用户点击确定');
-											} else if (res.cancel) {
-												console.log('用户点击取消');
-											}
-										}
-									});
-								}
-							},
-
-							showTag() {
-								this.flag = !this.flag;
-							},
-
-							InputFocus(e) {
-								this.InputBottom = e.detail.height
-							},
-							InputBlur(e) {
-								this.InputBottom = 0
-							},
-
-							changeTab(Inv) {
-								that.navIdx = Inv;
-
-							},
+			changeTab(Inv) {
+				that.navIdx = Inv;
+
+			},
 
-			}
 		}
+	}
 </script>
 
 <style lang="scss">

+ 56 - 18
pages/login/login.vue

@@ -15,7 +15,11 @@
 				<view class="password-box">
 					<input type="text" placeholder="请输入验证码" v-model="verify">
 					<text class="icon iconfont left-icon">&#xe86a;</text>
-					<view class="right-icon verify" @click="getVerifyCode">获取验证码</view>
+					<view @click="getVerifyCode">
+						<!-- <text class="right-icon verify">获取验证码</text> -->
+						<text class="right-icon verify">{{!codeTime?'获取验证码':codeTime+'s'}}</text>
+
+					</view>
 				</view>
 
 				<view class="btn-area">
@@ -23,18 +27,16 @@
 				</view>
 			</view>
 		</form>
-
-
 	</view>
-
-
-
 </template>
 
 <script>
 	export default {
 		data() {
 			return {
+				codeTime: 0,
+
+
 				phone: '',
 				verify: '',
 				VerificationCodeOne: ''
@@ -57,7 +59,7 @@
 			});
 
 
-			this.getLoginAuthorize()
+			// this.getLoginAuthorize()
 
 
 		},
@@ -81,26 +83,38 @@
 				let ua = navigator.userAgent.toLowerCase();
 
 				if (ua.match(/MicroMessenger/i) == "micromessenger") {
+
+					var curl2 = window.location.href;
+					alert('curl2')
+					alert(curl2)
+
 					//是
 					var appId = "wx4eab2e3b5531d58b";
 					var params = {};
 					var CODE = this.getUrlCode();
 					var code = CODE['code'];
+					alert('code')
+					alert(code)
 					if (code) {
 						params.code = code;
 						const res = await this.$myRequest({
 							url: 'Login/getLoginAuthorize',
 							data: params
 						})
+						alert('res.data.flag')
+						alert(res.data.flag)
 						// if (res.data.flag == true) {
 						// 	uni.switchTab({
 						// 		url: '/pages/index/index'
 						// 	});
 						// }
+						code = '';
 						return "ok";
 					}
 					var cs = {};
 					var curl = window.location.href;
+					alert('curl')
+					alert(curl)
 					cs.curl = curl;
 					const res1 = await this.$myRequest({
 						url: 'Login/getLoginAuthorize',
@@ -114,8 +128,8 @@
 					const res = await this.$myRequest({
 						url: 'Login/getLoginAuthorize',
 						data: params
-					})
-					
+					})
+
 
 				}
 
@@ -125,23 +139,48 @@
 
 			//短信验证码验证
 			getVerifyCode() {
+
+
+
+
+
 				if (!this.phone) {
 					uni.showToast({
 						title: "请输入手机号码...",
 						icon: "none"
 					});
+					return
 
-				} else if (!/^1[345678]\d{9}$/.test(this.phone)) {
+				}
+				if (!/^1[345678]\d{9}$/.test(this.phone)) {
 					uni.showToast({
 						title: "请输入正确的手机号码...",
 						icon: "none"
 					});
+					return
+				}
+				this.getVerifyData({
+					"phone": this.phone
+				})
+
+				if (this.codeTime > 0) {
+					uni.showToast({
+						title: '不能重复获取',
+						icon: "none"
+					});
+					return;
 				} else {
-					this.getVerifyData({
-						"phone": this.phone
-					})
+					this.codeTime = 60
+					let timer = setInterval(() => {
+						this.codeTime--;
+						if (this.codeTime < 1) {
+							clearInterval(timer);
+							this.codeTime = 0
+						}
+					}, 1000)
 				}
 
+
 			},
 			async getVerifyData(ming = {}) {
 				const res = await this.$myRequest({
@@ -192,14 +231,15 @@
 					url: 'Login/setSignUp',
 					data: ming
 				})
-		
+				alert(1)
+				alert(res.data.flag)
 				if (res.data.flag == true) {
 					uni.switchTab({
 						url: '/pages/index/index'
 					});
 
 				} else {
-				
+
 				}
 			},
 
@@ -208,8 +248,6 @@
 				const res = await this.$myRequest({
 					url: 'Login/getLoginAuthorize',
 				})
-				// console.log('res')
-				// console.log(res)
 
 			},
 
@@ -291,7 +329,7 @@
 
 	.phone-box text,
 	.password-box text {
-		font-size: 38rpx;
+		font-size: 30rpx;
 		color: #999999
 	}
 

+ 0 - 22
pages/login2/login2.vue

@@ -1,22 +0,0 @@
-<template>
-	<view>
-		
-	</view>
-</template>
-
-<script>
-	export default {
-		data() {
-			return {
-				
-			}
-		},
-		methods: {
-			
-		}
-	}
-</script>
-
-<style>
-
-</style>

+ 95 - 85
pages/siteList/siteList.vue

@@ -1,13 +1,13 @@
 <template>
-	<view class="site-wrapper" ref="contentWrapper" >
+	<view class="site-wrapper" ref="contentWrapper">
 
 		<!-- 筛选框start -->
 		<view class="ding">
 			<view class="cu-bar search bg-gray filter-section">
 				<view class="search-form round bg-white">
 					<text class="cuIcon-search"></text>
-					<input class="" @focus="InputFocus" v-model="siteName" @blur="InputBlur" :adjust-position="false" type="text" placeholder="请输入站点名称"
-					 confirm-type="search"></input>
+					<input class="" @focus="InputFocus" v-model="siteName" @blur="InputBlur" :adjust-position="false" type="text"
+					 placeholder="请输入站点名称" confirm-type="search"></input>
 				</view>
 				<view class="action">
 					<button class="cu-btn bg-blue round" @click=searchData()>查询</button>
@@ -19,18 +19,18 @@
 
 		<!-- 站点列表start -->
 		<view class="site-items">
-			<view class="cu-list menu-avatar">
+			<view class="cu-list menu-avatar longPressUl">
 				<view class="cu-item" :class="modalName=='move-box-'+ index?'move-cur':''" v-for="(item,index) in newSiteListData"
 				 :key="index" :data-target="'move-box-' + index">
-					<view class="cu-avatar round lg"  style="background-image: url(../../static/site-icon-alarm.png);"></view>
-					<view class="content"  @tap="goDeviceType(item)" @longpress="showDetail(item)">
+					<view class="cu-avatar round lg" style="background-image: url(../../static/site-icon-alarm.png);"></view>
+					<view class="content" @tap="goDeviceType(item)" @longpress="showDetail(item)">
 						<view class="text-grey site-tit">
-							<text style="width:260rpx;" class="inOneLine">{{item.siteName}}</text>
-							<text style="font-size:28rpx;text-align:right"> 
-							   ( 共{{item.count}}个未处理告警 )
+							<text style="width:260rpx;" class="inOneLine">{{item.siteName}}</text>
+							<text style="font-size:28rpx;text-align:right">
+								( 共{{item.count}}个未处理告警 )
 							</text>
 						</view>
-						<view class="showDetail" v-if="item.isShow" @tap.stop="goSiteDetail(item)" >查看详情</view>
+						<view class="showDetail" v-if="item.isShow" @tap.stop="goSiteDetail(item)">查看详情</view>
 					</view>
 					<view class="nav-right num">
 						<view class="text-grey">
@@ -38,8 +38,8 @@
 						</view>
 					</view>
 				</view>
-			</view>
-			
+			</view>
+
 			<view v-if="!siteListData.length&&siteListRes==1" class="text-center margin-top"> 暂无数据</view>
 		</view>
 		<!-- 站点列表end -->
@@ -54,9 +54,9 @@
 
 	export default {
 		data() {
-			return {
-				siteListRes: 0,
-				siteName:'',
+			return {
+				siteListRes: 0,
+				siteName: '',
 				type: '0',
 				siteListData: [],
 				modalName: null,
@@ -66,7 +66,7 @@
 			};
 		},
 
-		
+
 		onPullDownRefresh() {
 			console.log('refresh');
 			setTimeout(function() {
@@ -79,42 +79,44 @@
 					this.$set(item, "isShow", false)
 					return item
 				})
-			}
-
-		},
-		
-		
-		mounted() {
-			document.addEventListener('click', (e) => {
-				if (e.target.className != 'showDetail') {
-					this.siteListData.forEach(item => {
-						item.isShow = false
-					})
-				}
-			})
-		},
-		onLoad(){
-			this.getSiteList()
-		},
-
-		methods: {
-			searchData(){
-				this.getSiteList({"siteName":this.siteName})
-			},
-			
-			
-			async getSiteList(ming) {
-				const res= await this.$myRequest({
-					url:'OperationMonitoring/getSiteList',
-					showLoading:true,
-					data:ming
-				})
-				this.siteListRes = 1;
-				console.log(res.data.data)
-				this.siteListData=res.data.data
-			},
-			
-			
+			}
+
+		},
+
+
+		mounted() {
+			document.addEventListener('click', (e) => {
+				if (e.target.className != 'showDetail') {
+					this.siteListData.forEach(item => {
+						item.isShow = false
+					})
+				}
+			})
+		},
+		onLoad() {
+			this.getSiteList()
+		},
+
+		methods: {
+			searchData() {
+				this.getSiteList({
+					"siteName": this.siteName
+				})
+			},
+
+
+			async getSiteList(ming) {
+				const res = await this.$myRequest({
+					url: 'OperationMonitoring/getSiteList',
+					showLoading: true,
+					data: ming
+				})
+				this.siteListRes = 1;
+				console.log(res.data.data)
+				this.siteListData = res.data.data
+			},
+
+
 			// 隐藏显示
 			showDetail(e) {
 				// 存储点击那一项的状态
@@ -134,20 +136,20 @@
 			},
 
 
-			goDeviceType(item) {
-				if(item.count){
-					uni.navigateTo({
-						url: '/pages/deviceType/deviceType?companyCode='+item.companyCode,
-						success: res => {},
-						fail: () => {},
-						complete: () => {}
-					});
+			goDeviceType(item) {
+				if (item.count) {
+					uni.navigateTo({
+						url: '/pages/deviceType/deviceType?companyCode=' + item.companyCode,
+						success: res => {},
+						fail: () => {},
+						complete: () => {}
+					});
 				}
-				
+
 			},
 			goSiteDetail(item) {
 				uni.navigateTo({
-					url: '/pages/siteDetail/siteDetail?id='+item.id+'',
+					url: '/pages/siteDetail/siteDetail?id=' + item.id + '',
 					success: res => {},
 					fail: () => {},
 					complete: () => {}
@@ -158,28 +160,36 @@
 	}
 </script>
 
-<style>
-	
-	.showDetail {
-		position: absolute;
-		background: #fff;
-		box-shadow: 0 1px 6px 0 rgb(32 33 36 / 28%);
-		padding: 0rpx 32rpx;
-		border-radius: 10rpx;
-		top: 42rpx;
-		right: 45%;
-		z-index: 3000000;
-		font-size: 28rpx;
-	
-	}
-	
-	*:not(input) {
-	    -webkit-touch-callout: none;
-	    -webkit-user-select: none;
-	    -khtml-user-select: none;
-	    -moz-user-select: none;
-	    -ms-user-select: none;
-	    user-select: none;
+<style>
+	.showDetail {
+		position: absolute;
+		background: #fff;
+		box-shadow: 0 1px 6px 0 rgb(32 33 36 / 28%);
+		padding: 0rpx 32rpx;
+		border-radius: 10rpx;
+		top: 42rpx;
+		right: 45%;
+		z-index: 3000000;
+		font-size: 28rpx;
+
 	}
-	
+
+	/* *:not(input) { */
+
+	* {
+		-webkit-touch-callout: none;
+		-webkit-user-select: none;
+		-khtml-user-select: none;
+		-moz-user-select: none;
+		-ms-user-select: none;
+		user-select: none;
+	}
+	input {
+		user-select: initial !important;
+	}
+
+
+	/* uni-page-head .uni-page-head-bd{
+		 user-select: none!important;
+	} */
 </style>

+ 6 - 4
pages/siteListAlarming/siteListAlarming.vue

@@ -1,5 +1,5 @@
 <template>
-	<list-test :bindData="siteListData" :bindUrl="linkUrl" :bindIcon="linkIcon" :bindNum="num" :bindType="type" :bindModel="siteName"
+	<list-test :bindData="siteListData" :bindUrl="linkUrl" :bindIcon="linkIcon" :bindNum="num" :bindType="type" :bindSiteName="siteName"
 	 :bindDetailUrl="detailUrl">
 	</list-test>
 
@@ -38,14 +38,16 @@
 		},
 
 		onLoad() {
-			this.getSiteList()
+			this.getDataList({})
 		},
 
 		methods: {
-			async getSiteList() {
+			async getDataList(params={}) {
 				const res= await this.$myRequest({
 					url:'IntegratedAlarm/getSiteList',
-					showLoading:true
+					showLoading:true,
+					data:params
+					
 				})
 				console.log(res.data.data)
 				this.siteListData=res.data.data

+ 4 - 1
util/api.js

@@ -26,7 +26,7 @@ export const myRequest = (options) => {
 				'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
 			},
 			success: (res) => {
-				if (res.data.flag == false) { //登录失效
+				if (res.data.flag == false) {
 					return uni.showToast({
 						title: res.data.msg?res.data.msg:"获取数据失败",
 						icon: "none"
@@ -62,3 +62,6 @@ export const myRequest = (options) => {
 	})
 
 }
+
+
+

+ 74 - 0
util/auth.js

@@ -0,0 +1,74 @@
+
+// start
+	getUrlCode() {
+		var url = location.search
+		this.winUrl = url
+		var theRequest = new Object()
+		if (url.indexOf("?") != -1) {
+			var str = url.substr(1)
+			var strs = str.split("&")
+			for (var i = 0; i < strs.length; i++) {
+				theRequest[strs[i].split("=")[0]] = (strs[i].split("=")[1])
+			}
+		}
+		return theRequest
+	},
+	 getUrlPrams(key) {
+		var reg = new RegExp("(^|&)" + key + "=([^&]*)(&|$)", "i");
+		var r = window.location.search.substr(1).match(reg); //获取url中"?"符后的字符串并正则匹配
+		var context = "";
+		if (r != null) {
+			context = r[2];
+		}
+		return context;
+	},
+
+export const authInit = (options) => {
+
+	var appId = "wx4eab2e3b5531d58b";
+	var params = {};
+	var CODE = getUrlCode();
+	var code = CODE['code'];
+	// alert("CODE="+code);
+	if (code) {
+	 // console.log("打印参数",JSON.stringify(params));
+	 params.code=code;
+	 // alert(code);
+	 // alert(JSON.stringify(params));
+		   
+	 //使用code请求服务器接口,换取用户用户openID
+	 const res = await this.$myRequest({
+	  url: 'Com/getPageAuthorization',
+	  data:params
+	 })
+	 // alert(res.data.flag);
+	 if(res.data.flag==3000){
+	  alert("授权失败,请重新登录");
+	  uni.navigateTo({
+	   url: '/pages/login/login',
+	  });
+	 }
+	 if(res.data.flag==3002){
+	  alert("授权失败,请重新登录");
+	  uni.navigateTo({
+	   url: '/pages/login/login',
+	  });
+	 }
+	 return "ok";
+	}
+	// alert("授权开始");
+	var cs = {};
+	var curl=window.location.href;
+	cs.curl=curl;
+	// alert("当前页面路径"+curl);
+	const res1 = await this.$myRequest({
+	 url: 'Com/getAuthorizationUrl',
+	 data:cs
+	})
+	// alert(res1.data);
+	var turl=res1.data.turl;
+	// alert(turl)
+	window.location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx4eab2e3b5531d58b&redirect_uri='+turl+'&response_type=code&scope=snsapi_base&state=abc123#wechat_redirect';
+		
+
+}