admin
2 天以前 ec060ce444cdd1c48a54686cadbc8950478eedcf
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
<html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport"
            content="width=device-width, viewport-fit=cover, initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
        <title>L后囊括范围</title>
        <link rel="stylesheet" type="text/css" href="layui/css/layui.css" />
        <script src="js/jquery.min.js"></script>
        <script src="http://cdn.yeshitv.com/js/vue.min.js"></script>
        <script src="js/qwebchannel.js"></script>
        <script src="js/http.js"></script>
        <script src="js/vconsole.min.js"></script>
        <script src="layui/layui.js"></script>
        <script src="js/md5.min.js"></script>
        <script>
            window.onresize = function() {
                document.documentElement.style.fontSize = document.documentElement.clientWidth / 7.5 + 'px';
            };
            window.onresize();
        </script>
        <style>
            .white {
                color: #FFF;
            }
 
            .red {
                color: #CE0E5F;
            }
            
            .gray {
                color: #BBB;
            }
 
            .purple {
                color: rgb(209, 135, 252);
            }
        
 
 
 
            
        </style>
 
        <style>
            body {
                background-color: #EEE;
                line-height: 0.3rem;
                color: white;
                font-family: 微软雅黑;
                background: #000;
                font-size: 0;
            }
 
            .scroll-y {
                overflow: hidden;
                overflow-y: auto;
                white-space: nowrap;
                outline: none;
            }
 
            #app {
                width: 100%;
                height: 100%;
            }
 
            .container {
                height: 100%;
            }
 
 
            .item {
                display: inline-block;
                width: 110px;
                height: 30px;
                line-height: 30px;
                text-align: center;
                font-size: 14px;
                margin: 2px;
            }
        </style>
 
    </head>
 
    <body>
        <div id="app">
 
            <div class="container">
 
                <div v-for="item in watch_info_list" class="item"
                    :class="{'gray':item[3]==14,'red':item[3]==12,'white':(item[3]==11||item[3]==0)&&item[1]<300e4, 'purple': (item[3]==11||item[3]==0)&&item[1]>=300e4 }">
                    {{toMoneyDesc(item[1])}}-{{item[4]}}%
                </div>
 
            </div>
        </div>
 
    </body>
 
 
    <script>
        document.addEventListener("DOMContentLoaded", function() {
            //把对象赋值到JS中
            try {
                new QWebChannel(qt.webChannelTransport, function(channel) {
                    window.pyjs = channel.objects.Bridge;
                    console.log("回调成功");
                });
            } catch (e) {
 
            }
        });
 
        $(function() {
 
            var app = new Vue({
                el: "#app",
                data: {
                    watch_info_list: [],
                },
                mounted: function() {
                    setTimeout(function() {
                        app.get_l_down_watch_index_overview();
                    }, 200);
                },
                methods: {
                    get_l_down_watch_index_overview: function() {
                        let code = http_util.getQueryString("code");
                        http_util.get_l_down_watch_index_overview(code, function(res) {
                            res = JSON.parse(res);
                            if (res.code == 0) {
                                
                                var total_money = 0;
                                res.data.forEach(function(e){
                                    total_money+=e[1];
                                });
                                
                                res.data.forEach(function(e){
                                    e.push((e[1]*100/total_money).toFixed(0));
                                });
                                
                                app.watch_info_list = res.data;
                                
                            }
                        });
                    },
                    toMoneyDesc: function(money) {
                        if (Math.abs(money) > 100000000) {
                            return (money / 100000000.0).toFixed(1) + "亿";
                        } else if (Math.abs(money) > 10000) {
                            return (money / 10000.0).toFixed(1) + "万";
                        } else {
                            return money + "";
                        }
                    },
                }
            });
        });
    </script>
 
</html>