feat:修改新概念2

This commit is contained in:
zyronon
2025-08-10 01:15:29 +08:00
parent 41479c6c2e
commit 777440af7d
14 changed files with 672 additions and 726 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,6 @@ import {useBaseStore} from "@/stores/base.ts";
import {nanoid} from "nanoid";
import {getDefaultArticle} from "@/types/func.ts";
export function useWordOptions() {
const store = useBaseStore()

View File

@@ -26,6 +26,7 @@ export function useSound(audioSrcList?: string[], audioFileLength?: number) {
}
function play(volume: number = 100) {
console.log('play')
index++
if (audioList.length > 1 && audioList.length !== audioLength) {
audioList[index % audioList.length].volume = volume / 100

View File

@@ -69,6 +69,7 @@ const searchList = computed<any[]>(() => {
v-if="searchList.length "
@selectDict="selectDict"
:list="searchList"
quantifier="篇"
:select-id="'-1'"/>
<Empty v-else text="没有相关书籍"/>
</div>
@@ -77,6 +78,7 @@ const searchList = computed<any[]>(() => {
v-if="enArticle.length "
@selectDict="selectDict"
:list="enArticle"
quantifier="篇"
:select-id="'-1'"/>
</div>
</div>

View File

@@ -11,6 +11,7 @@ import PracticeArticle from "@/pages/pc/article/practice-article/index.vue";
import {ShortcutKey} from "@/types/types.ts";
import {useStartKeyboardEventListener} from "@/hooks/event.ts";
import useTheme from "@/hooks/theme.ts";
import {ElMessage} from "element-plus";
const store = useBaseStore()
const settingStore = useSettingStore()

View File

@@ -13,6 +13,7 @@ import {getTranslateText} from "@/hooks/article.ts";
import BaseButton from "@/components/BaseButton.vue";
import QuestionForm from "@/pages/pc/article/components/QuestionForm.vue";
import {getDefaultArticle} from "@/types/func.ts";
import {ElMessage} from "element-plus";
interface IProps {
article: Article,
@@ -80,6 +81,7 @@ watch([() => sectionIndex, () => sentenceIndex, () => wordIndex, () => stringInd
})
watch(() => props.article, () => {
isEnd = false
sectionIndex = props.sectionIndex
sentenceIndex = props.sentenceIndex
wordIndex = props.wordIndex

View File

@@ -324,7 +324,7 @@ const {playSentenceAudio} = usePlaySentenceAudio()
@save="saveArticle"
/>
</div>
<div class="footer " :class="!settingStore.showToolbar && 'hide'">
<div class="footer" :class="!settingStore.showToolbar && 'hide'">
<div class="bottom">
<ElProgress
class="flex-1"

View File

@@ -5,6 +5,7 @@ import Book from "@/pages/pc/components/Book.vue";
defineProps<{
list?: Partial<Dict>[],
selectId?: string
quantifier?: string
}>()
const emit = defineEmits<{
@@ -21,7 +22,7 @@ const emit = defineEmits<{
<Book v-for="(dict,index) in list"
:is-add="false"
@click="emit('selectDict',{dict,index})"
quantifier="个词"
:quantifier="quantifier"
:item="dict"/>
</div>
</template>

View File

@@ -23,10 +23,10 @@ const {toggleTheme} = useTheme()
<div class="aside anim fixed" :class="{'expand':settingStore.sideExpand}">
<div class="top">
<Logo v-if="settingStore.sideExpand"/>
<div class="row" @click="router.push('/home')">
<Icon icon="iconoir:home"/>
<span v-if="settingStore.sideExpand">主页</span>
</div>
<!-- <div class="row" @click="router.push('/home')">-->
<!-- <Icon icon="iconoir:home"/>-->
<!-- <span v-if="settingStore.sideExpand">主页</span>-->
<!-- </div>-->
<div class="row" @click="router.push('/word')">
<Icon icon="material-symbols-light:dictionary-outline-sharp"/>
<!-- <Icon icon="streamline:dictionary-language-book"/>-->

View File

@@ -96,6 +96,7 @@ const searchList = computed<any[]>(() => {
v-if="searchList.length "
@selectDict="selectDict"
:list="searchList"
quantifier="个词"
:select-id="'-1'"/>
<Empty v-else text="没有相关词典"/>
</div>
@@ -104,6 +105,7 @@ const searchList = computed<any[]>(() => {
v-for="item in groupedByCategoryAndTag"
:select-id="store.currentStudyWordDict.id"
@selectDict="selectDict"
quantifier="个词"
:groupByTag="item[1]"
:category="item[0]"
/>

View File

@@ -5,23 +5,21 @@ import {useRuntimeStore} from "@/stores/runtime.ts";
import WordHomePage from "@/pages/pc/word/WordHomePage.vue";
import PC from "@/pages/pc/index.vue";
import ArticleHomePage from "@/pages/pc/article/ArticleHomePage.vue";
import HomeIndex from "@/pages/pc/home/HomeIndex.vue";
import StudyArticle from "@/pages/pc/article/StudyArticle.vue";
import DictDetail from "@/pages/pc/word/DictDetail.vue";
import StudyWord from "@/pages/pc/word/StudyWord.vue";
import EditArticlePage from "@/pages/pc/article/EditArticlePage.vue";
import BookDetail from "@/pages/pc/article/BookDetail.vue";
import BatchEditArticlePage from "@/pages/pc/article/BatchEditArticlePage.vue";
import DictList from "@/pages/pc/word/DictList.vue";
import Setting from "@/pages/pc/Setting.vue";
import BookList from "@/pages/pc/article/BookList.vue";
export const routes: RouteRecordRaw[] = [
{
path: '/', component: PC,
redirect: '/home',
path: '/',
component: PC,
redirect: '/word',
children: [
{path: 'home', component: HomeIndex},
// {path: 'home', component: HomeIndex},
{path: 'word', component: WordHomePage},
{path: 'dict-list', component: DictList},
{path: 'study-word', component: StudyWord},
@@ -29,15 +27,16 @@ export const routes: RouteRecordRaw[] = [
{path: 'article', component: ArticleHomePage},
{path: 'study-article', component: StudyArticle},
{path: 'edit-article', component: EditArticlePage},
{path: 'batch-edit-article', component: BatchEditArticlePage},
{path: 'edit-article', component: () => import("@/pages/pc/article/EditArticlePage.vue")},
{path: 'batch-edit-article', component: () => import("@/pages/pc/article/BatchEditArticlePage.vue")},
{path: 'book-detail', component: BookDetail},
{path: 'book-list', component: BookList},
{path: 'setting', component: Setting},
]
},
{path: '/test', component: Test},
// {path: '/', redirect: '/pc/practice'},
{path: '/:pathMatch(.*)*', redirect: '/word'},
]
const router = VueRouter.createRouter({

View File

@@ -394,25 +394,16 @@ export function _parseLRC(lrc: string): { start: number, end: number, text: stri
}
export async function _getDictDataByUrl(val: DictResource, type: DictType = DictType.word): Promise<Dict> {
let dictResourceUrl = `./dicts/${val.language}/word/${val.url}`.replace('.json', '_v2.json');
let dictResourceUrl = `./dicts/${val.language}/word/${val.url}`
if (type === DictType.article) {
dictResourceUrl = `./dicts/${val.language}/${val.type}/${val.url}`;
}
let s = await getDictFile(dictResourceUrl)
if (s) {
if (type === DictType.word) {
let words = cloneDeep(s.map(v => {
v.id = nanoid(6)
return v
}))
return getDefaultDict({...val, words})
return getDefaultDict({...val, words: s})
} else {
let articles = cloneDeep(s.map(v => {
v.id = nanoid(6)
return v
}))
console.log('articles', articles)
return getDefaultDict({...val, articles})
return getDefaultDict({...val, articles: s})
}
}
return getDefaultDict()