get-more.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <template>
  2. <div class="get-more-btns" v-if="props.style_type == 3">
  3. <div class="get-more-btn" @click="jumpMore">
  4. <img width="22" :src="require('@/assets/svg/icon-wallet-success.svg')" />
  5. <span>View wallet</span>
  6. </div>
  7. <div class="get-more-btn" @click="jumpMore">
  8. <img width="22" :src="require('@/assets/svg/icon-big-give.svg')" />
  9. <span>Get More Giveaway</span>
  10. </div>
  11. </div>
  12. <div class="getMore" @click="jumpMore" v-if="props.style_type == 1">
  13. <img width="20" :src="require('@/assets/svg/icon-big-give.svg')" />
  14. <span>Get More Giveaway</span>
  15. <img height="20" :src="require('@/assets/svg/icon-cell-arrow-right.svg')" />
  16. </div>
  17. <div class="get_more" v-if="props.style_type == 2" @click="jumpMore">
  18. <img width="18" :src="require('@/assets/svg/icon-big-give.svg')" />
  19. <span>Get More Giveaway</span>
  20. </div>
  21. <div v-if="style_type == 4" @click="jumpMore">
  22. <slot></slot>
  23. </div>
  24. </template>
  25. <script setup>
  26. import { getFrontConfig } from "@/http/account";
  27. import { number } from "mathjs";
  28. import { onBeforeMount, ref, defineProps } from "vue";
  29. import Report from "@/log-center/log"
  30. const props = defineProps({
  31. style_type: {
  32. type: Number,
  33. default: 1,
  34. },
  35. reportData: {
  36. type: Object,
  37. }
  38. })
  39. // const
  40. const moreUrl = ref('');
  41. onBeforeMount(() => {
  42. getFrontConfig({
  43. params: {},
  44. }).then(res => {
  45. moreUrl.value = res.data.moreLuckdropsUrl;
  46. })
  47. })
  48. const jumpMore = () => {
  49. if (props.reportData) {
  50. Report.reportLog({
  51. pageSource: props.reportData.pageSource,
  52. businessType: Report.businessType.buttonClick,
  53. objectType: Report.objectType.getMoreGiveaway,
  54. postId: props.reportData.postId,
  55. redPacketType: props.reportData.redPacketType
  56. });
  57. }
  58. if (moreUrl.value) {
  59. window.open(moreUrl.value)
  60. }
  61. }
  62. </script>
  63. <style lang="scss" scoped>
  64. .getMore {
  65. display: flex;
  66. height: 50px;
  67. cursor: pointer;
  68. user-select: none;
  69. align-items: center;
  70. justify-content: center;
  71. box-shadow: 0px -2px 10px rgba(0, 0, 0, 0.06);
  72. img {
  73. margin: 0 5px;
  74. }
  75. span {
  76. color: #000;
  77. font-size: 15px;
  78. font-weight: 500;
  79. line-height: 18px;
  80. }
  81. }
  82. .get_more {
  83. margin-top: 58px;
  84. width: 240px;
  85. height: 54px;
  86. background: #FFFFFF;
  87. border: 1px solid #E8E8E8;
  88. border-radius: 100px;
  89. display: flex;
  90. justify-content: center;
  91. align-items: center;
  92. cursor: pointer;
  93. img {
  94. margin-right: 8px;
  95. }
  96. }
  97. .get-more-btns {
  98. display: flex;
  99. cursor: pointer;
  100. user-select: none;
  101. align-items: center;
  102. justify-content: center;
  103. padding: 13px 0;
  104. box-shadow: 0px -2px 10px rgba(0, 0, 0, 0.06);
  105. position: relative;
  106. .get-more-btn {
  107. flex: 1;
  108. display: flex;
  109. cursor: pointer;
  110. user-select: none;
  111. flex-direction: column;
  112. align-items: center;
  113. justify-content: center;
  114. height: 44px;
  115. font {
  116. font-weight: 600;
  117. font-size: 14px;
  118. line-height: 17px;
  119. text-align: center;
  120. letter-spacing: 0.3px;
  121. color: #000000;
  122. }
  123. }
  124. &::after {
  125. content: "";
  126. width: 1px;
  127. height: 88px;
  128. position: absolute;
  129. left: 50%;
  130. top: 13px;
  131. background-color: rgba(0, 0, 0, .2);
  132. transform: scale(0.5);
  133. transform-origin: 0 0;
  134. }
  135. }
  136. </style>