|
@@ -5,15 +5,24 @@ let speaker = uni.requireNativePlugin("SpeechPlug");
|
|
|
const _handlePush = function(message) {
|
|
|
//{"message":{"__UUID__":"androidPushMsg222631973","appid":"__UNI__29ECCC8","content":"{\"type\":2,\"jumpTo\":\"pages/login/login\"}","payload":{"jumpTo":"pages/login/login","type":2},"title":"智慧停车PDA"}}
|
|
|
try {
|
|
|
+ alog.info({msg: '接收到消息:' + message});
|
|
|
const value = uni.getStorageSync('pushreg_switch');
|
|
|
if (value) {
|
|
|
return;
|
|
|
}
|
|
|
+ const roadinfoCache = uni.getStorageSync('payee_roadinfo');
|
|
|
+ alog.info({msg: '本地路段信息:' + roadinfoCache});
|
|
|
+ if (!roadinfoCache){
|
|
|
+ return;
|
|
|
+ }
|
|
|
let content = JSON.parse(message.content);
|
|
|
- if (content.type === 1){
|
|
|
- deviceParkIn(content)
|
|
|
- }else if (content.type === 2){
|
|
|
- deviceParkOut(content)
|
|
|
+ const roadinfo = JSON.parse(roadinfoCache) ;
|
|
|
+ if(content.roadNo && roadinfo.roadNo && content.roadNo == roadinfo.roadNo){
|
|
|
+ if (content.type === 1){
|
|
|
+ deviceParkIn(content)
|
|
|
+ }else if (content.type === 2){
|
|
|
+ deviceParkOut(content)
|
|
|
+ }
|
|
|
}
|
|
|
} catch(e){
|
|
|
|