更新记录
1.0.4(2025-07-23)
新增file: unifile:转base64
新增content://转path (uni.chooseFile)
1.0.3(2025-07-06)
- 新增获取APP图标
- 不想自定义基座重新打包,获取网络类型
1.0.2(2025-07-05)
不想重新打包自定义基座,陆续更新File方法
查看更多
平台兼容性
云端兼容性
uni-app(4.71)
Vue2 |
Vue2插件版本 |
Vue3 |
Vue2插件版本 |
Chrome |
Safari |
app-vue |
app-nvue |
Android |
iOS |
鸿蒙 |
√ |
1.0.0 |
√ |
1.0.0 |
× |
× |
× |
× |
× |
× |
× |
微信小程序 |
支付宝小程序 |
抖音小程序 |
百度小程序 |
快手小程序 |
京东小程序 |
鸿蒙元服务 |
QQ小程序 |
飞书小程序 |
快应用-华为 |
快应用-联盟 |
× |
× |
× |
× |
× |
× |
× |
× |
× |
× |
× |
uni-app x(4.71)
Chrome |
Safari |
Android |
Android插件版本 |
iOS |
鸿蒙 |
微信小程序 |
× |
× |
5.0 |
1.0.0 |
× |
× |
× |
acwy-common-api
方法
请求权限
requestPermission(['android.permission.READ_PHONE_STATE']).then(res=>{
// true
}).catch{
// false
}
获取IMEI 安卓9以下
// 首先需要获取电话权限
const imei: string = getImei()
使用浏览器打开Url
openUrl(url : string)
检查应用是否存在
const hasInstall: Boolean = isAppInstalled(packageName: String)
根据包名获取AppName
const appName: String = getAppNameByPackageName(packageName: String)
file: unifile:转base64
/**
* @description path转base64
* @param path /storage/emulated/ 如果是file: unifile: 需要UTSAndroid.convert2AbsFullPath转一下
* @return base64 不带base64前缀
*/
pathToBase64(path: string)
content://转path (uni.chooseFile)
/**
* @description chooseFile返回的tempFiles中的content协议文件转File
* @param name string 文件名
* @param contentPath string content协议文件
* @return File| null 返回File
*/
contentToFile(name: string, contentPath: string)