Skip to content

Commit

Permalink
feat(web): 显示视频播放页窗口标题
Browse files Browse the repository at this point in the history
  • Loading branch information
aooiuu committed Jun 29, 2024
1 parent 73b7053 commit 149e286
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
3 changes: 3 additions & 0 deletions packages/web/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ export {}
declare module 'vue' {
export interface GlobalComponents {
AApp: typeof import('ant-design-vue/es')['App']
ABackTop: typeof import('ant-design-vue/es')['BackTop']
AButton: typeof import('ant-design-vue/es')['Button']
AButtonGroup: typeof import('ant-design-vue/es')['ButtonGroup']
ACheckboxGroup: typeof import('ant-design-vue/es')['CheckboxGroup']
AConfigProvider: typeof import('ant-design-vue/es')['ConfigProvider']
ADropdown: typeof import('ant-design-vue/es')['Dropdown']
AEmpty: typeof import('ant-design-vue/es')['Empty']
AForm: typeof import('ant-design-vue/es')['Form']
AFormItem: typeof import('ant-design-vue/es')['FormItem']
AImage: typeof import('ant-design-vue/es')['Image']
Expand Down
1 change: 1 addition & 0 deletions packages/web/src/pages/pc/category/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
path: '/pc/chapter',
query: {
ruleId,
name: row.name,
filePath: row.url
}
})
Expand Down
11 changes: 8 additions & 3 deletions packages/web/src/pages/pc/chapter/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ async function init() {
init();
async function showContent(item) {
const { filePath, ruleId } = route.query;
const { filePath, ruleId, name } = route.query;
const rule = rulesStore.list.find((e) => e.id === ruleId);
if (rule?.contentType === CONTENT_TYPE.VIDEO) {
loading.value = true;
Expand All @@ -65,7 +65,9 @@ async function showContent(item) {
url:
'/player?' +
stringify({
url
url,
name,
chapterName: item.name
})
});
} else {
Expand All @@ -80,12 +82,15 @@ async function showContent(item) {
chapterPath: item.url || item.chapterPath
}).catch(() => {});
console.log('getContent', res);
const url = res?.data?.content || '';
if (res?.code === 0) {
openWindow({
url:
'/iframe?' +
stringify({
url: res?.data?.content || ''
url,
name,
chapterName: item.name
})
});
return;
Expand Down
3 changes: 3 additions & 0 deletions packages/web/src/pages/pc/player/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ onMounted(async () => {
}
}
});
const { name, chapterName } = route.query;
document.title = [name, chapterName].filter((e) => e).join('-');
});
watch(
Expand Down
1 change: 1 addition & 0 deletions packages/web/src/pages/pc/search/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
path: '/pc/chapter',
query: {
ruleId: item.rule.id,
name: row.name,
filePath: row.url
}
})
Expand Down

0 comments on commit 149e286

Please sign in to comment.