<template>
  <div class="components">
    <img class="close" @click="cancel" src="/img/download/close.png" alt="极度证券">
    <div class="label">安卓手机</div>
    <div class="ul">
      <div class="btn flex" v-if="apk.playurl" @click="downloadApk(apk.playurl)">
        <div class=" left flex">
          <img class="icon" src="/img/download/google.png" alt="极度证券">
          <div>Google Play</div>
        </div>
        <div class="right">立即下载</div>
      </div>
      <div class="btn flex" v-if="apk.url" @click="downloadApk(apk.url)">
        <div class=" left flex">
          <img class="icon" src="/img/download/icon1.png" alt="极度证券">
          <div>下载通道1</div>
        </div>
        <div class="right">立即下载</div>
      </div>
      <div class="btn flex" v-if="apk.url2" @click="downloadApk(apk.url2)">
        <div class=" left flex">
          <img class="icon" src="/img/download/icon1.png" alt="极度证券">
          <div>下载通道2</div>
        </div>
        <div class="right">立即下载</div>
      </div>
    </div>
    <div class="label mr">苹果手机</div>
    <div class="ul">
      <div class="btn flex" v-if="ios.store" @click="downloadApk(ios.store)">
        <div class=" left flex">
          <img class="icon" src="/img/download/apple.png" alt="极度证券">
          <div>Apple Store</div>
        </div>
        <div class="right">立即下载</div>
      </div>
      <div class="btn flex" v-if="ios.testflight" @click="downloadApk(ios.testflight)">
        <div class=" left flex">
          <img class="icon" src="/img/download/icon2.png" alt="极度证券">
          <div>TestFlight 1</div>
        </div>
        <div class="right">立即下载</div>
      </div>
      <div class="btn flex" v-if="ios.testflight2" @click="downloadApk(ios.testflight2)">
        <div class=" left flex">
          <img class="icon" src="/img/download/icon2.png" alt="极度证券">
          <div>TestFlight 2</div>
        </div>
        <div class="right">立即下载</div>
      </div>
      <!-- <div class="btn flex" v-if="ios.ipa" @click="downloadApk(ios.ipa)">
        <div class=" left flex">
          <img class="icon" src="/img/download/icon3.png" alt="极度证券">
          <div>IPA</div>
        </div>
        <div class="right">立即下载</div>
      </div> -->
    </div>
  </div>
</template>
<script>
export default {
  props: ['apk', 'ios'],
  data () {
    return {
      
    }
  },
  methods: {
    downloadApk(url) {
      this.$emit('cancel')
      location.href = url
    },
    cancel() {
      this.$emit('cancel')
    }
  }
}
</script>
<style lang="less" scoped>
.components {
  padding: 24px 24px 47px;
  position: relative;
}
.close {
  position: absolute;
  top: 12px;
  right: 12px;
  cursor: pointer;
  width: 22px;
}
.label {
  font-size: 16px;
  margin-bottom: 15px;
  color: #7B7B7B;
}
.mr {
  margin-top: 25px;
}
.btn {
  background: #FFFFFF;
  box-shadow: 0px 2px 6px 0px rgba(230,230,230,0.5);
  border-radius: 10px;
  border: 1px solid #F6F6F6;
  cursor: pointer;
  padding-right: 14px;
  color: #000000;
  font-size: 15px;
  justify-content: space-between;
  .icon {
    width: 56px;
    margin-right: 3px;
  }
  .right {
    font-size: 16px;
    color: var(--color-);
  }
  &+.btn {
    margin-top: 14px;
  }
}
</style>