luckdraw.vue 32 KB

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