|
@@ -1,11 +1,44 @@
|
|
|
|
|
|
|
|
|
var alog = uni.requireNativePlugin("AndroidLog")
|
|
|
+let speaker = uni.requireNativePlugin("SpeechPlug");
|
|
|
const _handlePush = function(message) {
|
|
|
|
|
|
- alog.info({msg: '接收到推送信息:' + JSON.stringify(message)});
|
|
|
+ try {
|
|
|
+ alog.info({msg: '接收到推送信息:' + message.content});
|
|
|
+ let content = JSON.parse(message.content);
|
|
|
+ if (content.type === 1){
|
|
|
+ deviceParkIn(content)
|
|
|
+ }
|
|
|
+ } catch(e){
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
};
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+function deviceParkIn(content){
|
|
|
+ if(content.speakMsg){
|
|
|
+ speaker.speakAction(content.speakMsg)
|
|
|
+ }
|
|
|
+ uni.showModal({
|
|
|
+ title: '温馨提示',
|
|
|
+ content: content.popNode,
|
|
|
+ success: (res) => {
|
|
|
+ if(res.confirm){
|
|
|
+ uni.navigateTo({
|
|
|
+ url: content.jumpTo
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
function pushreg(vue){
|
|
|
alog.info({msg: '推送注册'});
|
|
|
|