微信小程序开发之——获取系统信息,2021阿里、网易、京东等大厂最新Android面试题

news/2024/8/26 12:05:13 标签: 架构, 移动开发, android

用户字体大小

{{result.fontSizeSetting}}

客户端基础库版本

{{result.SDKVersion}}

设备性能等级

{{result.benchmarkLevel}}

设备方向

{{result.deviceOrientation}}

允许微信使用相册

{{result.albumAuthorized}}

允许微信使用摄像头

{{result.cameraAuthorized}}

允许微信
使用定位

{{result.locationAuthorized}}

允许微信使用麦克风

{{result.microphoneAuthorized}}

允许微信通知

{{result.notificationAuthorized}}

微信通知带有提醒

{{result.notificationAlertAuthorized}}

微信通知带有标记

{{result.notificationBadgeAuthorized}}

微信通知带有声音

{{result.notificationSoundAuthorized}}

微信使用日历

{{result.phoneCalendarAuthorized}}

蓝牙开关

{{result.bluetoothEnabled}}

地理位置开关

{{result.locationEnabled}}

Wi-Fi开关

{{result.wifiEnabled}}

系统当前主题

{{result.theme}}

3.2 样式文件(systemInfo.wxss)

/* pages/systemInfo/systemInfo.wxss */

.table{

border: 1px solid orange;

font-size: 40rpx;

font-family: ‘Franklin Gothic Medium’, ‘Arial Narrow’, Arial, sans-serif;

}

.tr{

display: flex;

width: 100%;

justify-content: center;

height: 2rem;

align-items: center;

}

.th{

width: 50%;

display: flex;

justify-content: center;

align-items: center;

background: #3366ff;

color: #fff;

height: 2rem;

border-right: 1px black solid;

}

.th:last-child{

border-right: none;

}

.td{

width: 50%;

display: flex;

justify-content: center;

align-items: center;

text-align: center;

height: 2rem;

border-right: 1px black solid;

border-bottom: 1px black solid;

}

.td:last-child{

border-right: none;

}

3.3 逻辑文件

// pages/systemInfo/systemInfo.js

Page({

/**

  • 生命周期函数–监听页面加载

*/

onLoad: function (options) {

wx.getSystemInfo({

success: (result) => {

this.setData({

result

})

console.log(result)

},

fail:err=>{

console.log(“信息获取失败”)

}

})

},

})

3.4 systemInfo.json

/systemInfo/systemInfo.js

Page({

/**

  • 生命周期函数–监听页面加载

*/

onLoad: function (options) {

wx.getSystemInfo({

success: (result) => {

this.setData({

result

})

console.log(result)

},

fail:err=>{

console.log(“信息获取失败”)

}

})

},

})

3.4 systemInfo.json


http://www.niftyadmin.cn/n/1720048.html

相关文章

为什么开发人员对于PHP语言褒贬不一

PHP 语言,作为服务器端开发的脚本语言,在网站开发方面非常有名。从1995年 Rasmus Lerdorf 创建之后,W3Techs 的调查显示在已知的服务端编程语言中,PHP 占了82%。其中不乏WordPress,Facebook 这种公司。PHP 语言&#x…

关于标准android中视频播放器中的快进和快退的步长时间设置

文件 :frameworks/base/core/java/android/widget/MediaController.java private View.OnClickListener mRewListener new View.OnClickListener() {public void onClick(View v) {int pos mPlayer.getCurrentPosition();pos - 5000; // millisecondsmPlayer.seek…

dump数据方法

//media.vt.dumpdata //Pvmi_mio_comm_ril.cpp

CentOS在VMware中的安装

1、启动VMware 2、新建一台虚拟机,选择典型 3、选择稍后安装操作系统 4、选择引导系统为Linux,系统版本为Centos 5、选择安装位置 6、选择最大磁盘容量 7、点击自定义硬件,进行硬件设置 8、 9、启动程序,安装系统 10、选择中文&am…

机器视觉-相机镜头光源介绍及选型-11.采集卡

采集卡 1.1.定义: 将视频信号经AD转换成电脑可用数字格式,经PCI总线实时传到内存和显存。 采集卡传送数据采用PCI Master Burst方式,图像传送速度高达40MB/S,实现图像到内存可靠实时传送, 几乎不占用CPU时…

基础乐理--变音记号

用来表示升高或降低基本音级的记号叫做变音记号。 变音记号有五种: 升记号(#)表示将基本音级升高半音。 降记号(b)表示将基本音级降低半音。 重升记号()表示将基本音级升高两个半音&#xf…

机器视觉-相机镜头光源介绍及选型-12.系统选型

系统选型 1.选型步骤: 选择相机 采集卡 选择镜头 光源 #二者结合选择 1.1.面阵相机选型 1).彩色还是黑白 2).确定X、Y单方向的精度要求,获得所需要的分辨率 3).根据物体位置变化速度,推算所需要的帧速 4).在合适的相机中选择数据输…

onRetainNonConfigurationInstance()

关于转屏,与activity状态的保存 比较onSaveInstanceState() 与 onRetainNonConfigurationInstance()在不同需求中的用法 针对Android平台,不论出于哪种目的,都或多或少需要在多个Activities中的跳转操作,其中包括为了获得某些系统…