/*data*/
<template>
  <div class="megagame">
  <div class="da_left">
    <div class="bs_timu">
      <h1>前沿</h1>
      <el-button type="primary"  @click="canjia" plain>参加比赛</el-button>
    </div>
  </div>
  <div class="dasai">
  
  </div>
  </div>
</template>

<script>
import { request, getImage } from '@/utils/request'
import { parseTime } from '@/utils/index'
import store from '@/store' // vue状态管理
import { Message, MessageBox } from 'element-ui' // 引入Message、MessageBox
import NProgress from 'nprogress' // 进度条
import 'nprogress/nprogress.css' // 进度条样式
export default {
  name: 'megagame',
  components: {},
  data() {
    return {
     
    }
  },
  created() {

  },
  mounted(){
   this.megeme();
  },
  methods: {
  //获取当前大赛信息
megeme(){
const params = {
            transCode: 'D00027',
          }
          request(params)
            .then((res) => {
              console.log(res)
       
            })
            .catch((err) => {})
},

canjia(){

  let loginStatus= store.getters.loginStatus
  this.$router.replace(`/userLayout/project`)
      if (loginStatus ) {
            NProgress.done() // 关闭进度
        }else {
            MessageBox.confirm('你还未登录，请登录后再操作, 是否登录?', '提示', {
                    confirmButtonText: '登录',
                    cancelButtonText: '取消',
                    center: true,
                    closeOnClickModal: false,
                    type: 'warning'
                })
                .then(() => {
               console.log(1111);
                    // next(`/login?redirect=${to.path}`) // 在没有访问权限的其他页面将重定向到登录页
                    //next(`/indexLayout/home?type=reLogin`) // 在没有访问权限的其他页面将重定向到登录页
                     this.$router.replace(`/indexLayout/home?type=reLogin`)
                    NProgress.done() // 关闭进度条
                })
                .catch(() => {
                    NProgress.done() // 关闭进度条
                    Message.info('已取消')
                })
        }
}

  },
}
</script>

<style lang="scss" scoped>
@import '@/styles/variables.scss';
@import '@/styles/mixin.scss';
.megagame {
  // @include w_h(100%, 100%);
  @include w_h(100%);
  padding: 30px 60px;
  background: #000;
  .dasai{
      height: 300px;
      width: 100%;
  }
  .da_left{
  color: #ffffff;
  }
  .latest {
    h3 {
      color: #ee6a74;
    }
  }
  .popularity {
    margin-top: 20px;
    h3 {
      color: #db7116;
    }
  }
}
</style>
