From 9cad6a832c786989be620573b09badccfe7e3b51 Mon Sep 17 00:00:00 2001 From: QYF-GitLab1 <1940665526@qq.com> Date: 星期一, 25 八月 2025 15:11:37 +0800 Subject: [PATCH] 首页头部,样式调整 --- src/views/bookStore/detail.vue | 27 ++++++++++++++------------- 1 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/views/bookStore/detail.vue b/src/views/bookStore/detail.vue index d2b4537..6fbb16d 100644 --- a/src/views/bookStore/detail.vue +++ b/src/views/bookStore/detail.vue @@ -168,11 +168,19 @@ <el-button v-if="currentRoute == 'teachingServices'" plain @click="addPaperBook" >绾歌川鏍蜂功</el-button > - <el-button plain @click="applyTextBook" v-if="!bookInfo.alreadyBuy" + <el-button + plain + @click="applyTextBook" + v-if="!bookInfo.alreadyBuy && currentBook?.state !== 'Normal'" >鐢宠璇曠敤</el-button > <el-button plain @click="useCode" v-if="!bookInfo.alreadyBuy">浣跨敤璐功鐮�</el-button> - <el-button plain @click="read" v-if="bookInfo.alreadyBuy">寮�濮嬮槄璇�</el-button> + <el-button + plain + @click="read" + v-if="bookInfo.alreadyBuy || currentBook?.state == 'Normal'" + >寮�濮嬮槄璇�</el-button + > </div> </div> </div> @@ -317,6 +325,7 @@ let editableTabsValue = ref('1') let activateCode = ref('') let resourceHave = ref(true) +let currentBook = ref(null) let loading = ref(false) let buyBookCodeDialog = ref(false) var chartDom = null @@ -354,6 +363,7 @@ digitalTextId.value = route.query.bookId getBookDetail(digitalTextId.value) getRecommendBookList() + getTextBookList() }) watchEffect(() => { @@ -380,14 +390,7 @@ item.content = JSON.parse(item.content)[0] item.productId = item.content.id } - const currentBook = res.datas.find((item) => item.productId == digitalTextId.value) - if (currentBook) { - return currentBook - } else { - return null - } - } else { - return null + currentBook.value = res.datas.find((item) => item.productId == digitalTextId.value) } } @@ -498,9 +501,7 @@ //鐢宠璇曠敤 const applyTextBook = async () => { - console.log(userStore.userInfo, 'userInfo') - const isApply = await getTextBookList() - if (isApply?.state == 'WaitAudit') { + if (currentBook.value?.state == 'WaitAudit') { ElMessageBox.confirm('鎮ㄥ凡鐢宠璇曠敤璇ヤ功锛屾槸鍚﹀墠寰�鏌ョ湅', '鎻愮ず', { confirmButtonText: '纭畾', cancelButtonText: '鍙栨秷', -- Gitblit v1.9.1