index.vue 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480
  1. <template>
  2. <div style="width: 100%; height: 100%;">
  3. <div class="content" :style="{ 'background': `#F5FAFF` }" v-show="show_home" v-if="detail">
  4. <div class="logo">
  5. <img src="/img/icon-logo.png" alt />
  6. </div>
  7. <!-- 未开始 -->
  8. <div class="not-open" v-show="status == 'not-open'">
  9. <img src="/subject/001.gif">
  10. </div>
  11. <!-- 红包打开 -->
  12. <div class="redPacket"
  13. :class="{ redPacket2: status != 'open', key_packet: status == 'open' }"
  14. v-if="status != 'nothing'"
  15. v-show="status != 'not-open'">
  16. <!-- 内容 -->
  17. <div class="head">
  18. <div class="head-title">
  19. <img :src="detail.postBizData.postUserInfo.avatarUrl" alt />
  20. <span>{{ detail.postBizData.postUserInfo.nickName }}</span>
  21. </div>
  22. <!-- <div class="head-txt" v-if="status == 'open' || status == 'opened'">Awesome! You Will Get</div> -->
  23. <!-- <div class="head-area" v-else-if="status == 'opened'">opened!</div> -->
  24. <!-- 红包被领完了 -->
  25. <div class="head-area" v-if="status == 'nothing'">
  26. <div class="txt">Better luck next time!</div>
  27. </div>
  28. <!-- 过期 -->
  29. <div class="head-area expire" v-if="status == 'expire'">
  30. <div class="txt">This Giveaways</div>
  31. <div class="titme">expired on {{ formatTime(detail.postBizData.endTimestamp, 'MM-DD') }}</div>
  32. </div>
  33. <!-- 非chrome浏览器 -->
  34. <div class="head-area expire" v-if="status == 'no-chrome'">
  35. <div class="txt">Get Giveaways</div>
  36. <div class="titme">with chrome</div>
  37. </div>
  38. <!-- 领取成功 -->
  39. <div class="head-area head-money" v-if="status == 'open' || status == 'opened'">
  40. <div class="txt">AWESOME! YOU Will GET</div>
  41. <div class="head-money-area">
  42. <img :src="currencyIconPath" alt />
  43. <span class="money-txt" :style="{ fontSize: amount_font_size + 'px' }">{{ receiveAmount }}</span>
  44. </div>
  45. </div>
  46. </div>
  47. <!-- 领取列表 -->
  48. <div class="luck-list-title">
  49. <div>{{ detail.postBizData.receiveCount || 0 }}/{{ detail.postBizData.totalCount || 0 }} Winners
  50. </div>
  51. <div> {{ detail.postBizData.receiveAmountValue }} / {{
  52. detail.postBizData.amountValue || ''
  53. }} {{ detail.postBizData.currencySymbol || '' }}</div>
  54. </div>
  55. <div class="luck-list" @scroll="handleScroll($event)">
  56. <div class="luck-item" v-for="item, i in luck_list" v-bind:key="i">
  57. <img v-if="item.simpleUserInfoVO.avatarUrl" :src="item.simpleUserInfoVO.avatarUrl" alt />
  58. <img v-else src="/svg/icon-twitter.svg" alt />
  59. <div class="luck-content">
  60. <div class="luck-title">{{ item.simpleUserInfoVO.nickName || 'Twitter User' }}</div>
  61. <div class="luck-time">{{ formatTime(item.receiveTimestamp, 'MM-DD HH:mm') }}</div>
  62. </div>
  63. <div class="luck-money">
  64. <img :src="item.currencyIconPath" alt />
  65. <div class="luck-money-txt">{{ item.amountValue || 0 }}</div>
  66. </div>
  67. <div class="luck-king" v-if="item.maxAmount">
  68. <img src="/svg/icon-king-hat.svg" alt />
  69. <span>Luckiest Draw</span>
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. <div class="redBag" v-else>
  75. <img src="/subject/001-card.png" alt="">
  76. <img class="open-gif" src="/subject/001.gif" />
  77. <div class="title" v-if="detail.postBizData.postUserInfo">
  78. <img :src="detail.postBizData.postUserInfo.avatarUrl" alt />
  79. <span>{{ detail.postBizData.postUserInfo.nickName || 'FutureDoctor' }}</span>
  80. </div>
  81. <div class="money-area">
  82. <div class="txt">{{ detail.postBizData.currencySymbol }} GIVEAWAY</div>
  83. <div class="coin">
  84. <img :src="detail.postBizData.currencyIconPath" alt />
  85. <font-amount :amount="detail.postBizData.amountValue"></font-amount>
  86. </div>
  87. <div class="people">{{ detail.postBizData.totalCount }} WINNERS TO SHARE</div>
  88. </div>
  89. </div>
  90. <!-- 安装 -->
  91. <div class="install" v-if="status == 'nothing' || status == 'open' || status == 'opened'"
  92. :class="{ key_install: status == 'open' }">
  93. <div v-if="status == 'nothing'">
  94. <div class="title">Install Denet to Draw</div>
  95. </div>
  96. <div v-else>
  97. <div class="title">Withdraw to Wallet</div>
  98. <div class="validity">
  99. <template v-if="validity_state">
  100. <span style="color:#FFA620;">Remaining valid time </span>
  101. <span style="color: #FFA620;">{{ validity }}</span>
  102. </template>
  103. <template v-else>
  104. <span style="color: #FFA620;">Giveaways Validity</span>
  105. </template>
  106. </div>
  107. </div>
  108. <div class="flow">
  109. <div class="line"></div>
  110. <div class="area_num">
  111. <div class="num">1</div>
  112. <span>Install DeNet</span>
  113. </div>
  114. <div class="tip">Used to verify tasks and get rewards</div>
  115. <div class="install_btn" @click="installExtension">Install</div>
  116. <div class="area_num">
  117. <div class="num">2</div>
  118. <span v-if="status == 'nothing'">Complete Tasks</span>
  119. <span v-else>Complete Tasks by {{ detail.postBizData.postUserInfo.nickName }}</span>
  120. </div>
  121. <div class="tip">Complete like, retweet and follow in a simple way</div>
  122. </div>
  123. </div>
  124. <!-- 过期 -->
  125. <div class="install install-error" v-if="status == 'expire'">
  126. <div class="title">Install DeNet</div>
  127. <div class="title">Don't miss the next Giveaway</div>
  128. <div class="tip">Used to verify tasks and get rewards</div>
  129. <div class="install_btn" @click="installExtension">Install</div>
  130. </div>
  131. <!-- 非chrome 浏览器状态 -->
  132. <div class="install install-error" v-if="status == 'no-chrome'">
  133. <div class="title">Open Giveaways</div>
  134. <div class="title">with chrome</div>
  135. <div class="tip">Only supports getting Giveaways through chrome</div>
  136. <div class="install_chrome" @click="clickOpenChrome()">
  137. <img src="/svg/icon-chrome.svg" alt />
  138. Install Chrome
  139. </div>
  140. </div>
  141. <div v-if="status == 'error'"></div>
  142. </div>
  143. <div v-if="show_moblie" class="moblie">
  144. <div class="head-area">
  145. <div class="gift">
  146. <img :src=" require('../static/subject/gift.svg') " />
  147. </div>
  148. <div class="txt">
  149. <div>Complete tasks</div>
  150. <div>to Draw Prizes</div>
  151. </div>
  152. </div>
  153. <!-- 领取列表 -->
  154. <div class="luck-list" @scroll="handleScroll($event)">
  155. <div class="luck-item" v-for="item, i in luck_list" v-bind:key="i">
  156. <img v-if="item.simpleUserInfoVO.avatarUrl" :src="item.simpleUserInfoVO.avatarUrl" alt />
  157. <img v-else src="/svg/icon-twitter.svg" alt />
  158. <div class="luck-content">
  159. <div class="luck-title">{{ item.simpleUserInfoVO.nickName || 'Twitter User' }}</div>
  160. <div class="luck-time">{{ formatTime(item.receiveTimestamp) }}</div>
  161. </div>
  162. <div class="luck-money">
  163. <img :src="item.currencyIconPath" alt />
  164. <div class="luck-money-txt">{{ item.amountValue || 0 }}</div>
  165. </div>
  166. <div class="luck-king" v-if="item.maxAmount">
  167. <img src="/svg/icon-king-hat.svg" alt />
  168. <span>Luckiest Draw</span>
  169. </div>
  170. </div>
  171. </div>
  172. <div class="area-cp-link">
  173. <div class="area-list">
  174. <div class="item">
  175. <div class="icon"><img :src=" require('../static/subject/01.svg') " /></div>
  176. <div class="font">Complete the tasks on tweet</div>
  177. </div>
  178. <div class="item">
  179. <div class="icon"><img :src=" require('../static/subject/02.svg') " /></div>
  180. <div class="font">Open link on PC to draw</div>
  181. <div class="pc"><img :src=" require('../static/subject/pc.svg') " /></div>
  182. </div>
  183. </div>
  184. <div class="area-content">
  185. {{ cp_link }}
  186. </div>
  187. <div class="area-btn">
  188. <div class="btn" :data-clipboard-text="cp_link">Copy Link</div>
  189. </div>
  190. </div>
  191. <div class="layer" v-show="layer_show">
  192. <div class="layer-box">
  193. <div class="layer-txt">Unable to copy, please enter the link manually</div>
  194. <div class="layer-btn" @click="layer_show = false">Done</div>
  195. </div>
  196. </div>
  197. </div>
  198. </div>
  199. </template>
  200. <script>
  201. import axios from 'axios';
  202. import Cookies from 'js-cookie'
  203. import { isBrowser } from '../utils/help.js'
  204. import Report from "../log-center/log"
  205. import { Toast } from 'vant';
  206. import FontAmount from '../components/FontAmount.vue'
  207. var moment = require('moment');
  208. var ClipboardJS = require('clipboard')
  209. const api = {
  210. prod: 'https://api.denetme.net',
  211. pre: 'https://preapi.denetme.net',
  212. test: 'https://testapi.denetme.net'
  213. }
  214. const page = {
  215. prod: "https://h5.denetme.net",
  216. pre: "https://preh5.denetme.net",
  217. test: 'https://testh5.denetme.net'
  218. }
  219. const jumpUrl = page[process.env.NUXT_ENV.MODE] + '/'
  220. const baseURL = api[process.env.NUXT_ENV.MODE]
  221. const appType = 1;
  222. export default {
  223. name: "index",
  224. data() {
  225. return {
  226. cp_link: '',
  227. appVersionCode: 3,
  228. mid: '',
  229. show_moblie: false,
  230. show_home: false,
  231. layer_show: false,
  232. amount_font_size:46,
  233. validity: '',
  234. receiveAmount: 0,
  235. validity_state: true,
  236. detail: {
  237. postId: '',
  238. postBizData: {
  239. imagePath: '',
  240. postUserInfo: {
  241. }
  242. }
  243. },
  244. currencyIconPath: '',
  245. title: 'DeNet Giveaway',
  246. twitterTitle: 'DeNet: An Easy Web3 Tool For GIVEAWAY / AIRDROP',
  247. jumpUrl: jumpUrl,
  248. status: '',
  249. page_index: 1,
  250. page_size: 20,
  251. luck_list: [],
  252. luck_list_end: false,
  253. config: {
  254. extensionsInstallChannel: 'officeDownload', // chromeAppStore
  255. extensionsInstallUrl: ''
  256. }
  257. }
  258. },
  259. components: {
  260. FontAmount,
  261. },
  262. head() {
  263. return {
  264. type: '',
  265. title: this.title,
  266. appVersionCode: 3,
  267. meta: [
  268. {
  269. name: 'twitter:card',
  270. content: 'summary_large_image'
  271. },
  272. {
  273. name: 'twitter:url',
  274. content: this.jumpUrl + this.detail.postId
  275. },
  276. {
  277. name: 'twitter:title',
  278. content: this.twitterTitle
  279. },
  280. {
  281. name: 'twitter:image',
  282. content: this.detail.postBizData.imagePath || ''
  283. }
  284. ]
  285. }
  286. },
  287. methods: {
  288. clickOpenChrome() {
  289. window.open('https://www.google.com/chrome')
  290. },
  291. isMobile() {
  292. let flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i);
  293. return flag;
  294. },
  295. installExtension() {
  296. let { extensionsInstallChannel, extensionsInstallUrl } = this.config;
  297. let url = extensionsInstallUrl;
  298. Report.reportLog({
  299. baseInfo: {
  300. appVersionCode: this.appVersionCode,
  301. mid: this.mid,
  302. pageSource: Report.pageSource.newUserLandingPage,
  303. appType,
  304. machineCode: this.mid
  305. },
  306. params: {
  307. eventData: {
  308. businessType: Report.businessType.buttonClick,
  309. objectType: Report.objectType.installButton
  310. }
  311. }
  312. })
  313. switch (extensionsInstallChannel) {
  314. case "officeDownload":
  315. location.href = url;
  316. this.$router.push({
  317. path: '/install'
  318. })
  319. break;
  320. case "chromeAppStore":
  321. window.open(extensionsInstallUrl)
  322. break;
  323. }
  324. },
  325. formatTime(time, _type = 'MM-DD HH:mm:ss') {
  326. return moment(time).format(_type)
  327. },
  328. guid() {
  329. return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
  330. var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
  331. return v.toString(16);
  332. });
  333. },
  334. handleScroll(e) {
  335. e = e.target
  336. if (this.luck_list_end) {
  337. return
  338. }
  339. if ((e.clientHeight + e.scrollTop) / e.scrollHeight > .8) {
  340. this.luck_list_end = false
  341. this.page_index++
  342. this.getReceivedList()
  343. }
  344. },
  345. getFontSize(amount) {
  346. let _num = parseInt(360 / amount.length);
  347. this.amount_font_size = _num < 46 ? _num : 46;
  348. },
  349. setCookieMid() {
  350. let _cookie_mid_arr = Cookies.get('mid') || []
  351. if (_cookie_mid_arr.length > 0) {
  352. this.mid = JSON.parse(_cookie_mid_arr)[0].mid
  353. } else {
  354. this.mid = this.guid()
  355. Cookies.set('mid', JSON.stringify([{ mid: this.mid }]), { expires: 1000 })
  356. }
  357. },
  358. async getRedPacket() {
  359. this.currencyIconPath = this.detail.postBizData.currencyIconPath
  360. let { data } = await axios.post(`${baseURL}/denet/post/luckdrop/receiveLuckdrop`, {
  361. baseInfo: {
  362. appVersionCode: this.appVersionCode,
  363. mid: this.mid
  364. },
  365. params: {
  366. postId: this.detail.postId || ''
  367. }
  368. })
  369. this.show_home = true
  370. switch (data.code.toString()) {
  371. case '0':
  372. this.getDetail()
  373. if (data.data.receiveAmount == '0') {
  374. this.status = 'nothing'
  375. } else {
  376. if (data.data.newReceived) {
  377. this.status = 'not-open'
  378. setTimeout(() => {
  379. this.status = 'open'
  380. }, 3000)
  381. this.receiveAmount = data.data.receiveAmount
  382. } else {
  383. this.status = 'opened'
  384. }
  385. }
  386. this.getValidity(data.data.endTimestamp)
  387. this.receiveAmount = data.data.receiveAmount
  388. this.getFontSize(this.receiveAmount)
  389. break;
  390. case '2003':
  391. // this.status = 'expire'
  392. this.getDetail()
  393. this.status = 'nothing'
  394. break
  395. // 红包被领完了
  396. case '2008':
  397. this.getDetail()
  398. this.status = 'nothing'
  399. break
  400. case '2029':
  401. // 推文未发布
  402. this.status = 'error'
  403. break
  404. default:
  405. console.log('getRedPacket', data)
  406. // this.show_home = false
  407. this.getDetail()
  408. this.status = 'nothing'
  409. break;
  410. }
  411. // 领取列表分页
  412. this.getReceivedList()
  413. },
  414. async getReceivedList() {
  415. let { data } = await axios.post(`${baseURL}/denet/post/luckdrop/getReceivedList`, {
  416. baseInfo: {
  417. appVersionCode: this.appVersionCode,
  418. mid: this.mid
  419. },
  420. params: {
  421. pageNum: this.page_index,
  422. pageSize: this.page_size,
  423. postId: this.detail.postId || ''
  424. }
  425. })
  426. if (data.code == 0) {
  427. if (data.data.length > 0) {
  428. this.luck_list = this.luck_list.concat(data.data)
  429. this.luck_list_end = false
  430. } else {
  431. this.luck_list_end = true
  432. }
  433. } else {
  434. console.log('getReceivedList', data)
  435. }
  436. },
  437. getValidity(end_time) {
  438. let _d1, _d2, _d3, _h, _m, _s
  439. let timer = setInterval(() => {
  440. let _time = new Date().getTime()
  441. _d3 = end_time - _time
  442. if (_d3 > 0) {
  443. _d1 = moment(end_time)
  444. _d2 = moment(_time)
  445. _h = moment.duration(_d1.diff(_d2)).hours()
  446. _m = moment.duration(_d1.diff(_d2)).minutes()
  447. _s = moment.duration(_d1.diff(_d2)).seconds()
  448. if (_h < 10) {
  449. _h = '0' + _h
  450. }
  451. if (_m < 10) {
  452. _m = '0' + _m
  453. }
  454. if (_s < 10) {
  455. _s = '0' + _s
  456. }
  457. this.validity = `${_h}:${_m}:${_s}`
  458. } else {
  459. clearInterval(timer)
  460. }
  461. }, 1000)
  462. },
  463. setPickupInfo() {
  464. let pickupInfo = {
  465. srcContentId: this.detail.srcContentId,
  466. postNickName: this.detail.postBizData.postUserInfo.nickName
  467. };
  468. Cookies.set('pickup_info', JSON.stringify(pickupInfo), { expires: 100 });
  469. },
  470. async getDetail() {
  471. let { data } = await axios.post(`${baseURL}/denet/post/getDetail`, {
  472. baseInfo: {
  473. appVersionCode: this.appVersionCode,
  474. mid: this.mid
  475. },
  476. params: {
  477. postId: this.detail.postId
  478. }
  479. })
  480. if (data.code == 0) {
  481. this.detail.postBizData = JSON.parse(data.data.postBizData)
  482. }
  483. },
  484. async getConfig() {
  485. let { data } = await axios.post(`${baseURL}/denet/base/config/getFrontConfig`, {
  486. baseInfo: {
  487. appVersionCode: this.appVersionCode,
  488. mid: this.mid
  489. },
  490. params: {
  491. }
  492. })
  493. if (data.code == 0) {
  494. this.config = data.data;
  495. }
  496. },
  497. },
  498. async asyncData(params) {
  499. let { route } = params;
  500. let { data } = await axios.post(`${baseURL}/denet/post/getDetail`, {
  501. baseInfo: {
  502. mid: function () {
  503. return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
  504. var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
  505. return v.toString(16);
  506. });
  507. }()
  508. },
  509. params: {
  510. postId: route.params.id || ''
  511. }
  512. })
  513. if (data.code == 0) {
  514. if (data.data && data.data.postBizData && typeof data.data.postBizData == 'string') {
  515. data.data.postBizData = JSON.parse(data.data.postBizData)
  516. }
  517. if(data.data.postBizData === null) {
  518. data.data.postBizData = {
  519. postUserInfo: {
  520. }
  521. }
  522. }
  523. return {
  524. detail: data.data,
  525. }
  526. }
  527. },
  528. mounted() {
  529. this.getConfig()
  530. if (!this.detail.postId) {
  531. return
  532. }
  533. console.log(this.detail)
  534. //改变font-size
  535. // (function (doc, win) {
  536. // var docEI = doc.documentElement,
  537. // resizeEvt = 'orientationchange' in window ? 'orientataionchange' : 'resize',
  538. // recalc = function () {
  539. // var clientWidth = docEI.clientWidth;
  540. // if (!clientWidth) return;
  541. // //100是字体大小,1510是开发时浏览器窗口的宽度,等比计算
  542. // docEI.style.fontSize = 10 * (clientWidth / 1510) + 'px';
  543. // }
  544. // if (!doc.addEventListener) return;
  545. // win.addEventListener(resizeEvt, recalc, false);
  546. // doc.addEventListener('DOMContentLoaded', recalc, false);
  547. // })(document, window);
  548. document.documentElement.style.fontSize = '62.5%'
  549. if (this.isMobile()) {
  550. this.show_moblie = true
  551. this.cp_link = window.location.href
  552. // 复制链接
  553. var clipboard = new ClipboardJS('.btn');
  554. clipboard.on('success', function (e) {
  555. Toast('copy success');
  556. console.info('Action:', e.action);
  557. console.info('Text:', e.text);
  558. console.info('Trigger:', e.trigger);
  559. e.clearSelection();
  560. });
  561. clipboard.on('error', function (e) {
  562. this.layer_show = true
  563. console.error('Action:', e.action);
  564. console.error('Trigger:', e.trigger);
  565. });
  566. // 领取列表分页
  567. this.getReceivedList()
  568. } else if (isBrowser() == 'chrome') {
  569. // 领取任务红包
  570. this.setCookieMid()
  571. // 是否被领完
  572. if(this.detail.postBizData.receiveCount < this.detail.postBizData.totalCount){
  573. this.getRedPacket()
  574. }else{
  575. this.show_home = true
  576. this.status = 'nothing'
  577. }
  578. this.setPickupInfo()
  579. Report.reportLog({
  580. baseInfo: {
  581. appVersionCode: this.appVersionCode,
  582. mid: this.mid,
  583. pageSource: Report.pageSource.newUserLandingPage,
  584. appType,
  585. machineCode: this.mid
  586. },
  587. params: {
  588. eventData: {
  589. businessType: Report.businessType.pageView,
  590. }
  591. }
  592. });
  593. } else {
  594. this.show_home = true
  595. this.status = 'no-chrome'
  596. }
  597. }
  598. }
  599. </script>
  600. <style lang="scss" >
  601. html,
  602. body,
  603. #__nuxt,
  604. #__layout {
  605. width: 100%;
  606. height: 100%;
  607. padding: 0;
  608. margin: 0;
  609. }
  610. .moblie {
  611. display: flex;
  612. flex-wrap: wrap;
  613. height: 100%;
  614. align-content: flex-start;
  615. flex-direction: column;
  616. .layer {
  617. position: fixed;
  618. width: 100%;
  619. height: 100%;
  620. top: 0;
  621. left: 0;
  622. background: rgba(0, 0, 0, .5);
  623. .layer-box {
  624. width: 30rem;
  625. height: 17rem;
  626. background: #FFFFFF;
  627. border-radius: 11px;
  628. opacity: 1;
  629. position: absolute;
  630. top: 25rem;
  631. left: 50%;
  632. margin-left: -15rem;
  633. .layer-txt {
  634. margin: 3rem 0;
  635. width: 100%;
  636. padding: 0 2.7rem;
  637. font-weight: 600;
  638. font-size: 1.8rem;
  639. text-align: center;
  640. }
  641. .layer-btn {
  642. width: 19rem;
  643. height: 4rem;
  644. background: #389AFF;
  645. border-radius: 100px;
  646. margin: 0 auto;
  647. text-align: center;
  648. line-height: 4rem;
  649. color: #fff;
  650. font-weight: 600;
  651. font-size: 1.8rem;
  652. }
  653. }
  654. }
  655. .head-area {
  656. width: 100%;
  657. height: 11rem;
  658. text-align: center;
  659. letter-spacing: 0.3px;
  660. font-size: 2rem;
  661. text-align: center;
  662. color: #fff;
  663. background: #389AFF;
  664. border-radius: 0 586px 586px/0 0 104px 104px;
  665. display: flex;
  666. align-items: center;
  667. justify-content: center;
  668. .gift {
  669. margin-right: 1.4rem;
  670. img {
  671. width: 5.2rem;
  672. }
  673. }
  674. .txt {
  675. font-size: 1.8rem;
  676. text-align: left;
  677. }
  678. }
  679. .luck-list-title {
  680. /* margin-top: 47px;*/
  681. margin: 0 16px;
  682. padding: 14px 0 11px 0;
  683. background: #fff;
  684. display: flex;
  685. justify-content: space-between;
  686. color: #B0B0B0;
  687. border-bottom: 1px solid #D1D1D1;
  688. }
  689. .luck-list {
  690. flex: 1;
  691. width: 100%;
  692. overflow-y: auto;
  693. .luck-item {
  694. display: flex;
  695. padding: 12px 0;
  696. margin: 0 16px;
  697. border-bottom: 1px solid #F2F2F2;
  698. justify-content: space-between;
  699. position: relative;
  700. img:first-child {
  701. border-radius: 50%;
  702. }
  703. .luck-king {
  704. position: absolute;
  705. top: 36px;
  706. right: 0px;
  707. display: flex;
  708. align-items: center;
  709. img {
  710. width: 22px;
  711. height: 19px;
  712. margin: 0;
  713. }
  714. span {
  715. font-weight: 500;
  716. font-size: 12px;
  717. line-height: 14px;
  718. letter-spacing: 0.3px;
  719. color: #f5b945;
  720. }
  721. }
  722. img {
  723. width: 42px;
  724. height: 42px;
  725. margin-right: 12px;
  726. }
  727. .luck-content {
  728. flex: auto;
  729. .luck-title {
  730. font-weight: 500;
  731. font-size: 16px;
  732. letter-spacing: 0.3px;
  733. color: #444444;
  734. }
  735. .luck-time {
  736. font-weight: 400;
  737. font-size: 12px;
  738. line-height: 14px;
  739. color: #9b9b9b;
  740. }
  741. }
  742. .luck-money {
  743. display: flex;
  744. height: 17px;
  745. align-items: center;
  746. img {
  747. width: 14px;
  748. height: 14px;
  749. margin-right: 6px;
  750. }
  751. .luck-money-txt {
  752. font-weight: 500;
  753. font-size: 14px;
  754. /* identical to box height */
  755. text-align: right;
  756. letter-spacing: 0.3px;
  757. color: #444444;
  758. }
  759. }
  760. }
  761. .luck-item:last-child {
  762. border: 0;
  763. }
  764. }
  765. .area-cp-link {
  766. background: #fff;
  767. width: 100%;
  768. flex-wrap: wrap;
  769. height: 20rem;
  770. box-shadow: 0px -4px 10px rgba(0, 0, 0, 0.1);
  771. border-top-left-radius: 1rem;
  772. border-top-right-radius: 1rem;
  773. .area-list {
  774. width: 34.3rem;
  775. margin: 1.5rem auto;
  776. .item {
  777. clear: both;
  778. overflow: hidden;
  779. margin: 0.7rem 0;
  780. font-size: 1.6rem;
  781. font-weight: 500;
  782. .icon {
  783. float: left;
  784. margin-right: 0.8rem;
  785. }
  786. .font {
  787. float: left;
  788. margin-right: 0.8rem;
  789. }
  790. .pc {
  791. float: left;
  792. }
  793. }
  794. }
  795. .area-content {
  796. background: #F4F4F4;
  797. padding: 0.7rem 1rem;
  798. margin: 0 auto 1rem;
  799. width: 34.3rem;
  800. font-size: 1.3rem;
  801. border-radius: 0.5rem;
  802. word-break: break-all;
  803. }
  804. .area-btn {
  805. flex: 1;
  806. display: flex;
  807. justify-content: center;
  808. .btn {
  809. width: 34.3rem;
  810. height: 4rem;
  811. background: #389AFF;
  812. border-radius: 100px;
  813. font-size: 1.8rem;
  814. color: #FFFFFF;
  815. }
  816. }
  817. }
  818. }
  819. .content {
  820. width: 100%;
  821. height: 100%;
  822. background-size: 100%;
  823. background-repeat: no-repeat;
  824. position: relative;
  825. font-family: "SF Pro Display";
  826. font-style: normal;
  827. font-weight: 600;
  828. .not-open {
  829. display: flex;
  830. align-items: center;
  831. justify-content: center;
  832. width: 100%;
  833. height: 100%;
  834. img {
  835. width: 20rem;
  836. height: 20rem;
  837. }
  838. }
  839. .logo {
  840. position: absolute;
  841. left: 4rem;
  842. top: 1.5rem;
  843. img {
  844. width: 10.7rem;
  845. height: 3.4rem;
  846. }
  847. }
  848. .key_packet {
  849. animation: key_packet 3s;
  850. animation-delay: 0s;
  851. animation-fill-mode: forwards;
  852. }
  853. .redBag {
  854. display: flex;
  855. justify-content: flex-start;
  856. flex-direction: column;
  857. position: absolute;
  858. top: 14rem;
  859. left: 30.6rem;
  860. width: 37.5rem;
  861. height: 50rem;
  862. border-radius: 2rem;
  863. overflow-y: hidden;
  864. box-shadow: 0 0 5px #888888;
  865. background: #fff;
  866. .money-area {
  867. width: 100%;
  868. position: absolute;
  869. top: 65px;
  870. display: flex;
  871. flex-wrap: wrap;
  872. align-items: center;
  873. justify-content: center;
  874. .txt {
  875. font-weight: 800;
  876. font-size: 16px;
  877. text-align: center;
  878. letter-spacing: 0.3px;
  879. color: #FFFFFF;
  880. }
  881. .coin {
  882. text-align: center;
  883. margin-top: 6px;
  884. margin-bottom: 7px;
  885. display: flex;
  886. justify-content: center;
  887. align-items: center;
  888. width: 90%;
  889. img {
  890. width: 46px;
  891. height: 46px;
  892. border-radius: 50%;
  893. border: 3px solid #FFFFFF;
  894. }
  895. span {
  896. margin-left: 15px;
  897. font-weight: 800;
  898. font-size: 60px;
  899. line-height: 76px;
  900. color: #FFFFFF;
  901. }
  902. }
  903. .people {
  904. font-weight: 800;
  905. font-size: 13px;
  906. line-height: 16px;
  907. letter-spacing: 0.05em;
  908. text-align: center;
  909. color: #FFFFFF;
  910. }
  911. }
  912. .title {
  913. position: absolute;
  914. top: 15px;
  915. left: 15px;
  916. z-index: 3;
  917. display: flex;
  918. align-items: center;
  919. img {
  920. width: 24px;
  921. height: 24px;
  922. border: 2px solid #FFF;
  923. border-radius: 50%;
  924. }
  925. span {
  926. margin-left: 10px;
  927. font-weight: 600;
  928. font-size: 16px;
  929. letter-spacing: 0.3px;
  930. color: #fff;
  931. }
  932. }
  933. img {
  934. width: 100%;
  935. }
  936. .up {
  937. position: absolute;
  938. top: 0;
  939. z-index: 1;
  940. }
  941. .down {
  942. position: absolute;
  943. top: 253px;
  944. }
  945. .open {
  946. width: 335px;
  947. height: 50px;
  948. cursor: pointer;
  949. position: absolute;
  950. bottom: 28px;
  951. left: 50%;
  952. margin-left: -167.5px;
  953. z-index: 4;
  954. }
  955. .open-gif {
  956. width: 200px;
  957. height: 200px;
  958. text-align: center;
  959. position: absolute;
  960. bottom: 70px;
  961. left: 50%;
  962. margin-left: -100px;
  963. z-index: 3;
  964. }
  965. }
  966. .redPacket {
  967. display: flex;
  968. justify-content: flex-start;
  969. flex-direction: column;
  970. position: absolute;
  971. top: 9rem;
  972. left: 50%;
  973. width: 37.5rem;
  974. margin-left: -18rem;
  975. height: 65rem;
  976. border-radius: 2rem;
  977. // background: red;
  978. overflow-y: hidden;
  979. box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.1);
  980. background: #fff;
  981. .top {
  982. top: 0;
  983. position: absolute;
  984. width: 100%;
  985. z-index: 12;
  986. }
  987. .down {
  988. bottom: 0;
  989. position: absolute;
  990. height: 32.3rem;
  991. z-index: 11;
  992. }
  993. .head {
  994. position: relative;
  995. .head-title {
  996. position: absolute;
  997. top: 0;
  998. width: 100%;
  999. display: flex;
  1000. align-items: center;
  1001. justify-content: center;
  1002. height: 3.6rem;
  1003. background: rgba(255, 255, 255, .1);
  1004. img {
  1005. width: 1.8rem;
  1006. height: 1.8rem;
  1007. border-radius: 50%;
  1008. border: 1px solid #fff;
  1009. }
  1010. span {
  1011. margin-left: .8rem;
  1012. font-size: 1.2rem;
  1013. color: #fff;
  1014. }
  1015. }
  1016. .head-txt {
  1017. margin-top: 4.7rem;
  1018. font-size: 2rem;
  1019. text-align: center;
  1020. color: #fff;
  1021. }
  1022. .head-area {
  1023. height: 19rem;
  1024. text-align: center;
  1025. letter-spacing: 0.3px;
  1026. font-size: 2rem;
  1027. text-align: center;
  1028. color: #fff;
  1029. background: #389AFF;
  1030. border-radius: 0 586px 586px/0 0 164px 164px;
  1031. .txt {
  1032. padding-top: 8.5rem;
  1033. }
  1034. }
  1035. .head-money {
  1036. .txt {
  1037. padding-top: 6.8rem;
  1038. font-weight: 800;
  1039. font-size: 1.5rem;
  1040. text-align: center;
  1041. letter-spacing: 0.3px;
  1042. }
  1043. .head-money-area {
  1044. display: flex;
  1045. width: 100%;
  1046. justify-content: center;
  1047. align-items: center;
  1048. img {
  1049. width: 4rem;
  1050. height: 4rem;
  1051. border: 2px solid #FFFFFF;
  1052. border-radius: 100px;
  1053. }
  1054. span {
  1055. margin-left: 1.3rem;
  1056. font-size: 4.6rem;
  1057. word-break: break-all;
  1058. }
  1059. }
  1060. }
  1061. }
  1062. .luck-list-title {
  1063. /* margin-top: 47px;*/
  1064. margin: 0 16px;
  1065. padding: 14px 0 11px 0;
  1066. background: #fff;
  1067. display: flex;
  1068. font-weight: 500;
  1069. justify-content: space-between;
  1070. color: #B0B0B0;
  1071. border-bottom: 1px solid #F2F2F2;
  1072. }
  1073. .luck-list {
  1074. background: #fff;
  1075. overflow-y: auto;
  1076. .luck-item {
  1077. display: flex;
  1078. padding: 12px 0;
  1079. margin: 0 16px;
  1080. border-bottom: 1px solid #F2F2F2;
  1081. justify-content: space-between;
  1082. position: relative;
  1083. img:first-child {
  1084. border-radius: 50%;
  1085. }
  1086. .luck-king {
  1087. position: absolute;
  1088. top: 36px;
  1089. right: 0px;
  1090. display: flex;
  1091. align-items: center;
  1092. img {
  1093. width: 22px;
  1094. height: 19px;
  1095. margin: 0;
  1096. }
  1097. span {
  1098. font-weight: 500;
  1099. font-size: 12px;
  1100. line-height: 14px;
  1101. letter-spacing: 0.3px;
  1102. color: #f5b945;
  1103. }
  1104. }
  1105. img {
  1106. width: 42px;
  1107. height: 42px;
  1108. margin-right: 12px;
  1109. }
  1110. .luck-content {
  1111. flex: auto;
  1112. .luck-title {
  1113. font-weight: 500;
  1114. font-size: 16px;
  1115. letter-spacing: 0.3px;
  1116. color: #444444;
  1117. margin-bottom: 5px;
  1118. }
  1119. .luck-time {
  1120. font-weight: 400;
  1121. font-size: 12px;
  1122. line-height: 14px;
  1123. color: #B0B0B0;
  1124. }
  1125. }
  1126. .luck-money {
  1127. display: flex;
  1128. height: 17px;
  1129. align-items: center;
  1130. img {
  1131. width: 14px;
  1132. height: 14px;
  1133. margin-right: 6px;
  1134. }
  1135. .luck-money-txt {
  1136. font-weight: 500;
  1137. font-size: 14px;
  1138. /* identical to box height */
  1139. text-align: right;
  1140. letter-spacing: 0.3px;
  1141. color: #444444;
  1142. }
  1143. }
  1144. }
  1145. .luck-item:last-child {
  1146. border: 0;
  1147. }
  1148. }
  1149. .area {
  1150. position: absolute;
  1151. z-index: 112;
  1152. width: 100%;
  1153. .title {
  1154. z-index: 11;
  1155. margin-top: 8.5rem;
  1156. text-align: center;
  1157. img {
  1158. width: 3.6rem;
  1159. height: 3.6rem;
  1160. border: 2px solid #fff4db;
  1161. border-radius: 50%;
  1162. }
  1163. span {
  1164. letter-spacing: 0.3px;
  1165. font-size: 1.6rem;
  1166. color: #fff2d3;
  1167. }
  1168. }
  1169. .txt {
  1170. font-size: 4rem;
  1171. text-align: center;
  1172. letter-spacing: 0.03rem;
  1173. color: #fff2d3;
  1174. }
  1175. }
  1176. .key_area {
  1177. animation: key_area 1s;
  1178. animation-delay: 1s;
  1179. animation-fill-mode: forwards;
  1180. }
  1181. }
  1182. .redPacket2 {
  1183. left: 43.6rem;
  1184. margin-left: -18rem;
  1185. }
  1186. .key_install {
  1187. opacity: 0;
  1188. animation: key_install 2s;
  1189. animation-delay: 0s;
  1190. animation-fill-mode: forwards;
  1191. }
  1192. .install {
  1193. position: absolute;
  1194. top: 20rem;
  1195. left: 73.5rem;
  1196. .title {
  1197. font-size: 4.8rem;
  1198. color: #000000;
  1199. letter-spacing: 0.3px;
  1200. }
  1201. .validity {
  1202. margin-top: 1rem;
  1203. color: #FF0000;
  1204. width: 40rem;
  1205. height: 3.3rem;
  1206. line-height: 3.3rem;
  1207. font-weight: normal;
  1208. span {
  1209. font-size: 1.4rem;
  1210. }
  1211. }
  1212. .flow {
  1213. position: absolute;
  1214. margin-top: 4rem;
  1215. .line {
  1216. position: absolute;
  1217. height: 16rem;
  1218. border: 1px solid #e0e0e0;
  1219. top: 3rem;
  1220. left: 1.2rem;
  1221. }
  1222. .area_num {
  1223. display: flex;
  1224. align-items: center;
  1225. .num {
  1226. width: 2.4rem;
  1227. height: 2.4rem;
  1228. background-color: rgba(56, 154, 255, 1);
  1229. border-radius: 50%;
  1230. color: #fff;
  1231. text-align: center;
  1232. line-height: 2.4rem;
  1233. font-size: 1.4rem;
  1234. }
  1235. span {
  1236. margin-left: 1.5rem;
  1237. color: #000000;
  1238. font-size: 1.8rem;
  1239. }
  1240. }
  1241. .tip {
  1242. margin-left: 4rem;
  1243. margin-top: 0.7rem;
  1244. font-size: 1.4rem;
  1245. color: #a4a4a4;
  1246. }
  1247. .install_btn {
  1248. cursor: pointer;
  1249. margin-left: 4rem;
  1250. margin-top: 2rem;
  1251. margin-bottom: 6.7rem;
  1252. width: 23rem;
  1253. height: 5.8rem;
  1254. background: #389aff;
  1255. border-radius: 10rem;
  1256. color: #fff;
  1257. line-height: 5.8rem;
  1258. text-align: center;
  1259. font-size: 2rem;
  1260. }
  1261. }
  1262. .tip {
  1263. margin-top: 0.7rem;
  1264. font-size: 1.4rem;
  1265. color: #a4a4a4;
  1266. }
  1267. .install_btn {
  1268. cursor: pointer;
  1269. margin-top: 2rem;
  1270. margin-bottom: 6.7rem;
  1271. width: 23rem;
  1272. height: 5.8rem;
  1273. background: #389aff;
  1274. border-radius: 10rem;
  1275. color: #fff;
  1276. line-height: 5.8rem;
  1277. text-align: center;
  1278. font-size: 2rem;
  1279. }
  1280. }
  1281. .install-error {
  1282. left: 78.5rem;
  1283. .install_chrome {
  1284. cursor: pointer;
  1285. width: 24.3rem;
  1286. height: 5.8rem;
  1287. font-size: 2rem;
  1288. font-weight: 500;
  1289. letter-spacing: 0.3px;
  1290. display: flex;
  1291. align-items: center;
  1292. background: #FFFFFF;
  1293. border: 1px solid #e8e8e8;
  1294. border-radius: 10rem;
  1295. margin-top: 3.3rem;
  1296. img {
  1297. width: 3.2rem;
  1298. height: 3.2rem;
  1299. margin-left: 3.3rem;
  1300. }
  1301. span {
  1302. margin-left: 1.2rem;
  1303. }
  1304. }
  1305. }
  1306. }
  1307. @keyframes key_area {
  1308. 0% {
  1309. opacity: 1;
  1310. }
  1311. 100% {
  1312. opacity: 0;
  1313. }
  1314. }
  1315. @keyframes key_install {
  1316. 0% {
  1317. opacity: 0;
  1318. }
  1319. 100% {
  1320. opacity: 1;
  1321. }
  1322. }
  1323. @keyframes key_packet {
  1324. 0% {}
  1325. 100% {
  1326. left: 30.6rem;
  1327. margin-left: -18rem;
  1328. }
  1329. }
  1330. </style>