luckdraw.vue 31 KB

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