diff --git a/server.js b/server.js
index ad89ddc..95cc39e 100644
--- a/server.js
+++ b/server.js
@@ -33,9 +33,9 @@ if (!isProduction) {
})
app.use(vite.middlewares)
} else {
- const compression = (await import('compression')).default
+ //const compression = (await import('compression')).default
const sirv = (await import('sirv')).default
- app.use(compression())
+ //app.use(compression())
app.use(base, sirv('./dist/client', { extensions: [] }))
}
diff --git a/src/main.scss b/src/main.scss
index 430410b..e52f761 100644
--- a/src/main.scss
+++ b/src/main.scss
@@ -21,8 +21,8 @@ body {
// MDUI 组件样式
mdui-card {
- width: 100%;
- padding: 0 16px 16px;
+ width: 98%;
+ padding: 8px;
}
mdui-text-field {
diff --git a/src/stores/workRead.js b/src/stores/workRead.js
index 60c17e9..dd31188 100644
--- a/src/stores/workRead.js
+++ b/src/stores/workRead.js
@@ -12,14 +12,27 @@ export const useWorkReadState = defineStore('workRead', () => {
const pesud = ref(null)
const title = ref(null)
const text = ref(null)
- const publishedTime = ref(null)
const state = ref('')
+ const publishedTime = ref(null)
+ const wordCount = ref(0)
+ const kudoCount = ref(0)
+ const hitCount = ref(0)
+ const category = ref([])
+ const fandom = ref([])
+ const lang = ref(null)
function setData(data) {
id.value = data.workId
title.value = data.title
summary.value = [escapeAndFormatText(data.summary)]
pesud.value = data.pesud
text.value = data.text.split('\n\n')
+ publishedTime.value = data.stats.publishedTime
+ wordCount.value = data.stats.wordCount
+ kudoCount.value = data.stats.kudoCount
+ hitCount.value = data.stats.hitCount
+ category.value = data.category
+ fandom.value = data.fandom
+ lang.value = data.lang
}
async function loadWork(target) {
if (target == id.value || state.value == 'loading') return
@@ -39,8 +52,14 @@ export const useWorkReadState = defineStore('workRead', () => {
summary,
pesud,
text,
- publishedTime,
state,
+ publishedTime,
+ wordCount,
+ kudoCount,
+ hitCount,
+ category,
+ fandom,
+ lang,
setData,
loadWork
}
diff --git a/src/ui/BetterHr.vue b/src/ui/BetterHr.vue
index 9d22f88..c0caf6d 100644
--- a/src/ui/BetterHr.vue
+++ b/src/ui/BetterHr.vue
@@ -1,11 +1,19 @@
-
+
+
-
-
+
+
+
+
+
+
diff --git a/src/views/Work.vue b/src/views/Work.vue
index 66b17eb..c5df40a 100644
--- a/src/views/Work.vue
+++ b/src/views/Work.vue
@@ -22,6 +22,9 @@ import 'mdui/components/button.js'
import 'mdui/components/dropdown.js'
import 'mdui/components/menu.js'
import 'mdui/components/menu-item.js'
+import 'mdui/components/collapse.js'
+import 'mdui/components/collapse-item.js'
+import 'mdui/components/card.js'
import '@mdui/icons/bookmark.js'
@@ -47,6 +50,12 @@ let bookmarkStore = null
let paragraphs = []
let currentParagraph = null
+const categoryName = {
+ mm: "男/男",
+ ff: "女/女",
+ fm: '女/男'
+}
+
async function addBookmark() {
if (currentParagraph) {
const id = await bookmarkStore.add(workReadState.id, readIndex, currentParagraph.textContent.slice(0,20), '')
@@ -187,10 +196,42 @@ onBeforeUnmount(() => {
{{ workReadState.title }}
{{ workReadState.pesud }}
+
+
+ 作品信息
+
+ - 分类
+ -
+ {{ categoryName[item] }}
+
+ - 原著
+ - 语言
-
+ {{ workReadState.lang }}
+
+
+
+ 作品状态
+
+ - 发布时间
-
+ {{ workReadState.publishedTime.year }} -
+ {{ workReadState.publishedTime.month }} -
+ {{ workReadState.publishedTime.date }}
+
+ - 字数
-
+ {{ workReadState.wordCount }}
+
+ - 点击
-
+ {{ workReadState.hitCount }}
+
+
+
-
+
@@ -237,6 +278,31 @@ onBeforeUnmount(() => {
{{ workReadState.title }}
{{ workReadState.pesud }}
+
+ - 分类
+ -
+ {{ categoryName[item] }}
+
+ - 原著
+ - 语言
-
+ {{ workReadState.lang }}
+
+ - 发布时间
-
+ {{ workReadState.publishedTime.year }} -
+ {{ workReadState.publishedTime.month }} -
+ {{ workReadState.publishedTime.date }}
+
+ - 字数
-
+ {{ workReadState.wordCount }}
+
+ - 点击
-
+ {{ workReadState.hitCount }}
+
+
+
@@ -254,4 +320,12 @@ onBeforeUnmount(() => {
z-index: 1000; /* 确保悬浮按钮在其他内容上方 */
animation: slideInFromRight var(--mdui-motion-duration-medium2) var(--mdui-motion-easing-standard); /* 动画时长和缓动效果 */
}
+
+.infoblock {
+ margin: 8px 16px;
+}
+
+.infoblockhead {
+ background-color: rgb(var(--mdui-color-primary-container));
+}