Merge pull request '是否有直播资格' (#138) from zhy into master

Reviewed-on: http://git.luyuan.tk/luyuan/beelink/pulls/138
This commit is contained in:
hansu 2020-11-19 15:27:30 +08:00
commit 90dcaa6662

View File

@ -6,7 +6,7 @@
<div class="hits">视频点击量</div>
</div>
<div class="list-body">
<div class="rank-item" v-for="(item,index) in filterData(list)" :key="index" :class="{'mine-item': item.isme }">
<div class="rank-item" v-for="(item,index) in newList" :key="index" :class="{'mine-item': item.isme }">
<div class="other-rank" :class="{'mine-rank': item.isme }">
<div class="ranking-number">
<span v-if="item.isme" class="mine">我的成绩</span>
@ -50,25 +50,22 @@ export default defineComponent({
type: Array
}
},
setup() {
setup(props) {
const deadLine = ref(4); // 线
function filterData(list: any) {
const list = ref(props.list);
let mineRank = 0; //
list.forEach((element: any) => {
list.value!.forEach((element: any) => {
if(element.isme) {
mineRank = element.rank;
}
});
//
const newList = list.filter((item: any) => {
const newList = list.value!.filter((item: any) => {
return item.rank <= 3 || item.rank == deadLine.value || item.rank === mineRank || item.rank === mineRank - 1 || item.rank === mineRank + 1;
})
return newList;
}
return {
filterData,
newList,
deadLine,
}
}