-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
32 lines (31 loc) · 1.16 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { CloudEnvId, showApiKey, showApiAppId } from './accountconfig';
App({
onLaunch() {
wx.cloud.init({
// env: CloudEnvId,
traceUser: true,
})
this.globalData.platform = typeof tt !== 'undefined' ? 'tt' : 'wx';
wx.getSystemInfo({
success: (res) => {
this.globalData.StatusBar = res.statusBarHeight;
let custom = wx.getMenuButtonBoundingClientRect();
this.globalData.Custom = custom;
this.globalData.CustomBar = custom.bottom + custom.top - res.statusBarHeight;
this.globalData.systeminfo = res
this.globalData.isIPhoneX = /iphonex/gi.test(res.model.replace(/\s+/, ''))
},
})
},
globalData: {
// keepscreenon:false,
systeminfo: {},
isIPhoneX: false,
weatherIconUrl: 'https://cdn.heweather.com/cond_icon/',
requestUrl: {
weather: `https://route.showapi.com/9-5?showapi_appid=${showApiAppId}&showapi_sign=${showApiKey}prov=北京`,
oilprice: `https://route.showapi.com/138-46?showapi_appid=${showApiAppId}&showapi_sign=${showApiKey}`,
hourly: `https://route.showapi.com/9-8?showapi_appid=${showApiAppId}&showapi_sign=${showApiKey}`,
},
},
})