index.vue 31 KB

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