luckdraw.vue 31 KB

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