Browse Source

fix: 文库会员过期显示精品文档原价下载按钮

Signed-off-by: tangshizhe <48740614+tangshizhe@users.noreply.github.com>
tangshizhe 10 months ago
parent
commit
b7143753f4
1 changed files with 6 additions and 3 deletions
  1. 6 3
      jydocs-pc/src/views/Content.vue

+ 6 - 3
jydocs-pc/src/views/Content.vue

@@ -320,8 +320,11 @@ export default {
       const nArr = arr.concat(oldArr)
       return nArr.splice(0, 3)
     },
+    isDocVip () {
+      return this.docsInfo.docStatus > 0
+    },
     showCostBtn () {
-      return (this.buyed !== 1 && !this.docsInfo.docStatus && this.docsInfo.freeDownload === 1 && this.downloadStatus !== 1) || !this.islogin
+      return (this.buyed !== 1 && !this.isDocVip && this.docsInfo.freeDownload === 1 && this.downloadStatus !== 1) || !this.islogin
     },
     // 未购买预览时,未读页码; 或者豆丁渲染错误,
     unreadPage () {
@@ -356,7 +359,7 @@ export default {
         }
       }
       // 会员免费文档+未下载+不是会员+未使用1次免费下载特权
-      if (this.islogin && this.datas.productType === 1 && this.buyed === 0 && !this.docsInfo.docStatus && this.docsInfo.freeDownload !== 1) {
+      if (this.islogin && this.datas.productType === 1 && this.buyed === 0 && !this.isDocVip && this.docsInfo.freeDownload !== 1) {
         btnText = '使用免费下载特权阅读全文'
       }
       if (this.buyed === 1 && this.datas.docFileType === 2) {
@@ -799,7 +802,7 @@ export default {
         }
         return
       }
-      if (this.buyed !== 1 && !this.docsInfo.docStatus && this.docsInfo.freeDownload !== 1 && this.datas.productType === 1) {
+      if (this.buyed !== 1 && !this.isDocVip && this.docsInfo.freeDownload !== 1 && this.datas.productType === 1) {
         this.downLoadFreeEvent()
       } else {
         this.loadFile()