Merge pull request '是否有直播资格' (#138) from zhy into master
Reviewed-on: http://git.luyuan.tk/luyuan/beelink/pulls/138
This commit is contained in:
commit
90dcaa6662
@ -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,
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user