-
Notifications
You must be signed in to change notification settings - Fork 12
/
app.js
51 lines (46 loc) · 1.06 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//app.js
App({
onLaunch: function() {
let that = this;
if (!wx.cloud) {
console.error('请使用 2.2.3 或以上的基础库以使用云能力')
} else {
wx.cloud.init({
env: 'lebu-t05b2',
traceUser: true,
})
}
// wx.cloud.callFunction({
// name:'getopenid',
// complete:res=>{
// //记录openid
// this.globalData.openid = res.result.openid;
// }
// })
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
})
// 登录
wx.login({success: res => {}})
// 获取用户信息
wx.getSetting({
success: res => {
if (res.authSetting['scope.userInfo']) {
wx.getUserInfo({
success: res => {
this.globalData.userInfo = res.userInfo
if (this.userInfoReadyCallback) {
this.userInfoReadyCallback(res)
}
}
})
}
}
})
},
globalData: {
userInfo: null,
openid: null
}
})