2024-04-12 17:57:52 +08:00
|
|
|
|
<style lang="scss">
|
|
|
|
|
|
/* 注意要写在第一行,同时给style标签加入lang="scss"属性 */
|
|
|
|
|
|
@import "@/uni_modules/uview-ui/index.scss";
|
|
|
|
|
|
</style>
|
|
|
|
|
|
<script>
|
|
|
|
|
|
import website from '@/config/website.js'
|
|
|
|
|
|
import {
|
|
|
|
|
|
mapGetters
|
|
|
|
|
|
} from 'vuex'
|
|
|
|
|
|
// #ifdef H5
|
|
|
|
|
|
import {
|
|
|
|
|
|
setPlatformByHostName
|
|
|
|
|
|
} from '@/untils/customized.js'
|
|
|
|
|
|
// #endif
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
|
onLaunch: function(options) {
|
|
|
|
|
|
if (options.query.token) {
|
|
|
|
|
|
uni.reLaunch({
|
|
|
|
|
|
url: '/pages/login/blank?token=' + options.query.token
|
|
|
|
|
|
})
|
|
|
|
|
|
} else if (this.$store.state.user.token) {
|
|
|
|
|
|
this.$store.dispatch('startRefreshTokenTimer')
|
|
|
|
|
|
this.$store.dispatch('startRefreshNewsTimer')
|
|
|
|
|
|
this.$store.dispatch('refreshAuthState')
|
|
|
|
|
|
}
|
|
|
|
|
|
// #ifdef H5
|
|
|
|
|
|
// 企业定制
|
|
|
|
|
|
setPlatformByHostName(this.$store)
|
|
|
|
|
|
// #endif
|
|
|
|
|
|
},
|
|
|
|
|
|
onShow: function() {},
|
|
|
|
|
|
onHide: function() {},
|
|
|
|
|
|
computed: {
|
|
|
|
|
|
...mapGetters(['news']),
|
|
|
|
|
|
allUnread() {
|
|
|
|
|
|
return this.news.allUnread
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2024-04-14 16:13:44 +08:00
|
|
|
|
mounted() {
|
|
|
|
|
|
this.$config.showTitle && document.documentElement.style.setProperty('--hide-title', 'block');
|
|
|
|
|
|
},
|
2024-04-12 17:57:52 +08:00
|
|
|
|
watch: {
|
|
|
|
|
|
allUnread(value) {
|
|
|
|
|
|
if (!this.$store.state.user.token) {} else if (value > 0) {
|
|
|
|
|
|
uni.showTabBarRedDot({
|
|
|
|
|
|
index: 2
|
|
|
|
|
|
})
|
|
|
|
|
|
uni.$once('newsReadChange', () => {
|
|
|
|
|
|
uni.showTabBarRedDot({
|
|
|
|
|
|
index: 2
|
|
|
|
|
|
})
|
|
|
|
|
|
})
|
|
|
|
|
|
} else {
|
|
|
|
|
|
uni.hideTabBarRedDot({
|
|
|
|
|
|
index: 2
|
|
|
|
|
|
})
|
|
|
|
|
|
uni.$once('newsReadChange', () => {
|
|
|
|
|
|
uni.hideTabBarRedDot({
|
|
|
|
|
|
index: 2
|
|
|
|
|
|
})
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
2024-04-14 16:13:44 +08:00
|
|
|
|
<style lang="scss">
|
2024-04-12 17:57:52 +08:00
|
|
|
|
/*每个页面公共css */
|
|
|
|
|
|
/* tabbar 字体大小 */
|
|
|
|
|
|
/* .uni-tabbar__label{
|
|
|
|
|
|
font-size: 14px !important;
|
|
|
|
|
|
} */
|
|
|
|
|
|
@font-face {
|
|
|
|
|
|
font-family: 'uicon-iconfont';
|
|
|
|
|
|
font-weight: mormal;
|
|
|
|
|
|
font-style: mormal;
|
|
|
|
|
|
src: url('/static/font/font_2225171_8kdcwk4po24.ttf') format('truetype');
|
|
|
|
|
|
}
|
2024-04-14 16:13:44 +08:00
|
|
|
|
|
|
|
|
|
|
:root {
|
|
|
|
|
|
--hide-title: none;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* #ifdef H5 */
|
|
|
|
|
|
uni-page-head {
|
|
|
|
|
|
display: var(--hide-title);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* #endif */
|
2024-04-12 17:57:52 +08:00
|
|
|
|
</style>
|