luckdraw.vue 31 KB

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