1
xuxueyang
2024-07-12 74ff2cd15d65511c26b6a1a2e58e6153deb1e938
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
130
131
132
133
<script>
    // 合伙人: "appid" : "wx6d0ecc4e18710458",
    // 花农: "appid" : "wx3203fd935a6ffe09",
    // 花店 wx1441324401626290
    import storage from '@/plugins/storage.js'
 
    export default {
        onLaunch: function(options) {
 
            // #ifdef MP
            // {
            //     if(decodeURIComponent(options.query.q))
            //     if (options.inviter) {
            //         //说明是邀请的,需要保存下来,
            //         this.$storage.setItem('inviter', options.inviter)
            //         //有效24小时
            //         this.$storage.setItem('inviterTime', new Date().getTime())
 
            //     }
            //     if (options.inviterName) {
            //         this.$storage.setItem('inviterName', options.inviterName)
            //         this.inviterName = options.inviterName
            //     }else{
            //         this.inviterName = this.$storage.getItem('inviterName') || ''
            //     }
            // }
            // #endif
            console.warn('当前组件仅支持 uni_modules 目录结构 ,请升级 HBuilderX 到 3.1.0 版本以上!')
            console.log('App Launch')
            uni.getSystemInfo({
                success: (e) => {
                    // this.globalData.StatusBar = e.statusBarHeight;
                    let custom = uni.getMenuButtonBoundingClientRect();
                    // this.globalData.Custom = custom;
                    // this.globalData.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
                    uni.setStorageSync('StatusBar', e.statusBarHeight);
                    uni.setStorageSync('CustomBar', (custom.bottom + custom.top - e.statusBarHeight));
                }
            });
            // #ifdef MP
            if (true && storage.getItem('token')) {
                setTimeout(async () => {
                    const res = await this.$store.dispatch('getCurrentInfo');
                    // console.log('init info',res,this.currentInfo)
                    // #ifdef PUB_CUSTOMER
                    if (this.currentInfo && this.currentInfo.id && !this.currentInfo.openId) {
                        uni.reLaunch({
                            url: '/pages/home/supplier-home'
                        })
                    }
                    // #endif
                }, 200);
            } else {
 
            }
            // #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>