-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.wxa
85 lines (83 loc) · 2.56 KB
/
app.wxa
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<template>
<page></page>
</template>
<script>
import system from './static/utils/system'
export default {
config: {
usingComponents: {},
pages: [
'pages/home/index',
'pages/plan/plan',
'pages/check/check',
'pages/past/past',
'pages/recog/recog',
'pages/modify/modify',
'pages/details/details',
'pages/today/today'
],
window: {
backgroundTextStyle: 'dark',
backgroundColor: '#FAFAFA',
navigationBarBackgroundColor: '#FFFFFF',
navigationBarTitleText: 'TouchUI',
navigationBarTextStyle: 'black'
},
networkTimeout: {
request: 10000
},
theme: {
'theme-color': '#39f'
}
},
globalData: {
server: 'http://47.95.113.33',
plan: [],
today: []
},
onLaunch() {
system.attachInfo()
},
onLoad() {},
onHide() {},
getOpenid() {
const that = this
wx.login({
timeout: 3000,
success: res => {
wx.request({
url: this.globalData.server + '/request_openid',
data: {
js_code: res.code
},
header: {
'content-type': 'application/json'
},
method: 'POST',
dataType: 'json',
success: result => {
console.log(result)
if (result.statusCode == 200) {
if (result.data.status == 200) {
wx.setStorage({
key: 'openid',
data: result.data.open_id
})
return 0
}
return 1
}
return 2
},
fail: () => {
return 3
}
})
}
})
}
}
</script>
<style lang="less">
@import './static/styles/index.less';
</style>