From 7c7c4ae64b84be1766a5ebbe3ba5ee97cba8c6da Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期四, 04 七月 2024 16:21:41 +0800
Subject: [PATCH] ‘’
---
h5/pages/notice/notice.vue | 27 ++++++++++++++++++---------
1 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/h5/pages/notice/notice.vue b/h5/pages/notice/notice.vue
index 4ad99a7..f108547 100644
--- a/h5/pages/notice/notice.vue
+++ b/h5/pages/notice/notice.vue
@@ -9,7 +9,7 @@
</view>
<view class="empty"></view>
</scroll-view>
- <view class="button" :class="{disable: num > 0}" @click="toapply">
+ <view class="button" :class="{ disable: num > 0 }" @click="toapply">
宸茬煡鏅擄紝涓嬩竴姝�
<text v-if="num > 0">({{ num }}绉�)</text>
</view>
@@ -33,12 +33,6 @@
if (!this.$store.state.openId) {
this.initToken()
}
- timer = setInterval(() => {
- this.num--
- if (this.num === 0) {
- clearInterval(timer)
- }
- }, 1000)
},
methods: {
initToken() {
@@ -59,6 +53,21 @@
this.content = res.data.code
}
})
+ // 鍊掕鏃舵椂闂�
+ getSystemDictData({
+ dictCode: 'SYSTEM',
+ label: 'NOTICE_CUTNTDOWN'
+ }).then(res => {
+ if (res.code === 200) {
+ this.num = res.data.code
+ timer = setInterval(() => {
+ this.num--
+ if (this.num === 0) {
+ clearInterval(timer)
+ }
+ }, 1000)
+ }
+ })
// 鏄惁闇�瑕佺瓟棰�
getSystemDictData({
dictCode: 'SYSTEM',
@@ -70,7 +79,7 @@
})
},
toapply() {
- if(this.num > 0) return
+ if (this.num > 0) return
if (this.answer === '0') {
uni.navigateTo({
url: '/pages/userinfo/userinfo'
@@ -125,7 +134,7 @@
bottom: 30rpx;
left: 30rpx;
}
- .disable{
+ .disable {
background-color: #cccccc;
}
}
--
Gitblit v1.9.3