luckdraw.vue 31 KB

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