result.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <template>
  2. <div class="content">
  3. <!-- 结果页 -->
  4. <div class="header">
  5. <img :src="require('@/assets/subject/004-back-head-top.svg')" alt class="back" />
  6. <!-- 领到钱了 -->
  7. <template v-if="Number(state.detail.receiveAmountUsdValue) > 0">
  8. <div class="tip1">This Giveaway Expired on {{ moment(state.detail.endTimestamp).format('MM-DD') }}</div>
  9. <div class="tip2">🎉 Awesome! You are the Winner!</div>
  10. <div class="tip3">+${{ state.detail.receiveAmountUsdValue }}</div>
  11. <div class="tip3-back"></div>
  12. </template>
  13. <!-- 没有领到钱 -->
  14. <template v-else>
  15. <div class="rabbit">
  16. <img :src="require('@/assets/subject/001-icon-rabbit.svg')" alt />
  17. <p>Sorry, you missed this treasure</p>
  18. </div>
  19. </template>
  20. </div>
  21. <div class="list">
  22. <receive-list></receive-list>
  23. </div>
  24. <div class="footer">
  25. <!-- 领取到钱了 -->
  26. <template v-if="Number(state.detail.amountUsdValue) > 0">
  27. <div class="btn btn1" @click="clickDone">
  28. <img :src="require('@/assets/svg/icon-wallet-success.svg')" alt />
  29. <span>Wallet</span>
  30. </div>
  31. <get-more :style_type="4"
  32. :reportData="{ pageSource: Report.pageSource.received_success_page, postId: state.postId, redPacketType: Report.redPacketType.treasure }">
  33. <div class="btn btn2">
  34. <img :src="require('@/assets/svg/icon-gold-box-close.svg')" alt />
  35. <span>Get More</span>
  36. </div>
  37. </get-more>
  38. </template>
  39. <!-- 没有领到钱 -->
  40. <template v-else>
  41. <div class="btn btn2 btn3" @click="clickBtn">
  42. <img :src="require('@/assets/svg/icon-gold-box-close.svg')" alt />
  43. <span>Look for more treasures</span>
  44. </div>
  45. </template>
  46. </div>
  47. </div>
  48. </template>
  49. <script setup>
  50. import { inject, onMounted } from 'vue'
  51. import ReceiveList from '@/view/iframe/treasure-hunt/components/receive-list.vue'
  52. import { chromeExtensionUrl } from '@/uilts/chromeExtension.js'
  53. import GetMore from '@/view/iframe/publish/components/get-more.vue'
  54. import Report from "@/log-center/log"
  55. let state = inject('state')
  56. var moment = require('moment')
  57. onMounted(() => {
  58. // 埋点
  59. logFunc()
  60. })
  61. const logFunc = (log = {}) => {
  62. log = Object.assign({
  63. pageSource: Report.pageSource.expiredPage,
  64. businessType: Report.businessType.pageView,
  65. myShareLinkId: state.detail.inviteCopyUrl,
  66. currentInvitedNum: state.inviteCount,
  67. redPacketType: Report.redPacketType.treasure,
  68. shareLinkId: state.invite_code || '',
  69. postId: state.postId
  70. }, log)
  71. if (Number(state.detail.amountUsdValue) > 0) {
  72. log.pageSource = Report.pageSource.received_success_page
  73. }
  74. Report.reportLog(log)
  75. }
  76. function clickDone() {
  77. window.open(`${chromeExtensionUrl + ('iframe/home.html')}`)
  78. // 埋点
  79. logFunc({
  80. businessType: Report.businessType.buttonClick,
  81. objectType: Report.objectType.wallet_button
  82. })
  83. }
  84. const clickBtn = () => {
  85. logFunc({
  86. businessType: Report.businessType.buttonClick,
  87. objectType: Report.objectType.getMoreGiveaway,
  88. currentInvitedNum: state.inviteCount,
  89. })
  90. window.open('https://twitter.com/search?q=%23denet');
  91. }
  92. </script>
  93. <style lang="scss" scoped>
  94. .content {
  95. width: 375px;
  96. background: #fff;
  97. .header {
  98. width: 100%;
  99. min-height: 150px;
  100. position: relative;
  101. .back {
  102. position: absolute;
  103. top: 0;
  104. left: 0;
  105. }
  106. .tip1 {
  107. color: #FFFFFF;
  108. opacity: 0.5;
  109. text-align: center;
  110. padding-top: 16px;
  111. font-weight: 700;
  112. font-size: 13px;
  113. width: 100%;
  114. z-index: 12;
  115. width: 100%;
  116. }
  117. .tip2 {
  118. color: #FFFFFF;
  119. text-align: center;
  120. font-weight: 800;
  121. width: 100%;
  122. position: absolute;
  123. font-size: 16px;
  124. margin-top: 11px;
  125. }
  126. .tip3-back {
  127. width: 100%;
  128. height: 43px;
  129. position: absolute;
  130. top: 74px;
  131. left: 0;
  132. background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.826667) 26.4%, #FFFFFF 71.47%, rgba(255, 255, 255, 0) 100%);
  133. opacity: 0.15;
  134. z-index: 1;
  135. }
  136. .tip3 {
  137. position: absolute;
  138. top: 74px;
  139. z-index: 2;
  140. left: 0;
  141. width: 100%;
  142. line-height: 43px;
  143. height: 43px;
  144. color: #F5C03F;
  145. text-align: center;
  146. font-size: 26px;
  147. font-weight: 800;
  148. }
  149. .rabbit {
  150. width: 100%;
  151. height: 100%;
  152. text-align: center;
  153. position: absolute;
  154. z-index: 11;
  155. img {
  156. width: 150px;
  157. height: 80px;
  158. margin-top: 14px;
  159. margin-bottom: 4px;
  160. }
  161. .flower {
  162. width: 62px;
  163. height: 62px;
  164. }
  165. p {
  166. width: 100%;
  167. margin: 0;
  168. padding: 0;
  169. font-weight: 800;
  170. font-size: 16px;
  171. color: #fff;
  172. text-align: center;
  173. letter-spacing: 0.3px;
  174. }
  175. }
  176. }
  177. .list {
  178. height: 336px;
  179. margin-top: 10px;
  180. }
  181. .footer {
  182. height: 84px;
  183. display: flex;
  184. padding: 16px;
  185. justify-content: space-between;
  186. .btn {
  187. width: 166.5px;
  188. height: 52px;
  189. border-radius: 100px;
  190. display: flex;
  191. align-items: center;
  192. justify-content: center;
  193. font-weight: 800;
  194. font-size: 18px;
  195. user-select: none;
  196. cursor: pointer;
  197. img {
  198. width: 24px;
  199. height: 24px;
  200. margin-right: 7px;
  201. }
  202. }
  203. .btn1 {
  204. background: #FFFFFF;
  205. border: 1px solid #DEDEDE;
  206. color: #585858;
  207. }
  208. .btn2 {
  209. color: #FFFFFF;
  210. background: #1D9BF0;
  211. }
  212. .btn3 {
  213. width: 100%;
  214. }
  215. }
  216. }
  217. </style>