-
Notifications
You must be signed in to change notification settings - Fork 71
/
Copy pathApp.vue
67 lines (55 loc) · 1.36 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
64
65
66
67
<script>
//app.js
import context from './lib/java110/Java110Context.js'
const loginFactory = context.factory.login;
const userFactory = context.factory.user;
import {reciveMessage} from './api/webView/webViewApi.js';
import {requestNoAuth} from './lib/java110/java110Request.js';
import url from './constant/url.js'
export default {
// 小程序启动生命周期
onLaunch: function() {
let that = this; // 检查登录状态
//loginFactory.checkLoginStatus(); // 获取用户地理位置
userFactory.getUserLocation();
// #ifdef H5
window.addEventListener("message", reciveMessage);
// #endif
uni.onTabBarMidButtonTap(()=>{
uni.navigateTo({
url:"/pages/machine/openDoorByQrCode",
animationType:'slide-in-bottom'
})
})
requestNoAuth({
url: url.listSystemInfo,
method: "GET",
data: {
page:1,
row:1
},
success: function(res) {
console.log(res.data);
if(res.data.data && res.data.data.length >0){
uni.setStorageSync('java110SystemConfig',res.data.data[0])
}
//reslove(res);
},
fail: function(e) {}
});
},
// app全局数据
globalData: {
userInfo: null
},
methods: {}
};
</script>
<style>
@import "./app.css";
/* #ifdef H5 */
uni-page-head {
display: none;
}
/* #endif */
</style>