zengh
2022-05-09 52c39f5e2711e5535b689b66dfa5e100c7882b7f
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
<script>
    import WxStorage from "./static/lib/wxStorage.js" //微信Storage
    export default {
        data() {
            return {
                login: '',
            }
        },
        methods: {
            judgeAdmin() {
                var scss = this.$route.path == "/pages/loging/loging";
                wx.getSystemInfo({
                    success(res) {
                        console.log(res)
                    }
                })
                console.log(this.$store.state.logPath, 'scss')
                if (scss) {
                    return
                }
                this.login = WxStorage.get("init");
                // console.log(this.login, 'login')
                if (this.login == "false") {
                    wx.navigateTo({
                        url: 'pages/loging/loging?id=1',
                    })
                }
            }
        },
        // computed: {
        //     socketValue() {
        //         return this.$store.state.socketValue;
        //     }
        // },
        // watch: {
        //     socketValue() {
        //         console.log(this.socketValue);
        //         let that = this;
        //         if (that.socketValue.type === "start") {
        //             // console.log("任务开启vuevueveu")
        //             // this.$store.commit("addTask", this.socketValue.rid);
        //             // uni.request({
        //             //     url: this.$store.state.piAPI + "taskqd/selectLi?id=" + this.socketValue.rid,
        //             //     method: "get",
        //             //     header: {
        //             //         "content-type": "application/x-www-form-urlencoded",
        //             //     },
        //             //     success(res) {
        //             // let vals = res.data.data.records[0];
        //             let types = uni.getSystemInfoSync().platform;
        //             let that = this,
        //                 d = {
        //                     serid: uni.getStorageSync("ids") || that.$store.state.puserID,
        //                     type: 0,
        //                 };
        //             uni.request({
        //                 url: this.$store.state.piAPI + "taskqd/selectLi",
        //                 method: "POST",
        //                 data: d,
        //                 header: {
        //                     "content-type": "application/x-www-form-urlencoded",
        //                 },
        //                 success(res) {
        //                     const data = res.data.data;
        //                     for (let k in data) {
        //                         if (data[k].id == that.socketValue.rid) {
        //                             let val = JSON.stringify({
        //                                 ...data[k],
        //                                 butCT: "beginUp",
        //                                 buttype: 0,
        //                                 myid: d.serid,
        //                                 myName: uni.getStorageSync("name") || that.$store.state.puserName,
        //                                 appenUrl: that.$store.state.piAPI,
        //                                 isOn: true
        //                             });
        //                             if(types == "android"){
        //                                 uni.navigateTo({
        //                                     url: "/pages/grabOrders/map?data=" + JSON.stringify(val),
        //                                 });
        //                                 return
        //                             }
        //                             uni.redirectTo({
        //                                 url: "/pages/grabOrders/map?data=" + JSON.stringify(val),
        //                             });
        //                         } else {
        //                             continue;
        //                         }
        //                     }
        //                 },
        //             });
 
        //         } else if (that.socketValue.type === "stop") {
        //             // console.log("任务结束vuevueveu")
        //             // this.$store.commit("stopTask", this.socketValue.rid);
        //             // uni.reLaunch({
        //             //     url: "/pages/home/home"
        //             // });
        //         }
        //     }
        // },
        mounted() {
            // console.log("登入状态", this.$store.state.loging)
            // if (this.$store.state.loging) {
            //     this.$store.dispatch("connectws");
            // }
        },
        onLaunch: function() { //初始化完成时触发(全局只触发一次)
            console.log('第一次进入')
            // Window.say = Window.console;
            // Window.console = function() {
            //     say.log("关闭console")
            // }
            if (WxStorage.get("init") == '') {
                WxStorage.set("init", 'false');
                console.log('第一次进入')
            }
            // this.judgeAdmin();
        },
        onShow: function() { //当 uni-app 启动,或从后台进入前台显示 //监听用户进入小程序
            // console.log('App Show')
            // this.judgeAdmin();
        },
        onHide: function() {
            // console.log('App Hide')
        }
    }
</script>
 
<style lang="scss">
    // @import '@smallwei/avue/lib/index.css';
    @import url("/components/feng-parse/parse.css");
    /*uview全局样式*/
    @import "uview-ui/index.scss";
    /*app全局样式*/
    @import 'static/style/app.scss';
 
    uni-page-wrapper {
        width: 100%;
        height: 100%;
    }
 
    uni-page-body {
        width: 100%;
        height: 100%;
    }
    
    .uGridSelected {
        background: #f4f4f4 !important;
    }
 
    /*每个页面公共css */
</style>