index.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <div class="pa">
  3. <div class="box">
  4. <img class="download" src="/static/image/getapp/app.png" alt="">
  5. <div class="btn" @click="installClick">
  6. Download OneCric Now
  7. </div>
  8. </div>
  9. </div>
  10. </template>
  11. <script>
  12. export default {
  13. created() {
  14. // this.installClick()
  15. },
  16. activated() {
  17. // this.installClick()
  18. },
  19. methods: {
  20. installClick() {
  21. uni.showLoading({
  22. title: this.$t('common.lab'),
  23. });
  24. var adgroup_id = localStorage.getItem('adgroup_id');
  25. var agency_id = localStorage.getItem('agency_id');
  26. var code = localStorage.getItem('agency_code');
  27. adgroup_id && (adgroup_id = JSON.parse(adgroup_id));
  28. agency_id && (agency_id = JSON.parse(agency_id));
  29. code && (code = JSON.parse(code));
  30. uni.$u.http
  31. .post("/api/Nginx/apk_download_log", {
  32. adgroup_id: adgroup_id,
  33. agency_id: agency_id,
  34. code: code,
  35. // ip: ip || 1,
  36. types: 'H5'
  37. })
  38. .then((res) => {
  39. window.location.href = res
  40. gtag('event', 'H5_install_app', {
  41. 'H5_install_app': '0'
  42. });
  43. }).finally(() => {
  44. // uni.switchTab({
  45. // url: '/pages/Live/Live'
  46. // })
  47. uni.hideLoading();
  48. });
  49. },
  50. }
  51. }
  52. </script>
  53. <style lang="scss" scoped>
  54. .pa {
  55. padding-top: 55px;
  56. padding-bottom: 50px;
  57. min-height: 100vh;
  58. background-image: url('/static/image/getapp/bg.jpg');
  59. background-repeat: no-repeat;
  60. background-size: 100% 100%;
  61. }
  62. .download {
  63. display: block;
  64. width: 100%;
  65. }
  66. .box {
  67. position: relative;
  68. padding-left: 47px;
  69. }
  70. .btn {
  71. position: absolute;
  72. bottom: 0;
  73. left: 50%;
  74. transform: translateX(-50%);
  75. cursor: pointer;
  76. text-align: center;
  77. background: #ff3300;
  78. border-radius: 6px;
  79. color: #fff;
  80. font-size: 15px;
  81. font-weight: 700;
  82. white-space: nowrap;
  83. width: 49.22vw;
  84. height: 7%;
  85. opacity: 0;
  86. }
  87. </style>