修复:内测问题修改

This commit is contained in:
2025-12-03 14:10:27 +08:00
parent 35e27753b8
commit 677fe7436e
19 changed files with 172 additions and 163 deletions

View File

@@ -102,6 +102,7 @@
<text class="popup-title">{{ $t('book.zjContents') }}</text>
<scroll-view scroll-y class="chapter-list">
<view
v-if="chapterList.length > 0"
v-for="(chapter, index) in chapterList"
:key="chapter.id"
class="chapter-item"
@@ -111,8 +112,9 @@
<text class="chapter-text" :class="{ locked: isLocked(index) }">
{{ chapter.chapter }}{{ chapter.content ? ' - ' + chapter.content : '' }}
</text>
<wd-icon v-if="isLocked(index)" name="lock-on" size="20px" />
<wd-icon v-if="isLocked(index) && !hasVip" name="lock-on" size="20px" />
</view>
<wd-status-tip v-else image="content" :tip="$t('global.dataNull')" />
</scroll-view>
</view>
</wd-popup>
@@ -191,6 +193,7 @@
import { ref, computed, onMounted } from 'vue'
import { onLoad, onShow, onHide, onBackPress } from '@dcloudio/uni-app'
import { useI18n } from 'vue-i18n'
import { useUserStore } from '@/stores/user'
import { useBookStore } from '@/stores/book'
import { bookApi } from '@/api/modules/book'
import type { IChapter, IChapterContent, IReadProgress } from '@/types/book'
@@ -198,6 +201,10 @@ import { onPageBack } from '@/utils/index'
const { t } = useI18n()
const bookStore = useBookStore()
const userStore = useUserStore()
// 会员状态
const hasVip = computed(() => userStore.userInfo?.userEbookVip?.length > 0 || false)
// 路由参数
const bookId = ref(0)
@@ -430,7 +437,7 @@ async function switchChapter(chapter: IChapter, index: number) {
// 判断章节是否锁定
function isLocked(index: number): boolean {
return !isBuy.value && index + 1 > count.value
return !isBuy.value && index + 1 > count.value && !hasVip.value
}
// 判断是否是图片
@@ -604,10 +611,9 @@ function changeReadMode(mode: 'scroll' | 'page') {
// 语言配置
const bookLanguages = ref([])
const currentLanguage = ref('')
const currentLanguage = ref('中文')
onMounted(() => {
currentLanguage.value = uni.getStorageSync('currentBookLanguage') || '中文'
console.log('currentLanguage', currentLanguage.value)
})
const getBookLanguages = async () => {
const res = await bookApi.getBookLanguages(bookId.value)
@@ -658,7 +664,7 @@ async function saveProgress() {
position: fixed;
left: 0;
right: 0;
z-index: 999;
z-index: 90;
background: inherit;
display: flex;
align-items: center;