<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>
|