luckdraw.vue 31 KB

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