cuiqian2004
2025-07-10 2db331628bbf94deee446d6e172e98f4db474a33
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<script>
    export default {
        globalData: {
            //更改此地址时 更改一下地址
            verdate: "2025.02.07.02",
            titleName: "共好",
            /* 汉和 */
            //#ifdef MP-DINGTALK
            appid: '5000000005078905',
            httproot: "http://124.71.73.232", //pm.plm.cn 124.71.73.232
            httpurl: "http://124.71.73.232/mobox3",
            apiport: {
                org: 5101,
                mobox: 5102,
                data: 5103,
                workflow: 5104,
                gungho: 5109,
            }, //webapi服务默认端口
            //#endif
            //#ifdef MP-WEIXIN
            //for wx
            appid: 'wx4c3b3d475887ceac',
            httproot: "https://pm.plm.cn", //pm.plm.cn 124.71.73.232
            httpurl: "https://pm.plm.cn/mobox3",
            apiport: {
                org: 15101,
                mobox: 5102,
                data: 5103,
                workflow: 5104,
                gungho: 15109,
            }, //webapi服务默认端口
            //#endif
            apiurl: {
                org: '',
                mobox: '',
                data: '',
                workflow: '',
                gungho: '',
            }, //webapi服务
 
 
 
            /* 井松 */
            /*//#ifdef MP-DINGTALK
            appid: '5000000006133707',
            //#endif
        
            httproot: "http://gen-song.vip",
            httpurl: "http://gen-song.vip/mobox3",
            apiurl: {
                org: '',
                mobox: '',
                data: '',
                workflow: '',
                gungho: '',
            }, //webapi服务
            
            apiport: {
                org: 15101,
                mobox: 15102,
                data: 15103,
                workflow: 15104,
                gungho: 15109,
            }, //webapi服务默认端口
             */
 
            files_flag: "", //文件服务标识
            // apptype: "HangChaTesting",//HangChaTesting 杭叉集团股份有限公司试验检测中心小程序
            apptype: "",
            defaultuserphoto: "/static/userm.png",
            //设备类型,系统名称
            platform: "",
            osName: "",
            deviceId: "",
            //wx.qy  
            qyWx: {
                isWork: false,
                userid: "",
                session_key: "",
            },
            //feishu
            feishu: {
                access_token: ""
            },
            //#ifdef MP-DINGTALK
            dingding: {
                access_token: "",
                authCode: "",
            },
            //#endif
 
            isPwdLogin: true,
            userInfo: null,
            userdata: null,
            safeAreaHeight: 0,
            safeAreaBottom: 0
        },
 
        methods: {
            loadSystemInfo() {
                const _this = this
                uni.getSystemInfo({
                    success(res) {
                        let app = getApp()
                        if (!app)
                            app = _this
                        app.globalData.deviceId = res.deviceId || res.deviceType + "_" + res.osName
                        if (res.platform)
                            app.globalData.platform = res.platform;
                        app.globalData.osName = res.osName;
                        if (res.safeAreaInsets)
                            app.globalData.safeAreaBottom = res.safeAreaInsets.bottom
                        app.globalData.qyWx.isWork = res.environment == 'wxwork';
                    }
                })
            }
        },
        onLaunch: function() {
            console.log('onLaunch')
            // #ifdef MP
            this.loadSystemInfo()
            const logs = uni.getStorageSync('logs') || []
            logs.unshift(Date.now())
            uni.setStorageSync('logs', logs)
            if (uni.canIUse("getUpdateManager")) {
                // console.log('App canIUse getUpdateManager')
                const updateManager = uni.getUpdateManager();
                updateManager.onCheckForUpdate(function(res) {
                    // console.log('App onCheckForUpdate', res)
                    if (res.hasUpdate) {
                        // 请求完新版本信息的回调
                        updateManager.onUpdateReady(function() {
                            uni.showModal({
                                title: "更新提示",
                                content: "新版本已经准备好,是否重启应用?",
                                showCancel: true, // 是否可取消展示取消按钮
                                success: function(res) {
                                    if (res.confirm) {
                                        // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
                                        updateManager.applyUpdate();
                                    }
                                },
                            });
                        });
                        updateManager.onUpdateFailed(function() {
                            uni.showModal({
                                // 新的版本下载失败
                                title: "已经有新版本了哟~",
                                content: "新版本已经上线啦~,请您删除当前小程序,重新搜索进入哟~",
                            });
                        });
                    }
                })
            }
            // #endif
        },
        onShow: function() {
            console.log('App Show')
        },
        onHide: function() {
            console.log('App Hide')
        },
 
    }
</script>
 
<style lang="scss">
    /*每个页面公共css */
    @import "/static/fonts/mobox_sys.css";
    @import "/static/fonts/mobox_user.css";
 
    .container-fill {
        display: flex;
        height: 100%;
        width: 100%;
        flex-direction: column;
    }
 
    .uni-panel-safe-bottom {
        display: flex;
        width: 100%;
        height: 0px;
    }
</style>