QYF-GitLab1
2 天以前 49a435043b0b1a289a24606e35253365d7ab3956
src/views/bookStore/detail.vue
@@ -168,11 +168,29 @@
              <el-button v-if="currentRoute == 'teachingServices'" plain @click="addPaperBook"
                >纸质样书</el-button
              >
              <el-button plain @click="applyTextBook" v-if="!bookInfo.alreadyBuy"
              <el-button
                size="large"
                type="primary"
                @click="useCode"
                v-if="!bookInfo.alreadyBuy && currentBook?.state !== 'Normal'"
                >使用购书码</el-button
              >
              <el-button
                style="background-color: #144941; color: #fff"
                @click="applyTextBook"
                size="large"
                type="primary"
                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
                size="large"
                @click="read"
                v-if="bookInfo.alreadyBuy || currentBook?.state == 'Normal'"
                >开始阅读</el-button
              >
            </div>
          </div>
        </div>
@@ -317,6 +335,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
@@ -332,18 +351,18 @@
    title: '目录',
    name: '2',
  },
  {
    title: '配套资源',
    name: '3',
  },
  {
    title: '题库',
    name: '4',
  },
  {
    title: '教师资源',
    name: '5',
  },
  // {
  //   title: '配套资源',
  //   name: '3',
  // },
  // {
  //   title: '题库',
  //   name: '4',
  // },
  // {
  //   title: '教师资源',
  //   name: '5',
  // },
  {
    title: '资源统计',
    name: '6',
@@ -354,6 +373,7 @@
  digitalTextId.value = route.query.bookId
  getBookDetail(digitalTextId.value)
  getRecommendBookList()
  getTextBookList()
})
watchEffect(() => {
@@ -380,14 +400,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 +511,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: '取消',