| | |
| | | <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> |
| | |
| | | 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 |
| | |
| | | digitalTextId.value = route.query.bookId |
| | | getBookDetail(digitalTextId.value) |
| | | getRecommendBookList() |
| | | getTextBookList() |
| | | }) |
| | | |
| | | watchEffect(() => { |
| | |
| | | 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) |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | //申请试用 |
| | | 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: '取消', |