luckdraw.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643
  1. <template>
  2. <div class="content">
  3. <template v-if="isLoading">
  4. <img
  5. class="loading"
  6. src="../static/svg/icon-loading.svg" />
  7. </template>
  8. <template v-else>
  9. <template v-if="isMobile">
  10. <!-- 手机端 -->
  11. <div class="small">
  12. <img class="lottery" :src=" require('../static/svg/icon-luck-mark.svg') " />
  13. <div class="head">
  14. <img :src="detail.postBizData.postUserInfo.avatarUrl" />
  15. <span>{{ detail.postBizData.postUserInfo.nickName }}</span>
  16. </div>
  17. <div class="price">
  18. <div class="usdt">USDT GIVEAWAY</div>
  19. <div class="money">
  20. <img :src="detail.postBizData.currencyIconPath" />
  21. <font-amount :fontSize="60" :amount="detail.postBizData.amountValue"></font-amount>
  22. </div>
  23. </div>
  24. <div class="time">
  25. <span class="t">🕒 18:23:53</span>
  26. <span class="w">🏆 3 WINNERS</span>
  27. </div>
  28. <div class="box">
  29. <img src="../static/subject/icon-box.png" />
  30. </div>
  31. <div class="area-cp-link">
  32. <div class="area-list">
  33. <div class="item">
  34. <div class="icon"><img :src=" require('../static/subject/01.svg') " /></div>
  35. <div class="font">Complete the tasks on tweet</div>
  36. </div>
  37. <div class="item">
  38. <div class="icon"><img :src=" require('../static/subject/02.svg') " /></div>
  39. <div class="font">Open link on PC to draw</div>
  40. <div class="pc"><img :src=" require('../static/subject/pc.svg') " /></div>
  41. </div>
  42. </div>
  43. <div class="area-content">
  44. {{ linkHref }}
  45. </div>
  46. <div class="area-btn">
  47. <div class="btn" :data-clipboard-text="linkHref" @click="copyLinkHandle">Copy Link</div>
  48. </div>
  49. </div>
  50. <div class="layer" v-show="layer_show">
  51. <div class="layer-box">
  52. <div class="layer-txt">Unable to copy, please enter the link manually</div>
  53. <div class="layer-btn" @click="layer_show = false">Done</div>
  54. </div>
  55. </div>
  56. </div>
  57. <!-- 手机端 -->
  58. </template>
  59. <template v-else>
  60. <div class="logo">
  61. <img src="/img/icon-logo.png" alt />
  62. </div>
  63. <div class="show">
  64. <div class="center">
  65. <div class="giveaway" :class="{ bg: false }">
  66. <template v-if="false">
  67. <img class="lottery" :src=" require('../static/svg/icon-luck-mark.svg') " />
  68. <div class="head">
  69. <img :src="detail.postBizData.postUserInfo.avatarUrl" />
  70. <span>{{ detail.postBizData.postUserInfo.nickName }}</span>
  71. </div>
  72. <div class="price">
  73. <div class="usdt">USDT GIVEAWAY</div>
  74. <div class="money">
  75. <img :src="detail.postBizData.currencyIconPath" />
  76. <font-amount :fontSize="60" :amount="detail.postBizData.amountValue"></font-amount>
  77. </div>
  78. </div>
  79. <div class="time">
  80. <span class="t">🕒 18:23:53</span>
  81. <span class="w">🏆 3 WINNERS</span>
  82. </div>
  83. <div class="box">
  84. <img src="../static/subject/icon-box.png" />
  85. </div>
  86. </template>
  87. <template v-else>
  88. <div class="succTop">
  89. <img :src=" require('../static/svg/icon-luck-complete.svg') " />
  90. <p class="tips">This Draw is Complete</p>
  91. </div>
  92. <div class="succTitle">
  93. <span>3/3 Winners</span>
  94. <span>100/100 USDT</span>
  95. </div>
  96. <div class="luck-list" @scroll="handleScroll($event)">
  97. <div class="luck-item" v-for="item, i in luck_list" v-bind:key="i">
  98. <img v-if="item.simpleUserInfoVO.avatarUrl" :src="item.simpleUserInfoVO.avatarUrl" alt />
  99. <img v-else src="/svg/icon-twitter.svg" alt />
  100. <div class="luck-content">
  101. <div class="luck-title">{{ item.simpleUserInfoVO.nickName || 'Twitter User' }}</div>
  102. <div class="luck-time">{{ formatTime(item.receiveTimestamp, 'MM-DD HH:mm') }}</div>
  103. </div>
  104. <div class="luck-money">
  105. <img :src="item.currencyIconPath" alt />
  106. <div class="luck-money-txt">{{ item.amountValue || 0 }}</div>
  107. </div>
  108. <div class="luck-king" v-if="item.maxAmount">
  109. <img src="/svg/icon-king-hat.svg" alt />
  110. <span>Luckiest Draw</span>
  111. </div>
  112. </div>
  113. </div>
  114. </template>
  115. </div>
  116. <div class="desc">
  117. <div class="title">Install DeNet Plugin<br/>to Draw Prizes</div>
  118. <div class="issue">DeNet will detect task situation to issue Giveaway</div>
  119. <img class="button" :src=" require('../static/img/icon-install-plugin.svg') " />
  120. </div>
  121. </div>
  122. </div>
  123. </template>
  124. </template>
  125. </div>
  126. </template>
  127. <script>
  128. import axios from 'axios'
  129. import Cookies from 'js-cookie'
  130. import { Toast } from 'vant';
  131. import { isBrowser } from '../utils/help.js'
  132. import FontAmount from '../components/FontAmount.vue'
  133. export default {
  134. name: 'luckdraw',
  135. components: {
  136. FontAmount,
  137. },
  138. data() {
  139. return {
  140. detail: {
  141. postId: '',
  142. postBizData: {
  143. imagePath: '',
  144. postUserInfo: {},
  145. amountValue: '0',
  146. }
  147. },
  148. luck_list: [],
  149. layer_show: true,
  150. isLoading: false,
  151. isMobile: false,
  152. isChrome: false,
  153. }
  154. },
  155. mounted() {
  156. this.checkBrowser()
  157. },
  158. methods: {
  159. checkBrowser() {
  160. this.linkHref = window.location.href;
  161. this.isChrome = isBrowser() == 'chrome';
  162. this.isMobile = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i);
  163. },
  164. copyLinkHandle() {
  165. }
  166. }
  167. }
  168. </script>
  169. <style lang="scss">
  170. html,
  171. body,
  172. #__nuxt,
  173. #__layout {
  174. width: 100%;
  175. height: 100%;
  176. padding: 0;
  177. margin: 0;
  178. }
  179. .content {
  180. overflow: hidden;
  181. width: 100%;
  182. height: 100%;
  183. background: #F5FAFF;
  184. .loading {
  185. position: absolute;
  186. transform: translate(-50%, -50%);
  187. top: 50%;
  188. left: 50%;
  189. margin: auto;
  190. width: 40px;
  191. border-radius: 50%;
  192. }
  193. .logo {
  194. display: flex;
  195. align-items: center;
  196. height: 70px;
  197. margin-left: 25px;
  198. img {
  199. width: 99px;
  200. height: 32px;
  201. }
  202. }
  203. .show {
  204. display: flex;
  205. align-items: center;
  206. height: calc(100% - 70px);
  207. .center {
  208. display: flex;
  209. margin: -50px auto 0;
  210. justify-content: space-between;
  211. width: 1000px;
  212. .giveaway {
  213. position: relative;
  214. overflow: hidden;
  215. width: 375px;
  216. height: 500px;
  217. border-radius: 20px;
  218. background-color: #fff;
  219. box-shadow: 0px 2px 20px rgba(0, 0, 0, 0.1);
  220. &.bg {
  221. background: linear-gradient(17.98deg, #3438FF 3.69%, #8B56FC 74.32%);
  222. }
  223. .lottery {
  224. position: absolute;
  225. top: 0;
  226. right: 0;
  227. width: 110px;
  228. height: 94px;
  229. }
  230. .head {
  231. display: flex;
  232. height: 50px;
  233. align-items: center;
  234. img {
  235. width: 20px;
  236. height: 20px;
  237. border-radius: 50%;
  238. margin: 0 10px 0 15px;
  239. border: solid 2px #fff;
  240. }
  241. span {
  242. color: #fff;
  243. font-size: 13px;
  244. font-weight: 700;
  245. line-height: 16px;
  246. letter-spacing: 0.005em;
  247. }
  248. }
  249. .price {
  250. text-align: center;
  251. .usdt {
  252. margin: 10px 0;
  253. color: #FFFFFF;
  254. font-weight: bold;
  255. font-size: 16px;
  256. line-height: 20px;
  257. text-align: center;
  258. letter-spacing: 0.3px;
  259. }
  260. .money {
  261. display: flex;
  262. align-items: center;
  263. justify-content: center;
  264. img {
  265. width: 46px;
  266. height: 46px;
  267. margin-right: 15px;
  268. border-radius: 50%;
  269. border: solid 3px #fff;
  270. }
  271. span {
  272. color: #fff;
  273. font-size: 60px;
  274. font-weight: 800;
  275. line-height: 76px;
  276. }
  277. }
  278. }
  279. .time {
  280. display: flex;
  281. height: 30px;
  282. align-items: center;
  283. justify-content: center;
  284. font-weight: bold;
  285. font-size: 17px;
  286. line-height: 22px;
  287. text-align: center;
  288. .t {
  289. color: #fff;
  290. margin-right: 8px;
  291. }
  292. .w {
  293. color: #fcc74e;
  294. margin-left: 8px;
  295. }
  296. }
  297. .box {
  298. margin: auto;
  299. width: 200px;
  300. height: 200px;
  301. margin-top: 27px;
  302. img {
  303. width: 100%;
  304. height: 100%;
  305. }
  306. }
  307. .succTop {
  308. display: flex;
  309. align-items: center;
  310. flex-direction: column;
  311. justify-content: center;
  312. height: 150px;
  313. margin-bottom: 13px;
  314. background: #7D52FD;
  315. border-radius: 0 586px 586px/0 0 104px 104px;
  316. img {
  317. width: 62px;
  318. height: 62px;
  319. }
  320. .tips {
  321. color: #FFFFFF;
  322. font-size: 22px;
  323. font-weight: 800;
  324. line-height: 26px;
  325. margin-top: 15px;
  326. }
  327. }
  328. .succTitle {
  329. display: flex;
  330. justify-content: space-between;
  331. height: 28px;
  332. box-shadow: inset 0px -1px 0px #F2F2F2;
  333. span {
  334. margin: 0 16px;
  335. font-size: 12px;
  336. color: #B0B0B0;
  337. }
  338. }
  339. .luck-list {
  340. flex: 1;
  341. width: 100%;
  342. overflow-y: auto;
  343. .luck-item {
  344. display: flex;
  345. padding: 12px 0;
  346. margin: 0 16px;
  347. border-bottom: 1px solid #F2F2F2;
  348. justify-content: space-between;
  349. position: relative;
  350. img:first-child {
  351. border-radius: 50%;
  352. }
  353. .luck-king {
  354. position: absolute;
  355. top: 36px;
  356. right: 0px;
  357. display: flex;
  358. align-items: center;
  359. img {
  360. width: 22px;
  361. height: 19px;
  362. margin: 0;
  363. }
  364. span {
  365. font-weight: 500;
  366. font-size: 12px;
  367. line-height: 14px;
  368. letter-spacing: 0.3px;
  369. color: #f5b945;
  370. }
  371. }
  372. img {
  373. width: 42px;
  374. height: 42px;
  375. margin-right: 12px;
  376. }
  377. .luck-content {
  378. flex: auto;
  379. .luck-title {
  380. font-weight: 500;
  381. font-size: 16px;
  382. letter-spacing: 0.3px;
  383. color: #444444;
  384. }
  385. .luck-time {
  386. font-weight: 400;
  387. font-size: 12px;
  388. line-height: 14px;
  389. color: #9b9b9b;
  390. }
  391. }
  392. .luck-money {
  393. display: flex;
  394. height: 17px;
  395. align-items: center;
  396. img {
  397. width: 14px;
  398. height: 14px;
  399. margin-right: 6px;
  400. }
  401. .luck-money-txt {
  402. font-weight: 500;
  403. font-size: 14px;
  404. /* identical to box height */
  405. text-align: right;
  406. letter-spacing: 0.3px;
  407. color: #444444;
  408. }
  409. }
  410. }
  411. .luck-item:last-child {
  412. border: 0;
  413. }
  414. }
  415. }
  416. .desc {
  417. width: 520px;
  418. .title {
  419. color: #2C2C2C;
  420. font-size: 36px;
  421. line-height: 40px;
  422. font-weight: 900;
  423. margin-top: 90px;
  424. margin-bottom: 20px;
  425. }
  426. .issue {
  427. font-size: 15px;
  428. color: #A4A4A4;
  429. }
  430. .button {
  431. height: 64px;
  432. margin-top: 30px;
  433. }
  434. }
  435. }
  436. }
  437. }
  438. .small {
  439. width: 100%;
  440. height: 100%;
  441. position: relative;
  442. background: linear-gradient(17.98deg, #3438FF 3.69%, #8B56FC 74.32%);
  443. .lottery {
  444. position: absolute;
  445. top: 0;
  446. right: 0;
  447. width: 110px;
  448. height: 94px;
  449. }
  450. .head {
  451. display: flex;
  452. height: 50px;
  453. align-items: center;
  454. img {
  455. width: 20px;
  456. height: 20px;
  457. border-radius: 50%;
  458. margin: 0 10px 0 15px;
  459. border: solid 2px #fff;
  460. }
  461. span {
  462. color: #fff;
  463. font-size: 13px;
  464. font-weight: 700;
  465. line-height: 16px;
  466. letter-spacing: 0.005em;
  467. }
  468. }
  469. .price {
  470. text-align: center;
  471. .usdt {
  472. margin: 10px 0;
  473. color: #FFFFFF;
  474. font-weight: bold;
  475. font-size: 16px;
  476. line-height: 20px;
  477. text-align: center;
  478. letter-spacing: 0.3px;
  479. }
  480. .money {
  481. display: flex;
  482. align-items: center;
  483. justify-content: center;
  484. img {
  485. width: 46px;
  486. height: 46px;
  487. margin-right: 15px;
  488. border-radius: 50%;
  489. border: solid 3px #fff;
  490. }
  491. span {
  492. color: #fff;
  493. font-size: 60px;
  494. font-weight: 800;
  495. line-height: 76px;
  496. }
  497. }
  498. }
  499. .time {
  500. display: flex;
  501. height: 30px;
  502. align-items: center;
  503. justify-content: center;
  504. font-weight: bold;
  505. font-size: 17px;
  506. line-height: 22px;
  507. text-align: center;
  508. .t {
  509. color: #fff;
  510. margin-right: 8px;
  511. }
  512. .w {
  513. color: #fcc74e;
  514. margin-left: 8px;
  515. }
  516. }
  517. .box {
  518. margin: auto;
  519. width: 200px;
  520. height: 200px;
  521. margin-top: 27px;
  522. img {
  523. width: 100%;
  524. height: 100%;
  525. }
  526. }
  527. .area-cp-link {
  528. position: absolute;
  529. bottom: 0;
  530. background: #fff;
  531. overflow: hidden;
  532. width: 100%;
  533. flex-wrap: wrap;
  534. height: 238px;
  535. box-shadow: 0px -4px 10px rgba(0, 0, 0, 0.1);
  536. border-top-left-radius: 10px;
  537. border-top-right-radius: 10px;
  538. .area-list {
  539. clear: both;
  540. margin: 15px;
  541. .item {
  542. clear: both;
  543. overflow: hidden;
  544. margin: 7px 0;
  545. font-size: 16px;
  546. font-weight: 500;
  547. .icon {
  548. float: left;
  549. margin-right: 8px;
  550. margin-top: -2px;
  551. }
  552. .font {
  553. float: left;
  554. margin-right: 8px;
  555. }
  556. .pc {
  557. float: left;
  558. margin-top: -2px;
  559. }
  560. }
  561. }
  562. .area-content {
  563. margin: 0 15px;
  564. color: #4B4B4B;
  565. padding: 7px 10px;
  566. font-size: 13px;
  567. border-radius: 5px;
  568. background: #F4F4F4;
  569. word-break: break-all;
  570. }
  571. .area-btn {
  572. flex: 1;
  573. display: flex;
  574. justify-content: center;
  575. .btn {
  576. margin: 15px 15px 0 15px;
  577. display: inline-block;
  578. width: 100%;
  579. height: 47px;
  580. font-size: 18px;
  581. line-height: 34px;
  582. color: #FFFFFF;
  583. border-radius: 100px;
  584. background: #389AFF;
  585. }
  586. }
  587. }
  588. }
  589. .layer {
  590. position: fixed;
  591. width: 100%;
  592. height: 100%;
  593. top: 0;
  594. left: 0;
  595. background: rgba(0, 0, 0, .5);
  596. .layer-box {
  597. width: 300px;
  598. height: 170px;
  599. background: #FFFFFF;
  600. border-radius: 11px;
  601. opacity: 1;
  602. position: absolute;
  603. top: 250px;
  604. left: 50%;
  605. margin-left: -150px;
  606. .layer-txt {
  607. margin: 30px 0;
  608. width: 100%;
  609. padding: 0 27px;
  610. font-weight: 600;
  611. font-size: 18px;
  612. text-align: center;
  613. }
  614. .layer-btn {
  615. width: 190px;
  616. height: 40px;
  617. background: #389AFF;
  618. border-radius: 100px;
  619. margin: 0 auto;
  620. text-align: center;
  621. line-height: 40px;
  622. color: #fff;
  623. font-weight: 600;
  624. font-size: 18px;
  625. }
  626. }
  627. }
  628. </style>