install.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <div class="wrapper">
  3. <img class="img-title" src="../static/img/img-install-title.png" @click="installExtension">
  4. <div class="row">
  5. <img src="../static/img/img-install-01.png">
  6. <img src="../static/img/img-install-02.png">
  7. <img src="../static/img/img-install-03.png">
  8. <img src="../static/img/img-install-04.png">
  9. </div>
  10. </div>
  11. </template>
  12. <script>
  13. import axios from 'axios';
  14. const api = {
  15. prod: 'https://api.denetme.net',
  16. pre: 'https://preapi.denetme.net',
  17. test: 'https://testapi.denetme.net'
  18. }
  19. const baseURL = api[process.env.NUXT_ENV.MODE]
  20. export default {
  21. name: "install",
  22. data() {
  23. return {
  24. config: {
  25. extensionsInstallChannel : 'officeDownload', // chromeAppStore
  26. extensionsInstallUrl: ''
  27. }
  28. }
  29. },
  30. methods: {
  31. installExtension() {
  32. let {extensionsInstallChannel, extensionsInstallUrl} = this.config;
  33. let url = extensionsInstallUrl
  34. switch (extensionsInstallChannel) {
  35. case "officeDownload":
  36. location.href = url;
  37. break;
  38. case "chromeAppStore":
  39. window.open(extensionsInstallUrl)
  40. break;
  41. }
  42. },
  43. async getConfig() {
  44. let {data} = await axios.post(`${baseURL}/denet/base/config/getFrontConfig`, {
  45. baseInfo: {
  46. appVersionCode: this.appVersionCode,
  47. mid: this.mid
  48. },
  49. params: {
  50. }
  51. })
  52. if (data.code == 0) {
  53. this.config = data.data;
  54. }
  55. },
  56. },
  57. mounted () {
  58. this.getConfig();
  59. }
  60. }
  61. </script>
  62. <style scoped lang="scss">
  63. .wrapper {
  64. width: 100%;
  65. height: 100vh;
  66. display: flex;
  67. flex-direction: column;
  68. align-items: center;
  69. justify-content: center;
  70. padding: 40px;
  71. box-sizing: border-box;
  72. .img-title {
  73. width: 510px;
  74. margin-bottom: 90px;
  75. cursor: pointer;
  76. }
  77. .row {
  78. img {
  79. width: 270px;
  80. margin-right: 30px;
  81. }
  82. }
  83. }
  84. </style>