liukangdong
2024-07-04 7c7c4ae64b84be1766a5ebbe3ba5ee97cba8c6da
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;
  }
}