From fac03bf0a48b328b814e2c40bf2a4e0f0f0f7a27 Mon Sep 17 00:00:00 2001 From: Zyronon Date: Sat, 20 Dec 2025 23:12:54 +0800 Subject: [PATCH] feat:add resource share page --- components.d.ts | 1 + src/components/ResourceCard.vue | 75 +++ src/pages/article/components/EditBook.vue | 5 +- src/pages/doc.vue | 205 ++----- src/pages/feedback.vue | 2 +- src/pages/layout.vue | 8 +- src/pages/qa.vue | 2 +- src/pages/setting/Log.vue | 10 +- src/pages/word/DictDetail.vue | 703 ++++++++++++---------- 9 files changed, 530 insertions(+), 481 deletions(-) create mode 100644 src/components/ResourceCard.vue diff --git a/components.d.ts b/components.d.ts index cefc3420..20e2399b 100644 --- a/components.d.ts +++ b/components.d.ts @@ -146,6 +146,7 @@ declare module 'vue' { Progress: typeof import('./src/components/base/Progress.vue')['default'] Radio: typeof import('./src/components/base/radio/Radio.vue')['default'] RadioGroup: typeof import('./src/components/base/radio/RadioGroup.vue')['default'] + ResourceCard: typeof import('./src/components/ResourceCard.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] Select: typeof import('./src/components/base/select/Select.vue')['default'] diff --git a/src/components/ResourceCard.vue b/src/components/ResourceCard.vue new file mode 100644 index 00000000..afb56362 --- /dev/null +++ b/src/components/ResourceCard.vue @@ -0,0 +1,75 @@ + + + diff --git a/src/pages/article/components/EditBook.vue b/src/pages/article/components/EditBook.vue index 2f8b631b..5d1628d6 100644 --- a/src/pages/article/components/EditBook.vue +++ b/src/pages/article/components/EditBook.vue @@ -54,6 +54,7 @@ async function onSubmit() { //todo 可以检查的更准确些,比如json对比 if (props.isAdd) { data.id = 'custom-dict-' + Date.now() + data.custom = true if (source.bookList.find(v => v.name === data.name)) { Toast.warning('已有相同名称!') return @@ -84,11 +85,11 @@ async function onSubmit() { } runtimeStore.editDict = data if (rIndex > -1) { - source.bookList[rIndex] = cloneDeep(data) + source.bookList[rIndex] = getDefaultDict(data) emit('submit') Toast.success('修改成功') } else { - source.bookList.push(cloneDeep(data)) + source.bookList.push(getDefaultDict(data)) Toast.success('修改成功并加入我的词典') } } diff --git a/src/pages/doc.vue b/src/pages/doc.vue index e08120f2..595c88b0 100644 --- a/src/pages/doc.vue +++ b/src/pages/doc.vue @@ -2,6 +2,7 @@ import { computed, ref } from 'vue' import BasePage from '@/components/BasePage.vue' import BaseButton from '@/components/BaseButton.vue' +import ResourceCard from '@/components/ResourceCard.vue' // 类型定义 interface Resource { @@ -23,7 +24,7 @@ interface Subcategory { interface Category { id: string name: string - icon: string + icon?: string description?: string resources?: Resource[] subcategories?: Subcategory[] @@ -34,113 +35,111 @@ const categories = ref([ { id: 'new-concept', name: '新概念英语', - icon: '📚', description: '经典英语教材,适合系统学习', resources: [ { name: '新概念英语第一册', description: '适合英语初学者', difficulty: '入门', - link: 'https://pan.quark.cn/s/92a317cf1a16', + link: 'https://pan.quark.cn/s/0d2ece46983f', }, { name: '新概念英语第二册', description: '基础英语学习,巩固语法和词汇', difficulty: '基础', - link: 'https://pan.quark.cn/s/1ee9c8a7e8e2', + link: 'https://pan.quark.cn/s/df29bb396728', }, { name: '新概念英语第三册', description: '提高英语水平,增强阅读能力', difficulty: '进阶', - link: 'https://pan.quark.cn/s/b35c2859812a', + link: 'https://pan.quark.cn/s/ec39dc7cbe5b', }, { name: '新概念英语第四册', description: '高级英语学习,提升综合能力', difficulty: '高级', - link: 'https://pan.quark.cn/s/a56713cafbc5', + link: 'https://pan.quark.cn/s/207a2cc8a320', }, { name: '新概念英青少年版', description: '儿童读物', difficulty: '7岁至14岁', - link: 'https://pan.quark.cn/s/9de8d7967de2', + link: 'https://pan.quark.cn/s/4628b00b39c0', }, { name: '新概念英语1-4 教材高清 PDF', description: '仅 1-4 册的教材高清扫描版 PDF', difficulty: '', - link: 'https://pan.quark.cn/s/ec49145d6b00', + link: 'https://pan.quark.cn/s/f1e7739ed806', }, { name: '新概念讲解视频', description: '多家机构/个人的讲解视频', difficulty: '', - link: 'https://pan.quark.cn/s/09e98acd55b4', + link: 'https://pan.quark.cn/s/07e25ee6de9f', }, { name: '新概念合集', description: '包含前面的内容', difficulty: '', - link: 'https://pan.quark.cn/s/667e2e48eba4', + link: 'https://pan.quark.cn/s/6b12da160020', }, ], }, { id: 'exam', name: '电视/电影', - icon: '🎯', description: '一些不错的美/英剧,可练听力和口语', resources: [ { name: '老友记', description: '', difficulty: '喜剧/爱情', - link: 'https://pan.quark.cn/s/674834e7a5b1', + link: 'https://pan.quark.cn/s/c17770edfa15', }, { name: '生活大爆炸', description: '', difficulty: '喜剧/爱情', - link: 'https://pan.quark.cn/s/0539c10704ba', + link: 'https://pan.quark.cn/s/3e66da8ce1c4', }, { name: '是大臣/是首相', description: '', difficulty: '喜剧/讽刺', - link: 'https://pan.quark.cn/s/316323ce51d5', + link: 'https://pan.quark.cn/s/2c62ce3e220d', }, { name: '破产姐妹', description: '', difficulty: '喜剧', - link: 'https://pan.quark.cn/s/40af6faaa19a', + link: 'https://pan.quark.cn/s/018600971998', }, { name: '绝望主妇', description: '', difficulty: '悬疑', - link: 'https://pan.quark.cn/s/bcccdf9e788b', + link: 'https://pan.quark.cn/s/1c67ae200c2e', }, { name: '纸牌屋', description: '', difficulty: '纸牌屋', - link: 'https://pan.quark.cn/s/d2f3082508fd', + link: 'https://pan.quark.cn/s/5ba146c46180', }, { name: '电视/电影合集', description: '包含前面的内容', difficulty: '', - link: 'https://pan.quark.cn/s/84ecb30b700b', + link: 'https://pan.quark.cn/s/84ecb30b700b', //159 + // link: 'https://pan.quark.cn/s/e9b62b79c48c', }, ], }, { id: 'grammar', name: '语法学习', - icon: '📝', description: '', subcategories: [ { @@ -150,32 +149,33 @@ const categories = ref([ { name: '英语语法新思维', author: '张满胜', - features:'从思维角度讲解语法,注重理解而非死记硬背,分为初级、中级、高级三册,循序渐进', - suitable:'希望系统建立语法体系的学习者', + features: + '从思维角度讲解语法,注重理解而非死记硬背,分为初级、中级、高级三册,循序渐进', + suitable: '希望系统建立语法体系的学习者', difficulty: '', link: 'https://pan.quark.cn/s/d06abef6c737', }, { name: '薄冰英语语法', author: '薄冰', - features:'老牌经典,体系完整,分类非常细,查语法点方便', - suitable:'中学生或基础较弱的学习者', + features: '老牌经典,体系完整,分类非常细,查语法点方便', + suitable: '中学生或基础较弱的学习者', difficulty: '', link: 'https://pan.quark.cn/s/30777ceba5b9', }, - { - name: '实用英语语法', - author: '张道真', - features:'国内经典语法教材,内容详实全面,例句丰富,适合作为工具书查阅', - suitable:'需要权威参考书的学生或教师', - difficulty: '', - link: 'https://pan.baidu.com/s/xxx', - }, + // { + // name: '实用英语语法', + // author: '张道真', + // features: '国内经典语法教材,内容详实全面,例句丰富,适合作为工具书查阅', + // suitable: '需要权威参考书的学生或教师', + // difficulty: '', + // link: 'https://pan.baidu.com/s/xxx', + // }, { name: '旋元估文法', author: '旋元估', - features:'以通俗易懂的语言解析复杂语法,强调“理解逻辑”,适合突破语法难点', - suitable:'对传统语法教学感到枯燥,想轻松掌握核心逻辑的学习者', + features: '以通俗易懂的语言解析复杂语法,强调“理解逻辑”,适合突破语法难点', + suitable: '对传统语法教学感到枯燥,想轻松掌握核心逻辑的学习者', difficulty: '繁体中文版', link: 'https://pan.quark.cn/s/0d0de559794e', }, @@ -188,8 +188,8 @@ const categories = ref([ { name: '剑桥英语语法(English Grammar in Use)', author: '剑桥大学出版', - features:'分为初级、中级、高级三册,经典畅销语法自学书,解释简明且有大量练习', - suitable:'需要结合国际考试的学习者', + features: '分为初级、中级、高级三册,经典畅销语法自学书,解释简明且有大量练习', + suitable: '需要结合国际考试的学习者', description: '', difficulty: '中文版', link: 'https://pan.quark.cn/s/d4a6ef53c04d', @@ -197,16 +197,17 @@ const categories = ref([ { name: 'Oxford English Grammar(牛津英语语法)', author: 'Sidney Greenbaum & Gerald Nelson', - features:'分为基础、提升、高级三册,英式语法权威,解释清晰、例句地道,适合备考雅思/托福', - suitable:'想全面系统梳理语法体系的人', + features: + '分为基础、提升、高级三册,英式语法权威,解释清晰、例句地道,适合备考雅思/托福', + suitable: '想全面系统梳理语法体系的人', difficulty: '英文版', link: 'https://pan.quark.cn/s/ca505875e68c', }, { name: '实用英语用法(Practical English Usage)', author: 'Michael Swan', - features:'解释非常细致,尤其适合纠正常见错误和困惑', - suitable:'中高级学习者,适合作为语法问题的工具书', + features: '解释非常细致,尤其适合纠正常见错误和困惑', + suitable: '中高级学习者,适合作为语法问题的工具书', difficulty: '中文版/英文版', link: 'https://pan.quark.cn/s/05006e705a77', }, @@ -217,14 +218,13 @@ const categories = ref([ { id: 'listening', name: '听力训练', - icon: '🎧', description: '提升英语听力水平', resources: [ { name: 'VOA慢速英语合集', description: '新闻类听力材料,语速适中,内容丰富', difficulty: '初级', - link: 'https://pan.quark.cn/s/23fc83043ca4', + link: 'https://pan.quark.cn/s/681794bffc6e', }, // { // name: 'BBC Learning English', @@ -236,13 +236,13 @@ const categories = ref([ name: 'TED-ED 科普动画', description: 'TED-Ed 是一个专为初高中生所设计的在3到5分钟长的科普动画課程', difficulty: '初级', - link: 'https://pan.quark.cn/s/e4c0182833ba', + link: 'https://pan.quark.cn/s/d3d83038afb9', }, { name: '哈弗演讲', description: '高质量演讲,锻炼听力同时开拓视野', difficulty: '中高级', - link: 'https://pan.quark.cn/s/f2bfa8a50d25', + link: 'https://pan.quark.cn/s/62e8d536a34f', }, ], }, @@ -263,26 +263,6 @@ const filteredResources = computed(() => { const openLink = (url: string) => { window.open(url, '_blank') } - -// 根据难度获取对应的样式类 -const getDifficultyClass = (difficulty: string) => { - switch (difficulty) { - case '入门': - return 'bg-green-500' - case '基础': - return 'bg-blue-500' - case '中级': - return 'bg-purple-500' - case '进阶': - return 'bg-amber-500' - case '高级': - return 'bg-red-500' - case '全级别': - return 'bg-gray-500' - default: - return 'bg-blue-500' - } -} @@ -387,41 +334,12 @@ const getDifficultyClass = (difficulty: string) => { @@ -429,12 +347,15 @@ const getDifficultyClass = (difficulty: string) => {
-
-

💡 温馨提示

-
    +
    +
    温馨提示
    +
    • 所有资源均来自互联网收集,仅供学习交流使用
    • -
    • 如果链接失效,请及时告知,我会尽快更新
    • +
    • + 如果链接失效,请及时告知,我会尽快更新 +
diff --git a/src/pages/feedback.vue b/src/pages/feedback.vue index 167d1466..e900c32d 100644 --- a/src/pages/feedback.vue +++ b/src/pages/feedback.vue @@ -7,7 +7,7 @@ import About from "@/components/About.vue";