From 94dc723910e27f57639f35fa82e2abfcfd40cfd7 Mon Sep 17 00:00:00 2001 From: osiris Date: Sat, 18 May 2024 19:14:55 +0800 Subject: [PATCH] fix: --- src/components/Home/About copy.vue | 34 +++++++++ src/components/Home/About.vue | 111 +++++++++++++++++++++++------ src/components/Home/Home.vue | 55 ++++++++++---- src/store/modules/scan.ts | 36 +++++++++- 4 files changed, 201 insertions(+), 35 deletions(-) create mode 100644 src/components/Home/About copy.vue diff --git a/src/components/Home/About copy.vue b/src/components/Home/About copy.vue new file mode 100644 index 0000000..4354178 --- /dev/null +++ b/src/components/Home/About copy.vue @@ -0,0 +1,34 @@ + + + + + \ No newline at end of file diff --git a/src/components/Home/About.vue b/src/components/Home/About.vue index 4354178..e66d6d1 100644 --- a/src/components/Home/About.vue +++ b/src/components/Home/About.vue @@ -1,31 +1,100 @@ diff --git a/src/components/Home/Home.vue b/src/components/Home/Home.vue index 97272d3..45436a1 100644 --- a/src/components/Home/Home.vue +++ b/src/components/Home/Home.vue @@ -3,10 +3,10 @@ import { onMounted,reactive, ref } from 'vue'; import { useScanStore } from '@/store/modules/scan' // import { ElMessage } from 'element-plus' import { Search } from '@element-plus/icons-vue'; -// import { useRoute } from "vue-router" +import { useRouter } from "vue-router" //store const scanStore = useScanStore() -// const route = useRoute() +const router = useRouter() // const getToolsCate = async () => { // try { // await toolsStore.getToolCate() @@ -18,8 +18,8 @@ const scanStore = useScanStore() const loading = ref(false) const setTagsDialog = ref(false) // const checkedTags = reactive({}) -//常见视频格式 -const extVideo = ref(['ts', 'mp4', 'mkv', 'wmv', 'avi', 'flv', '3gp', 'dvd', 'mov', 'vob', 'webm']) +//----- config ----- +//----- ^ ----- //获取分类 //查询参数 @@ -28,8 +28,9 @@ const searchParam = reactive({ tags: '', page: 1, }) -const getList = async () => { +const getList = async (query) => { try { + searchParam.title = query await scanStore.getList(searchParam) } catch (error) { console.log(error) @@ -97,15 +98,38 @@ const pageChange = async (nowPage: number) => { await scanStore.getList(searchParam) } +/** + * open local app + * + * index: 索引 + * data: 内容数据 + */ +const open = (index: number, data: any) => { + //缓存当前播放和播放索引 + scanStore.setNowPlay(data) + scanStore.setNowIndex(index) + router.push({ + path: '/about', + }) + + // let addr = router.resolve({ + // path: '/about', + // params: { + // url: url + // } + // }).href + // window.open(addr, '_blank') +} + onMounted(() => { - getList(); + getList(''); getTags(); })