018A初步完成
This commit is contained in:
17
App.vue
17
App.vue
@ -35,6 +35,10 @@
|
||||
//以上代码仅在开发时使用,否则会出现不可预知的问题。
|
||||
|
||||
// #ifdef APP|APP-PLUS
|
||||
|
||||
let system=uni.getSystemInfoSync();
|
||||
|
||||
|
||||
let initOS = () => {
|
||||
let ble = bleTool.getBleTool();
|
||||
|
||||
@ -48,14 +52,17 @@
|
||||
}
|
||||
});
|
||||
if (!uni.setAppBadgeNumber) { //兼容鸿蒙的写法
|
||||
uni.setAppBadgeNumber = plus.runtime.setBadgeNumber;
|
||||
if(plus){
|
||||
uni.setAppBadgeNumber = plus.runtime.setBadgeNumber;
|
||||
}
|
||||
|
||||
}
|
||||
uni.onPushMessage((res) => {
|
||||
console.log("收到推送消息:", res); //监听推送消息
|
||||
if (res.type == 'click') {
|
||||
//将App角标设置为0,清空app在消息中心的所有消息
|
||||
uni.setAppBadgeNumber(0);
|
||||
plus.push.clear();
|
||||
plus && plus.push.clear();
|
||||
return;
|
||||
}
|
||||
uni.createPushMessage({
|
||||
@ -66,6 +73,7 @@
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
if (plus.os.name == 'Android') {
|
||||
if (plus.runtime.isAgreePrivacy()) {
|
||||
initOS();
|
||||
@ -75,7 +83,7 @@
|
||||
}
|
||||
|
||||
|
||||
let system=uni.getSystemInfoSync();
|
||||
|
||||
console.log("system=",system);
|
||||
// #endif
|
||||
},
|
||||
@ -206,6 +214,9 @@
|
||||
color: #ffffffde;
|
||||
}
|
||||
|
||||
.uni-app--maxwidth,.uni-body{
|
||||
background-color: #121212;
|
||||
}
|
||||
|
||||
.fleft {
|
||||
float: left;
|
||||
|
||||
Reference in New Issue
Block a user