Skip to content

Commit 0815e4d

Browse files
authored
Update Video2.vue 新增视频列表页
1 parent 40a6df8 commit 0815e4d

File tree

1 file changed

+28
-16
lines changed

1 file changed

+28
-16
lines changed

dashboard/src/views/Video2.vue

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,15 @@
99
@onSearch="onSearch"
1010
:now_site_title="form.now_site_title"
1111
>
12-
<template #default>
13-
<!-- 默认default 插槽的内容放这里 -->
14-
<div class="current-time">
15-
<span>{{ currentDateTime }}</span>
16-
</div>
17-
</template>
12+
<!-- 默认插槽的内容放这里 -->
13+
<div class="current-time">
14+
<span>{{ currentDateTime }}</span>
15+
</div>
1816
</Breadcrumb>
1917

2018
<!-- 内容区域 -->
2119
<a-layout-content class="content">
22-
<div>
23-
<h1>点播</h1>
24-
<p>这是点播页面的内容。</p>
25-
<ul v-if="form.sites.length > 0">
26-
<li v-for="site in form.sites" :key="site.key">{{ site.name }}</li>
27-
</ul>
28-
<p v-else>没有站点信息。</p>
29-
</div>
20+
<VideoList :classList="form.classList" />
3021
</a-layout-content>
3122

3223
<SourceDialog
@@ -45,6 +36,7 @@
4536
import { ref, reactive, onMounted, onBeforeUnmount } from "vue";
4637
import SourceDialog from "../components/SourceDialog.vue";
4738
import Breadcrumb from "../components/Breadcrumb.vue";
39+
import VideoList from "../components/VideoList.vue";
4840
import req from "@/utils/req";
4941
import { useSiteStore } from "@/stores/siteStore";
5042
@@ -57,7 +49,10 @@ const form = reactive({
5749
now_site: {},
5850
visible: false,
5951
form_title: "",
52+
classList: {},
53+
videoList: {},
6054
});
55+
6156
const timer = ref(null);
6257
const getData = async () => {
6358
try {
@@ -121,7 +116,6 @@ const refreshPage = () => {
121116
const minimize = () => {};
122117
const maximize = () => {};
123118
const closeWindow = () => {};
124-
const onSearch = (value) => console.log("搜索内容:", value);
125119
126120
const handleChangeRule = (site) => (form.new_site = site);
127121
@@ -134,11 +128,28 @@ const handleConfirmClear = () => {
134128
};
135129
136130
const handleConfirmChange = (site) => {
137-
console.log("确认换源");
138131
form.now_site = site;
139132
setCurrentSite(site);
140133
form.now_site_title = site.name;
141134
form.visible = false;
135+
getClassList(site); //获取分类列表
136+
};
137+
//获取分类列表
138+
const getClassList = async (site) => {
139+
console.log(site, "确认换源");
140+
141+
let response;
142+
if (req.defaults.baseURL === "") {
143+
response = await req.get("/mock/data.json");
144+
form.classList = response.home;
145+
} else {
146+
response = await req.get("/home");
147+
form.classList = response;
148+
}
149+
console.log(form.classList);
150+
};
151+
const onSearch = (value) => {
152+
console.log("搜索内容:", value);
142153
};
143154
144155
const handleOpenForm = () => {
@@ -151,6 +162,7 @@ const handleOpenForm = () => {
151162
onMounted(() => {
152163
getData(); // 页面加载时获取数据
153164
getNowSite(); // 获取储存的当前源
165+
getClassList(form.now_site);
154166
startClock(); // 启动时钟
155167
});
156168

0 commit comments

Comments
 (0)