yangan
2025-04-11 5e08d4f61c24db589bd6d30875fcb1191f719b16
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<script>
    import { mapState, mapMutations } from 'vuex';
    export default {
        onLaunch() {},
        onHide() {
            console.log('appvue隐藏后台');
            this.changeisconnect(false);
            console.log(this.globalisconnect, this.globalisUploadimg, this.globalisLogin);
 
        },
        onShow() {
            console.log('appvue显示');
            if (!this.globalisconnect && !this.globalisUploadimg && this.globalisLogin) {
                if (!this.is_open_socket) {
                    this.$store.dispatch('websocketInit')
                    this.changeisconnect(false);
                    console.log('appvue的ws');
                }
            }
        },
        methods: {
            ...mapMutations(['changeisconnect'])
        },
        computed: {
            ...mapState(['globalisconnect', 'globalisUploadimg', 'globalisLogin', 'is_open_socket'])
        }
    };
</script>
 
<style lang="scss"
    scoped>
    /*每个页面公共css */
    @import '@/uni_modules/uview-ui/index.scss';
 
    @font-face {
        font-family: siYuanLight;
        src: url('https://mx.jzeg.cn:9095/appimg/fonts/siyuannormal.OTF');
    }
 
    @font-face {
        font-family: weighting;
        src: url('https://mx.jzeg.cn:9095/appimg/fonts/weighting.TTF');
    }
 
    body {
        font-family: siYuanLight, sans-serif;
    }
</style>