1 Star 0 Fork 1

windmao / ktv

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
app.js 1.08 KB
一键复制 编辑 原始数据 按行查看 历史
// app.js
App({
onLaunch() {
// 展示本地存储能力
const logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
wx.setStorageSync('logs', logs)
// console.log(wx.getMenuButtonBoundingClientRect())
wx.getSystemInfo({
success: res => {
// console.log(res)
this.globalData.statusBarRight = res.screenWidth - wx.getMenuButtonBoundingClientRect().right
}
})
// 登录
wx.login({
success: res => {
// 发送 res.code 到后台换取 openId, sessionKey, unionId
}
})
},
onShow() {
wx.setKeepScreenOn({
keepScreenOn: true,
fail: function () {
wx.setKeepScreenOn({
keepScreenOn: true
});
},
});
},
systemInfo: () => {
let isIos = false
try {
const res = wx.getSystemInfoSync(),
system = res.system
system.search('iOS') !== -1 ? isIos = true : isIos = false
} catch (e) {
// Do something when catch error
}
return isIos
},
globalData: {
// Service: Service,
userInfo: null,
statusBarHeight: wx.getSystemInfoSync()['statusBarHeight'],
statusBarRight: wx.getMenuButtonBoundingClientRect()
}
})
1
https://gitee.com/maosixone/ktv.git
git@gitee.com:maosixone/ktv.git
maosixone
ktv
ktv
master

搜索帮助