index.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516
  1. <template>
  2. <div class="content" :style="{ 'backgroundImage': `url(${this.back_img})` }">
  3. <div class="logo">
  4. <img src="/svg/icon-logo.svg" alt />
  5. </div>
  6. <!-- 红包 -->
  7. <div class="redPacket">
  8. <div class="area" v-show="area_show">
  9. <div class="title">
  10. <img src="/svg/icon-logo.svg" alt />
  11. <span>Giveaways from: Elon Musk</span>
  12. </div>
  13. <div class="txt">Good Luck!</div>
  14. </div>
  15. <img src="/svg/back-top.svg" alt class="top" />
  16. <img src="/svg/back-down.svg" alt class="down" />
  17. <img src="/svg/icon-usd.svg" alt class="start" v-show="area_show" />
  18. <!-- 内容 -->
  19. <div class="head">
  20. <div class="head-title">
  21. <img src="/svg/icon-logo.svg" alt />
  22. <span>Giveaways from: Elon Musk</span>
  23. </div>
  24. <div class="head-txt">Awesome! You Will Get</div>
  25. <div class="head-money">
  26. <img src="/svg/icon-usd.svg" alt />
  27. <span class="money-txt">1.753</span>
  28. <div>
  29. <span>USD</span>
  30. </div>
  31. </div>
  32. </div>
  33. <div class="luck-list-title">
  34. <div>0/0 People Got</div>
  35. <div>Total $1 isd</div>
  36. </div>
  37. <div class="luck-list">
  38. <div class="luck-item">
  39. <img alt />
  40. <div class="luck-content">
  41. <div class="luck-title">123</div>
  42. <div class="luck-time">123</div>
  43. </div>
  44. <div class="luck-money">
  45. <img src="/svg/icon-logo.svg" alt />
  46. <div class="luck-money-txt">123</div>
  47. </div>
  48. <div class="luck-king">
  49. <img src="/svg/icon-logo.svg" alt />
  50. <span>Luckiest Draw</span>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. <!-- 安装 -->
  56. <div class="install">
  57. <div class="title">Withdraw to Wallet</div>
  58. <div class="validity">
  59. <span>Validity</span>
  60. <span style="color: red;">23:57:32</span>
  61. </div>
  62. <div class="flow">
  63. <div class="line"></div>
  64. <div class="area_num">
  65. <div class="num">1</div>
  66. <span>Install DeNet</span>
  67. </div>
  68. <div class="tip">Used for Task Verification and Giveaways Withdrawal</div>
  69. <div class="install_btn">Install</div>
  70. <div class="area_num">
  71. <div class="num">2</div>
  72. <span>Complete Tasks by Elon Musk</span>
  73. </div>
  74. <div class="tip">Follow、Like tweet、Retweet (Just 1-3 minutes)</div>
  75. </div>
  76. </div>
  77. </div>
  78. </template>
  79. <script>
  80. import axios from 'axios';
  81. export default {
  82. name: "index",
  83. data() {
  84. return {
  85. back_img: '/svg/back-denet.svg',
  86. area_show: true,
  87. detail: {
  88. postId: '',
  89. postBizData: {
  90. imagePath: ''
  91. }
  92. },
  93. title: '',
  94. twitterTitle: 'deNet',
  95. jumpUrl: 'https://de-net-test.piaoquantv.com/'
  96. }
  97. },
  98. head() {
  99. return {
  100. type: '',
  101. title: this.title,
  102. meta: [
  103. {
  104. name: 'twitter:card',
  105. content: 'summary_large_image'
  106. },
  107. {
  108. name: 'twitter:url',
  109. content: this.jumpUrl + this.detail.postId
  110. },
  111. {
  112. name: 'twitter:title',
  113. content: this.twitterTitle
  114. },
  115. {
  116. name: 'twitter:image',
  117. content: this.detail.postBizData.imagePath || ''
  118. },
  119. {
  120. name: 'twitter:image:width',
  121. content: '1280'
  122. },
  123. {
  124. name: 'twitter:image:height',
  125. content: '720'
  126. },
  127. ]
  128. }
  129. },
  130. async asyncData(params) {
  131. let { route } = params;
  132. let { data } = await axios.post('https://denettestapi.piaoquantv.com/denet/post/getDetail', {
  133. baseInfo: {
  134. token: ''
  135. },
  136. params: {
  137. postId: route.params.id || ''
  138. }
  139. })
  140. if (data.code == 0) {
  141. if (data.data && data.data.postBizData && typeof data.data.postBizData == 'string') {
  142. data.data.postBizData = JSON.parse(data.data.postBizData)
  143. }
  144. return {
  145. detail: data.data,
  146. }
  147. }
  148. },
  149. mounted() {
  150. //改变font-size
  151. (function (doc, win) {
  152. var docEI = doc.documentElement,
  153. resizeEvt = 'orientationchange' in window ? 'orientataionchange' : 'resize',
  154. recalc = function () {
  155. var clientWidth = docEI.clientWidth;
  156. if (!clientWidth) return;
  157. //100是字体大小,1510是开发时浏览器窗口的宽度,等比计算
  158. docEI.style.fontSize = 10 * (clientWidth / 1510) + 'px';
  159. }
  160. if (!doc.addEventListener) return;
  161. win.addEventListener(resizeEvt, recalc, false);
  162. doc.addEventListener('DOMContentLoaded', recalc, false);
  163. })(document, window);
  164. setTimeout(() => {
  165. this.area_show = false
  166. }, 1000)
  167. }
  168. }
  169. </script>
  170. <style lang="scss" >
  171. html,
  172. body,
  173. #__nuxt,
  174. #__layout {
  175. width: 100%;
  176. height: 100%;
  177. padding: 0;
  178. margin: 0;
  179. }
  180. .content {
  181. width: 100%;
  182. height: 100%;
  183. background-size: 100%;
  184. background-repeat: no-repeat;
  185. position: relative;
  186. font-family: "SF Pro Display";
  187. font-style: normal;
  188. font-weight: 600;
  189. .logo {
  190. position: absolute;
  191. left: 4rem;
  192. top: 1.5rem;
  193. img {
  194. width: 107px;
  195. height: 40px;
  196. }
  197. }
  198. .redPacket {
  199. position: absolute;
  200. top: 9rem;
  201. left: 50%;
  202. width: 37.5rem;
  203. margin-left: -18rem;
  204. height: 65rem;
  205. border-radius: 2rem;
  206. // background: red;
  207. overflow: hidden;
  208. animation: key_packet 3s;
  209. animation-delay: 6s;
  210. animation-fill-mode: forwards;
  211. box-shadow: 0 0 5px #888888;
  212. .start {
  213. position: absolute;
  214. width: 10rem;
  215. height: 10rem;
  216. bottom: 24rem;
  217. left: 50%;
  218. margin-left: -5rem;
  219. z-index: 3;
  220. }
  221. .top {
  222. top: 0;
  223. position: absolute;
  224. width: 100%;
  225. z-index: 1;
  226. animation: key_top 4s;
  227. animation-delay: 2s;
  228. animation-fill-mode: forwards;
  229. }
  230. .down {
  231. bottom: 0;
  232. position: absolute;
  233. height: 32.3rem;
  234. animation: key_down 4s;
  235. animation-delay: 2s;
  236. animation-fill-mode: forwards;
  237. }
  238. .head {
  239. .head-title {
  240. height: 9.7rem;
  241. line-height: 9.7rem;
  242. background: #ef4545;
  243. text-align: center;
  244. border-radius: 0 586px 586px/0 0 104px 104px;
  245. overflow: hidden;
  246. box-shadow: 0 0 5px #888888;
  247. img {
  248. width: 3rem;
  249. height: 3rem;
  250. border-radius: 50%;
  251. border: 2px solid #fff4db;
  252. }
  253. span {
  254. font-size: 1.4rem;
  255. color: #fff2d3;
  256. }
  257. }
  258. .head-txt {
  259. margin-top: 4.7rem;
  260. font-size: 2rem;
  261. text-align: center;
  262. color: #ef4545;
  263. }
  264. .head-money {
  265. display: flex;
  266. align-items: center;
  267. justify-content: center;
  268. img {
  269. width: 4rem;
  270. height: 4rem;
  271. }
  272. span {
  273. font-size: 1.3rem;
  274. }
  275. .money-txt {
  276. font-weight: 700;
  277. font-size: 4.8rem;
  278. color: #000000;
  279. letter-spacing: 0.3px;
  280. }
  281. }
  282. }
  283. .luck-list-title {
  284. padding: 0 16px;
  285. background: #fff;
  286. color: #9b9b9b;
  287. display: flex;
  288. justify-content: space-between;
  289. }
  290. .luck-list {
  291. background: #fff;
  292. .luck-item {
  293. display: flex;
  294. padding: 12px 16px;
  295. border-top: 1px solid #d1d1d1;
  296. justify-content: space-between;
  297. position: relative;
  298. img:first-child {
  299. border-radius: 50%;
  300. }
  301. .luck-king {
  302. position: absolute;
  303. top: 36px;
  304. right: 16px;
  305. display: flex;
  306. align-items: center;
  307. img {
  308. width: 22px;
  309. height: 19px;
  310. margin: 0;
  311. }
  312. span {
  313. font-weight: 500;
  314. font-size: 12px;
  315. line-height: 14px;
  316. letter-spacing: 0.3px;
  317. color: #f5b945;
  318. }
  319. }
  320. img {
  321. width: 42px;
  322. height: 42px;
  323. margin-right: 12px;
  324. }
  325. .luck-content {
  326. flex: auto;
  327. .luck-title {
  328. font-weight: 500;
  329. font-size: 16px;
  330. letter-spacing: 0.3px;
  331. color: #444444;
  332. }
  333. .luck-time {
  334. font-weight: 400;
  335. font-size: 12px;
  336. line-height: 14px;
  337. color: #9b9b9b;
  338. }
  339. }
  340. .luck-money {
  341. display: flex;
  342. height: 17px;
  343. align-items: center;
  344. img {
  345. width: 14px;
  346. height: 14px;
  347. margin-right: 6px;
  348. }
  349. .luck-money-txt {
  350. font-weight: 500;
  351. font-size: 14px;
  352. /* identical to box height */
  353. text-align: right;
  354. letter-spacing: 0.3px;
  355. color: #444444;
  356. }
  357. }
  358. }
  359. }
  360. .area {
  361. position: absolute;
  362. z-index: 2;
  363. width: 100%;
  364. .title {
  365. z-index: 11;
  366. margin-top: 8.5rem;
  367. text-align: center;
  368. img {
  369. width: 3rem;
  370. height: 3rem;
  371. border: 2px solid #fff4db;
  372. }
  373. span {
  374. letter-spacing: 0.3px;
  375. font-size: 1.6rem;
  376. color: #fff2d3;
  377. }
  378. }
  379. .txt {
  380. font-size: 4rem;
  381. text-align: center;
  382. letter-spacing: 0.03rem;
  383. color: #fff2d3;
  384. }
  385. }
  386. }
  387. .install {
  388. position: absolute;
  389. top: 20rem;
  390. right: 28.5rem;
  391. opacity: 0;
  392. animation: key_install 2s;
  393. animation-delay: 6s;
  394. animation-fill-mode: forwards;
  395. .title {
  396. font-size: 4.8rem;
  397. color: #000000;
  398. letter-spacing: 0.3px;
  399. }
  400. .validity {
  401. margin-top: 2rem;
  402. background: rgba(166, 166, 166, 0.1);
  403. width: 40rem;
  404. height: 3.3rem;
  405. line-height: 3.3rem;
  406. span {
  407. color: #000000;
  408. font-size: 1.4rem;
  409. }
  410. }
  411. .flow {
  412. position: absolute;
  413. margin-top: 4.6rem;
  414. .line {
  415. position: absolute;
  416. height: 16rem;
  417. border: 1px solid #e0e0e0;
  418. top: 3rem;
  419. left: 1.2rem;
  420. }
  421. .area_num {
  422. display: flex;
  423. align-items: center;
  424. .num {
  425. width: 2.4rem;
  426. height: 2.4rem;
  427. background-color: rgba(56, 154, 255, 1);
  428. border-radius: 50%;
  429. color: #fff;
  430. text-align: center;
  431. line-height: 2.4rem;
  432. font-size: 1.4rem;
  433. }
  434. span {
  435. margin-left: 1.5rem;
  436. color: #000000;
  437. font-size: 1.8rem;
  438. }
  439. }
  440. .tip {
  441. margin-left: 4rem;
  442. margin-top: 0.7rem;
  443. font-size: 1.4rem;
  444. color: #a4a4a4;
  445. }
  446. .install_btn {
  447. margin-left: 4rem;
  448. margin-top: 2rem;
  449. margin-bottom: 6.7rem;
  450. width: 23rem;
  451. height: 5.8rem;
  452. background: #389aff;
  453. border-radius: 10rem;
  454. color: #fff;
  455. line-height: 5.8rem;
  456. text-align: center;
  457. }
  458. }
  459. }
  460. }
  461. @keyframes key_install {
  462. 0% {
  463. opacity: 0.1;
  464. }
  465. 100% {
  466. opacity: 1;
  467. }
  468. }
  469. @keyframes key_packet {
  470. 0% {
  471. }
  472. 100% {
  473. left: 30.6rem;
  474. margin-left: -18rem;
  475. }
  476. }
  477. @keyframes key_top {
  478. 0% {
  479. top: 0;
  480. }
  481. 50% {
  482. top: -30rem;
  483. }
  484. 100% {
  485. top: -36rem;
  486. }
  487. }
  488. @keyframes key_down {
  489. 0% {
  490. bottom: 0;
  491. }
  492. 50% {
  493. bottom: -28.3rem;
  494. }
  495. 100% {
  496. bottom: -32.3rem;
  497. }
  498. }
  499. </style>