-
Notifications
You must be signed in to change notification settings - Fork 88
/
Copy pathApp.vue
53 lines (50 loc) · 1.27 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
<script>
export default {
onLaunch: function() {
console.log('App Launch');
// #ifdef APP-NVUE
plus.screen.lockOrientation('portrait-primary');
let appid = plus.runtime.appid;
if (appid && appid.toLocaleLowerCase() != "hbuilder") {
uni.request({
url: 'https://uniapp.dcloud.io/update', //检查更新的服务器地址
data: {
appid: plus.runtime.appid,
version: plus.runtime.version
},
success: (res) => {
console.log('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);
}
}
})
}
}
})
}
var domModule = weex.requireModule('dom');
domModule.addRule('fontFace', {
'fontFamily': "texticons",
'src': "url('./static/text-icon.ttf')"
});
// #endif
},
onShow: function() {
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
}
}
</script>
<style>
/*每个页面公共css */
</style>