diff --git a/src/stores/search.js b/src/stores/search.js
index 0360565..27be514 100644
--- a/src/stores/search.js
+++ b/src/stores/search.js
@@ -13,16 +13,15 @@ export const useSimpleSearchState = defineStore('simpleSearch', () => {
const state = ref(null)
async function load() {
if (pageCount.value && currentPage.value >= pageCount.value){ state.value = 'finish'; return }
+ state.value = 'loading'
let res = await api.workSimpleSearch(keyword.value, currentPage.value)
res = res.data
- if( pageCount.value ) {
- currentPage.value++
- if (currentPage.value > pageCount.value) currentPage.value = pageCount.value
- }
if (res.code == 0) {
- if ( !pageCount.value ) {
+ currentPage.value++
+ if( pageCount.value ) {
+ if (currentPage.value > pageCount.value) currentPage.value = pageCount.value
+ } else {
pageCount.value = res.pageCount
- currentPage.value = res.page
}
count.value = res.count
state.value = import.meta.env.SSR ? 'ssrready' : 'ready'
diff --git a/src/views/SimpleSearch.vue b/src/views/SimpleSearch.vue
index 584e755..ea919f6 100644
--- a/src/views/SimpleSearch.vue
+++ b/src/views/SimpleSearch.vue
@@ -39,7 +39,7 @@ onMounted(async () => {
isObserver = new IntersectionObserver((entries) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
- if (simpleSearchState.state == 'ready') simpleSearchState.load()
+ if (simpleSearchState.state == 'ready' || simpleSearchState.state == 'ssrready') setTimeout(simpleSearchState.load,400)
}
})
}, { threshold: 1 })
diff --git a/src/views/Work.vue b/src/views/Work.vue
index 07c063d..36bbff3 100644
--- a/src/views/Work.vue
+++ b/src/views/Work.vue
@@ -163,8 +163,12 @@ async function switchWorkWithIndex(target) {
- 第 {{ workReadState.chapterIndex + 1 }} / {{ workReadState.chapters.length }} 章: {{ workReadState.chapters[workReadState.chapterIndex].title }}第 {{ workReadState.chapterIndex + 1 }} / {{ workReadState.chapters.length }} 章: {{ workReadState.chapters[workReadState.chapterIndex].title }}
+
@@ -192,7 +196,11 @@ async function switchWorkWithIndex(target) {
点击跳转 -+ @@ -249,6 +257,9 @@ async function switchWorkWithIndex(target) { {{index + 1}}. {{ chapter.title }}