app接收到报警记录后处理方法

This commit is contained in:
xusd 2024-06-03 09:30:34 +08:00
parent 05664feb52
commit 52f83b39e0

22
App.vue
View File

@ -1,13 +1,31 @@
<script> <script>
import config from './config' import config from './config'
import store from '@/store' import store from '@/store'
import { getToken } from '@/utils/auth' import {
getToken
} from '@/utils/auth'
export default { export default {
onLaunch: function() { onLaunch: function() {
this.initApp() this.initApp();
this.listenMessage();
}, },
methods: { methods: {
listenMessage() {
// #ifdef APP-PLUS
const _self = this;
const _handlePush = function(message) {
// TODO
console.log(message);
if (message.payload.type === "alarm") {
uni.navigateTo({
url: '/pages/work/alarm/detailsAlarm?id=' + message.payload.id
});
}
};
plus.push.addEventListener('click', _handlePush);
// #endif
},
// //
initApp() { initApp() {
// //