<template>
  <div class="mainPage">
    <div class="contenr">
      <i class="iconfont icon-ziyuan" v-if="status === 'success'"></i>
      <i class="iconfont icon-shibai fail" v-else></i>
      <span v-if="status === 'success'">领取成功</span>
      <span v-else>领取失败</span>
      <span v-if="status === 'success'">快去个人中心查看我的体验券</span>
      <span v-else>{{msg}}</span>
      <div class="back" v-if="status === 'success'" @click="back">查看我的体验券</div>
      <div v-else></div>
      <img :src="logo" class="bottomLogo">
    </div>
  </div>
</template>

<script>
import logo from '../../../common/icon/logoTop.png'
import { createNamespacedHelpers } from 'vuex'
const { mapState: mapShareState } = createNamespacedHelpers('share')
export default {
  data () {
    return {
      logo,
      status: 'fail'
    }
  },
  computed: {
    ...mapShareState({
      msg: x => x.msg
    })
  },
  created () {
    this.status = this.$route.query.type
  },
  methods: {
    back () {
      this.$router.push({ name: 'userCenter' })
    }
  }
}
</script>

<style lang="scss" scoped>
@import 'page.scss';
</style>
