<template>
  <div>
    <!-- 极度合伙人管理后台 -->
    <backBar v-if="!appFlag" :title="$t('join.l33')"/>
    <div class="page">
      <img class="img" src="/img/join/img3.png" alt="极度证券">
      <div class="title">
        <!-- 恭喜！您已成为极度合伙人 -->
        {{ $t('join.l34') }}
      </div>
      <div class="tip">
        <!-- 您可以通过以下两种方式登录合伙人后台 -->
        {{ $t('join.l35') }}
      </div>
      <div class="section">
       <div>
          <!-- 1、在PC端通过以下地址打开极度合伙人后台，使用极度证券账号密码直接登录进行管理  推荐 -->
          {{ $t('join.l36') }}<span class="div">{{ $t('join.l59') }}</span>
        </div>
        <div class="box">
          {{ agentUrl }}
          <img class="copy" @click="copyText(hrefUrl)" src="/img/icon/copy.png" alt="极度证券">
        </div>
      </div>
      <div class="section">
        <!-- 2、点击下面的按钮，直接使用手机访问极度合伙人后台； -->
        {{ $t('join.l37') }}
      </div>
      <a class="href" :href="hrefUrl">
        <!-- 点击访问合伙人后台 -->
        {{ $t('join.l38') }}
      </a>
    </div>
  </div>
</template>
<script>
import { copyText } from '@/utils/index'
import backBar from '@/components/backBar'
export default {
  components: {
    backBar
  },
  data () {
    return {
      agentUrl: 'https://www.jdnx2.com/agentoffice'
    }
  },
  computed: {
    hrefUrl() {
      var lan = {
        'en': 'en',
        'zh-CN': 'zh-CN',
      }
      return `${this.agentUrl}/#/${lan[this.language] || 'en'}/`
    }
  },
  created () {
    this.agentUrl = `https://www.jdnx${this.getRandomInt(2, 10)}.com/agentoffice`
  },
  methods: {
    getRandomInt(min, max) {
      min = Math.ceil(min);
      max = Math.floor(max);
      return Math.floor(Math.random() * (max - min + 1)) + min;
    },
    copyText(text) {
      copyText(text)
    },
  }
}
</script>
<style lang="less" scoped>
.page {
  padding: 15px 17px;
}
.img {
  display: block;
  width: 169px;
  max-width: 100%;
  margin: 0 auto 22px;
}
.title {
  font-size: 20px;
  font-weight: 600;
  line-height: 26px;
  margin-bottom: 12px;
  text-align: center;
}
.tip {
  color: #616161;
  margin-bottom: 41px;
  text-align: center;
}
.section {
  box-shadow: 0px 4px 13px 0px rgba(225,225,225,0.5);
  border-radius: 8px;
  padding: 13px 11px 13px 13px;
  line-height: 24px;
  &+.section {
    margin-top: 22px;
  }
  .icon {
    width: 42px;
    vertical-align: top;
  }
  .div {
    display: inline-block;
    padding: 3px 6px;
    line-height: 1;
    border-radius: 5px;
    border: 1px solid #FF6F30;
    font-size: 14px;
    color: #FF6F30;
    margin-left: 3px;
  }
}
.box {
  position: relative;
  line-height: 1;
  font-weight: 600;
  color: var(--color-);
  padding: 11px 28px 11px 13px;
  border-radius: 3px;
  background-color: rgba(255, 238, 231, 0.44);
  margin-top: 10px;
  .copy {
    position: absolute;
    top: 9px;
    right: 7px;
    cursor: pointer;
    width: 19px;
  }
}
.href {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background-color: var(--color-);
  border-radius: 6px;
  min-height: 44px;
  font-size: 16px;
  color: #FEFFFF;
  font-weight: 600;
  margin-top: 30px;
}
</style>