Skip to content

Commit

Permalink
style: horse
Browse files Browse the repository at this point in the history
  • Loading branch information
zixuan1986 committed Jan 2, 2024
1 parent bb4825e commit f4f139c
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/components/horse/HorseBroadcastV2.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,15 @@
<div class="m-item" v-for="(item, index) in listData" :key="index">
<div
class="m-horse"
@click="active = index"
v-if="item.fromTime"
@click="changeHorse(item, index)"
v-if="!item.is_chitu"
:class="{ active: active === index }"
>
<div class="u-col u-times" :class="item.subtype === 'foreshow' && 'u-times-lately'">
<div
class="u-col u-times"
:class="item.subtype === 'foreshow' && 'u-times-lately'"
v-if="item.fromTime"
>
<span>{{ item.fromTime }}</span>
<span> ~ </span>
<span>{{ item.toTime }}</span>
Expand Down Expand Up @@ -109,8 +113,9 @@ export default {
},
listData() {
let list = this.list || [];
const arr = this.isPhone ? [] : new Array(15 - list.length).fill({});
list = list.sort((a, b) => this.convertTime(a.fromTime) - this.convertTime(b.fromTime));
return list.concat(this.existData) || [];
return list.concat(this.existData, arr) || [];
},
isPhone() {
return document.documentElement.clientWidth <= 768;
Expand Down Expand Up @@ -295,9 +300,6 @@ export default {
toTime: toTime,
};
});
// .sort(function (a, b) {
// return dayjs.tz(new Date(b.fromTime)).valueOf() - dayjs.tz(new Date(a.fromTime)).valueOf();
// });
});
},
convertTime(time) {
Expand All @@ -307,6 +309,10 @@ export default {
horseList(item) {
return this.isPhone ? item.horses : item.horses.slice(0, 3);
},
changeHorse(item, index) {
if (!item.map_id) return;
this.active = index;
},
},
mounted() {
if (User.isLogin()) {
Expand Down

0 comments on commit f4f139c

Please sign in to comment.