index.vue 31 KB

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