index.vue 30 KB

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