Commit 6a473f84 by levlin

Merge branch 'test' into dev

parents 5c5430d0 e709511a
......@@ -2,6 +2,13 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
### [1.6.3](https://gitlab.aodianyun.com/live/web-tv/compare/v1.6.2...v1.6.3) (2024-12-24)
### Features
* 优化ua判断 ([fdaf1b9](https://gitlab.aodianyun.com/live/web-tv/commit/fdaf1b9c27d4192785c4218b3ba8f478595e3680))
### [1.6.2](https://gitlab.aodianyun.com/live/web-tv/compare/v1.6.1...v1.6.2) (2024-12-23)
......
{
"name": "ssr-program-tv",
"version": "1.6.2",
"version": "1.6.3",
"author": "1006903445@qq.com",
"private": true,
"scripts": {
......
......@@ -29,6 +29,7 @@
</template>
<script>
import { mapGetters } from "vuex";
export default {
name: "Timeline",
props: {
......@@ -45,6 +46,7 @@ export default {
},
computed: {
...mapGetters({ channelInfo: "channelInfo" }),
timeData() {
let timeArr = [];
const WEEK_CONFIG = {
......@@ -58,8 +60,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,7 +91,12 @@ 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);
});
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment