1 Star 0 Fork 0

时不待我/WeChat3D

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
app.js 1.18 KB
一键复制 编辑 原始数据 按行查看 历史
时不待我 提交于 2023-06-26 19:58 +08:00 . 初始化
/*
* @Author: 时不待我 790002517@qq.com
* @Date: 2023-02-12 12:21:32
* @LastEditors: 时不待我 790002517@qq.com
* @LastEditTime: 2023-03-26 15:28:04
*/
//app.js
App({
onLaunch: function () {
wx.getSystemInfo({
success: (res) => {
console.log(res);
// 获取可使用窗口宽度
this.globalData.systeminfo.height = res.windowHeight;
// 获取可使用窗口高度
this.globalData.systeminfo.width = res.windowWidth;
// 获取状态栏高度
this.globalData.systeminfo.statusBarHeight = res.statusBarHeight;
}
})
// 获得胶囊按钮位置信息
this.globalData.systeminfo.headerBtnPosi = wx.getMenuButtonBoundingClientRect()
//设置音频播放不受静音开关控制
wx.setInnerAudioOption({
obeyMuteSwitch: false,
success: function (e) {
console.log(e)
console.log('play success')
},
fail: function (e) {
console.log(e)
console.log('play fail')
}
})
},
globalData: {
systeminfo:{
height: 0, width: 0, statusBarHeight: 0 // 状态栏高度
},
headerBtnPosi: null,
StaticURL: 'https://.com',
},
})
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/time-doesnt-wait-for-me/we-chat3-d.git
git@gitee.com:time-doesnt-wait-for-me/we-chat3-d.git
time-doesnt-wait-for-me
we-chat3-d
WeChat3D
master

搜索帮助