工作端小程序
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.

38 lines
953 B

1 month ago
<script>
5 days ago
import { getMessageReminder } from '@/pages/api'
1 month ago
export default {
onLaunch: function() {
1 month ago
console.log('App Launch');
1 month ago
1 month ago
},
1 month ago
onShow: function() {
console.log('App Show')
5 days ago
// 全局刷新消息TabBar小红点(索引0)
// 延迟到页面栈稳定后调用,避免初次进入还未渲染tabBar
setTimeout(async () => {
try {
const res = await getMessageReminder()
if (res && res.code === 200 && Number(res.data) > 0) {
uni.showTabBarRedDot({ index: 0 })
} else {
uni.hideTabBarRedDot({ index: 0 })
}
} catch (e) {
console.warn('App onShow 获取消息提醒失败', e)
}
}, 0)
1 month ago
},
onHide: function() {
console.log('App Hide')
}
}
</script>
<style lang="scss">
/* 注意要写在第一行,同时给style标签加入lang="scss"属性 */
@import "uview-ui/index.scss";
1 month ago
</style>
<style>
/*每个页面公共css */
@import "static/common.css";
1 month ago
</style>