2024-02-06 15:49:51 +08:00
|
|
|
|
<style lang="scss">
|
|
|
|
|
|
/* 注意要写在第一行,同时给style标签加入lang="scss"属性 */
|
|
|
|
|
|
@import "@/uni_modules/uview-ui/index.scss";
|
|
|
|
|
|
</style>
|
2024-02-02 14:44:30 +08:00
|
|
|
|
<script>
|
2024-03-20 17:16:16 +08:00
|
|
|
|
import website from '@/config/website.js'
|
2024-02-02 14:44:30 +08:00
|
|
|
|
import {
|
|
|
|
|
|
mapGetters
|
|
|
|
|
|
} from 'vuex'
|
|
|
|
|
|
// #ifdef H5
|
|
|
|
|
|
import {
|
|
|
|
|
|
setPlatformByHostName
|
|
|
|
|
|
} from '@/untils/customized.js'
|
|
|
|
|
|
// #endif
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
2024-03-20 17:16:16 +08:00
|
|
|
|
onLaunch: function(options) {
|
|
|
|
|
|
console.log(options.query)
|
|
|
|
|
|
if(options.query.token) {
|
|
|
|
|
|
const { token } = options
|
|
|
|
|
|
this.$store.dispatch("LoginByUsername", {
|
|
|
|
|
|
username: 'admin',
|
|
|
|
|
|
password: "admin",
|
|
|
|
|
|
key: '',
|
|
|
|
|
|
code: '1111',
|
|
|
|
|
|
type: "account",
|
|
|
|
|
|
token: options.query.token,
|
|
|
|
|
|
tenantId: website.tenantId
|
|
|
|
|
|
}).then((resp) => {
|
|
|
|
|
|
this.$store.dispatch('refreshAuthState').then(() => {
|
|
|
|
|
|
that.loading = false
|
|
|
|
|
|
var auth = this.auth
|
|
|
|
|
|
if (!auth.bankCardState) {
|
|
|
|
|
|
that.goSign(0)
|
|
|
|
|
|
} else {
|
|
|
|
|
|
uni.switchTab({
|
|
|
|
|
|
url: '/pages/index/index'
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}).catch((err) => {
|
|
|
|
|
|
this.loading = false
|
|
|
|
|
|
// this.$refs.code.refushCode()
|
|
|
|
|
|
});
|
|
|
|
|
|
} else if (this.$store.state.user.token) {
|
2024-02-02 14:44:30 +08:00
|
|
|
|
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
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
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>
|
|
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
|
/*每个页面公共css */
|
|
|
|
|
|
/* tabbar 字体大小 */
|
|
|
|
|
|
/* .uni-tabbar__label{
|
|
|
|
|
|
font-size: 14px !important;
|
|
|
|
|
|
} */
|
|
|
|
|
|
</style>
|