12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- var alog = uni.requireNativePlugin("AndroidLog")
- let speaker = uni.requireNativePlugin("SpeechPlug");
- const _handlePush = function(message) {
-
- try {
- const value = uni.getStorageSync('pushreg_switch');
- if (value) {
- return;
- }
- let content = JSON.parse(message.content);
- if (content.type === 1){
- deviceParkIn(content)
- }else if (content.type === 2){
- deviceParkOut(content)
- }
- } catch(e){
-
- }
-
- };
- function deviceParkIn(content){
- if(content.speakMsg){
- speaker.speakAction(content.speakMsg)
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- }
- function deviceParkOut(content){
- if(content.speakMsg){
- speaker.speakAction(content.speakMsg)
- }
- }
- function pushreg(vue){
-
-
- uni.setStorageSync('pushreg_switch', '1');
-
- plus.push.addEventListener('click', _handlePush, false);
-
- plus.push.addEventListener('receive', _handlePush, false);
- }
- export default pushreg
|