| 12345678910111213141516171819202122232425262728293031323334 |
- <script>
- export default {
- onLaunch: function () {
- },
- async onShow() {
- const getMessageCount = async () => {
- if(!this.$store.state.token) return
- let res = await this.$http.get('/message/getMessageCount')
- if (res.code == 200) {
- uni.setTabBarBadge({
- index: 2,//tabbar的索引
- text: res.data['999'] + ''
- })
- }
- }
- setInterval(() => {
- getMessageCount()
- }, 30000);
- },
- onHide: function () { }
- }
- </script>
- <style lang="scss">
- /* #ifndef APP-PLUS-NVUE */
- /*每个页面公共css */
- /* 注意要写在第一行,同时给style标签加入lang="scss"属性 */
- @import "uview-ui/index.scss";
- /* 公共样式库 */
- @import "/style/zcm-main.css";
- /* #endif */
- </style>
|