Browse Source

项目联调

shilin 4 years atrás
parent
commit
9af822741f

+ 106 - 78
common/common.js

@@ -1,78 +1,106 @@
-class Common{
+class Common {
 	constructor() {
-	    
+
 	}
-	
+
 	//跳转
-	navTo(url){
+	navTo(url) {
 		uni.navigateTo({
-			url:url
+			url: url
 		})
-	}	
-	
-	goback(url){
-	 var page = getCurrentPages();
-	 console.log(page);
-	 console.log(url);
-	 let windpowerstationName =  uni.getStorageSync('windpowerstationName');
-	 page[page.length-1].$vm.address = windpowerstationName;
-			// if(windpowerstationName=="宁夏新能源公司"){
-			// 	if(page[page.length-1].route=="components/weatherProphethomepage/WeatherProphethomepage"){
-			// 		page[page.length-1].$vm.FDC="MHS_FDC";
-			// 	}else{
-			// 		page[page.length-1].$vm.FDC="0";
-			// 	}
-	 	//  	 }
-	 	//  	 if(windpowerstationName=="麻黄山风电场"){
-	 	//  	 	page[page.length-1].$vm.FDC="MHS_FDC";
-	 	//  	 }
-	 	//  	 if(windpowerstationName=="牛首山风电场"){
-	 	//  	 	page[page.length-1].$vm.FDC="NSS_FDC";
-	 	//  	 }
-	 	//  	 if(windpowerstationName=="石板泉风电场"){
-	 	//  	 	page[page.length-1].$vm.FDC="SBQ_FDC";
-	 	//  	 }
-	 	//  	 if(windpowerstationName=="青山风电场"){
-	 	//  	 	page[page.length-1].$vm.FDC="QS_FDC";
-	 	//  	 }
-	 	//  	 if(windpowerstationName=="香山风电场"){
-	 	//  	 	page[page.length-1].$vm.FDC="XS_FDC";
-	 	//  	 }
-			 //首页
-			 if(page[page.length-1].route=="pages/index/Index"){
-				 page[page.length-1].target_comprehensive_indicators();
-				 page[page.length-1].target_windSpeed_power();
-				 page[page.length-1].index_windturbine_status();
-				 page[page.length-1].index_electricQuantity();
-				 page[page.length-1].index_target_basic_indicators();
-			 }
-			 if(page[page.length-1].route=="components/weatherProphethomepage/WeatherProphethomepage"){
-				 page[page.length-1].viewUserid();
-				 page[page.length-1].getWeatherDataToday();
-				 page[page.length-1].getWeatherData7();
-				 page[page.length-1].getWeatherData();
-				 page[page.length-1].getWeatherData40();
-				 if(windpowerstationName=="宁夏新能源公司"){
-				 	page[page.length-1].$vm.windStationName="麻黄山";
-				  }
-				  if(windpowerstationName=="麻黄山风电场"){
-				  	page[page.length-1].$vm.windStationName="麻黄山";
-				  }
-				  if(windpowerstationName=="牛首山风电场"){
-				  	page[page.length-1].$vm.windStationName="牛首山";
-				  }
-				  if(windpowerstationName=="石板泉风电场"){
-				  	page[page.length-1].$vm.windStationName="石板泉";
-				  }
-				  if(windpowerstationName=="青山风电场"){
-				  	page[page.length-1].$vm.windStationName="青山";
-				  }
-				  if(windpowerstationName=="香山风电场"){
-				  	page[page.length-1].$vm.windStationName="香山";
-				  }
-			 }
-	
-  //    uni.showModal({
+	}
+
+	goback(url) {
+		var page = getCurrentPages();
+		//debugger
+		console.log(page);
+		console.log(url);
+		let windpowerstationName = uni.getStorageSync('windpowerstationName');
+		page[page.length - 1].$vm.address = windpowerstationName;
+		// if(windpowerstationName=="宁夏新能源公司"){
+		// 	if(page[page.length-1].route=="components/weatherProphethomepage/WeatherProphethomepage"){
+		// 		page[page.length-1].$vm.FDC="MHS_FDC";
+		// 	}else{
+		// 		page[page.length-1].$vm.FDC="0";
+		// 	}
+		//  	 }
+		//  	 if(windpowerstationName=="麻黄山风电场"){
+		//  	 	page[page.length-1].$vm.FDC="MHS_FDC";
+		//  	 }
+		//  	 if(windpowerstationName=="牛首山风电场"){
+		//  	 	page[page.length-1].$vm.FDC="NSS_FDC";
+		//  	 }
+		//  	 if(windpowerstationName=="石板泉风电场"){
+		//  	 	page[page.length-1].$vm.FDC="SBQ_FDC";
+		//  	 }
+		//  	 if(windpowerstationName=="青山风电场"){
+		//  	 	page[page.length-1].$vm.FDC="QS_FDC";
+		//  	 }
+		//  	 if(windpowerstationName=="香山风电场"){
+		//  	 	page[page.length-1].$vm.FDC="XS_FDC";
+		//  	 }
+		//首页
+		if (page[page.length - 1].route == "pages/index/Index") {
+			page[page.length - 1].target_comprehensive_indicators();
+			page[page.length - 1].target_windSpeed_power();
+			page[page.length - 1].index_windturbine_status();
+			page[page.length - 1].index_electricQuantity();
+			page[page.length - 1].index_target_basic_indicators();
+		}
+		if (page[page.length - 1].route == "pages/forecast/Forecast") {
+
+			//page[page.length-1].$refs.r1.viewUserid();
+			page[page.length - 1].$refs.r1.getWeatherDataToday();
+			page[page.length - 1].$refs.r1.getWeatherData7();
+			page[page.length - 1].$refs.r1.getWeatherData();
+			page[page.length - 1].$refs.r1.getWeatherData40();
+			page[page.length - 1].$refs.r1.address = windpowerstationName;
+			if (windpowerstationName == "宁夏新能源公司") {
+				page[page.length - 1].$refs.r1.windStationName = "麻黄山";
+				page[page.length - 1].$refs.r1.FDC = "0";
+			}
+			if (windpowerstationName == "麻黄山风电场") {
+				page[page.length - 1].$refs.r1.windStationName = "麻黄山";
+				page[page.length - 1].$refs.r1.FDC = "MHS_FDC";
+			}
+			if (windpowerstationName == "牛首山风电场") {
+				page[page.length - 1].$refs.r1.windStationName = "牛首山";
+				page[page.length - 1].$refs.r1.FDC = "NSS_FDC";
+			}
+			if (windpowerstationName == "石板泉风电场") {
+				page[page.length - 1].$refs.r1.windStationName = "石板泉";
+				page[page.length - 1].$refs.r1.FDC = "SBQ_FDC";
+			}
+			if (windpowerstationName == "青山风电场") {
+				page[page.length - 1].$refs.r1.windStationName = "青山";
+				page[page.length - 1].$refs.r1.FDC = "QS_FDC";
+			}
+			if (windpowerstationName == "香山风电场") {
+				page[page.length - 1].$refs.r1.windStationName = "香山";
+				page[page.length - 1].$refs.r1.FDC = "XS_FDC";
+			}
+
+			if (windpowerstationName == "河北能源集团") {
+				page[page.length - 1].$refs.r1.windStationName = "崇礼";
+				page[page.length - 1].$refs.r1.FDC = "0";
+			}
+			if (windpowerstationName == "崇礼风电场") {
+				page[page.length - 1].$refs.r1.windStationName = "崇礼";
+				page[page.length - 1].$refs.r1.FDC = "CL_FDC";
+
+			}
+			if (windpowerstationName == "康保风电场") {
+				page[page.length - 1].$refs.r1.windStationName = "康保";
+				page[page.length - 1].$refs.r1.FDC = "KB_FDC";	
+			}
+			if (windpowerstationName == "代县风电场") {
+				page[page.length - 1].$refs.r1.windStationName = "代县";
+				page[page.length - 1].$refs.r1.FDC = "YMG_FDC";
+			}
+			uni.setStorageSync('windPowerStationId',page[page.length - 1].$refs.r1.FDC);
+		}
+
+		//    uni.showModal({
 		// 		title: '提示',
 		// 		content: page,
 		// 		success: function (res) {
@@ -83,21 +111,21 @@ class Common{
 		// 			}
 		// 		}
 		// 	});
-		
+
 		// uni.switchTab({
-			
+
 		// 	url: url,success: function(e) {				
 		// 		//if (page[0] == undefined || page[0] == null) return;
 		// 			page[page.length-1].onLoad();
 		// 		}
-				
+
 		// })
-		
-		
+
+
 	}
-	
-	
+
+
 }
 
 let common = new Common();
-export default common;
+export default common;

+ 3 - 1
components/drawer/plusDrawer.vue

@@ -2,7 +2,7 @@
 	<view>
 		<!-- <scroll-view scroll-y class="DrawerPage" :class="modalName=='viewModal'?'show':''" >
 		</scroll-view> -->
-		<view class="DrawerClose" :class="modalName=='viewModal'?'show':''" @tap="hideModal">
+		<view class="DrawerClose" :class="modalName=='viewModal'?'show':''" @tap="hideModal" >
 			<text class="cuIcon-pullright"></text>
 		</view>
 		<scroll-view scroll-y class="DrawerWindow" :class="modalName=='viewModal'?'show':''" @tap="showModal" data-target="viewModal"
@@ -63,7 +63,9 @@
 			pushWindPowerStationNameToSessionStorage(windpowerstationName, windPowerStationId) {
 				uni.setStorageSync('windpowerstationName', windpowerstationName);
 				uni.setStorageSync('windPowerStationId', windPowerStationId);
+				//debugger
 				this.common.goback('/pages/index/Index');
+				
 			},
 			getWindPowerStationNamesToSessionStorage() {
 				uni.getStorageSync('windpowerstationNames');

+ 68 - 2
components/login/Login.vue

@@ -16,6 +16,7 @@
 				<a style="float: right;color:#77A8E6;" @tap="goToIndex()">游客身份登录</a>
 			</view>
 			<button class="cu-btn bg-red lg" @tap="login" :disabled="usernameLoginDisabled" type="" :style="{ 'height': buttonHeight}">登录</button>
+			<button class="cu-btn bg-red lg" @tap="checkIsSoterEnrolledInDeviceFingerPrint"  type="" :style="{ 'height': buttonHeight}">指纹登录</button>
 			<view class="bottomWord" :style="{ 'font-size': bottomWordFontSize,'margin-top':bottomWordMarginTop}">
 				点击登录,即代表已阅读并同意<a href="#">隐私政策</a>和<a href="#">用户协议</a>
 			</view>
@@ -216,6 +217,24 @@ export default {
 		setUsernamePassword: function() {
 			uni.setStorageSync('gyeeusername', this.username);
 			uni.setStorageSync('gyeepassword', this.password);
+			this.setFingerPrintPassword();
+		},
+		setFingerPrintPassword: function() {
+			uni.setStorageSync('fingerPrintname', this.username);
+			uni.setStorageSync('fingerPrintpassword', this.password);
+		},
+		getFingerPrintPassword: function() {
+
+			if (uni.getStorageSync('fingerPrintname') != '' && uni.getStorageSync('fingerPrintpassword') != '') {
+				uni.switchTab({
+					url: '/pages/index/Index'
+				});
+			}else
+			{
+				uni.showToast({
+					title:"请先用密码登录!"
+				});
+			}
 		},
 		getUsernamePassword: function() {
 			this.lastUserName = uni.getStorageSync('gyeeusername');
@@ -229,6 +248,7 @@ export default {
 		removeUsernamePassword: function() {
 			uni.removeStorageSync('gyeeusername');
 			uni.removeStorageSync('gyeepassword');
+			//uni.removeStorageSync('userid');
 		},
 		login: function() {
 			let _this = this;
@@ -239,7 +259,9 @@ export default {
 				success: function(res) {
 					console.log(res.data);
 					_this.userid = res.data.data;
-					sessionStorage.setItem('userid',_this.userid);
+					
+					uni.setStorageSync('userid',_this.userid);
+					//sessionStorage.setItem('userid',_this.userid);
 					if (res.data.code == 200) {
 						_this.setUsernamePassword();
 						_this.loginFalg = true;
@@ -380,7 +402,51 @@ export default {
 					_this.tips = '网络错误,小程序端请检查合法域名';
 				}
 			});
-		}
+		},checkIsSoterEnrolledInDeviceFingerPrint() {
+				let _this = this;
+                uni.checkIsSoterEnrolledInDevice({
+                    checkAuthMode: 'fingerPrint',
+                    success(res) {
+						
+                        uni.startSoterAuthentication({
+                            requestAuthModes: ['fingerPrint'],
+                            challenge: '123456',
+                            authContent: '请用指纹解锁',
+                            success(result) {
+					
+									if(result.errMsg=="startSoterAuthentication:ok")
+									{	
+											//_this.setUsernamePassword();
+											//_this.loginFalg = true;
+											//_this.getUser()
+											_this.getFingerPrintPassword();
+									}else {
+											uni.showToast({
+												title:"指纹登录失败!"
+											});
+											_this.username = '';
+											_this.password = '';
+										}
+                     
+								},
+                            fail(err) {
+                                console.log(err);
+                            },
+                            complete(res) {
+                                console.log(res);
+                            }
+                        })
+                    },
+                    fail(err) {
+						uni.showToast({
+							title:"请用手机指纹管理功能新建指纹录!"
+						});
+                    },
+                    complete(res) {
+                        console.log(res);
+                    }
+                })
+            }
 	}
 	
 };

File diff suppressed because it is too large
+ 67 - 1068
components/weatherProphethomepage/WeatherProphethomepage.vue


+ 16 - 2
components/weatherProphethomepage/weatherDetail/Detail.vue

@@ -210,6 +210,7 @@
 		},
 		created: function() {
 			//this.pushWindPowerStationNameToSessionStorage("麻黄山");
+
 			this.address = this.getWindPowerStationNameToSessionStorage();
 			this.windPowerStationId=uni.getStorageSync('windPowerStationId');
 			this.getWeatherData();
@@ -234,6 +235,17 @@
 			this.windPowerStationId=uni.getStorageSync('windPowerStationId');
 			this.getWeatherData();
 		},
+		computed: {
+					backStageIp: function() {
+						return this.$store.state.wholeSituationBackStageIp;
+					},
+					backStagePort: function() {
+						return this.$store.state.wholeSituationBackStagePort;
+					},
+					windpowerstationNameToId: function() {
+						return this.$store.state.windpowerstationNameToId;
+					}
+				},
 		methods:{
 			pushWindPowerStationNameToSessionStorage(windpowerstationName) {
 				uni.setStorageSync('windpowerstationName',windpowerstationName);
@@ -247,15 +259,16 @@
 			},
 			getWeatherData: function() {
 				let _this = this;
+					
 				// 创建一个this.socketTask对象【发送、接收、关闭socket都由这个对象操作】
 				this.socketTask = uni.connectSocket({
 					// 【非常重要】必须确保你的服务器是成功的,如果是手机测试千万别使用ws://127.0.0.1:9099【特别容易犯的错误】
-					url: "ws://49.4.78.143:8081/websocket/pageNumber_3/functionNumber_2",
+					url: 'ws://' + this.backStageIp + ':' + this.backStagePort + '/websocket/pageNumber_3/functionNumber_2',
 					success(data) {
 						console.log("websocket连接成功");
 					},
 				});		
-				
+
 				// 消息的发送和接收必须在正常连接打开中,才能发送或接收【否则会失败】
 				this.socketTask.onOpen((res) => {
 					console.log("WebSocket连接正常打开中...!");
@@ -264,6 +277,7 @@
 					// 注:只有连接正常打开中 ,才能正常收到消息
 					this.socketTask.onMessage((res) => {
 						//console.log("收到服务器内容:" + res.data);
+						//debugger
 						_this.weatherProphetDataAll_17Hour =res.data;
 						_this.weatherProphetDataAll_17Hour=JSON.parse(res.data);
 						_this.weatherProphetData_17Hour = [];

+ 22 - 17
manifest.json

@@ -1,6 +1,6 @@
 {
     "name" : "sis_phone",
-    "appid" : "__UNI__C060991",
+    "appid" : "__UNI__40A0AEB",
     "description" : "sis_phone",
     "versionName" : "1.0.1",
     "versionCode" : 101,
@@ -17,35 +17,40 @@
             "delay" : 0
         },
         /* 模块配置 */
-        "modules" : {},
+        "modules" : {
+            "Maps" : {},
+            "Fingerprint" : {}
+        },
         /* 应用发布信息 */
         "distribute" : {
             /* android打包配置 */
             "android" : {
                 "permissions" : [
-                    "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
-                    "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
-                    "<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
-                    "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
-                    "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
-                    "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
+                    "<uses-feature android:name=\"android.hardware.camera\"/>",
                     "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
-                    "<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
                     "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
                     "<uses-permission android:name=\"android.permission.CAMERA\"/>",
-                    "<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
+                    "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
                     "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
                     "<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
+                    "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
+                    "<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
+                    "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
                     "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
-                    "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
+                    "<uses-permission android:name=\"android.permission.USE_FINGERPRINT\"/>",
+                    "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
                     "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
-                    "<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
-                    "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
-                    "<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
-                    "<uses-feature android:name=\"android.hardware.camera\"/>",
-                    "<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
+                    "<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
                     "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
-                ]
+                ],
+                "abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ]
             },
             /* ios打包配置 */
             "ios" : {

+ 23 - 8
pages/forecast/Forecast.vue

@@ -70,19 +70,20 @@
 		<!-- 健康详情组件 -->
 		<view class="healthy">
 			<view class="healthy_H">
-				<view class="details_z">心跳频率:<!-- ({{ bracelet[deviceName][targetName_xtpl][targetName_xtpl_size].value }}) --></view>
-				<view class="details_m">步数:<!-- ({{ bracelet[deviceName][targetName_bs][targetName_bs_size].value }}) --></view>
-				<view class="details_y">收缩频率:<!-- ({{ bracelet[deviceName][targetName_ssxy][targetName_ssxy_size].value }}) --></view>
+		
+				<view class="details_z">{{xtpl_computed}}<!-- ({{ bracelet[deviceName][targetName_xtpl][targetName_xtpl_size].value }}) --></view>
+				<view class="details_m">{{bs_computed}}</view>
+				<view class="details_y">{{ssxy_computed}}</view>
 			</view>
 			<view class="healthy_N">
-				<view class="details_z">舒张压:<!-- ({{ bracelet[deviceName][targetName_szxy][targetName_szxy_size].value }}) --></view>
-				<view class="details_m">疲劳度:<!-- ({{ bracelet[deviceName][targetName_pld][targetName_pld_size].value }}) --></view>
-				<view class="details_y">血氧浓度:<!-- ({{ bracelet[deviceName][targetName_xynd][targetName_xynd_size].value }}) --></view>
+				<view class="details_z">{{szxy_computed}}<!-- ({{ bracelet[deviceName][targetName_szxy][targetName_szxy_size].value }}) --></view>
+				<view class="details_m">{{pld_computed}}<!-- ({{ bracelet[deviceName][targetName_pld][targetName_pld_size].value }}) --></view>
+				<view class="details_y">{{xynd_computed}}<!-- ({{ bracelet[deviceName][targetName_xynd][targetName_xynd_size].value }}) --></view>
 			</view>
 		</view>
 		</view>
 		<view v-if="toggleSwitch==true">
-			<WeatherProphethomepage></WeatherProphethomepage>
+			<WeatherProphethomepage ref="r1"></WeatherProphethomepage>
 		</view>
 	</view>
 </template>
@@ -101,6 +102,13 @@ export default {
 	},
 	data: function() {
 		return {
+			bs_computed:'',
+			xtpl_computed:'',
+			ssxy_computed:'',
+			szxy_computed:'',
+			pld_computed:'',
+			xynd_computed:'',
+			WeatherProphethomepagebool:true,
 			toggleSwitch:false,
 			menuKey:1,
 			pointKey: 'MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0087',
@@ -307,7 +315,7 @@ export default {
 		};
 	},
 	mounted() {
-		document.querySelector('body').setAttribute('style', 'background-color:#000000');
+		//document.querySelector('body').setAttribute('style', 'background-color:#000000');
 	},
 	onHide() {
 		this.$refs.drawer.closeDrawer();
@@ -336,6 +344,7 @@ export default {
 	onReady() {},
 
 	computed: {
+		
 		targetName_xtpl: function() {
 			return this.deviceName + '_XTPL';
 		},
@@ -518,6 +527,12 @@ export default {
 					_this.covers[1].latitude = _this.mapEnd_2;
 					_this.covers[1].longitude = _this.mapEnd_1;
 					
+					_this.bs_computed = _this.bracelet[_this.deviceName][_this.targetName_bs][_this.targetName_bs_size].value;
+					_this.xtpl_computed = _this.bracelet[_this.deviceName][_this.targetName_xtpl][_this.targetName_xtpl_size].value;
+					_this.ssxy_computed = _this.bracelet[_this.deviceName][_this.targetName_ssxy][_this.targetName_ssxy_size].value;
+					_this.szxy_computed = _this.bracelet[_this.deviceName][_this.targetName_szxy][_this.targetName_szxy_size].value;
+					_this.pld_computed = _this.bracelet[_this.deviceName][_this.targetName_pld][_this.targetName_pld_size].value;
+					_this.xynd_computed = _this.bracelet[_this.deviceName][_this.targetName_xynd][_this.targetName_xynd_size].value;
 					/* this.braceletCurve_LNG = this.bracelet[this.deviceName][this.deviceNameLng];
 					this.braceletCurve_LAT = this.bracelet[this.deviceName][this.deviceNameLat];