k94314517
2024-10-16 17efddc6a667670dca682bf36b51a43e99615e6d
h5/pages/notice/notice.vue
@@ -1,19 +1,19 @@
<template>
  <div class="container">
  <view class="container">
    <!-- <video
      src="https://vdept3.bdstatic.com/mda-nj7gwfue9kdnbtsh/sc/cae_h264/1665488517815949255/mda-nj7gwfue9kdnbtsh.mp4?v_from_s=hkapp-haokan-hbe&auth_key=1715141591-0-0-6dfdf4d4c3d94b60b9adeb53368a72f3&bcevod_channel=searchbox_feed&pd=1&cr=2&cd=0&pt=3&logid=0791905773&vid=13790089500387859718&klogid=0791905773&abtest="
    ></video> -->
    <scroll-view scroll-y class="content">
      <div>
        <div v-html="content"></div>
      </div>
      <div class="empty"></div>
      <view>
        <view v-html="content"></view>
      </view>
      <view class="empty"></view>
    </scroll-view>
    <div class="button" @click="handleAgree" v-if="num === 6">确认了解</div>
    <div class="button" @click="toapply" v-else>
      已知晓,下一步({{ num }}秒)
    </div>
  </div>
    <view class="button" :class="{ disable: num > 0 }" @click="toapply">
      已知晓,下一步
      <text v-if="num > 0">({{ num }}秒)</text>
    </view>
  </view>
</template>
<script>
@@ -25,26 +25,16 @@
    return {
      content: ``,
      answer: '',
      num: 6
      num: 5
    }
  },
  onLoad() {
    this.getInfo()
    if (!this.$store.state.openId) {
      this.initToken()
      // this.initToken()
    }
  },
  methods: {
    handleAgree() {
      this.num--
      timer = setInterval(() => {
        this.num--
        if (this.num === 0) {
          this.toapply()
        }
      }, 1000)
    },
    initToken() {
      const appID = 'wxac2a80c2144c4ee0'
      // const AppSecret = '922c93596d134fedf5bd22a9354b3bfe'
@@ -63,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',
@@ -74,7 +79,7 @@
      })
    },
    toapply() {
      clearInterval(timer)
      if (this.num > 0) return
      if (this.answer === '0') {
        uni.navigateTo({
          url: '/pages/userinfo/userinfo'
@@ -106,7 +111,7 @@
    height: calc(100% - 170rpx);
    .title {
      color: #333333;
      font-weight: 500;
      font-weight: 600;
      margin-bottom: 16rpx;
    }
    .text {
@@ -129,5 +134,8 @@
    bottom: 30rpx;
    left: 30rpx;
  }
  .disable {
    background-color: #cccccc;
  }
}
</style>