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
| <script>
| // import config from '@/common/config.js'
| const config = require('@/common/config.js')
| export default {
| globalData: {
| circleId: '',
| circlelat: '',
| circlelng: '',
| windowHeight: 0, //屏幕的高度
| rpxR: 0, //换算的单位
| statusBarHeight: uni.getSystemInfoSync()['statusBarHeight'], //不同机型导航栏高度
| isPerfectInfo: false, //是否完善个人信息
| cityCode: 0, //用户所在城市编码
| ...config.config,
| loginCallback: null,
| },
| onLaunch: function(options) {
| let that = this;
| // #ifdef MP-WEIXIN
| const updateManager = uni.getUpdateManager()
| updateManager.onCheckForUpdate(function(res) {
| // 请求完新版本信息的回调
|
| })
| updateManager.onUpdateReady(function() {
| uni.showModal({
| title: '更新提示',
| content: '新版本已经准备好,是否重启应用?',
| success(res) {
| if (res.confirm) {
| // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
| updateManager.applyUpdate()
| }
| }
| })
| })
| updateManager.onUpdateFailed(function() {
| // 新版本下载失败
| })
| // #endif
| //获取屏幕的高度
| uni.getSystemInfo({
| success: function(res) {
| var model = res.model;
| //判断设备是iPhone X
| if (model.search('iPhone X') != -1) {
| that.globalData.isIpx = true;
| } else {
| that.globalData.isIpx = false;
| }
| that.globalData.windowHeight = res.windowHeight;
| that.globalData.rpxR = res.windowHeight / res.windowWidth;
| }
| });
|
|
| },
| onShow: function() {
| console.log('App Show')
| },
| onHide: function() {
| console.log('App Hide')
| },
| methods: {
|
| }
| }
| </script>
|
| <style lang="scss">
| /*每个页面公共css */
| @import "@/uni_modules/uview-ui/index.scss";
| @import "@/common/scss/public.scss";
| </style>
|
|