<template>
  <div class="root_container">
    <div class="header">
      <div class="title_tips">Mac下载</div>
      <el-link target="_blank" :href="download_mac_arm64" :underline="false"
        style="margin-top: 15px; mrigin-bottom: 15px; margin-right: 15px">
        <el-button type="info">下载M2/M1芯片应用 ({{ download_mac_arm64_version }})</el-button>
      </el-link>
      <el-link target="_blank" :href="download_mac" :underline="false"
        style="margin-top: 15px; mrigin-bottom: 15px; margin-right: 15px">
        <el-button type="info">下载Intel芯片应用 ({{ download_mac_version }})</el-button>
      </el-link>
      <div class="title_tips">Windows下载</div>
      <el-link target="_blank" :href="download_windows" :underline="false" style="margin-top: 15px; mrigin-bottom: 15px">
        <el-button type="info">下载Windows应用 ({{ download_windows_version }})</el-button>
      </el-link>
    </div>
  </div>
</template>
<script>
import Editor from "vue2-ace-editor";
import { appInfo } from "../../api/log/translate_v2";
import { Message } from "element-ui";
export default {
  components: {
    Editor,
  },
  data() {
    return {
      download_windows: '',
      download_windows_version: '',
      download_mac_arm64: '',
      download_mac_arm64_version: '',
      download_mac: '',
      download_mac_version: '',
    };
  },
  watch: {},
  mounted: function () {
    this.getData()
  },
  methods: {
    getData() {
      appInfo()
        .then((result) => {
          if (result.data.code == 200) {
            result.data.data.forEach(res => {
              if (res.type == '2') {
                this.download_mac = res.url
                this.download_mac_version = res.version
              } else if (res.type == '3') {
                this.download_mac_arm64 = res.url
                this.download_mac_arm64_version = res.version
              } else if (res.type == '4') {
                this.download_windows = res.url
                this.download_windows_version = res.version
              }
            })

          }
        })
        .catch((err) => { });
    },
  },
};
</script>
<style lang="scss" scoped>
.title_tips {
  padding-top: 15px;
}

.header {
  padding-left: 20px;
}
</style>