-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.vue
134 lines (132 loc) · 4.41 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<script>
import Vue from 'vue';
import update from 'uni_modules/uni-upgrade-center-app/utils/check-update';
var jpushModule = null;
// #ifdef APP-PLUS
// jpushModule = uni.requireNativePlugin('JG-JPush');
//监听系统通知栏消息点击事件
var clientInfo = plus.push.getClientInfo();
console.log('push:id=' + clientInfo.id);
console.log('push:token=' + clientInfo.token);
console.log('push:clientid=' + clientInfo.clientid);
console.log('push:appid=' + clientInfo.appid);
console.log('push:appkey=' + clientInfo.appkey);
// #endif
export default {
onLaunch: function() {
uni.getSystemInfo({
success: function(e) {
// #ifndef MP
Vue.prototype.StatusBar = e.statusBarHeight;
if (e.platform == 'android') {
Vue.prototype.CustomBar = e.statusBarHeight + 44;
} else {
Vue.prototype.CustomBar = e.statusBarHeight + 44;
}
// #endif
// #ifdef MP-WEIXIN
Vue.prototype.StatusBar = e.statusBarHeight;
let custom = wx.getMenuButtonBoundingClientRect();
Vue.prototype.Custom = custom;
Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
// #endif
// #ifdef MP-ALIPAY
Vue.prototype.StatusBar = e.statusBarHeight;
Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
// #endif
// #ifdef H5
Vue.prototype.StatusBar = 0;
Vue.prototype.CustomBar = 44;
// #endif
}
});
//版本更新
update();
/* 推送 */
// if (uni.getSystemInfoSync().platform == 'ios') {
// if (jpushModule) {
// // 请求定位权限
// let locationServicesEnabled = jpushModule.locationServicesEnabled();
// let locationAuthorizationStatus = jpushModule.getLocationAuthorizationStatus();
// // console.log('locationAuthorizationStatus', locationAuthorizationStatus)
// if (locationServicesEnabled == true && locationAuthorizationStatus < 3) {
// jpushModule.requestLocationAuthorization(result => {
// // console.log('定位权限', result.status)
// });
// }
// jpushModule.requestNotificationAuthorization(result => {
// let status = result.status;
// if (status < 2) {
// // uni.showToast({
// // icon: 'none',
// // title: '您还没有打开通知权限',
// // duration: 3000
// // })
// }
// });
// }
// }
// if (jpushModule) {
// /* 初始化函数 */
// jpushModule.initJPushService();
// /* 设置 debug 模式 */
// jpushModule.setLoggerEnable(false);
// /* 连接状态回调 */
// jpushModule.addConnectEventListener(result => {
// let connectEnable = result.connectEnable;
// if (connectEnable == true) {
// jpushModule.getRegistrationID(result => {
// let registerID = result.registerID;
// uni.setStorageSync('registerID', registerID);
// // console.log("registerID:" + registerID)
// });
// }
// });
// // jpushModule.clearLocalNotifications()
// var that = this;
// /* 通知事件回调 */
// jpushModule.addNotificationListener(result => {
// if (result && result.notificationEventType && result.notificationEventType == 'notificationOpened' && result.extras && result.extras.dataid) {
// var urls = that.$config.url_config + '/api/Home/NewInfo?tid=' + result.extras.dataid + '&uid=' + that.$utils.getUserId();
// that.$config.noticeUrl = urls;
// uni.$emit('pushIntent', result.title);
// // var GeTuiSdk = plus.ios.importClass('GeTuiSdk');
// // plus.runtime.setBadgeNumber(0);
// }
// });
// /* 自定义消息事件回调 */
// jpushModule.addCustomMessageListener(result => {
// let type = result.type;
// let messageType = result.messageType;
// let content = result.content;
// uni.showToast({
// icon: 'none',
// title: JSON.stringify(result),
// duration: 3000
// });
// });
// /* 监听崩溃 */
// jpushModule.initCrashHandler();
// }
},
onShow: function() {},
onHide: function() {}
};
</script>
<style lang="scss">
@import 'uview-ui/index.scss';
/*每个页面公共css */
@import '@/common/common.style.scss';
/*toast字体图标*/
@import '@/components/iconfont.css';
.cell-hover-class {
background-color: #f7f8f9 !important;
}
::-webkit-scrollbar {
display: none;
width: 0 !important;
height: 0 !important;
-webkit-appearance: none;
background: transparent;
}
</style>