| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 | 
							- <script>
 
- 	import config from 'common/config.js';
 
- 	import {
 
- 		mapMutations
 
- 	} from 'vuex'
 
- 	export default {
 
- 		methods: {
 
- 			...mapMutations(['onLuanchLogin', 'getBLEDeviceList', 'getFinalUseDevice', 'onAccAndGyroConvertDataGet',
 
- 				'getGuideUnlockState', 'setGuideUnlockState'
 
- 			]),
 
- 		},
 
- 		onLaunch: function() {
 
- 			console.log('App Launch');
 
- 			//这里先隐藏游戏和视频栏目
 
- 			uni.setTabBarItem({
 
- 				index: 2,
 
- 				visible: false
 
- 			})
 
- 			uni.setTabBarItem({
 
- 				index: 3,
 
- 				visible: false
 
- 			})
 
- 			// 先判断 系统版本
 
- 			const _systemInfo = uni.getSystemInfoSync();
 
- 			// uni.getSystemInfo({
 
- 			// 	success: (res) => {
 
- 			// 		console.log("系统信息:", res);
 
- 			// 		this.$store.state.clientName = res.model;
 
- 			// 		this.$store.state.system = res.system;
 
- 			// 		this.$store.state.platform = res.platform;
 
- 			// 		this.$store.state.systemInfo = res;
 
- 			// 	},
 
- 			// 	fail: (err) => {},
 
- 			// 	complete: () => {}
 
- 			// })
 
- 			console.log("系统信息:", _systemInfo);
 
- 			this.$store.state.clientName = _systemInfo.model;
 
- 			this.$store.state.system = _systemInfo.system;
 
- 			this.$store.state.platform = _systemInfo.platform;
 
- 			this.$store.state.systemInfo = _systemInfo;
 
- 			//获取记录的最后一次连接
 
- 			this.getFinalUseDevice();
 
- 			//获取记录的蓝牙列表数据
 
- 			this.getBLEDeviceList();
 
- 			// #ifdef APP-PLUS
 
- 			plus.runtime.getProperty(plus.runtime.appid, (info) => {
 
- 				console.log("version:", info);
 
- 				this.$store.state.version = info.version;
 
- 				this.$store.state.versionCode = info.versionCode;
 
- 				this.$store.state.appName = info.name;
 
- 			});
 
- 			// 锁住屏幕正方向
 
- 			plus.screen.lockOrientation('portrait-primary');
 
- 			// 屏幕常亮
 
- 			// 下面这个打包要开启手机设置权限
 
- 			plus.device.setWakelock(true);
 
- 			// #endif
 
- 			// #ifdef MP
 
- 			//开始登陆
 
- 			this.onLuanchLogin({});
 
- 			// #endif
 
- 			this.onAccAndGyroConvertDataGet();
 
- 			// this.setGuideUnlockState({
 
- 			// 	//是否首次安装
 
- 			// 	firstInstallation: true,
 
- 			// 	firstDisconnectBluetooth: true,
 
- 			// 	firstUnlockJumpUp: true,
 
- 			// 	firstUnlockLeftAndRightJump: true,
 
- 			// 	firstUnlockLeftAndRightRotationJump: true
 
- 			// });
 
- 			//获取guide任务的解锁状态
 
- 			this.getGuideUnlockState();
 
- 			if (plus.runtime.isApplicationExist({
 
- 					pname: 'com.tencent.mm',
 
- 					action: 'weixin://'
 
- 				})) {
 
- 				//安装了微信
 
- 				// console.log("安装了微信");
 
- 				this.$store.state.bInstallWechat = true;
 
- 			} else {
 
- 				//未安装微信
 
- 				// console.log("未安装微信");
 
- 				this.$store.state.bInstallWechat = false;
 
- 			}
 
- 		},
 
- 		onShow: function() {
 
- 			console.log('App Show');
 
- 			// #ifdef APP-PLUS
 
- 			// 设置非暗夜模式
 
- 			var style = plus.navigator.getUIStyle();
 
- 			if ('dark' == style) {
 
- 				plus.nativeUI.setUIStyle('light');
 
- 			}
 
- 			// 锁住屏幕正方向
 
- 			// plus.screen.lockOrientation('portrait-primary');
 
- 			// 屏幕常亮
 
- 			// plus.device.setWakelock(true);
 
- 			// 下面这个打包要开启手机设置权限
 
- 			// uni.setScreenBrightness({
 
- 			//     value: 0.8,
 
- 			//     success: function () {
 
- 			//         console.log('setScreenBrightness success');
 
- 			//     }
 
- 			// });
 
- 			// uni.setKeepScreenOn({
 
- 			// 	keepScreenOn: true,
 
- 			// 	success: function () {
 
- 			// 	    console.log('setKeepScreenOn success');
 
- 			// 	}
 
- 			// });
 
- 			// let self = this;
 
- 			// uni.getScreenBrightness({
 
- 			//     success: function (res) {
 
- 			//         console.log('屏幕亮度值:' + res.value);
 
- 			// 		self.Test = '=='+plus.device.isWakelock()+ '=getScreenBrightness success';
 
- 			// 		self.screenValue = res.value;
 
- 			//     }
 
- 			// });
 
- 			// #endif
 
- 		},
 
- 		onHide: function() {
 
- 			console.log('App Hide')
 
- 		}
 
- 	}
 
- </script>
 
- <!-- <style src="@/util/util-css/main-nvue.css"></style> -->
 
- <style>
 
- 	/*每个页面公共css */
 
- 	// #ifndef APP-PLUS-NVUE
 
- 	@import "util/util-css/main.css";
 
- 	@import "util/util-css/icon.css";
 
- 	// #endif
 
- 	/* nvue 页面公共css */
 
- 	// #ifdef APP-PLUS-NVUE 
 
- 	@import "util/util-css/main-nvue.css";
 
- 	// #endif 
 
- </style>
 
 
  |