12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- <script>
- import config from 'common/config.js';
- import {
- mapMutations
- } from 'vuex'
- export default {
- methods: {
- ...mapMutations(['onLuanchLogin', 'getBLEDeviceList','getFinalUseDevice']),
- },
- onLaunch: function() {
- console.log('App Launch');
- // 先判断 系统版本
- 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
-
- },
- fail: (err) => {},
- complete: () => {}
- })
- //获取记录的最后一次连接
- 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
- },
- onShow: function() {
- console.log('App Show');
- // #ifdef APP-PLUS
- // 锁住屏幕正方向
- // 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>
- /*每个页面公共css */
- // #ifndef APP-PLUS-NVUE
- @import "util/util-css/main.css";
- @import "util/util-css/icon.css";
- // #endif
- </style>
|