Răsfoiți Sursa

feat: 留资和下载完成后修改页面状态,收藏列表显示会员免费文档标识

Signed-off-by: tangshizhe <48740614+tangshizhe@users.noreply.github.com>
tangshizhe 1 an în urmă
părinte
comite
0ad84a6e33
2 a modificat fișierele cu 25 adăugiri și 11 ștergeri
  1. 24 10
      jydocs-pc/src/views/Content.vue
  2. 1 1
      jydocs-pc/src/views/UserCollections.vue

+ 24 - 10
jydocs-pc/src/views/Content.vue

@@ -42,7 +42,7 @@
           <div class="foot-tip tops" id="footp">
             <div class="member-time-tip" v-if="redShow && islogin">
               <span class="warn-icon">i</span>
-              <span>您的文库会员将于7天后到期,续费即享下载特权!</span>
+              <span>您的文库会员将于{{ surplusDay }}到期,续费即享下载特权!</span>
               <span @click="goRenew" style="color: #2ABED1;cursor: pointer;">请点击前往续费></span>
               <span @click="redShow = false" class="time-tip-close el-icon-close"></span>
             </div>
@@ -52,6 +52,7 @@
                   <img :src="jyPcDocmemberDetail[0].s_pic" :alt="jyPcDocmemberDetail[0].s_remark" />
                 </a>
               </div>
+              <span @click="jyPcDocmemberDetail = []" class="time-tip-close el-icon-close"></span>
             </div>
             <div class="load-doc">
               <div class="icons">
@@ -209,7 +210,8 @@ export default {
         endDate: 0,
         freeDownload: 0,
         startDate: 0
-      }
+      },
+      surplusDay: 0, // 剩余多少天到期
     }
   },
   created () {
@@ -258,8 +260,15 @@ export default {
           this.docsInfo = val.docsInfo
           const date = parseInt(new Date().getTime() / 1000)
           const sevenDay = 60 * 60 * 24 * 7
+          const oneDay = 60 * 60 * 24
+          const surplus = val.docsInfo?.endDate - date
           if (val.docsInfo?.endDate - date <= sevenDay && val.docsInfo.dataStatus === 1) {
             this.redShow = true
+            this.surplusDay = Math.ceil(surplus / oneDay) + '天后'
+            // 如果剩余天数不到1天,则显示今天到期
+            if (this.surplusDay < 1) {
+              this.surplusDay = '今天'
+            }
           }
         }
       },
@@ -290,6 +299,7 @@ export default {
               confirmText: '我知道了'
             }
             this.dialogInfo = params
+            this.buyed = 1
           }
         })
       }
@@ -1041,16 +1051,17 @@ export default {
             color: #fff;
             background: #F56500;
           }
-          .time-tip-close{
-            position: absolute;
-            right: 24px;
-            top: 11px;
-            cursor: pointer;
-            font-size: 18px;
-            color: #AAAAAA;
-          }
+        }
+        .time-tip-close{
+          position: absolute;
+          right: 24px;
+          top: 11px;
+          cursor: pointer;
+          font-size: 18px;
+          color: #AAAAAA;
         }
         .doc-detail-ad{
+          position: relative;
           width: 920px;
           height: 64px;
           .doc-detail-ad-img{
@@ -1060,6 +1071,9 @@ export default {
             width: 100%;
             height: 100%;
           }
+          .time-tip-close{
+            color: #fff;
+          }
         }
         .load-doc {
           height: 68px;

+ 1 - 1
jydocs-pc/src/views/UserCollections.vue

@@ -11,7 +11,7 @@
           :title="item.DocName"
           :desc="item.DocSummary"
           :docType="item.DocFileType"
-          :productType="item.product_type ? 1 : 0"
+          :productType="item.productType"
           :subInfo="calcSubInfo(item)"
           @onClick="toDocDetail(item)"
         >