Skip to content

Commit 8be3ef4

Browse files
author
Taois
committed
feat: 弹窗测试
1 parent 58d6761 commit 8be3ef4

File tree

5 files changed

+569
-18
lines changed

5 files changed

+569
-18
lines changed

dashboard/src/components/SearchResults.vue

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -306,15 +306,21 @@ const handleVideoClick = (video) => {
306306
if (video && video.vod_id) {
307307
// 检查是否为action类型
308308
if (video.vod_tag === 'action') {
309-
// 调用ActionRenderer处理action
310-
currentActionData.value = {
311-
actionId: video.vod_id,
312-
title: video.vod_name,
313-
pic: video.vod_pic,
314-
remarks: video.vod_remarks
315-
};
316-
showActionRenderer.value = true;
317-
return;
309+
try {
310+
// 解析vod_id中的JSON字符串获取action配置
311+
const actionConfig = JSON.parse(video.vod_id);
312+
console.log('SearchResults解析action配置:', actionConfig);
313+
314+
// 传递解析后的action配置给ActionRenderer
315+
currentActionData.value = actionConfig;
316+
showActionRenderer.value = true;
317+
return;
318+
} catch (error) {
319+
console.error('SearchResults解析action配置失败:', error, 'vod_id:', video.vod_id);
320+
// 如果解析失败,显示错误信息
321+
alert(`Action配置解析失败: ${error.message}`);
322+
return;
323+
}
318324
}
319325
320326
// 记录最后点击的视频

dashboard/src/components/VideoGrid.vue

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,21 @@ const handleVideoClick = (video) => {
114114
if (video && video.vod_id) {
115115
// 检查是否为action类型
116116
if (video.vod_tag === 'action') {
117-
// 调用ActionRenderer处理action
118-
currentActionData.value = {
119-
actionId: video.vod_id,
120-
title: video.vod_name,
121-
pic: video.vod_pic,
122-
remarks: video.vod_remarks
123-
};
124-
showActionRenderer.value = true;
125-
return;
117+
try {
118+
// 解析vod_id中的JSON字符串获取action配置
119+
const actionConfig = JSON.parse(video.vod_id);
120+
console.log('VideoGrid解析action配置:', actionConfig);
121+
122+
// 传递解析后的action配置给ActionRenderer
123+
currentActionData.value = actionConfig;
124+
showActionRenderer.value = true;
125+
return;
126+
} catch (error) {
127+
console.error('VideoGrid解析action配置失败:', error, 'vod_id:', video.vod_id);
128+
// 如果解析失败,显示错误信息
129+
alert(`Action配置解析失败: ${error.message}`);
130+
return;
131+
}
126132
}
127133
128134
// 记录最后点击的视频

dashboard/src/router/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import Settings from '@/views/Settings.vue';
1010
import BookGallery from '@/views/BookGallery.vue';
1111
import ActionTest from '@/views/ActionTest.vue';
1212
import ActionIntegrationTest from '@/views/ActionIntegrationTest.vue';
13+
import ActionDebugTest from '@/views/ActionDebugTest.vue';
14+
import SimpleActionDebug from '@/views/SimpleActionDebug.vue';
1315

1416
const routes = [
1517
{path: '/', component: Home, name: 'Home'},
@@ -23,6 +25,8 @@ const routes = [
2325
{path: '/parser', component: Parser, name: 'Parser'},
2426
{path: '/action-test', component: ActionTest, name: 'ActionTest'},
2527
{path: '/action-integration-test', component: ActionIntegrationTest, name: 'ActionIntegrationTest'},
28+
{path: '/action-debug-test', component: ActionDebugTest, name: 'ActionDebugTest'},
29+
{path: '/simple-action-debug', component: SimpleActionDebug, name: 'SimpleActionDebug'},
2630
// 404 fallback路由 - 必须放在最后
2731
{path: '/:pathMatch(.*)*', redirect: '/'}
2832
];

0 commit comments

Comments
 (0)