Files
ys-app/src/App.vue

52 lines
1.3 KiB
Vue
Raw Normal View History

2025-07-22 11:21:01 +08:00
<template>
</template>
<script setup>
2025-09-04 14:02:33 +08:00
import {showAlert} from '@/utils/message.js'
import { onLaunch } from '@dcloudio/uni-app';
onLaunch((opt) => {
// uni.preloadPage({ url: "/pages/login/login" });
// uni.preloadPage({ url: "/pages/home/home" });
// uni.preloadPage({ url: "/pages/business/business" });
// uni.preloadPage({ url: "/pages/notice/notice" });
// uni.preloadPage({ url: "/pages/userinfo/userinfo" });
console.log("APP onLaunch")
// #ifdef APP-PLUS
2025-09-04 14:34:00 +08:00
// uni.getPushClientId({
// success: (res) => {
// let push_clientid = res.cid
// console.log('客户端推送标识:', push_clientid);
// },
// fail(err) {
// console.log(err)
// }
// })
2025-09-04 14:02:33 +08:00
uni.onPushMessage(res => {
console.log("收到推送消息:", res) //监听推送消息
showAlert(JSON.stringify(res))
2025-09-04 14:34:00 +08:00
// uni.createPushMessage({
// title: res.data.title,
// content: res.data.content,
// payload: res.data.payload
// })
2025-09-04 14:02:33 +08:00
})
// #endif
})
2025-08-01 18:12:36 +08:00
2025-07-22 11:21:01 +08:00
</script>
<style>
@import '@/static/common.css';
2025-08-01 18:12:36 +08:00
.uni-app--show{
opacity:1;
transition: opacity 0.3s;
}
.uni-app--hide {
opacity:0;
transition:opacity 0.3s;
}
2025-07-22 11:21:01 +08:00
</style>