-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.vue
63 lines (58 loc) · 1.21 KB
/
App.vue
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
52
53
54
55
56
57
58
59
60
61
62
63
<script>
export default {
onLaunch: function() {
// #ifdef MP-WEIXIN
uni.getProvider({
service: 'oauth',
success: (res) => {
if (~res.provider.indexOf('weixin')) {
uni.login({
provider: 'weixin',
success: res => {
if (res.errMsg == "login:ok") {
uni.setStorageSync('code', res.code);
this.$http.wxLogin({
code: res.code
}, msg => {
this.$db.set("userinfo", msg.data.userinfo)
this.$db.set("confirm_unionid", msg.data.confirm_unionid)
})
} else {
// reject(res);
}
},
fail: function(err) {
uni.showToast({
icon: none,
title: "授权失败!"
})
uni.hideLoading()
}
});
} else {
uni.showToast({
title: '请先安装微信或升级版本',
icon: "none"
});
}
},
})
// #endif
},
onShow: function() {
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
}
}
</script>
<style>
@import 'colorui/main.css';
@import 'colorui/icon.css';
@import 'style/icon.css';
/* @import 'style/app.scss'; */
page {
background-color: #fff;
}
</style>