微信小程序开发之——获取系统信息(1)

微信版本号

{{result.version}}

操作系统及版本

{{result.system}}

客户端平台

{{result.platform}}

用户字体大小

{{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

{

“navigationBarTitleText”: “设备信息”

}

最后

这里我希望可以帮助到大家提升进阶。

内容包含:Android学习PDF+架构视频+面试文档+源码笔记高级架构技术进阶脑图、Android开发面试专题资料,高级进阶架构资料 这几块的内容。非常适合近期有面试和想在技术道路上继续精进的朋友。

喜欢本文的话,不妨给我点个小赞、评论区留言或者转发支持一下呗~

img
《Android学习笔记总结+移动架构视频+大厂面试真题+项目实战源码》点击传送门,即可获取!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值