GuidePage.vue 1.06 KB
<template>
  <div class="guide-page" v-if="show">
    <img :src="img" @click="tap" />
  </div>
</template>

<script type="text/ecmascript-6">
const imgUrl = 'https://img02.glsx.com.cn/weapp/resource/scrm-mobile/crowdfunding/guide-'
export default {
  name: 'GuidePage',
  data () {
    return {
      img: '',
      index: 0,
      show: true
    }
  },
  mounted () {
    this.img = `${imgUrl}${this.index}.webp`
    let timer = setTimeout(() => {
      if (this.show) this.hide()
      clearTimeout(timer)
    }, 10e3)
  },
  methods: {
    tap () {
      let { index } = this
      if (index == 2) {
        this.hide()
        return
      }
      ++this.index
      this.img = `${imgUrl}${this.index}.webp?v=${Date.now()}`
    },
    hide () {
      this.$parent.loginLinkFlag = false
      this.$parent.getActivityGroup()
      this.show = false
      this.setLocalStorage('login_link_flag', true)
    }
  }
}
</script>

<style scoped lang="scss">
.guide-page {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10086;
  background-color: #000;
}
</style>