12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <script>
- // import getWenjian from './utils/getWenjian.js' //方法:获取文件数据
- export default {
- onLaunch: function() {
- console.log('App Launch')
- plus.screen.lockOrientation('landscape-primary'); //锁定
- },
- onShow() {
- // #ifdef APP-PLUS
- // 隐藏顶部电池,时间等信息
- plus.navigator.setFullscreen(true);
- //隐藏虚拟按键
- // plus.navigator.hideSystemNavigation()
- // #endif
- },
- onHide: function() {
- console.log('App Hide')
- },
- created() {
- // getWenjian("/storage/emulated/0/QingTianGB_X/cadre.db").then(res => {
- // console.log(res);
- // })
- uni.getNetworkType({
- success: (res) => {
- if (res.networkType != "wifi") {
- console.log('未连接wifi');
- } else {
- this.changeWifiStatus(false)
- }
- }
- })
- },
- methods: {
- changeWifiStatus(value) {
- let wifiManager;
- let Context = plus.android.importClass("android.content.Context");
- let WifiManager = plus.android.importClass("android.net.wifi.WifiManager");
- wifiManager = plus.android.runtimeMainActivity().getSystemService(Context.WIFI_SERVICE);
- wifiManager.setWifiEnabled(value);
- },
- }
- }
- </script>
- <style lang="scss">
- /*每个页面公共css */
- @import "uview-ui/index.scss";
- .myChart {
- width: 100%;
- height: 100%;
- }
- page {
- height: 100%;
- font-size: 18rpx;
- }
- </style>
|