Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
live
/
web-radio
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d127fed2
authored
Apr 21, 2025
by
levlin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev'
parents
dd46fa45
729d826c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
public/prod/config.js
+0
-0
src/components/common/Timeline.vue
+13
-4
No files found.
public/prod/config.js
0 → 100644
View file @
d127fed2
This diff is collapsed.
Click to expand it.
src/components/common/Timeline.vue
View file @
d127fed2
...
...
@@ -29,6 +29,7 @@
</
template
>
<
script
>
import
{
mapGetters
}
from
"vuex"
;
export
default
{
name
:
"Timeline"
,
props
:
{
...
...
@@ -44,6 +45,7 @@ export default {
};
},
computed
:
{
...
mapGetters
({
channelInfo
:
"channelInfo"
}),
timeData
()
{
let
timeArr
=
[];
const
WEEK_CONFIG
=
{
...
...
@@ -57,8 +59,9 @@ export default {
};
const
oneDayTime
=
86400000
;
const
{
currentTime
}
=
this
;
const
playbackDay
=
this
.
channelInfo
?.
playbackDay
||
7
;
// 创建时间轴数据
for
(
let
i
=
0
;
i
<=
7
;
i
++
)
{
for
(
let
i
=
0
;
i
<=
playbackDay
;
i
++
)
{
const
leftTimestamp
=
currentTime
-
i
*
oneDayTime
;
const
leftDate
=
new
Date
(
leftTimestamp
);
const
timeData
=
{
...
...
@@ -88,15 +91,21 @@ export default {
mounted
()
{
// 老版
this
.
$nextTick
(()
=>
{
// 默认激活第7个tab,也就是“今天”
// 查找"今天"的索引
const
todayIndex
=
this
.
timeData
.
findIndex
(
item
=>
item
.
week
===
'今天'
);
if
(
todayIndex
!==
-
1
)
{
this
.
activeTab
=
todayIndex
;
}
// 默认激活找到的tab
this
.
scrollTo
(
"activatedItem"
,
this
.
activeTab
);
});
// 新版
this
.
$Bus
.
$on
(
'first-playBill'
,
()
=>
{
this
.
$Bus
.
$on
(
"first-playBill"
,
()
=>
{
this
.
$nextTick
(()
=>
{
// 同样,在新版逻辑中也查找"今天"的索引
this
.
scrollTo
(
"activatedItem"
,
this
.
activeTab
);
});
})
})
;
},
methods
:
{
changeTab
(
info
,
index
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment