首页 > 其他分享 >uniapp获取设备信息:uni.getSystemInfo或uni.getSystemInfoSync,可用于设置顶部安全区

uniapp获取设备信息:uni.getSystemInfo或uni.getSystemInfoSync,可用于设置顶部安全区

时间:2023-07-20 10:44:24浏览次数:33  
标签:安全区 uniapp zh 44 414 uni getSystemInfoSync

uniapp获取设备信息:uni.getSystemInfo或uni.getSystemInfoSync,可用于设置顶部安全区

let sysInfo = uni.getSystemInfoSync(); console.log(sysInfo); //{

SDKVersion: "2.33.0"
appId: "__UNI__EEB4CD4"
appLanguage: "zh-Hans"
appName: "sc-vue3"
appVersion: "0.0.1"
appVersionCode: 1
batteryLevel: 100
benchmarkLevel: 1
bluetoothEnabled: true
brand: "devtools"
browserName: undefined
browserVersion: undefined
cameraAuthorized: true
deviceBrand: "devtools"
deviceId: "16897597042117133529"
deviceModel: "iPhone XR"
deviceOrientation: "portrait"
devicePixelRatio: 2
deviceType: "phone"
enableDebug: false
fontSizeSetting: 16
hostFontSizeSetting: 16
hostLanguage: "zh-CN"
hostName: "WeChat"
hostPackageName: undefined
hostSDKVersion: "2.33.0"
hostTheme: undefined
hostVersion: "8.0.5"
language: "zh_CN"
locationAuthorized: true
locationEnabled: true
microphoneAuthorized: true
mode: "default"
model: "iPhone XR"
notificationAuthorized: true
osLanguage: undefined
osName: "ios"
osTheme: undefined
osVersion: "10.0.1"
pixelRatio: 2
platform: "devtools"
safeArea: {top: 44, left: 0, right: 414, bottom: 862, width: 414, …}//安全区信息
safeAreaInsets: {top: 44, left: 0, right: 0, bottom: 34}//安全区信息
screenHeight: 896
screenWidth: 414
statusBarHeight: 44 //顶部安全区高度,单位是px需要自行转换 44px = 44/(windowWidth/750)rpx
system: "iOS 10.0.1"
ua: undefined
uniCompileVersion: "3.8.4"
uniPlatform: "mp-weixin"
uniRuntimeVersion: "3.8.4"
version: "8.0.5"
wifiEnabled: true
windowBottom: 0
windowHeight: 896//屏幕高度
windowTop: 0
windowWidth: 414//屏幕宽度

标签:安全区,uniapp,zh,44,414,uni,getSystemInfoSync
From: https://www.cnblogs.com/Dasate/p/17567692.html

相关文章

  • 设备唯一标识方法(Unique Identifier):如何在Windows系统上获取设备的唯一标识
      唯一的标识一个设备是一个基本功能,可以拥有很多应用场景,比如软件授权(如何保证你的软件在授权后才能在特定机器上使用)、软件License,设备标识,设备身份识别等。下面列举一下各种方法的优劣:(1)网卡MAC地址        MAC地址可能是最常用的标识方法,但是现在这种方法基本不可......
  • maven build 运行unit test失败 process exit code:134
    环境:JDK:17.0.7Springboot:3.1.0Junit:5问题:运行mvncleaninstall时在maven-surefire-plugin:test阶段失败。TheforkedVMterminatedwithoutprperlysayinggoodbye.VMcrashorSystem.exitcalled?dumpfile中的错误:Corruptedchannelbydirectlywriting......
  • uniapp专栏 —— vscode报错 'uni' is not defined.
    写在前面这些内容基于通过cli搭建的uniapp项目,使用了vite4,ts4.9,vue3(组合式API,setup语法糖)。如果有版本不一致,请谨慎参考。正文uni是一个全局变量,但是eslint没有识别到。避免这个错误报错在.eslintrc.js文件中加上配置globals:{uni:true},......
  • c++笔记-scoped_lock/unique_lock解析
    目录scoped_lockvsunique_lock灵活性生命周期资源所有权性能对比例源码unque_lockscoped_lockscoped_lockvsunique_lock在C++中,std::scoped_lock和std::unique_lock都是用来管理互斥量(mutex)的RAII(ResourceAcquisitionIsInitialization)类,用于简化多线程编程中的锁管理。它......
  • docker compose报错environment array items[0,4] must be unique
    DockerCompose报错:environmentarrayitems[0,4]mustbeunique在使用DockerCompose进行容器编排时,有时候会遇到以下错误提示:environmentarrayitems[0,4]mustbeunique。这个错误发生在定义了重复的环境变量时,本文将详细解释这个错误的原因,并提供解决方案。DockerCompose......
  • vue3,ts,vite4,uniapp设置路径别名
    安装依赖npminstall--save-dev@types/node配置vite.config.ts文件//vite.config.tsimport{defineConfig}from'vite';import{resolve}from'path';exportdefaultdefineConfig({resolve:{alias:{'/@/':resolve(......
  • uniapp小程序客服拖拽+左右吸附
    <template> <viewclass=""v-if="x!=0&&y!=0"> <movable-areaclass="movableArea"> <movable-viewclass="movableView":position="position":x="x":y="y&q......
  • uniq
    uniq显示或忽略重复的行。概要uniq[OPTION]...[INPUT[OUTPUT]]主要用途将输入文件(或标准输入)中邻近的重复行写入到输出文件(或标准输出)中。当没有选项时,邻近的重复行将合并为一个。选项-c,--count在每行开头增加重复次数。-d,--repeated......
  • 修改unittest中ddt中的源码,使得生成的htmltestrunner报告标题更直观
    ddt是unittest中配合数据驱动思想的一个模块,为了使得生成的报告标题更直观,现修改源码1.先把内置的ddt模块,复制到项目中,修改复制的后ddt文件,这样就不是直接改别人的源码了 2.具体如何修改在这个地方添加 @ddt.ddt中进去  ifisinstance(v,list):test_name=mk_tes......
  • [论文笔记] Line-CNN: End-to-End Traffic Line Detection With Line Proposal Unit
    IEEETITS2019YangJianlastupdate:2023/07/17简介作者受Faster-RCNN启发,提出Line-CNN,提出了一种新颖的车道线Anchor的表示方法,解决了车道线检测中表征的难点,实现了端到端的车道线检测.车道线是一条曲线,所以无法使用常规检测中矩形bbox作为Anchor,为了用Anchor来......