index.vue 30 KB

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