Parcourir la source

新增底部cookie

liyangbin il y a 2 ans
Parent
commit
4f4ccbd7b1
1 fichiers modifiés avec 27 ajouts et 2 suppressions
  1. 27 2
      pages/index.vue

+ 27 - 2
pages/index.vue

@@ -1,9 +1,11 @@
 <script>
+import cookies from 'js-cookie'
 export default {
   middleware: 'user',
   data() {
     return {
-      indexActive: 1
+      indexActive: 1,
+      showCookie: false
     }
   },
   head() {
@@ -43,8 +45,20 @@ export default {
       }else{
         this.$refs.carousel.prev()
       }
+    },
+    changeShowCookie(){
+      this.showCookie = false    
+      cookies.set('17pdf_cookie','true')
     }
-  }
+  },
+  mounted() {
+    if( cookies.get('17pdf_cookie') ){
+      this.showCookie = false
+    }else{
+      this.showCookie = true
+      cookies.set('17pdf_cookie','',{expires:14})
+    }
+  },
 }
 </script>
 <template>
@@ -279,6 +293,17 @@ export default {
       <span>现在注册即送10张格式转换券!</span>
       <a class="cursor-pointer" @click="openInterface">立即注册</a>
 	  </div>
+    <!-- 底部cookie -->
+    <div class="cookie fixed bottom-0 w-full bg-[#000000cc] min-h-42px items-center justify-center z-99999 py-14px px-18px" style="display: flex;" v-if="showCookie">
+	    <p class="text-[#fff] tracking-[-0.3px] text-[14px] leading-[1.428571429] m-0">
+        该网站使用cookie。使用本网站,即表示您同意我们按照
+        <a href="/privacy" class="ml-5px text-[14px] text-[#fff] underline">隐私政策</a>
+        中所述使用cookie。
+      </p>
+	  <div class="btn inline-flex items-center h-30px min-w-60px text-[#fff] pl-13px bg-transparent align-middle text-[14px] leading-[1.428571429] cursor-pointer border-2 border-solid border-white rounded-20px" @click="changeShowCookie">
+      确认
+    </div>
+</div>
   </div>
 </template>