<template>
    <ul class="sign-list">
        <li @click="handleEos">
            <i class="icon icon-eos"></i>
            <p>EOS</p>
        </li>
        <li @click="loginSimpleWallet" v-if="!inWallet && meechatType==='h5'">
            <i class="icon icon-meetone"></i>
            <p>SimpleWallet</p>
        </li>
        <!-- <li>
            <i class="icon icon-tron"></i>
            <p>TRON</p>
        </li> -->
        <li @click="loginTelegram" v-if="!inWallet">
            <i class="icon icon-tele"></i>
            <p>Telegram</p>
        </li>
    </ul>
</template>

<script>
import Vue from 'vue'
import { Button } from 'element-ui'
import { accountLoginMixin } from '@/mixins/login'
import { getMeechatType } from '@/util/util'

Vue.component(Button.name, Button)

export default {
  name: 'loginBox',
  mixins: [accountLoginMixin],
  data () {
    return {
      meechatType: getMeechatType()
    }
  },
  created () {

  },
  computed: {
    inWallet () {
      return /token|meet\.one|wallet|bit|eos|nova/.test(navigator.userAgent.toLowerCase())
    }
  },
  methods: {
    handleEos () {
      if (top === self) {
        this.loginEos()
      } else {
        this.loginEosParent()
      }
    }
  }
}
</script>

<style lang="scss" scoped>
.sign-list{
  display: flex;
  // width: 400px;
  width: 320px;
  margin: 0 auto;
  justify-content: space-around;
  li{
    width: 80px;
    text-align: center;
    margin: 0 10px;
    cursor: pointer;
    &:hover{
      opacity: 0.8;
    }
  }
  p{
    color: #333333;
    font-size: 12px;
    margin-top: 20px;
  }
  .icon{
    display: inline-block;
    width: 60px;
    height: 60px;
    border-radius: 50%;
  }
  .icon-eos{
    background: url(./img/icon-eos.png) center #ffffff no-repeat;
  }
  .icon-meetone{
    background: url(./img/icon-meetone.png) center/100% #ffffff no-repeat;
  }
  .icon-tron{
    background: url(./img/icon-tron.png) center #ffffff no-repeat;
  }
  .icon-tele{
    background: url(./img/icon-tele.png) center #ffffff no-repeat;
  }
}

.mini-wrap{
  .sign-list{
    width: auto;
    margin-top: 20px;
    // justify-content: space-between;
    // width: 260px;
    li{
      width: auto;
      margin: 0 10px 0 0;
    }
    .icon{
      width: 55px;
      height: 55px;
      background-color: #f5f5f5;
    }
    // p{
    //   display: none;
    // }
  }
}

.h5-wrap{
    .sign-list{
        width: auto;
        p{
            color: #fff;
        }
    }
    .icon{
      width: px2rem(110);
      height: px2rem(110);
      background-color: #f5f5f5;
    }
}
</style>
