luckdraw.vue 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149
  1. <!-- 红包玩法落地页 -->
  2. <template>
  3. <div class="content">
  4. <template v-if="isLoading">
  5. <img
  6. class="loading"
  7. src="../static/svg/icon-loading.svg" />
  8. </template>
  9. <template v-else>
  10. <template v-if="isMobile">
  11. <!-- 手机端 -->
  12. <div class="small" :class="{ bg: status === 'not-open' }">
  13. <template v-if="status === 'not-open'">
  14. <template v-if="isMoneyPrize">
  15. <img class="lottery" :src=" require('../static/svg/icon-luck-mark.svg') " />
  16. <div class="head">
  17. <img :src="detail.postBizData.postUserInfo.avatarUrl" />
  18. <span>{{ detail.postBizData.postUserInfo.nickName }}</span>
  19. </div>
  20. <div class="price">
  21. <div class="usdt">{{ detail.postBizData.currencySymbol }} GIVEAWAY</div>
  22. <div class="money">
  23. <img :src="detail.postBizData.currencyIconPath" />
  24. <font-amount :fontSize="60" :amount="detail.postBizData.amountValue"></font-amount>
  25. </div>
  26. </div>
  27. <div class="time">
  28. <img class="img" :src=" require('../static/svg/icon-time.svg') " />
  29. {{ validity || '00:00:00' }}
  30. </div>
  31. <div class="box">
  32. <img src="../static/subject/icon-box.png" />
  33. </div>
  34. </template>
  35. <template v-else>
  36. <custom-card-cover
  37. :totalCount="detail.postBizData.totalCount"
  38. :amountValue="detail.postBizData.amountValue"
  39. :tokenSymbol="detail.postBizData.tokenSymbol"
  40. :currencyIconUrl="detail.postBizData.iconPath"
  41. :playType="2"
  42. :validity="validity"
  43. :userInfo="{
  44. nickName: detail.postBizData.postUserInfo.nickName,
  45. avatarUrl: detail.postBizData.postUserInfo.avatarUrl
  46. }"
  47. :rewardType="detail.postBizData.rewardType"
  48. :customizedReward="detail.postBizData.customizedReward"
  49. :showBottomInfo="false"
  50. ></custom-card-cover>
  51. </template>
  52. </template>
  53. <template v-else>
  54. <div class="succTop">
  55. <template v-if="status === 'opened'">
  56. <img class="img" :src=" require('../static/svg/icon-luck-rabbit.svg') " />
  57. <p class="tips">Good Luck Next Time!</p>
  58. </template>
  59. <template v-else-if="status === 'expire'">
  60. <!-- <img class="img" :src=" require('../static/svg/icon-luck-complete.svg') " />
  61. <p class="tips">This Draw is Complete</p> -->
  62. <p class="expire">This Giveaways<br/>expired on {{ formatTime(detail.postBizData.endTimestamp, 'MM-DD') }}</p>
  63. </template>
  64. <template v-else>
  65. <p class="win">🎉 Awesome! You Will Get</p>
  66. <div class="win-money">
  67. <img :src="detail.postBizData.currencyIconPath" />
  68. <font-amount :fontSize="46" :amount="receiveAmount"></font-amount>
  69. </div>
  70. </template>
  71. </div>
  72. <div class="succTitle">
  73. <span>{{ detail.postBizData.receiveCount || 0 }}/{{ detail.postBizData.totalCount || 0 }} Winners</span>
  74. <span v-if="isMoneyPrize">{{ detail.postBizData.receiveAmountValue }} / {{ detail.postBizData.amountValue || '' }} {{ detail.postBizData.currencySymbol || '' }}</span>
  75. </div>
  76. <div class="luck-list" @scroll="handleScroll($event)">
  77. <div class="luck-item" v-for="item, i in luck_list" v-bind:key="i">
  78. <div class="userLogo">
  79. <img class="medal" v-if="i < 2" :src=" require('../static/svg/icon-medal-' + i + '.svg') " />
  80. <img class="header" v-if="item.simpleUserInfoVO.avatarUrl" :src="item.simpleUserInfoVO.avatarUrl" alt />
  81. <img class="header" v-else src="/svg/icon-twitter.svg" alt />
  82. </div>
  83. <div class="luck-content">
  84. <div class="luck-title">{{ item.simpleUserInfoVO.nickName || 'Twitter User' }}</div>
  85. <div class="luck-time">{{ formatTime(item.receiveTimestamp, 'MM-DD HH:mm') }}</div>
  86. </div>
  87. <div class="luck-money" v-if="isMoneyPrize">
  88. <img :src="item.currencyIconPath" alt />
  89. <div class="luck-money-txt">{{ item.amountValue || 0 }}</div>
  90. </div>
  91. <div class="luck-custom-prize" v-else>winner</div>
  92. <div class="luck-king" v-if="isMoneyPrize && item.maxAmount">
  93. <img src="/svg/icon-king-hat.svg" alt />
  94. <span>Luckiest Draw</span>
  95. </div>
  96. </div>
  97. </div>
  98. </template>
  99. <div class="area-cp-link">
  100. <div class="area-list">
  101. <div class="item">
  102. <div class="icon"><img :src=" require('../static/subject/01.svg') " /></div>
  103. <div class="font">Complete the tasks on tweet</div>
  104. </div>
  105. <div class="item">
  106. <div class="icon"><img :src=" require('../static/subject/02.svg') " /></div>
  107. <div class="font">Open link on PC to draw</div>
  108. <div class="pc"><img :src=" require('../static/subject/pc.svg') " /></div>
  109. </div>
  110. </div>
  111. <div class="area-content">
  112. {{ linkHref }}
  113. </div>
  114. <div class="area-btn">
  115. <div class="btn" :data-clipboard-text="linkHref">Copy Link</div>
  116. </div>
  117. </div>
  118. <div class="layer" v-show="layer_show">
  119. <div class="layer-box">
  120. <div class="layer-txt">Unable to copy, please enter the link manually</div>
  121. <div class="layer-btn" @click="layer_show = false">Done</div>
  122. </div>
  123. </div>
  124. </div>
  125. </template>
  126. <!-- PC端 -->
  127. <template v-else>
  128. <div class="logo">
  129. <img src="/img/icon-logo.png" />
  130. </div>
  131. <div class="show">
  132. <div class="center">
  133. <div class="head-in-custom" v-if="!isMoneyPrize">
  134. <img :src="detail.postBizData.postUserInfo.avatarUrl" />
  135. <span>{{ detail.postBizData.postUserInfo.nickName }}</span>
  136. </div>
  137. <div class="giveaway" :class="{ bg: status === 'not-open', 'auto-height': !isMoneyPrize }">
  138. <!-- 旧版 样式,后续更新时在 custom-card-cover 公共组件内维护-->
  139. <template v-if="status === 'not-open'">
  140. <template v-if="isMoneyPrize">
  141. <img class="lottery" :src=" require('../static/svg/icon-luck-mark.svg') " />
  142. <div class="head">
  143. <img :src="detail.postBizData.postUserInfo.avatarUrl" />
  144. <span>{{ detail.postBizData.postUserInfo.nickName }}</span>
  145. </div>
  146. <div class="price">
  147. <div class="usdt">{{ detail.postBizData.currencySymbol }} GIVEAWAY</div>
  148. <div class="money">
  149. <img :src="detail.postBizData.currencyIconPath" />
  150. <font-amount :fontSize="60" :amount="detail.postBizData.amountValue"></font-amount>
  151. </div>
  152. </div>
  153. <div class="time">
  154. <img class="img" :src=" require('../static/svg/icon-time.svg') " />
  155. {{ validity || '00:00:00' }}
  156. </div>
  157. <div class="box">
  158. <img src="../static/subject/icon-box.png" />
  159. </div>
  160. </template>
  161. <template v-else>
  162. <custom-card-cover
  163. :totalCount="detail.postBizData.totalCount"
  164. :amountValue="detail.postBizData.amountValue"
  165. :tokenSymbol="detail.postBizData.tokenSymbol"
  166. :currencyIconUrl="detail.postBizData.iconPath"
  167. :playType="2"
  168. :validity="validity"
  169. :userInfo="{
  170. nickName: detail.postBizData.postUserInfo.nickName,
  171. avatarUrl: detail.postBizData.postUserInfo.avatarUrl
  172. }"
  173. :rewardType="detail.postBizData.rewardType"
  174. :customizedReward="detail.postBizData.customizedReward"
  175. :showBottomInfo="true"
  176. ></custom-card-cover>
  177. </template>
  178. </template>
  179. <template v-else>
  180. <div class="succTop">
  181. <template v-if="status === 'opened'">
  182. <img class="img" :src=" require('../static/svg/icon-luck-rabbit.svg') " />
  183. <p class="tips">Good Luck Next Time!</p>
  184. </template>
  185. <template v-else-if="status === 'expire'">
  186. <!-- <img class="img" :src=" require('../static/svg/icon-luck-complete.svg') " />
  187. <p class="tips">This Draw is Complete</p> -->
  188. <p class="expire">This Giveaways<br/>expired on {{ formatTime(detail.postBizData.endTimestamp, 'MM-DD') }}</p>
  189. </template>
  190. <template v-else>
  191. <p class="win">🎉 Awesome! You are Winner!</p>
  192. <div class="win-money">
  193. <img :src="detail.postBizData.currencyIconPath" />
  194. <font-amount :fontSize="46" :amount="receiveAmount"></font-amount>
  195. </div>
  196. </template>
  197. </div>
  198. <div class="succTitle">
  199. <span>{{ detail.postBizData.receiveCount || 0 }}/{{ detail.postBizData.totalCount || 0 }} Winners</span>
  200. <span v-if="isMoneyPrize">{{ detail.postBizData.receiveAmountValue }} / {{ detail.postBizData.amountValue || '' }} {{ detail.postBizData.currencySymbol || '' }}</span>
  201. </div>
  202. <div class="luck-list" @scroll="handleScroll($event)">
  203. <div class="luck-item" v-for="item, i in luck_list" v-bind:key="i">
  204. <div class="userLogo">
  205. <img class="medal" v-if="i < 2" :src=" require('../static/svg/icon-medal-' + i + '.svg') " />
  206. <img class="header" v-if="item.simpleUserInfoVO.avatarUrl" :src="item.simpleUserInfoVO.avatarUrl" alt />
  207. <img class="header" v-else src="/svg/icon-twitter.svg" alt />
  208. </div>
  209. <div class="luck-content">
  210. <div class="luck-title">{{ item.simpleUserInfoVO.nickName || 'Twitter User' }}</div>
  211. <div class="luck-time">{{ formatTime(item.receiveTimestamp, 'MM-DD HH:mm') }}</div>
  212. </div>
  213. <div class="luck-money" v-if="isMoneyPrize">
  214. <img :src="item.currencyIconPath" alt />
  215. <div class="luck-money-txt">{{ item.amountValue || 0 }}</div>
  216. </div>
  217. <div class="luck-custom-prize" v-else>winner</div>
  218. <div class="luck-king" v-if="isMoneyPrize && item.maxAmount">
  219. <img src="/svg/icon-king-hat.svg" alt />
  220. <span>Luckiest Draw</span>
  221. </div>
  222. </div>
  223. </div>
  224. </template>
  225. </div>
  226. <div class="desc">
  227. <template v-if="isChrome">
  228. <template v-if="status === 'not-open'">
  229. <div class="title">Install DeNet Plugin<br/>to Draw Prizes</div>
  230. <div class="issue">DeNet will detect task situation to issue Giveaway</div>
  231. </template>
  232. <template v-else>
  233. <div class="title">Install the Denet plugin<br/>to not miss the next draw</div>
  234. </template>
  235. <img class="button" @click="installExtension" src="../static/svg/icon-install-nft-plugin.svg" />
  236. </template>
  237. <template v-else>
  238. <div class="title">Get Giveaway<br />with chrome</div>
  239. <div class="issue">Only supports getting Giveaways through chrome</div>
  240. <img class="button" @click="clickOpenChrome" src="../static/svg/icon-install-nft-chrome.svg" />
  241. </template>
  242. </div>
  243. </div>
  244. </div>
  245. </template>
  246. </template>
  247. </div>
  248. </template>
  249. <script>
  250. import axios from 'axios'
  251. import Cookies from 'js-cookie'
  252. import { Toast } from 'vant';
  253. import { isBrowser, appType, appVersionCode, formatSecondsAsDaysOrTime } from '../utils/help.js'
  254. import FontAmount from '../components/FontAmount.vue'
  255. import CustomCardCover from '../components/CustomCardCover.vue'
  256. import { RewardType } from '../types';
  257. var moment = require('moment');
  258. var ClipboardJS = require('clipboard')
  259. const api = {
  260. prod: 'https://api.denetme.net',
  261. pre: 'https://preapi.denetme.net',
  262. test: 'https://testapi.denetme.net'
  263. }
  264. const page = {
  265. prod: "https://h5.denetme.net",
  266. pre: "https://preh5.denetme.net",
  267. test: 'https://testh5.denetme.net'
  268. }
  269. const jumpUrl = page[process.env.NUXT_ENV.MODE] + '/'
  270. const baseURL = api[process.env.NUXT_ENV.MODE]
  271. export default {
  272. name: 'luckdraw',
  273. components: {
  274. FontAmount,CustomCardCover
  275. },
  276. head() {
  277. return {
  278. type: '',
  279. title: this.title,
  280. appVersionCode: 3,
  281. meta: [
  282. // facebook
  283. {
  284. name: 'og:url',
  285. content: this.jumpUrl + 'luckdraw/' + this.detail.postId
  286. },
  287. {
  288. name: 'og:title',
  289. content: this.metaTitle
  290. },
  291. {
  292. name: 'og:image',
  293. content: this.detail.postBizData.imagePath || ''
  294. },
  295. // twitter
  296. {
  297. name: 'twitter:card',
  298. content: 'summary_large_image'
  299. },
  300. {
  301. name: 'twitter:url',
  302. content: this.jumpUrl + 'luckdraw/' + this.detail.postId
  303. },
  304. {
  305. name: 'twitter:title',
  306. content: this.metaTitle
  307. },
  308. {
  309. name: 'twitter:image',
  310. content: this.detail.postBizData.imagePath || ''
  311. }
  312. ]
  313. }
  314. },
  315. data() {
  316. return {
  317. detail: {
  318. postId: '',
  319. postBizData: {
  320. imagePath: '',
  321. postUserInfo: {},
  322. amountValue: '0',
  323. }
  324. },
  325. luck_list: [],
  326. luck_list_end: false,
  327. layer_show: false,
  328. isLoading: true,
  329. isMobile: false,
  330. isChrome: false,
  331. config: {},
  332. mid: '',
  333. status: '', // not-open->未打开 opened->没有抽中 success->抽中了 expire->过期
  334. page_index: 1,
  335. page_size: 20,
  336. validity: '',
  337. receiveAmount: '0',
  338. title: 'DeNet Giveaway',
  339. jumpUrl: jumpUrl,
  340. metaTitle: 'DeNet: An Easy Web3 Tool For GIVEAWAY / AIRDROP',
  341. }
  342. },
  343. computed: {
  344. // 货币类型的奖品
  345. isMoneyPrize() {
  346. return this.detail.postBizData.rewardType === RewardType.money;
  347. }
  348. },
  349. mounted() {
  350. this.getConfig()
  351. this.setCookieMid()
  352. this.checkBrowser()
  353. this.handleStatusPage()
  354. this.isLoading = false;
  355. // 复制链接
  356. var clipboard = new ClipboardJS('.btn');
  357. clipboard.on('success', function (e) {
  358. Toast('copy success');
  359. e.clearSelection();
  360. });
  361. clipboard.on('error', function (e) {
  362. this.layer_show = true
  363. });
  364. },
  365. async asyncData(params) {
  366. let { route } = params;
  367. let { data } = await axios.post(`${baseURL}/denet/post/getDetail`, {
  368. baseInfo: {
  369. appVersionCode: appVersionCode,
  370. mid: function () {
  371. return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
  372. var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
  373. return v.toString(16);
  374. });
  375. }()
  376. },
  377. params: {
  378. postId: route.params.id || ''
  379. }
  380. })
  381. if (data.code == 0) {
  382. if (data.data && data.data.postBizData && typeof data.data.postBizData == 'string') {
  383. data.data.postBizData = JSON.parse(data.data.postBizData)
  384. }
  385. if(data.data.postBizData === null) {
  386. data.data.postBizData = {
  387. postUserInfo: {}
  388. }
  389. }
  390. return {
  391. detail: data.data,
  392. }
  393. }
  394. },
  395. methods: {
  396. checkBrowser() {
  397. this.linkHref = window.location.href;
  398. this.isChrome = isBrowser() == 'chrome';
  399. 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);
  400. if (!this.isChrome) {
  401. this.status = 'no-chrome'
  402. } else {
  403. this.setPickupInfo()
  404. }
  405. },
  406. async getConfig() {
  407. let { data } = await axios.post(`${baseURL}/denet/base/config/getFrontConfig`, {
  408. baseInfo: {
  409. appVersionCode: appVersionCode,
  410. mid: this.mid
  411. },
  412. params: {}
  413. })
  414. if (data.code == 0) {
  415. this.config = data.data;
  416. }
  417. },
  418. setCookieMid() {
  419. let _cookie_mid_arr = Cookies.get('mid') || []
  420. if (_cookie_mid_arr.length > 0) {
  421. this.mid = JSON.parse(_cookie_mid_arr)[0].mid
  422. } else {
  423. this.mid = this.guid()
  424. Cookies.set('mid', JSON.stringify([{ mid: this.mid }]), { expires: 1000 })
  425. }
  426. },
  427. guid() {
  428. return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
  429. var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
  430. return v.toString(16);
  431. });
  432. },
  433. clickOpenChrome() {
  434. window.open('https://www.google.com/chrome')
  435. },
  436. installExtension() {
  437. let { extensionsInstallChannel, extensionsInstallUrl } = this.config;
  438. switch (extensionsInstallChannel) {
  439. case "officeDownload":
  440. location.href = url;
  441. this.$router.push({
  442. path: '/install'
  443. })
  444. break;
  445. case "chromeAppStore":
  446. window.open(extensionsInstallUrl)
  447. break;
  448. }
  449. },
  450. setPickupInfo() {
  451. let pickupInfo = {
  452. srcContentId: this.detail.srcContentId,
  453. postNickName: this.detail.postBizData.postUserInfo.nickName,
  454. createTime: Date.now(),
  455. };
  456. Cookies.set('pickup_info', JSON.stringify(pickupInfo), { expires: 100 });
  457. },
  458. formatTime(time, _type = 'MM-DD HH:mm:ss') {
  459. return moment(time).format(_type)
  460. },
  461. getValidity(end_time) {
  462. let timer = setInterval(() => {
  463. let time = moment(new Date().getTime())
  464. let endTime = moment(end_time + 5000)
  465. let downTime = (endTime - time) || 0
  466. if (downTime > 0) {
  467. this.validity = formatSecondsAsDaysOrTime(downTime / 1000);
  468. } else {
  469. this.validity = `00:00:00`
  470. this.getDetail(() => {
  471. this.handleStatusPage()
  472. })
  473. clearInterval(timer)
  474. }
  475. }, 1000)
  476. },
  477. handleScroll(e) {
  478. e = e.target
  479. if (this.luck_list_end) {
  480. return
  481. }
  482. if ((e.clientHeight + e.scrollTop) / e.scrollHeight > .8) {
  483. this.luck_list_end = false
  484. this.page_index++
  485. this.getReceivedList()
  486. }
  487. },
  488. handleStatusPage() {
  489. // 如果 我领取过了
  490. // taskFinishStatus 任务完成状态(0:未完成,1:已完成,2:已过期)
  491. if (this.detail.postBizData.myReceived) {
  492. this.receiveAmount = this.detail.postBizData.myReceived.amountValue || 0
  493. // 如果 任务完成状态 = 未完成
  494. if (this.detail.postBizData.myReceived.taskFinishStatus == 0) {
  495. // 显示任务未完成页面
  496. this.status = `opened`
  497. } else if (this.detail.postBizData.myReceived.taskFinishStatus == 1) {
  498. //如果 任务完成状态 = 已经完成
  499. if (this.receiveAmount == 0) {
  500. // 领取到空红包
  501. this.status = `opened`
  502. } else {
  503. // 显示成功页面
  504. this.status = `success`
  505. }
  506. } else {
  507. // 如果 任务完成状态 = 已经过期
  508. if (this.detail.postBizData.status == 1) {
  509. // 显示未打开页面
  510. this.status = 'not-open'
  511. } else {
  512. // 显示已经过期页面
  513. this.status = 'expire'
  514. }
  515. }
  516. } else {
  517. // 如果 我没有领取过
  518. // 如果 红包状态 = 进行中
  519. if (this.detail.postBizData.status == 1) {
  520. // 如果 过了红包的领取截止时间 = true
  521. if (this.detail.postBizData.receiveTimeExpired) {
  522. // 显示过期页面
  523. this.status = 'expire'
  524. } else {
  525. // 如果 过了红包的领取截止时间 = false
  526. // 显示未打开页面
  527. this.status = 'not-open'
  528. }
  529. } else {
  530. // 红包状态 = 已经结束了 | 已经终止 | 终止退款中
  531. // 显示过期页面
  532. this.status = 'expire'
  533. }
  534. }
  535. // this.status = 'not-open'
  536. // getList
  537. if (this.status !== 'not-open') {
  538. this.getReceivedList()
  539. } else {
  540. this.getValidity(this.detail.postBizData.endTimestamp)
  541. }
  542. },
  543. async getDetail(fn) {
  544. let { data } = await axios.post(`${baseURL}/denet/post/getDetail`, {
  545. baseInfo: {
  546. appVersionCode: appVersionCode,
  547. mid: this.mid
  548. },
  549. params: {
  550. postId: this.detail.postId
  551. }
  552. })
  553. if (data.code == 0) {
  554. console.log(data.data)
  555. this.detail.postBizData = JSON.parse(data.data.postBizData)
  556. if (fn) fn();
  557. }
  558. },
  559. async getReceivedList() {
  560. let { data } = await axios.post(`${baseURL}/denet/post/luckdrop/getReceivedList`, {
  561. baseInfo: {
  562. appVersionCode: appVersionCode,
  563. mid: this.mid
  564. },
  565. params: {
  566. pageNum: this.page_index,
  567. pageSize: this.page_size,
  568. postId: this.detail.postId || ''
  569. }
  570. })
  571. if (data.code == 0) {
  572. if (data.data.length > 0) {
  573. this.luck_list = this.luck_list.concat(data.data)
  574. this.luck_list_end = false
  575. } else {
  576. this.luck_list_end = true
  577. }
  578. }
  579. },
  580. }
  581. }
  582. </script>
  583. <style lang="scss">
  584. html,
  585. body,
  586. #__nuxt,
  587. #__layout {
  588. width: 100%;
  589. height: 100%;
  590. padding: 0;
  591. margin: 0;
  592. }
  593. .content {
  594. overflow: hidden;
  595. width: 100%;
  596. height: 100%;
  597. background: #fff;
  598. .loading {
  599. position: absolute;
  600. transform: translate(-50%, -50%);
  601. top: 50%;
  602. left: 50%;
  603. margin: auto;
  604. width: 40px;
  605. border-radius: 50%;
  606. }
  607. .logo {
  608. display: flex;
  609. align-items: center;
  610. height: 70px;
  611. margin-left: 25px;
  612. img {
  613. width: 99px;
  614. height: 32px;
  615. }
  616. }
  617. .show {
  618. display: flex;
  619. align-items: center;
  620. height: calc(100% - 70px);
  621. .center {
  622. display: flex;
  623. margin: -50px auto 0;
  624. justify-content: space-between;
  625. width: 1000px;
  626. position: relative;
  627. .head-in-custom {
  628. position: absolute;
  629. bottom: 100%;
  630. left: 0;
  631. background: #fff;
  632. display: flex;
  633. align-items: center;
  634. font-weight: 500;
  635. font-size: 15px;
  636. color: #000;
  637. height: 54px;
  638. img {
  639. width: 30px;
  640. height: 30px;
  641. border-radius: 50%;
  642. margin-right: 10px;
  643. }
  644. }
  645. .giveaway {
  646. position: relative;
  647. overflow: hidden;
  648. width: 375px;
  649. height: 500px;
  650. border-radius: 20px;
  651. background-color: #fff;
  652. box-shadow: 0px 2px 20px rgba(0, 0, 0, 0.1);
  653. &.bg {
  654. background: linear-gradient(17.98deg, #3438FF 3.69%, #8B56FC 74.32%);
  655. }
  656. &.auto-height {
  657. height: auto;
  658. }
  659. .lottery {
  660. position: absolute;
  661. top: 0;
  662. right: 0;
  663. width: 110px;
  664. height: 94px;
  665. }
  666. .head {
  667. display: flex;
  668. height: 50px;
  669. align-items: center;
  670. img {
  671. width: 20px;
  672. height: 20px;
  673. border-radius: 50%;
  674. margin: 0 10px 0 15px;
  675. border: solid 2px #fff;
  676. }
  677. span {
  678. color: #fff;
  679. font-size: 13px;
  680. font-weight: 700;
  681. line-height: 16px;
  682. letter-spacing: 0.005em;
  683. }
  684. }
  685. .price {
  686. text-align: center;
  687. .usdt {
  688. margin: 10px 0;
  689. color: #FFFFFF;
  690. font-weight: bold;
  691. font-size: 16px;
  692. line-height: 20px;
  693. text-align: center;
  694. letter-spacing: 0.3px;
  695. }
  696. .money {
  697. display: flex;
  698. align-items: center;
  699. justify-content: center;
  700. img {
  701. width: 46px;
  702. height: 46px;
  703. margin-right: 15px;
  704. border-radius: 50%;
  705. border: solid 3px #fff;
  706. }
  707. span {
  708. color: #fff;
  709. font-size: 60px;
  710. font-weight: 800;
  711. line-height: 76px;
  712. }
  713. }
  714. }
  715. .time {
  716. display: flex;
  717. height: 46px;
  718. color: #FFCC4D;
  719. align-items: center;
  720. justify-content: center;
  721. font-weight: bold;
  722. font-size: 26px;
  723. line-height: 33px;
  724. text-align: center;
  725. background: rgba($color: #000000, $alpha: .15);
  726. .img {
  727. width: 26px;
  728. margin-right: 10px;
  729. }
  730. }
  731. .box {
  732. margin: auto;
  733. width: 200px;
  734. height: 200px;
  735. margin-top: 27px;
  736. img {
  737. width: 100%;
  738. height: 100%;
  739. }
  740. }
  741. }
  742. .desc {
  743. width: 520px;
  744. .title {
  745. color: #2C2C2C;
  746. font-size: 36px;
  747. line-height: 40px;
  748. font-weight: 900;
  749. margin-top: 90px;
  750. margin-bottom: 20px;
  751. }
  752. .issue {
  753. font-size: 15px;
  754. color: #A4A4A4;
  755. }
  756. .button {
  757. cursor: pointer;
  758. height: 64px;
  759. margin-top: 30px;
  760. }
  761. }
  762. }
  763. }
  764. }
  765. .small {
  766. width: 100%;
  767. height: 100%;
  768. position: relative;
  769. background-color: #fff;
  770. &.bg {
  771. background: linear-gradient(17.98deg, #3438FF 3.69%, #8B56FC 74.32%);
  772. }
  773. .lottery {
  774. position: absolute;
  775. top: 0;
  776. right: 0;
  777. width: 110px;
  778. height: 94px;
  779. }
  780. .luck-list {
  781. height: calc(100% - 430px);
  782. }
  783. .head {
  784. display: flex;
  785. height: 50px;
  786. align-items: center;
  787. img {
  788. width: 20px;
  789. height: 20px;
  790. border-radius: 50%;
  791. margin: 0 10px 0 15px;
  792. border: solid 2px #fff;
  793. }
  794. span {
  795. color: #fff;
  796. font-size: 13px;
  797. font-weight: 700;
  798. line-height: 16px;
  799. letter-spacing: 0.005em;
  800. }
  801. }
  802. .price {
  803. text-align: center;
  804. .usdt {
  805. margin: 10px 0;
  806. color: #FFFFFF;
  807. font-weight: bold;
  808. font-size: 16px;
  809. line-height: 20px;
  810. text-align: center;
  811. letter-spacing: 0.3px;
  812. }
  813. .money {
  814. display: flex;
  815. align-items: center;
  816. justify-content: center;
  817. img {
  818. width: 46px;
  819. height: 46px;
  820. margin-right: 15px;
  821. border-radius: 50%;
  822. border: solid 3px #fff;
  823. }
  824. span {
  825. color: #fff;
  826. font-size: 60px;
  827. font-weight: 800;
  828. line-height: 76px;
  829. }
  830. }
  831. }
  832. .time {
  833. display: flex;
  834. height: 46px;
  835. color: #FFCC4D;
  836. align-items: center;
  837. justify-content: center;
  838. font-weight: bold;
  839. font-size: 26px;
  840. line-height: 33px;
  841. text-align: center;
  842. background: rgba($color: #000000, $alpha: .15);
  843. .img {
  844. width: 26px;
  845. margin-right: 10px;
  846. }
  847. }
  848. .box {
  849. margin: auto;
  850. width: 200px;
  851. height: 200px;
  852. margin-top: 27px;
  853. img {
  854. width: 100%;
  855. height: 100%;
  856. }
  857. }
  858. .area-cp-link {
  859. position: absolute;
  860. bottom: 0;
  861. background: #fff;
  862. overflow: hidden;
  863. width: 100%;
  864. flex-wrap: wrap;
  865. height: 238px;
  866. box-shadow: 0px -4px 10px rgba(0, 0, 0, 0.1);
  867. border-top-left-radius: 10px;
  868. border-top-right-radius: 10px;
  869. .area-list {
  870. clear: both;
  871. margin: 15px;
  872. .item {
  873. clear: both;
  874. overflow: hidden;
  875. margin: 7px 0;
  876. font-size: 16px;
  877. font-weight: 500;
  878. .icon {
  879. float: left;
  880. margin-right: 8px;
  881. margin-top: -2px;
  882. }
  883. .font {
  884. float: left;
  885. margin-right: 8px;
  886. }
  887. .pc {
  888. float: left;
  889. margin-top: -2px;
  890. }
  891. }
  892. }
  893. .area-content {
  894. margin: 0 15px;
  895. color: #4B4B4B;
  896. padding: 7px 10px;
  897. font-size: 13px;
  898. border-radius: 5px;
  899. background: #F4F4F4;
  900. word-break: break-all;
  901. }
  902. .area-btn {
  903. flex: 1;
  904. display: flex;
  905. justify-content: center;
  906. .btn {
  907. margin: 15px 15px 0 15px;
  908. display: inline-block;
  909. width: 100%;
  910. height: 47px;
  911. font-size: 18px;
  912. line-height: 34px;
  913. color: #FFFFFF;
  914. border-radius: 100px;
  915. background: #389AFF;
  916. }
  917. }
  918. }
  919. }
  920. .layer {
  921. position: fixed;
  922. width: 100%;
  923. height: 100%;
  924. top: 0;
  925. left: 0;
  926. background: rgba(0, 0, 0, .5);
  927. .layer-box {
  928. width: 300px;
  929. height: 170px;
  930. background: #FFFFFF;
  931. border-radius: 11px;
  932. opacity: 1;
  933. position: absolute;
  934. top: 250px;
  935. left: 50%;
  936. margin-left: -150px;
  937. .layer-txt {
  938. margin: 30px 0;
  939. width: 100%;
  940. padding: 0 27px;
  941. font-weight: 600;
  942. font-size: 18px;
  943. text-align: center;
  944. }
  945. .layer-btn {
  946. width: 190px;
  947. height: 40px;
  948. background: #389AFF;
  949. border-radius: 100px;
  950. margin: 0 auto;
  951. text-align: center;
  952. line-height: 40px;
  953. color: #fff;
  954. font-weight: 600;
  955. font-size: 18px;
  956. }
  957. }
  958. }
  959. .luck-list {
  960. flex: 1;
  961. width: 100%;
  962. height: 310px;
  963. overflow-y: auto;
  964. .luck-item {
  965. display: flex;
  966. padding: 12px 0;
  967. margin: 0 16px;
  968. border-bottom: 1px solid #F2F2F2;
  969. justify-content: space-between;
  970. position: relative;
  971. .header {
  972. border-radius: 50%;
  973. }
  974. .luck-king {
  975. position: absolute;
  976. top: 36px;
  977. right: 0px;
  978. display: flex;
  979. align-items: center;
  980. img {
  981. width: 22px;
  982. height: 19px;
  983. margin: 0;
  984. }
  985. span {
  986. font-weight: 500;
  987. font-size: 12px;
  988. line-height: 14px;
  989. letter-spacing: 0.3px;
  990. color: #f5b945;
  991. }
  992. }
  993. .userLogo {
  994. position: relative;
  995. width: 42px;
  996. height: 42px;
  997. margin-right: 12px;
  998. .medal {
  999. position: absolute;
  1000. right: -5px;
  1001. bottom: -5px;
  1002. width: 18px;
  1003. height: 18px;
  1004. }
  1005. img {
  1006. width: 100%;
  1007. height: 100%;
  1008. }
  1009. }
  1010. .luck-content {
  1011. flex: auto;
  1012. .luck-title {
  1013. font-weight: 500;
  1014. font-size: 16px;
  1015. letter-spacing: 0.3px;
  1016. color: #444444;
  1017. }
  1018. .luck-time {
  1019. font-weight: 400;
  1020. font-size: 12px;
  1021. line-height: 14px;
  1022. color: #9b9b9b;
  1023. }
  1024. }
  1025. .luck-money {
  1026. display: flex;
  1027. height: 17px;
  1028. align-items: center;
  1029. img {
  1030. width: 14px;
  1031. height: 14px;
  1032. margin-right: 6px;
  1033. }
  1034. .luck-money-txt {
  1035. font-weight: 500;
  1036. font-size: 14px;
  1037. /* identical to box height */
  1038. text-align: right;
  1039. letter-spacing: 0.3px;
  1040. color: #444444;
  1041. }
  1042. }
  1043. .luck-custom-prize {
  1044. font-weight: 500;
  1045. font-size: 14px;
  1046. letter-spacing: 0.3px;
  1047. color: #F5B945;
  1048. }
  1049. }
  1050. .luck-item:last-child {
  1051. border: 0;
  1052. }
  1053. }
  1054. .succTop {
  1055. display: flex;
  1056. align-items: center;
  1057. flex-direction: column;
  1058. justify-content: center;
  1059. height: 150px;
  1060. margin-bottom: 13px;
  1061. background: #7D52FD;
  1062. border-radius: 0 586px 586px/0 0 104px 104px;
  1063. .img {
  1064. height: 62px;
  1065. }
  1066. .expire {
  1067. color: #FFFFFF;
  1068. font-size: 22px;
  1069. font-weight: 800;
  1070. line-height: 36px;
  1071. margin-top: 15px;
  1072. text-align: center;
  1073. }
  1074. .tips {
  1075. color: #FFFFFF;
  1076. font-size: 22px;
  1077. font-weight: 800;
  1078. line-height: 26px;
  1079. margin-top: 15px;
  1080. }
  1081. .win {
  1082. font-size: 21px;
  1083. font-weight: 800;
  1084. color: #fff;
  1085. }
  1086. .win-money {
  1087. display: flex;
  1088. margin-top: -10px;
  1089. align-items: center;
  1090. justify-content: center;
  1091. img {
  1092. width: 44px;
  1093. height: 44px;
  1094. margin-right: 15px;
  1095. border-radius: 50%;
  1096. border: solid 3px #fff;
  1097. }
  1098. span {
  1099. color: #fff;
  1100. font-size: 60px;
  1101. font-weight: 800;
  1102. line-height: 76px;
  1103. }
  1104. }
  1105. }
  1106. .succTitle {
  1107. display: flex;
  1108. padding: 5px 0;
  1109. justify-content: space-between;
  1110. box-shadow: inset 0px -1px 0px #F2F2F2;
  1111. span {
  1112. margin: 0 16px;
  1113. font-size: 12px;
  1114. color: #B0B0B0;
  1115. &:last-child {
  1116. text-align: right;
  1117. }
  1118. }
  1119. }
  1120. </style>