3 files modified
9 files added
| | |
| | | import { useGlobalWS } from '@/hooks/useGlobalWS.js' |
| | | // #ifdef APP-PLUS |
| | | import { keepAliveStart, requestIgnoreBatteryOptimization } from '@/uni_modules/keep-app' |
| | | import { openDialog,closeDialog } from '@/uni_modules/lgh-dialog' |
| | | // #endif |
| | | |
| | | const appStore = useAppStore() |
| | |
| | | // console.log('电池电量:', getBatteryCapacity()) |
| | | // #endif |
| | | |
| | | const valuetest = ref(1) |
| | | const currentKey = ref(1) |
| | | function tests() { |
| | | setInterval(() => { |
| | | valuetest.value = valuetest.value + 1 |
| | | console.log('valuetest.value:', valuetest.value) |
| | | uni.showToast({ title: valuetest.value, icon: 'none' }) |
| | | currentKey.value = currentKey.value + 1 |
| | | const val = '保活服务验证:' + currentKey.value |
| | | console.log(val) |
| | | uni.showToast({ title: val, icon: 'none' }) |
| | | }, 1000) |
| | | } |
| | | |
| | | function popUpInterface() { |
| | | uni.showToast({ title: '弹框', icon: 'none' }) |
| | | openDialog() |
| | | } |
| | | |
| | | setTimeout(() => { |
| | | popUpInterface() |
| | | },10000) |
| | | |
| | | setTimeout(() => { |
| | | closeDialog() |
| | | },20000) |
| | | |
| | | tests() |
| | | useGlobalWS() |
| | | |
| | |
| | | // #ifdef APP-PLUS |
| | | keepAliveStart() |
| | | // 请求用户允许忽略电池优化(重要:用于保活) |
| | | setTimeout(() => { |
| | | requestIgnoreBatteryOptimization() |
| | | }, 2000) |
| | | setTimeout(requestIgnoreBatteryOptimization, 2000) |
| | | // #endif |
| | | if (!userStore.userInfo) { |
| | | //不存在则跳转至登录页 |
| | |
| | | { |
| | | "name": "吉安低空", |
| | | "appid": "__UNI__FFA6B4D", |
| | | "description": "", |
| | | "versionName": "1.0.1", |
| | | "versionCode": 101, |
| | | "transformPx": false, |
| | | /* 5+App特有相关 */ |
| | | "app-plus": { |
| | | "orientation": [ |
| | | //竖屏正方向 |
| | | "portrait-primary", |
| | | //竖屏反方向 |
| | | "portrait-secondary", |
| | | //横屏正方向 |
| | | "landscape-primary", |
| | | //横屏反方向 |
| | | "landscape-secondary", |
| | | //自然方向 |
| | | "default" |
| | | ], |
| | | "usingComponents": true, |
| | | "nvueStyleCompiler": "uni-app", |
| | | "compilerVersion": 3, |
| | | "splashscreen": { |
| | | "alwaysShowBeforeRender": true, |
| | | "waiting": true, |
| | | "autoclose": true, |
| | | "delay": 0 |
| | | }, |
| | | /* 模块配置 */ |
| | | "modules": { |
| | | "Share": {} |
| | | }, |
| | | /* 应用发布信息 */ |
| | | "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.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.autofocus\"/>", |
| | | "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>", |
| | | "<uses-permission android:name=\"android.permission.CAMERA\"/>", |
| | | "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>", |
| | | "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>", |
| | | "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>", |
| | | "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>", |
| | | "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>", |
| | | "<uses-feature android:name=\"android.hardware.camera\"/>", |
| | | "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>", |
| | | "<uses-permission android:name=\"android.permission.RECORD_AUDIO\" />", |
| | | "<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" />", |
| | | "<uses-permission android:name=\"android.permission.FOREGROUND_SERVICE\" />", |
| | | "<uses-permission android:name=\"android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS\" />" |
| | | ] |
| | | }, |
| | | /* ios打包配置 */ |
| | | "ios": { |
| | | "dSYMs": false |
| | | }, |
| | | /* SDK配置 */ |
| | | "sdkConfigs": { |
| | | "share": { |
| | | "weixin": { |
| | | "appid": "gh_f2fbbd1d5d2a", |
| | | "UniversalLinks": "" |
| | | } |
| | | } |
| | | }, |
| | | "icons": { |
| | | "android": { |
| | | "hdpi": "src/static/images/app-logo.png", |
| | | "xhdpi": "src/static/images/app-logo.png", |
| | | "xxhdpi": "src/static/images/app-logo.png", |
| | | "xxxhdpi": "src/static/images/app-logo.png" |
| | | } |
| | | } |
| | | }, |
| | | "nativePlugins": {} |
| | | }, |
| | | /* 快应用特有相关 */ |
| | | "quickapp": {}, |
| | | /* 小程序特有相关 */ |
| | | "mp-weixin": { |
| | | "appid": "wx05742eafb412a57a", |
| | | "setting": { |
| | | "urlCheck": false |
| | | }, |
| | | "usingComponents": true |
| | | }, |
| | | "mp-alipay": { |
| | | "usingComponents": true |
| | | }, |
| | | "mp-baidu": { |
| | | "usingComponents": true |
| | | }, |
| | | "mp-toutiao": { |
| | | "usingComponents": true |
| | | }, |
| | | "uniStatistics": { |
| | | "enable": false |
| | | }, |
| | | "vueVersion": "3", |
| | | "h5": { |
| | | "router": { |
| | | "mode": "hash", |
| | | "base": "/work-app/" |
| | | } |
| | | } |
| | | "name" : "吉安低空", |
| | | "appid" : "__UNI__FFA6B4D", |
| | | "description" : "", |
| | | "versionName" : "1.0.1", |
| | | "versionCode" : 101, |
| | | "transformPx" : false, |
| | | /* 5+App特有相关 */ |
| | | "app-plus" : { |
| | | "orientation" : [ |
| | | //竖屏正方向 |
| | | "portrait-primary", |
| | | //竖屏反方向 |
| | | "portrait-secondary", |
| | | //横屏正方向 |
| | | "landscape-primary", |
| | | //横屏反方向 |
| | | "landscape-secondary", |
| | | //自然方向 |
| | | "default" |
| | | ], |
| | | "usingComponents" : true, |
| | | "nvueStyleCompiler" : "uni-app", |
| | | "compilerVersion" : 3, |
| | | "splashscreen" : { |
| | | "alwaysShowBeforeRender" : true, |
| | | "waiting" : true, |
| | | "autoclose" : true, |
| | | "delay" : 0 |
| | | }, |
| | | /* 模块配置 */ |
| | | "modules" : { |
| | | "Share" : {} |
| | | }, |
| | | /* 应用发布信息 */ |
| | | "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.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.autofocus\"/>", |
| | | "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>", |
| | | "<uses-permission android:name=\"android.permission.CAMERA\"/>", |
| | | "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>", |
| | | "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>", |
| | | "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>", |
| | | "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>", |
| | | "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>", |
| | | "<uses-feature android:name=\"android.hardware.camera\"/>", |
| | | "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>", |
| | | "<uses-permission android:name=\"android.permission.RECORD_AUDIO\" />", |
| | | "<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" />", |
| | | "<uses-permission android:name=\"android.permission.FOREGROUND_SERVICE\" />", |
| | | "<uses-permission android:name=\"android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS\" />", |
| | | "<uses-permission android:name=\"android.permission.SYSTEM_ALERT_WINDOW\" />", |
| | | "<uses-permission android:name=\"android.permission.USE_FULL_SCREEN_INTENT\" />" |
| | | ] |
| | | }, |
| | | /* ios打包配置 */ |
| | | "ios" : { |
| | | "dSYMs" : false |
| | | }, |
| | | /* SDK配置 */ |
| | | "sdkConfigs" : { |
| | | "share" : { |
| | | "weixin" : { |
| | | "appid" : "gh_f2fbbd1d5d2a", |
| | | "UniversalLinks" : "" |
| | | } |
| | | } |
| | | }, |
| | | "icons" : { |
| | | "android" : { |
| | | "hdpi" : "src/static/images/app-logo.png", |
| | | "xhdpi" : "src/static/images/app-logo.png", |
| | | "xxhdpi" : "src/static/images/app-logo.png", |
| | | "xxxhdpi" : "src/static/images/app-logo.png" |
| | | } |
| | | } |
| | | }, |
| | | "nativePlugins" : {} |
| | | }, |
| | | /* 快应用特有相关 */ |
| | | "quickapp" : {}, |
| | | /* 小程序特有相关 */ |
| | | "mp-weixin" : { |
| | | "appid" : "wx05742eafb412a57a", |
| | | "setting" : { |
| | | "urlCheck" : false |
| | | }, |
| | | "usingComponents" : true |
| | | }, |
| | | "mp-alipay" : { |
| | | "usingComponents" : true |
| | | }, |
| | | "mp-baidu" : { |
| | | "usingComponents" : true |
| | | }, |
| | | "mp-toutiao" : { |
| | | "usingComponents" : true |
| | | }, |
| | | "uniStatistics" : { |
| | | "enable" : false |
| | | }, |
| | | "vueVersion" : "3", |
| | | "h5" : { |
| | | "router" : { |
| | | "mode" : "hash", |
| | | "base" : "/work-app/" |
| | | } |
| | | } |
| | | } |
| | | |
| New file |
| | |
| | | { |
| | | "id": "lgh-dialog", |
| | | "displayName": "lgh-dialog", |
| | | "version": "1.0.0", |
| | | "description": "lgh-dialog", |
| | | "keywords": [ |
| | | "lgh-dialog" |
| | | ], |
| | | "repository": "", |
| | | "engines": { |
| | | "HBuilderX": "^3.6.8", |
| | | "uni-app": "^3.1.0", |
| | | "uni-app-x": "^3.1.0" |
| | | }, |
| | | "dcloudext": { |
| | | "type": "uts", |
| | | "sale": { |
| | | "regular": { |
| | | "price": "0.00" |
| | | }, |
| | | "sourcecode": { |
| | | "price": "0.00" |
| | | } |
| | | }, |
| | | "contact": { |
| | | "qq": "" |
| | | }, |
| | | "declaration": { |
| | | "ads": "", |
| | | "data": "", |
| | | "permissions": "" |
| | | }, |
| | | "npmurl": "", |
| | | "darkmode": "-", |
| | | "i18n": "-", |
| | | "widescreen": "-" |
| | | }, |
| | | "uni_modules": { |
| | | "dependencies": [], |
| | | "encrypt": [], |
| | | "platforms": { |
| | | "cloud": { |
| | | "tcb": "-", |
| | | "aliyun": "-", |
| | | "alipay": "-" |
| | | }, |
| | | "client": { |
| | | "uni-app": { |
| | | "vue": { |
| | | "vue2": "-", |
| | | "vue3": "-" |
| | | }, |
| | | "web": { |
| | | "safari": "-", |
| | | "chrome": "-" |
| | | }, |
| | | "app": { |
| | | "vue": "-", |
| | | "nvue": "-", |
| | | "android": "-", |
| | | "ios": "-", |
| | | "harmony": "-" |
| | | }, |
| | | "mp": { |
| | | "weixin": "-", |
| | | "alipay": "-", |
| | | "toutiao": "-", |
| | | "baidu": "-", |
| | | "kuaishou": "-", |
| | | "jd": "-", |
| | | "harmony": "-", |
| | | "qq": "-", |
| | | "lark": "-" |
| | | }, |
| | | "quickapp": { |
| | | "huawei": "-", |
| | | "union": "-" |
| | | } |
| | | }, |
| | | "uni-app-x": { |
| | | "web": { |
| | | "safari": "-", |
| | | "chrome": "-" |
| | | }, |
| | | "app": { |
| | | "android": "-", |
| | | "ios": "-", |
| | | "harmony": "-" |
| | | }, |
| | | "mp": { |
| | | "weixin": "-" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | # lgh-dialog |
| | | ### 开发文档 |
| | | [UTS 语法](https://uniapp.dcloud.net.cn/tutorial/syntax-uts.html) |
| | | [UTS API插件](https://uniapp.dcloud.net.cn/plugin/uts-plugin.html) |
| | | [UTS uni-app兼容模式组件](https://uniapp.dcloud.net.cn/plugin/uts-component.html) |
| | | [UTS 标准模式组件](https://doc.dcloud.net.cn/uni-app-x/plugin/uts-vue-component.html) |
| | | [Hello UTS](https://gitcode.net/dcloud/hello-uts) |
| New file |
| | |
| | | { |
| | | "minSdkVersion": "21" |
| | | } |
| New file |
| | |
| | | import Build from "android.os.Build"; |
| | | import Context from "android.content.Context"; |
| | | import WindowManager from "android.view.WindowManager"; |
| | | import TextView from "android.widget.TextView"; |
| | | import Gravity from "android.view.Gravity"; |
| | | import Color from "android.graphics.Color"; |
| | | import PixelFormat from "android.graphics.PixelFormat"; |
| | | import Settings from "android.provider.Settings"; |
| | | import { UTSAndroid } from "io.dcloud.uts"; |
| | | |
| | | let dialogView: TextView | null = null; |
| | | |
| | | export function openDialog(): void { |
| | | const context = UTSAndroid.getAppContext(); |
| | | if (context == null || dialogView != null) return; |
| | | |
| | | if (Build.VERSION.SDK_INT >= 23 && !Settings.canDrawOverlays(context)) { |
| | | console.error("无悬浮窗权限"); |
| | | return; |
| | | } |
| | | |
| | | const wm = context.getSystemService(Context.WINDOW_SERVICE) as WindowManager; |
| | | if (wm == null) return; |
| | | |
| | | dialogView = new TextView(context); |
| | | dialogView!.setText("系统接听页面"); |
| | | dialogView!.setTextColor(Color.WHITE); |
| | | dialogView!.setTextSize(22.0.toFloat()); |
| | | dialogView!.setGravity(Gravity.CENTER); |
| | | dialogView!.setBackgroundColor(Color.parseColor("#CC000000")); |
| | | |
| | | const type = Build.VERSION.SDK_INT >= 26 ? WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY : WindowManager.LayoutParams.TYPE_PHONE; |
| | | const flags = WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS | |
| | | WindowManager.LayoutParams.FLAG_FULLSCREEN | |
| | | WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | |
| | | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON | |
| | | WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON; |
| | | |
| | | const params = new WindowManager.LayoutParams( |
| | | WindowManager.LayoutParams.MATCH_PARENT, |
| | | WindowManager.LayoutParams.MATCH_PARENT, |
| | | type, |
| | | flags, |
| | | PixelFormat.TRANSLUCENT |
| | | ); |
| | | |
| | | try { |
| | | wm.addView(dialogView, params); |
| | | } catch (e) { |
| | | console.error(e); |
| | | dialogView = null; |
| | | } |
| | | } |
| | | |
| | | export function closeDialog(): void { |
| | | if (dialogView == null) return; |
| | | try { |
| | | const context = UTSAndroid.getAppContext(); |
| | | if (context == null) return; |
| | | const wm = context.getSystemService(Context.WINDOW_SERVICE) as WindowManager; |
| | | wm.removeView(dialogView); |
| | | } catch (e) { |
| | | console.error(e); |
| | | } finally { |
| | | dialogView = null; |
| | | } |
| | | } |
| New file |
| | |
| | | { |
| | | "deploymentTarget": "12" |
| | | } |
| New file |
| | |
| | | /** |
| | | * 引用 iOS 系统库,示例如下: |
| | | * import { UIDevice } from "UIKit"; |
| | | * [可选实现,按需引入] |
| | | */ |
| | | |
| | | /* 引入 interface.uts 文件中定义的变量 */ |
| | | import { MyApiOptions, MyApiResult, MyApi, MyApiSync } from '../interface.uts'; |
| | | |
| | | /* 引入 unierror.uts 文件中定义的变量 */ |
| | | import { MyApiFailImpl } from '../unierror'; |
| | | |
| | | /** |
| | | * 引入三方库 |
| | | * [可选实现,按需引入] |
| | | * |
| | | * 在 iOS 平台引入三方库有以下两种方式: |
| | | * 1、通过引入三方库framework 或者.a 等方式,需要将 .framework 放到 ./Frameworks 目录下,将.a 放到 ./Libs 目录下。更多信息[详见](https://uniapp.dcloud.net.cn/plugin/uts-plugin.html#ios-平台原生配置) |
| | | * 2、通过 cocoaPods 方式引入,将要引入的 pod 信息配置到 config.json 文件下的 dependencies-pods 字段下。详细配置方式[详见](https://uniapp.dcloud.net.cn/plugin/uts-ios-cocoapods.html) |
| | | * |
| | | * 在通过上述任意方式依赖三方库后,使用时需要在文件中 import: |
| | | * 示例:import { LottieLoopMode } from 'Lottie' |
| | | */ |
| | | |
| | | /** |
| | | * UTSiOS 为平台内置对象,不需要 import 可直接调用其API,[详见](https://uniapp.dcloud.net.cn/uts/utsios.html) |
| | | */ |
| | | |
| | | /** |
| | | * 异步方法 |
| | | * |
| | | * uni-app项目中(vue/nvue)调用示例: |
| | | * 1、引入方法声明 import { myApi } from "@/uni_modules/uts-api" |
| | | * 2、方法调用 |
| | | * myApi({ |
| | | * paramA: false, |
| | | * complete: (res) => { |
| | | * console.log(res) |
| | | * } |
| | | * }); |
| | | * |
| | | */ |
| | | export const myApi : MyApi = function (options : MyApiOptions) { |
| | | |
| | | if (options.paramA == true) { |
| | | // 返回数据 |
| | | const res : MyApiResult = { |
| | | fieldA: 85, |
| | | fieldB: true, |
| | | fieldC: 'some message' |
| | | }; |
| | | options.success?.(res); |
| | | options.complete?.(res); |
| | | |
| | | } else { |
| | | // 返回错误 |
| | | let failResult = new MyApiFailImpl(9010001); |
| | | options.fail?.(failResult) |
| | | options.complete?.(failResult) |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 同步方法 |
| | | * |
| | | * uni-app项目中(vue/nvue)调用示例: |
| | | * 1、引入方法声明 import { myApiSync } from "@/uni_modules/uts-api" |
| | | * 2、方法调用 |
| | | * myApiSync(true); |
| | | * |
| | | */ |
| | | export const myApiSync : MyApiSync = function (paramA : boolean) : MyApiResult { |
| | | // 返回数据,根据插件功能获取实际的返回值 |
| | | const res : MyApiResult = { |
| | | fieldA: 85, |
| | | fieldB: paramA, |
| | | fieldC: 'some message' |
| | | }; |
| | | return res; |
| | | } |
| | | |
| | | /** |
| | | * 更多插件开发的信息详见:https://uniapp.dcloud.net.cn/plugin/uts-plugin.html |
| | | */ |
| New file |
| | |
| | | /** |
| | | * interface.uts |
| | | * uts插件接口定义文件,按规范定义接口文件可以在HBuilderX中更好的做到语法提示 |
| | | */ |
| | | |
| | | /** |
| | | * myApi 异步函数的参数,在type里定义函数需要的参数以及api成功、失败的相关回调函数。 |
| | | */ |
| | | export type MyApiOptions = { |
| | | paramA : boolean |
| | | success ?: (res : MyApiResult) => void |
| | | fail ?: (res : MyApiFail) => void |
| | | complete ?: (res : any) => void |
| | | } |
| | | |
| | | /** |
| | | * 函数返回结果 |
| | | * 可以是void, 基本数据类型,自定义type, 或者其他类型。 |
| | | * [可选实现] |
| | | */ |
| | | export type MyApiResult = { |
| | | fieldA : number, |
| | | fieldB : boolean, |
| | | fieldC : string |
| | | } |
| | | |
| | | /** |
| | | * 错误码 |
| | | * 根据uni错误码规范要求,建议错误码以90开头,以下是错误码示例: |
| | | * - 9010001 错误信息1 |
| | | * - 9010002 错误信息2 |
| | | */ |
| | | export type MyApiErrorCode = 9010001 | 9010002; |
| | | /** |
| | | * myApi 的错误回调参数 |
| | | */ |
| | | export interface MyApiFail extends IUniError { |
| | | errCode : MyApiErrorCode |
| | | }; |
| | | |
| | | /* 异步函数定义 */ |
| | | export type MyApi = (options : MyApiOptions) => void |
| | | |
| | | /* 同步函数定义 */ |
| | | export type MyApiSync = (paramA : boolean) => MyApiResult |
| New file |
| | |
| | | /* 此规范为 uni 规范,可以按照自己的需要选择是否实现 */ |
| | | import { MyApiErrorCode, MyApiFail } from "./interface.uts" |
| | | /** |
| | | * 错误主题 |
| | | * 注意:错误主题一般为插件名称,每个组件不同,需要使用时请更改。 |
| | | * [可选实现] |
| | | */ |
| | | export const UniErrorSubject = 'uts-api'; |
| | | |
| | | |
| | | /** |
| | | * 错误信息 |
| | | * @UniError |
| | | * [可选实现] |
| | | */ |
| | | export const MyAPIErrors : Map<MyApiErrorCode, string> = new Map([ |
| | | /** |
| | | * 错误码及对应的错误信息 |
| | | */ |
| | | [9010001, 'custom error mseeage1'], |
| | | [9010002, 'custom error mseeage2'], |
| | | ]); |
| | | |
| | | |
| | | /** |
| | | * 错误对象实现 |
| | | */ |
| | | export class MyApiFailImpl extends UniError implements MyApiFail { |
| | | |
| | | /** |
| | | * 错误对象构造函数 |
| | | */ |
| | | constructor(errCode : MyApiErrorCode) { |
| | | super(); |
| | | this.errSubject = UniErrorSubject; |
| | | this.errCode = errCode; |
| | | this.errMsg = MyAPIErrors.get(errCode) ?? ""; |
| | | } |
| | | } |
| | |
| | | // index.uts |
| | | |
| | | // 引用android api |
| | | import Context from "android.content.Context"; |
| | | import BatteryManager from "android.os.BatteryManager"; |