From 2ff8699a66dcf963063e3acbcc996c1a0e437510 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期二, 25 六月 2024 09:58:05 +0800
Subject: [PATCH] ‘’

---
 h5/pages/notice/notice.vue |   37 ++++++++++++++++++++++++++++++++-----
 1 files changed, 32 insertions(+), 5 deletions(-)

diff --git a/h5/pages/notice/notice.vue b/h5/pages/notice/notice.vue
index ddd051b..f12ec94 100644
--- a/h5/pages/notice/notice.vue
+++ b/h5/pages/notice/notice.vue
@@ -9,26 +9,52 @@
       </div>
       <div class="empty"></div>
     </scroll-view>
-    <div class="button" @click="toapply">纭浜嗚В</div>
+    <div class="button" @click="handleAgree" v-if="num === 6">纭浜嗚В</div>
+    <div class="button" @click="toapply" v-else>
+      宸茬煡鏅擄紝涓嬩竴姝�({{ num }}绉�)
+    </div>
   </div>
 </template>
 
 <script>
+let timer
 import { getSystemDictData } from "@/api"
 export default {
   name: 'Index',
   data() {
     return {
       content: ``,
-      answer: ''
+      answer: '',
+      num: 6
     }
   },
   onLoad() {
     this.getInfo()
+    if (!this.$store.state.openId) {
+      this.initToken()
+    }
+
   },
   methods: {
+    handleAgree() {
+      this.num--
+      timer = setInterval(() => {
+        this.num--
+        if (this.num === 0) {
+          this.toapply()
+        }
+      }, 1000)
+    },
+    initToken() {
+      const appID = 'wxac2a80c2144c4ee0'
+      // const AppSecret = '922c93596d134fedf5bd22a9354b3bfe'
+      let uri = encodeURIComponent('http://xiaopiqiu2.natapp1.cc/static/redirect.html')
+      let authURL =
+        `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appID}&redirect_uri=${uri}&response_type=code&scope=snsapi_base&state=123#wechat_redirect`
+      window.location.href = authURL
+    },
     getInfo() {
-      // 鍏ュ満椤荤煡璇︽儏
+      // 鍏ュ洯椤荤煡璇︽儏
       getSystemDictData({
         dictCode: 'SYSTEM',
         label: 'VISIT_NOTICE'
@@ -48,6 +74,7 @@
       })
     },
     toapply() {
+      clearInterval(timer)
       if (this.answer === '0') {
         uni.navigateTo({
           url: '/pages/userinfo/userinfo'
@@ -98,8 +125,8 @@
     border-radius: 44rpx;
     font-size: 32rpx;
     color: #ffffff;
-    position: absolute;
-    bottom: 42rpx;
+    position: fixed;
+    bottom: 30rpx;
     left: 30rpx;
   }
 }

--
Gitblit v1.9.3