<template>
  <div class="indexpage">
    <img class="bgimg" :src="activitydetail.Thumb">
    <!-- <img v-if="type === 2" class="bgimg" :src="AudioPlay"> -->
    <button class="EnterActivity" @click="gotoactivity">进入活动</button>
  </div>
</template>

<script>
import { createNamespacedHelpers } from "vuex";
const {
  mapState: mapvoteState,
  mapActions: mapvoteActions
} = createNamespacedHelpers("homepage");
import BgIndex from "../images/BgImages.jpg";
import AudioPlay from '../images/audio_play.png';
export default {
  name: "index",
  data() {
    return {
      BgIndex,
      AudioPlay,
      type: this.$route.query.type
    };
  },
  //     components: {
  //     "vue-headful": () => import("vue-headful"),
  //   },
  computed: {
    ...mapvoteState({
      activitydetail: s => s.activitydetail
    })
  },
  created(){
    this.getActivity({actid: this.type})
  },
  methods: {
     ...mapvoteActions(["getActivity"]),
      gotoactivity() {
      this.$router.push({
        name: "lotterylist",
        query: { actid: this.type}
      });
    },
  }
};
</script>

<style lang="scss" scoped>
.indexpage {
  width: 100%;
  height: 100%;
  position: relative;

  .bgimg {
    width: 100%;
    height: 100%;
  }
  .EnterActivity {
    position: absolute;
    top: 5.86rem;
    left: 0.45rem;
    width: 75%;
    height: 0.5rem;
    border-radius: 0.25rem;
    background-color: rgba(166,184,201,1);
    border: none;
    font-size: 0.2rem;
    font-family: PingFangSC-Medium;
    font-weight: bold;
    color: rgba(255, 255, 255, 1);
    line-height: 0.28rem;
  }
}
</style>


