forked from dcloudio/hello-uniapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.vue
94 lines (86 loc) · 2.77 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<script>
export default {
onLaunch: function() {
console.log('App Launch');
// #ifdef APP-PLUS
// 检测升级
uni.request({
url: 'https://uniapp.dcloud.io/update', //检查更新的服务器地址
data: {
appid: plus.runtime.appid,
version: plus.runtime.version,
imei: plus.device.imei
},
success: (res) => {
if (res.statusCode == 200 && res.data.isUpdate) {
let openUrl = plus.os.name === 'iOS' ? res.data.iOS : res.data.Android;
// 提醒用户更新
uni.showModal({
title: '更新提示',
content: res.data.note ? res.data.note : '是否选择更新',
success: (showResult) => {
if (showResult.confirm) {
plus.runtime.openURL(openUrl);
}
}
})
}
}
})
// #endif
},
onShow: function() {
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
},
globalData: {
test: ''
}
}
</script>
<style>
/* #ifndef APP-PLUS-NVUE */
/* uni.css - 通用组件、模板样式库,可以当作一套ui库应用 */
@import './common/uni.css';
/* 以下样式用于 hello uni-app 演示所需 */
page {
background-color: #F4F5F6;
height: 100%;
font-size: 28rpx;
line-height: 1.8;
}
.uni-header-logo {
padding: 30rpx;
flex-direction: column;
justify-content: center;
align-items: center;
margin-top: 10rpx;
}
.uni-header-image {
width: 100px;
height: 100px;
}
.uni-hello-text {
color: #7A7E83;
}
.uni-hello-addfile {
text-align: center;
line-height: 300rpx;
background: #FFF;
padding: 50rpx;
margin-top: 10px;
font-size: 38rpx;
color: #808080;
}
/* #endif*/
/* #ifdef MP-360 */
::-webkit-scrollbar {width: 4px; height: 4px; background-color: transparent;}
::-webkit-scrollbar-track {background-color: transparent;}
::-webkit-scrollbar-thumb {background-color: #ddd;}
::-webkit-scrollbar-thumb:hover {background-color: #ccc;}
::-webkit-scrollbar-thumb:active {background-color: #bbb;}
::-webkit-scrollbar-corner {background: #ffffff;}
/* #endif*/
</style>