custom-card-cover.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <!-- 自定义卡片红包封面 -->
  2. <template>
  3. <div class="not-open">
  4. <img class="cover" :src="require('@/assets/subject/001-card.png')" />
  5. <img class="open-gif" :src="require('@/assets/gif/001.gif')" />
  6. <img
  7. :src="require('@/assets/svg/icon-open.svg')"
  8. class="open"
  9. @click="open"
  10. />
  11. <div class="title" v-if="data.userInfo">
  12. <img :src="data.userInfo.avatarUrl" />
  13. <span>{{
  14. data.userInfo.nickName || "FutureDoctor"
  15. }}</span>
  16. </div>
  17. <div class="money-area">
  18. <div class="txt">{{data.currencyCode == 'USD' ? 'USD' : data.tokenSymbol}} GIVEAWAY</div>
  19. <div class="coin">
  20. <img :src="data.currencyIconUrl" />
  21. <span>{{ data.amountValue }}</span>
  22. </div>
  23. <div class="people">
  24. {{ data.totalCount }} WINNERS TO SHARE
  25. </div>
  26. </div>
  27. </div>
  28. </template>
  29. <script setup>
  30. import { defineProps, defineEmits } from "vue";
  31. defineProps({
  32. data: {
  33. type: Object,
  34. default: () => {
  35. return {
  36. totalCount: 0,
  37. amountValue: 0,
  38. tokenSymbol: "",
  39. userInfo: {
  40. avatarUrl: "",
  41. nickName: "",
  42. },
  43. };
  44. },
  45. },
  46. });
  47. const emits = defineEmits(["clickOpenRedPacket"]);
  48. const open = () => {
  49. emits("clickOpenRedPacket", {});
  50. };
  51. </script>
  52. <style scoped lang="scss">
  53. .not-open {
  54. width: 100%;
  55. height: 100%;
  56. filter: drop-shadow(0px 2px 20px rgba(0, 0, 0, 0.1));
  57. position: relative;
  58. border-radius: 16px;
  59. .money-area {
  60. width: 100%;
  61. position: absolute;
  62. top: 65px;
  63. .txt {
  64. font-weight: 800;
  65. font-size: 16px;
  66. text-align: center;
  67. letter-spacing: 0.3px;
  68. color: #ffffff;
  69. }
  70. .coin {
  71. text-align: center;
  72. width: 100%;
  73. padding: 6px 0;
  74. margin: 0 auto;
  75. display: flex;
  76. align-items: center;
  77. justify-content: center;
  78. img {
  79. width: 46px;
  80. height: 46px;
  81. border-radius: 50%;
  82. border: 3px solid #ffffff;
  83. }
  84. span {
  85. margin-left: 15px;
  86. font-weight: 800;
  87. font-size: 60px;
  88. line-height: 76px;
  89. color: #ffffff;
  90. }
  91. }
  92. .people {
  93. font-weight: 800;
  94. font-size: 13px;
  95. line-height: 16px;
  96. letter-spacing: 0.05em;
  97. text-align: center;
  98. color: #ffffff;
  99. }
  100. }
  101. .title {
  102. position: absolute;
  103. top: 15px;
  104. left: 15px;
  105. z-index: 3;
  106. width: 100%;
  107. display: flex;
  108. align-items: center;
  109. img {
  110. width: 24px;
  111. height: 24px;
  112. border: 2px solid #fff;
  113. border-radius: 50%;
  114. }
  115. span {
  116. margin-left: 10px;
  117. font-weight: 600;
  118. font-size: 16px;
  119. letter-spacing: 0.3px;
  120. color: #fff;
  121. }
  122. }
  123. // .txt {
  124. // width: 100%;
  125. // position: absolute;
  126. // font-style: normal;
  127. // font-weight: 700;
  128. // font-size: 42px;
  129. // line-height: 50px;
  130. // text-align: center;
  131. // color: #FFF2D3;
  132. // top: 90px;
  133. // z-index: 3;
  134. // }
  135. img {
  136. width: 100%;
  137. }
  138. .cover {
  139. border-radius: 16px;
  140. }
  141. .up {
  142. position: absolute;
  143. top: 0;
  144. // box-shadow: 0px 4px 44px rgba(0, 0, 0, 0.1);
  145. z-index: 1;
  146. }
  147. .down {
  148. position: absolute;
  149. top: 253px;
  150. }
  151. .open {
  152. width: 335px;
  153. height: 50px;
  154. cursor: pointer;
  155. position: absolute;
  156. bottom: 28px;
  157. left: 50%;
  158. margin-left: -167.5px;
  159. z-index: 2;
  160. }
  161. .open-gif {
  162. width: 164px;
  163. height: 194px;
  164. text-align: center;
  165. position: absolute;
  166. bottom: 90px;
  167. left: 50%;
  168. margin-left: -82px;
  169. z-index: 3;
  170. }
  171. }
  172. </style>