<template>
  <view class="error-box">
    <view class="error-content">
      <view class="error-icon">
        <text  class="iconfont">
          &#xe678;
        </text>
      </view>
      <view class="error-text" v-if="!errorType">
        {{$t('index.error.errorMsg')}}~~
      </view>
      <view class="error-text" v-else>
        {{$t('index.error.errorMsg'+errorKey[errorType])}}~~
      </view>
      <view class="error-but">
        <button @click="closeSys">{{$t('index.error.quit')}}</button>
      </view>
    </view>


  </view>
</template>
<script>
export default {
  name: "error",
  props: {},
  components: {},
  data() {
    return {
      errorKey:[
          'errorMsg',
          'noWallet',
      ],
      errorType:0
    }
  },
  onLoad(query) {
    if(query.errorType!==undefined){
        this.errorType=query.errorType
    }
  },
  mounted() {

  },
  methods: {
    closeSys(){
      let userAgent = navigator.userAgent;
      if (userAgent.indexOf('Firefox') !== -1 || userAgent.indexOf('Chrome') !== -1) return window.location.href = 'about: blank';
      return window.opener = null,window.open('about: blank', '_self'),window.close();
    }
  }

}
</script>

<style scoped lang="scss">
@import url("/components/static/css/en-common.css") ;
.error-box{
  width: 100vw;
  height: 100vh;
  background: #fff;
  .error-content{
    padding-top: 300rpx;
    .error-icon{
      text-align: center;
      text{
        font-size: 240rpx;
        color: #9197a5;
      }
    }
    .error-text{
      font-size: 32rpx;
      text-align: center;
      font-weight: 600;
      color: #9197a5;
    }
    .error-but{
      button{
        width: calc(100% - 60rpx);
        height: 82rpx;
        line-height: 82rpx;
        border: 0;
        border-radius: 6rpx;
        background: #9197a5;
        color: #FFFFFF;
        letter-spacing: 4rpx;
        margin-top: 40rpx;
      }
    }
  }

}

</style>
