xuxueyang
2024-07-12 48dd8be3d25e5b6d8bfa57ad757569f470f5ff74
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<script>
    // 合伙人: "appid" : "wx6d0ecc4e18710458",
    // 花农: "appid" : "wx3203fd935a6ffe09",
    // 花店 wx1441324401626290
    import storage from '@/plugins/storage.js'
 
    export default {
        onLaunch: function(options) {
 
            console.warn('当前组件仅支持 uni_modules 目录结构 ,请升级 HBuilderX 到 3.1.0 版本以上!')
            console.log('App Launch')
            uni.getSystemInfo({
                success: (e) => {
                    try {
                        let custom = uni.getMenuButtonBoundingClientRect();
                        uni.setStorageSync('StatusBar', e.statusBarHeight);
                        uni.setStorageSync('CustomBar', (custom.bottom + custom.top - e.statusBarHeight));
                    } catch (e) {
                        console.error('e', e)
                    }
                }
            });
            // #ifdef MP
            if (true && storage.getItem('token')) {
                setTimeout(async () => {
                    const res = await this.$store.dispatch('getCurrentInfo');
                    // #ifndef PUB_CUSTOMER
                    if (this.currentInfo && this.currentInfo.id && !this.currentInfo.openId) {
                        uni.reLaunch({
                            url: '/pages/home/supplier-home'
                        })
                    } else {
                        uni.reLaunch({
                            url: '/pages/login/supplier-login'
                        })
                    }
                    // #endif
                }, 200);
            } else {
                // #ifndef PUB_CUSTOMER
                uni.reLaunch({
                    url: '/pages/login/supplier-login'
                })
                // #endif
            }
            // #endif
            // #ifdef PUB_CUSTOMER
            uni.reLaunch({
                url: '/pages/home/home'
            })
            // #endif
 
            // // #ifdef H5
            // if (true && storage.getItem('token')) {
            //     setTimeout(async () => {
            //         const res = await this.$store.dispatch('getCurrentInfo');
            //         // console.log('init info',res,this.currentInfo)
            //         if (this.currentInfo && this.currentInfo.id && !this.currentInfo.openId) {
            //             // uni.reLaunch({
            //             //     url: '/pages/home/supplier-home'
            //             // })
            //         }
            //     }, 200);
            // } else {
 
            // }
            // // #endif
        },
 
        onReady() {
            //做token判断
            // this.check_login()
        },
        onShow: function() {
            console.log('App Show')
        },
        onHide: function() {
            console.log('App Hide')
        },
 
    }
</script>
 
<style lang="scss">
    /*每个页面公共css */
    @import '@/uni_modules/uni-scss/index.scss';
    /* uni.scss */
 
    // @import "@/uni_modules/uview-plus/index.scss";
    @import "uview-ui/index.scss";
 
    /* #ifndef APP-NVUE */
    @import '@/static/customicons.css';
 
    // 设置整个项目的背景色
    page {
        background-color: #f5f5f5;
    }
 
    @import '@/common/self.scss';
    @import '@/common/icons.scss';
    @import '@/common/global.scss';
 
    /* #endif */
    .example-info {
        font-size: 14px;
        color: #333;
        padding: 10px;
    }
 
    // uni-rich-text img{
    //     max-width: 100% !important;
    // }
    .rich /deep/ img {
        max-width: 600rpx !important;
    }
 
    .rich /deep/ image {
        max-width: 600rpx !important;
    }
 
    .rich2 /deep/ img {
        max-width: 400rpx !important;
    }
 
    .rich2 /deep/ image {
        max-width: 400rpx !important;
    }
</style>