修复:修改书籍购买跳转和章节锁定问题

This commit is contained in:
2025-12-01 17:58:25 +08:00
parent b4585c93a6
commit 0ab55b538b
6 changed files with 49 additions and 17 deletions

View File

@@ -111,7 +111,7 @@
<text class="chapter-text" :class="{ locked: isLocked(index) }">
{{ chapter.chapter }}{{ chapter.content ? ' - ' + chapter.content : '' }}
</text>
<wd-icon v-if="isLocked(index)" name="lock" size="20px" />
<wd-icon v-if="isLocked(index)" name="lock-on" size="20px" />
</view>
</scroll-view>
</view>
@@ -201,7 +201,7 @@ const bookStore = useBookStore()
// 路由参数
const bookId = ref(0)
const isBuy = ref('0')
const isBuy = ref(false)
const count = ref(0)
// 数据状态
@@ -273,7 +273,7 @@ const currentChapterTitle = computed(() => {
onLoad((options: any) => {
if (options.bookId) bookId.value = Number(options.bookId)
if (options.isBuy) isBuy.value = options.isBuy
if (options.isBuy) isBuy.value = options.isBuy == 1 ? true : false
if (options.count) count.value = Number(options.count)
// 获取刘海高度
@@ -430,7 +430,7 @@ async function switchChapter(chapter: IChapter, index: number) {
// 判断章节是否锁定
function isLocked(index: number): boolean {
return isBuy.value === '1' && index + 1 > count.value
return !isBuy.value && index + 1 > count.value
}
// 判断是否是图片