luckdraw.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359
  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 } 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(params) {
  300. let { route } = params;
  301. let { data } = await axios.post(`${baseURL}/denet/post/getDetail`, {
  302. baseInfo: {
  303. appVersionCode: appVersionCode,
  304. mid: '00000000-0000-0000-0000-000000000000',
  305. },
  306. params: {
  307. postId: route.params.id || '',
  308. },
  309. });
  310. if (data.code == 0) {
  311. if (data.data && data.data.postBizData && typeof data.data.postBizData == 'string') {
  312. data.data.postBizData = JSON.parse(data.data.postBizData);
  313. }
  314. if (data.data.postBizData === null) {
  315. data.data.postBizData = {
  316. postUserInfo: {},
  317. };
  318. }
  319. return {
  320. detail: data.data,
  321. customCover: data.data.postBizData && data.data.postBizData.posterType == 2 ? 1 : 0,
  322. customGiveaway: data.data.postBizData && data.data.postBizData.rewardType == 2 ? 1 : 0,
  323. };
  324. }
  325. },
  326. methods: {
  327. checkBrowser() {
  328. this.linkHref = window.location.href;
  329. this.isChrome = isBrowser() == 'chrome';
  330. 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);
  331. if (!this.isChrome) {
  332. this.status = 'no-chrome';
  333. } else {
  334. this.setPickupInfo();
  335. }
  336. // report
  337. setTimeout(() => {
  338. this.reportData();
  339. }, 500);
  340. },
  341. async getConfig() {
  342. let { data } = await axios.post(`${baseURL}/denet/base/config/getFrontConfig`, {
  343. baseInfo: {
  344. appVersionCode: appVersionCode,
  345. mid: this.mid,
  346. },
  347. params: {},
  348. });
  349. if (data.code == 0) {
  350. this.config = data.data;
  351. }
  352. },
  353. setCookieMid() {
  354. let _cookie_mid_arr = Cookies.get('mid') || [];
  355. if (_cookie_mid_arr.length > 0) {
  356. this.mid = JSON.parse(_cookie_mid_arr)[0].mid;
  357. } else {
  358. this.mid = this.guid();
  359. Cookies.set('mid', JSON.stringify([{ mid: this.mid }]), { expires: 1000 });
  360. }
  361. },
  362. guid() {
  363. return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
  364. var r = (Math.random() * 16) | 0,
  365. v = c == 'x' ? r : (r & 0x3) | 0x8;
  366. return v.toString(16);
  367. });
  368. },
  369. clickOpenChrome() {
  370. window.open('https://www.google.com/chrome');
  371. let extParams = this.isMobile ? {} : { status: this.reportStatus };
  372. Report.reportLog({
  373. baseInfo: {
  374. appVersionCode: appVersionCode,
  375. mid: this.mid,
  376. pageSource: Report.pageSource.newUserLandingPage,
  377. appType,
  378. machineCode: this.mid,
  379. },
  380. params: {
  381. eventData: {
  382. businessType: Report.businessType.buttonClick,
  383. objectType: Report.objectType.installButton,
  384. postId: this.detail.postId,
  385. srcContentId: this.detail.srcContentId,
  386. senderId: this.detail.srcUserId,
  387. redPacketType: 1,
  388. customCover: this.customCover,
  389. customGiveaway: this.customGiveaway,
  390. },
  391. extParams: extParams,
  392. },
  393. });
  394. },
  395. installExtension() {
  396. let { extensionsInstallChannel, extensionsInstallUrl } = this.config;
  397. let url = extensionsInstallUrl;
  398. let extParams = this.isMobile ? {} : { status: this.reportStatus };
  399. Report.reportLog({
  400. baseInfo: {
  401. appVersionCode: appVersionCode,
  402. mid: this.mid,
  403. pageSource: Report.pageSource.newUserLandingPage,
  404. appType,
  405. machineCode: this.mid,
  406. },
  407. params: {
  408. eventData: {
  409. businessType: Report.businessType.buttonClick,
  410. objectType: Report.objectType.installButton,
  411. postId: this.detail.postId,
  412. srcContentId: this.detail.srcContentId,
  413. senderId: this.detail.srcUserId,
  414. redPacketType: 1,
  415. customCover: this.customCover,
  416. customGiveaway: this.customGiveaway,
  417. },
  418. extParams: extParams,
  419. },
  420. });
  421. switch (extensionsInstallChannel) {
  422. case 'officeDownload':
  423. location.href = url;
  424. this.$router.push({
  425. path: '/install',
  426. });
  427. break;
  428. case 'chromeAppStore':
  429. window.open(extensionsInstallUrl);
  430. break;
  431. }
  432. },
  433. setPickupInfo() {
  434. let pickupInfo = {
  435. srcContentId: this.detail.srcContentId || '',
  436. postNickName: this.detail.postBizData.postUserInfo.nickName || '',
  437. createTime: Date.now(),
  438. jump_type: 'luck_draw',
  439. postId: this.detail.postId || '',
  440. };
  441. Cookies.set('jump_info', JSON.stringify(pickupInfo), { expires: 100 });
  442. },
  443. formatTime(time, _type = 'MM-DD HH:mm:ss') {
  444. return moment(time).format(_type);
  445. },
  446. getValidity(end_time) {
  447. let timer = setInterval(() => {
  448. let time = moment(new Date().getTime());
  449. let endTime = moment(end_time + 5000);
  450. let downTime = endTime - time || 0;
  451. if (downTime > 0) {
  452. this.validity = formatSecondsAsDaysOrTime(downTime / 1000);
  453. } else {
  454. this.validity = `00:00:00`;
  455. this.getDetail(() => {
  456. this.handleStatusPage();
  457. });
  458. clearInterval(timer);
  459. }
  460. }, 1000);
  461. },
  462. handleScroll(e) {
  463. e = e.target;
  464. if (this.luck_list_end) {
  465. return;
  466. }
  467. if ((e.clientHeight + e.scrollTop) / e.scrollHeight > 0.8) {
  468. this.luck_list_end = false;
  469. this.page_index++;
  470. this.getReceivedList();
  471. }
  472. },
  473. handleStatusPage() {
  474. // 如果 我领取过了
  475. // taskFinishStatus 任务完成状态(0:未完成,1:已完成,2:已过期)
  476. if (this.detail.postBizData.myReceived) {
  477. this.receiveAmount = this.detail.postBizData.myReceived.amountValue || 0;
  478. // 如果 任务完成状态 = 未完成
  479. if (this.detail.postBizData.myReceived.taskFinishStatus == 0) {
  480. // 显示任务未完成页面
  481. this.status = `opened`;
  482. } else if (this.detail.postBizData.myReceived.taskFinishStatus == 1) {
  483. //如果 任务完成状态 = 已经完成
  484. if (this.receiveAmount == 0) {
  485. // 领取到空红包
  486. this.status = `opened`;
  487. this.reportStatus = `empty`;
  488. } else {
  489. // 显示成功页面
  490. this.status = `success`;
  491. }
  492. } else {
  493. // 如果 任务完成状态 = 已经过期
  494. if (this.detail.postBizData.status == 1) {
  495. // 显示未打开页面
  496. this.status = 'not-open';
  497. } else {
  498. // 显示已经过期页面
  499. this.status = 'expire';
  500. this.reportStatus = `empty`;
  501. }
  502. }
  503. } else {
  504. // 如果 我没有领取过
  505. // 如果 红包状态 = 进行中
  506. if (this.detail.postBizData.status == 1) {
  507. // 如果 过了红包的领取截止时间 = true
  508. if (this.detail.postBizData.receiveTimeExpired) {
  509. // 显示过期页面
  510. this.status = 'expire';
  511. this.reportStatus = `empty`;
  512. } else {
  513. // 如果 过了红包的领取截止时间 = false
  514. // 显示未打开页面
  515. this.status = 'not-open';
  516. }
  517. } else {
  518. // 红包状态 = 已经结束了 | 已经终止 | 终止退款中
  519. // 显示过期页面
  520. this.status = 'expire';
  521. this.reportStatus = `empty`;
  522. }
  523. }
  524. // this.status = 'not-open'
  525. // getList
  526. if (this.status !== 'not-open') {
  527. this.getReceivedList();
  528. } else {
  529. this.getValidity(this.detail.postBizData.endTimestamp);
  530. }
  531. },
  532. async getDetail(fn) {
  533. let { data } = await axios.post(`${baseURL}/denet/post/getDetail`, {
  534. baseInfo: {
  535. appVersionCode: appVersionCode,
  536. mid: this.mid,
  537. },
  538. params: {
  539. postId: this.detail.postId,
  540. },
  541. });
  542. if (data.code == 0) {
  543. this.detail.postBizData = JSON.parse(data.data.postBizData);
  544. this.customCover = this.detail.postBizData && this.detail.postBizData.posterType == 2 ? 1 : 0;
  545. this.customGiveaway = this.detail.postBizData && this.detail.postBizData.rewardType == 2 ? 1 : 0;
  546. if (fn) fn();
  547. }
  548. },
  549. async getReceivedList() {
  550. let { data } = await axios.post(`${baseURL}/denet/post/luckdrop/getReceivedList`, {
  551. baseInfo: {
  552. appVersionCode: appVersionCode,
  553. mid: this.mid,
  554. },
  555. params: {
  556. pageNum: this.page_index,
  557. pageSize: this.page_size,
  558. postId: this.detail.postId || '',
  559. },
  560. });
  561. if (data.code == 0) {
  562. if (data.data.length > 0) {
  563. this.luck_list = this.luck_list.concat(data.data);
  564. this.luck_list_end = false;
  565. } else {
  566. this.luck_list_end = true;
  567. }
  568. }
  569. },
  570. copyLinkHandle() {
  571. Report.reportLog({
  572. baseInfo: {
  573. appVersionCode: appVersionCode,
  574. mid: this.mid,
  575. pageSource: Report.pageSource.mobileLandingPage,
  576. appType,
  577. machineCode: this.mid,
  578. },
  579. params: {
  580. eventData: {
  581. businessType: Report.businessType.buttonClick,
  582. objectType: Report.objectType.copyLinkButton,
  583. postId: this.detail.postId || '',
  584. srcContentId: this.detail.srcContentId || '',
  585. senderId: this.detail.srcUserId || '',
  586. redPacketType: 1,
  587. customCover: this.customCover,
  588. customGiveaway: this.customGiveaway,
  589. },
  590. },
  591. });
  592. },
  593. reportData() {
  594. if (this.isMobile) {
  595. // 手机端
  596. Report.reportLog({
  597. baseInfo: {
  598. appVersionCode: appVersionCode,
  599. mid: this.mid,
  600. pageSource: Report.pageSource.mobileLandingPage,
  601. machineCode: this.mid,
  602. },
  603. params: {
  604. eventData: {
  605. businessType: Report.businessType.pageView,
  606. postId: this.detail.postId,
  607. redPacketType: 1,
  608. },
  609. },
  610. });
  611. } else if (this.isChrome) {
  612. // pc端
  613. Report.reportLog({
  614. baseInfo: {
  615. appVersionCode: appVersionCode,
  616. mid: this.mid,
  617. pageSource: Report.pageSource.newUserLandingPage,
  618. appType,
  619. machineCode: this.mid,
  620. },
  621. params: {
  622. eventData: {
  623. businessType: Report.businessType.pageView,
  624. postId: this.detail.postId,
  625. srcContentId: this.detail.srcContentId,
  626. senderId: this.detail.srcUserId,
  627. redPacketType: 1,
  628. customCover: this.customCover,
  629. customGiveaway: this.customGiveaway,
  630. },
  631. extParams: {
  632. status: this.reportStatus,
  633. },
  634. },
  635. });
  636. } else {
  637. Report.reportLog({
  638. baseInfo: {
  639. appVersionCode: appVersionCode,
  640. mid: this.mid,
  641. pageSource: Report.pageSource.newUserLandingPage,
  642. appType,
  643. machineCode: this.mid,
  644. },
  645. params: {
  646. eventData: {
  647. businessType: Report.businessType.pageView,
  648. postId: this.detail.postId,
  649. srcContentId: this.detail.srcContentId,
  650. senderId: this.detail.srcUserId,
  651. redPacketType: 1,
  652. customCover: this.customCover,
  653. customGiveaway: this.customGiveaway,
  654. },
  655. extParams: {
  656. status: 'not-chrome',
  657. },
  658. },
  659. });
  660. }
  661. },
  662. },
  663. };
  664. </script>
  665. <style lang="scss">
  666. html,
  667. body,
  668. #__nuxt,
  669. #__layout {
  670. width: 100%;
  671. height: 100%;
  672. padding: 0;
  673. margin: 0;
  674. }
  675. .content {
  676. width: 100%;
  677. height: 100%;
  678. background: #fff;
  679. .loading {
  680. position: absolute;
  681. transform: translate(-50%, -50%);
  682. top: 50%;
  683. left: 50%;
  684. margin: auto;
  685. width: 40px;
  686. border-radius: 50%;
  687. }
  688. .logo {
  689. display: flex;
  690. align-items: center;
  691. height: 70px;
  692. margin-left: 25px;
  693. img {
  694. width: 99px;
  695. height: 32px;
  696. }
  697. }
  698. .show {
  699. display: flex;
  700. align-items: center;
  701. height: calc(100% - 70px);
  702. .center {
  703. display: flex;
  704. margin: -50px auto 0;
  705. justify-content: space-between;
  706. width: 1000px;
  707. position: relative;
  708. .head-in-custom {
  709. position: absolute;
  710. bottom: 100%;
  711. left: 0;
  712. background: #fff;
  713. display: flex;
  714. align-items: center;
  715. font-weight: 500;
  716. font-size: 15px;
  717. color: #000;
  718. height: 54px;
  719. img {
  720. width: 30px;
  721. height: 30px;
  722. border-radius: 50%;
  723. margin-right: 10px;
  724. }
  725. }
  726. .giveaway {
  727. position: relative;
  728. overflow: hidden;
  729. width: 375px;
  730. height: 500px;
  731. border-radius: 20px;
  732. background-color: #fff;
  733. box-shadow: 0px 2px 20px rgba(0, 0, 0, 0.1);
  734. &.bg {
  735. background: linear-gradient(17.98deg, #3438ff 3.69%, #8b56fc 74.32%);
  736. }
  737. &.custom {
  738. background: unset;
  739. height: auto !important;
  740. }
  741. &.auto-height {
  742. height: auto;
  743. }
  744. .lottery {
  745. position: absolute;
  746. top: 0;
  747. right: 0;
  748. width: 110px;
  749. height: 94px;
  750. }
  751. .head {
  752. display: flex;
  753. height: 50px;
  754. align-items: center;
  755. img {
  756. width: 20px;
  757. height: 20px;
  758. border-radius: 50%;
  759. margin: 0 10px 0 15px;
  760. border: solid 2px #fff;
  761. }
  762. span {
  763. color: #fff;
  764. font-size: 13px;
  765. font-weight: 700;
  766. line-height: 16px;
  767. letter-spacing: 0.005em;
  768. }
  769. }
  770. .price {
  771. text-align: center;
  772. .usdt {
  773. margin: 10px 0;
  774. color: #ffffff;
  775. font-weight: bold;
  776. font-size: 16px;
  777. line-height: 20px;
  778. text-align: center;
  779. letter-spacing: 0.3px;
  780. }
  781. .money {
  782. display: flex;
  783. align-items: center;
  784. justify-content: center;
  785. img {
  786. width: 46px;
  787. height: 46px;
  788. margin-right: 15px;
  789. border-radius: 50%;
  790. border: solid 3px #fff;
  791. }
  792. span {
  793. color: #fff;
  794. font-size: 60px;
  795. font-weight: 800;
  796. line-height: 76px;
  797. }
  798. }
  799. }
  800. .time {
  801. display: flex;
  802. height: 46px;
  803. color: #ffcc4d;
  804. align-items: center;
  805. justify-content: center;
  806. font-weight: bold;
  807. font-size: 26px;
  808. line-height: 33px;
  809. text-align: center;
  810. background: rgba($color: #000000, $alpha: 0.15);
  811. .img {
  812. width: 26px;
  813. margin-right: 10px;
  814. }
  815. }
  816. .box {
  817. margin: auto;
  818. width: 200px;
  819. height: 200px;
  820. margin-top: 27px;
  821. img {
  822. width: 100%;
  823. height: 100%;
  824. }
  825. }
  826. }
  827. .desc {
  828. width: 520px;
  829. .title {
  830. color: #2c2c2c;
  831. font-size: 36px;
  832. line-height: 40px;
  833. font-weight: 900;
  834. margin-top: 90px;
  835. margin-bottom: 20px;
  836. }
  837. .issue {
  838. font-size: 15px;
  839. color: #a4a4a4;
  840. }
  841. .button {
  842. cursor: pointer;
  843. height: 64px;
  844. margin-top: 30px;
  845. }
  846. }
  847. }
  848. }
  849. }
  850. .small {
  851. width: 100%;
  852. height: 100%;
  853. position: relative;
  854. background-color: #fff;
  855. &.bg {
  856. background: linear-gradient(17.98deg, #3438ff 3.69%, #8b56fc 74.32%);
  857. }
  858. &.custom {
  859. background: #111214 !important;
  860. }
  861. .lottery {
  862. position: absolute;
  863. top: 0;
  864. right: 0;
  865. width: 110px;
  866. height: 94px;
  867. }
  868. .luck-list {
  869. height: calc(100% - 430px);
  870. }
  871. .head {
  872. display: flex;
  873. height: 50px;
  874. align-items: center;
  875. img {
  876. width: 20px;
  877. height: 20px;
  878. border-radius: 50%;
  879. margin: 0 10px 0 15px;
  880. border: solid 2px #fff;
  881. }
  882. span {
  883. color: #fff;
  884. font-size: 13px;
  885. font-weight: 700;
  886. line-height: 16px;
  887. letter-spacing: 0.005em;
  888. }
  889. }
  890. .price {
  891. text-align: center;
  892. .usdt {
  893. margin: 10px 0;
  894. color: #ffffff;
  895. font-weight: bold;
  896. font-size: 16px;
  897. line-height: 20px;
  898. text-align: center;
  899. letter-spacing: 0.3px;
  900. }
  901. .money {
  902. display: flex;
  903. align-items: center;
  904. justify-content: center;
  905. img {
  906. width: 46px;
  907. height: 46px;
  908. margin-right: 15px;
  909. border-radius: 50%;
  910. border: solid 3px #fff;
  911. }
  912. span {
  913. color: #fff;
  914. font-size: 60px;
  915. font-weight: 800;
  916. line-height: 76px;
  917. }
  918. }
  919. }
  920. .time {
  921. display: flex;
  922. height: 46px;
  923. color: #ffcc4d;
  924. align-items: center;
  925. justify-content: center;
  926. font-weight: bold;
  927. font-size: 26px;
  928. line-height: 33px;
  929. text-align: center;
  930. background: rgba($color: #000000, $alpha: 0.15);
  931. .img {
  932. width: 26px;
  933. margin-right: 10px;
  934. }
  935. }
  936. .box {
  937. margin: auto;
  938. width: 200px;
  939. height: 200px;
  940. margin-top: 27px;
  941. img {
  942. width: 100%;
  943. height: 100%;
  944. }
  945. }
  946. .area-cp-link {
  947. position: absolute;
  948. bottom: 0;
  949. background: #fff;
  950. overflow: hidden;
  951. width: 100%;
  952. flex-wrap: wrap;
  953. height: 238px;
  954. box-shadow: 0px -4px 10px rgba(0, 0, 0, 0.1);
  955. border-top-left-radius: 10px;
  956. border-top-right-radius: 10px;
  957. .area-list {
  958. clear: both;
  959. margin: 15px;
  960. .item {
  961. clear: both;
  962. overflow: hidden;
  963. margin: 7px 0;
  964. font-size: 16px;
  965. font-weight: 500;
  966. .icon {
  967. float: left;
  968. margin-right: 8px;
  969. margin-top: -2px;
  970. }
  971. .font {
  972. float: left;
  973. margin-right: 8px;
  974. }
  975. .pc {
  976. float: left;
  977. margin-top: -2px;
  978. }
  979. }
  980. }
  981. .area-content {
  982. margin: 0 15px;
  983. color: #4b4b4b;
  984. padding: 7px 10px;
  985. font-size: 13px;
  986. border-radius: 5px;
  987. background: #f4f4f4;
  988. word-break: break-all;
  989. }
  990. .area-btn {
  991. flex: 1;
  992. display: flex;
  993. justify-content: center;
  994. .btn {
  995. margin: 15px 15px 0 15px;
  996. display: inline-block;
  997. width: 100%;
  998. height: 47px;
  999. font-size: 18px;
  1000. line-height: 34px;
  1001. color: #ffffff;
  1002. border-radius: 100px;
  1003. background: #389aff;
  1004. }
  1005. }
  1006. }
  1007. }
  1008. .layer {
  1009. position: fixed;
  1010. width: 100%;
  1011. height: 100%;
  1012. top: 0;
  1013. left: 0;
  1014. background: rgba(0, 0, 0, 0.5);
  1015. .layer-box {
  1016. width: 300px;
  1017. height: 170px;
  1018. background: #ffffff;
  1019. border-radius: 11px;
  1020. opacity: 1;
  1021. position: absolute;
  1022. top: 250px;
  1023. left: 50%;
  1024. margin-left: -150px;
  1025. .layer-txt {
  1026. margin: 30px 0;
  1027. width: 100%;
  1028. padding: 0 27px;
  1029. font-weight: 600;
  1030. font-size: 18px;
  1031. text-align: center;
  1032. }
  1033. .layer-btn {
  1034. width: 190px;
  1035. height: 40px;
  1036. background: #389aff;
  1037. border-radius: 100px;
  1038. margin: 0 auto;
  1039. text-align: center;
  1040. line-height: 40px;
  1041. color: #fff;
  1042. font-weight: 600;
  1043. font-size: 18px;
  1044. }
  1045. }
  1046. }
  1047. .luck-list {
  1048. flex: 1;
  1049. width: 100%;
  1050. height: 310px;
  1051. overflow-y: auto;
  1052. .luck-item {
  1053. display: flex;
  1054. padding: 12px 0;
  1055. margin: 0 16px;
  1056. border-bottom: 1px solid #f2f2f2;
  1057. justify-content: space-between;
  1058. position: relative;
  1059. .header {
  1060. border-radius: 50%;
  1061. }
  1062. .luck-king {
  1063. position: absolute;
  1064. top: 36px;
  1065. right: 0px;
  1066. display: flex;
  1067. align-items: center;
  1068. img {
  1069. width: 22px;
  1070. height: 19px;
  1071. margin: 0;
  1072. }
  1073. span {
  1074. font-weight: 500;
  1075. font-size: 12px;
  1076. line-height: 14px;
  1077. letter-spacing: 0.3px;
  1078. color: #f5b945;
  1079. }
  1080. }
  1081. .userLogo {
  1082. position: relative;
  1083. width: 42px;
  1084. height: 42px;
  1085. margin-right: 12px;
  1086. .medal {
  1087. position: absolute;
  1088. right: -5px;
  1089. bottom: -5px;
  1090. width: 18px;
  1091. height: 18px;
  1092. }
  1093. img {
  1094. width: 100%;
  1095. height: 100%;
  1096. }
  1097. }
  1098. .luck-content {
  1099. flex: auto;
  1100. .luck-title {
  1101. font-weight: 500;
  1102. font-size: 16px;
  1103. letter-spacing: 0.3px;
  1104. color: #444444;
  1105. }
  1106. .luck-time {
  1107. font-weight: 400;
  1108. font-size: 12px;
  1109. line-height: 14px;
  1110. color: #9b9b9b;
  1111. }
  1112. }
  1113. .luck-money {
  1114. display: flex;
  1115. height: 17px;
  1116. align-items: center;
  1117. img {
  1118. width: 14px;
  1119. height: 14px;
  1120. margin-right: 6px;
  1121. }
  1122. .luck-money-txt {
  1123. font-weight: 500;
  1124. font-size: 14px;
  1125. /* identical to box height */
  1126. text-align: right;
  1127. letter-spacing: 0.3px;
  1128. color: #444444;
  1129. }
  1130. }
  1131. .luck-custom-prize {
  1132. font-weight: 500;
  1133. font-size: 14px;
  1134. letter-spacing: 0.3px;
  1135. color: #f5b945;
  1136. }
  1137. }
  1138. .luck-item:last-child {
  1139. border: 0;
  1140. }
  1141. }
  1142. .succTop {
  1143. display: flex;
  1144. align-items: center;
  1145. flex-direction: column;
  1146. justify-content: center;
  1147. height: 150px;
  1148. margin-bottom: 13px;
  1149. background: #7d52fd;
  1150. border-radius: 0 586px 586px/0 0 104px 104px;
  1151. .img {
  1152. height: 62px;
  1153. }
  1154. .expire {
  1155. color: #ffffff;
  1156. font-size: 22px;
  1157. font-weight: 800;
  1158. line-height: 36px;
  1159. margin-top: 15px;
  1160. text-align: center;
  1161. }
  1162. .tips {
  1163. color: #ffffff;
  1164. font-size: 22px;
  1165. font-weight: 800;
  1166. line-height: 26px;
  1167. margin-top: 15px;
  1168. }
  1169. .win {
  1170. font-size: 21px;
  1171. font-weight: 800;
  1172. color: #fff;
  1173. }
  1174. .win-money {
  1175. display: flex;
  1176. margin-top: -10px;
  1177. align-items: center;
  1178. justify-content: center;
  1179. img {
  1180. width: 44px;
  1181. height: 44px;
  1182. margin-right: 15px;
  1183. border-radius: 50%;
  1184. border: solid 3px #fff;
  1185. }
  1186. span {
  1187. color: #fff;
  1188. font-size: 60px;
  1189. font-weight: 800;
  1190. line-height: 76px;
  1191. }
  1192. }
  1193. }
  1194. .succTitle {
  1195. display: flex;
  1196. padding: 5px 0;
  1197. justify-content: space-between;
  1198. box-shadow: inset 0px -1px 0px #f2f2f2;
  1199. span {
  1200. margin: 0 16px;
  1201. font-size: 12px;
  1202. color: #b0b0b0;
  1203. &:last-child {
  1204. text-align: right;
  1205. }
  1206. }
  1207. }
  1208. .customImg {
  1209. width: 100%;
  1210. min-height: 373px;
  1211. }
  1212. .customBottom {
  1213. width: 100%;
  1214. background: #111214;
  1215. padding: 10px 16px;
  1216. font-weight: 500;
  1217. font-size: 12px;
  1218. line-height: 14px;
  1219. letter-spacing: 0.3px;
  1220. color: #838383;
  1221. line-height: 20px;
  1222. .theme {
  1223. display: flex;
  1224. height: 20px;
  1225. align-items: center;
  1226. justify-content: flex-start;
  1227. .icon {
  1228. width: 12px;
  1229. }
  1230. .time2 {
  1231. margin: 0 4px;
  1232. color: #1d9bf0;
  1233. }
  1234. }
  1235. .winner-info {
  1236. display: flex;
  1237. height: 20px;
  1238. align-items: center;
  1239. justify-content: flex-start;
  1240. .count {
  1241. color: #1d9bf0;
  1242. margin-right: 4px;
  1243. }
  1244. .prize-name {
  1245. color: #1d9bf0;
  1246. margin-left: 4px;
  1247. }
  1248. }
  1249. }
  1250. </style>