luckdraw.vue 32 KB

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