index.vue 32 KB

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