You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
673 B
30 lines
673 B
<script>
|
|
export default {
|
|
onLaunch: function() {
|
|
console.log('App Launch')
|
|
console.log('开始监听推送消息')
|
|
// 开始监听推送消息
|
|
uni.onPushMessage((res) => {
|
|
console.log("收到推送消息:", res) //监听推送消息
|
|
// #ifdef APP-PLUS
|
|
uni.createPushMessage({
|
|
title: res.data.title,
|
|
content: res.data.content
|
|
})
|
|
// #endif
|
|
})
|
|
},
|
|
onShow: function() {
|
|
console.log('App Show')
|
|
},
|
|
onHide: function() {
|
|
console.log('App Hide')
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
/*每个页面公共css */
|
|
@import '~@/assets/style/common.scss';
|
|
@import '~@/uni_modules/niu-ui/assets/style/common.scss'
|
|
</style>
|