You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.2 KiB

//app.js
App({
release: false,
httpUrl: 'https://api-test.qniao.cn',
tmplIds: ['kg0T1ve0FpYrEtZ4ExbypHm8mtS7OJaehvqN_T9ypoI'],
globalData: {
userInfo: {},
openId: null,
token: null
},
onLaunch: function () {
if (this.release) {
this.httpUrl = 'https://api.qniao.cn'
} else {
this.httpUrl = 'https://api-test.qniao.cn'
}
wx.loadFontFace({
family: 'DINAlternate',
source: 'url("https://medou.oss-cn-shenzhen.aliyuncs.com/ttf/DIN-BoldAlternate.otf")',
success: function (res) {
}
})
wx.getSystemInfo({
success: e => {
this.globalData.StatusBar = e.statusBarHeight;
let custom = wx.getMenuButtonBoundingClientRect();
this.globalData.Custom = custom;
this.globalData.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
let windowHeight = e.windowHeight * (750 / e.windowWidth);
let statusBarHeight = this.globalData.CustomBar * (750 / e.windowWidth);
this.globalData.fragmentHeight = windowHeight - statusBarHeight
// console.log('fragmentHeight>>>' + this.globalData.fragmentHeight + ',windowHeight=' + windowHeight)
}
})
}
})