index.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527
  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. };
  500. Cookies.set('pickup_info', JSON.stringify(pickupInfo), { expires: 100 });
  501. },
  502. async getDetail() {
  503. let { data } = await axios.post(`${baseURL}/denet/post/getDetail`, {
  504. baseInfo: {
  505. appVersionCode: this.appVersionCode,
  506. mid: this.mid
  507. },
  508. params: {
  509. postId: this.detail.postId
  510. }
  511. })
  512. if (data.code == 0) {
  513. this.detail.postBizData = JSON.parse(data.data.postBizData)
  514. }
  515. },
  516. async getConfig() {
  517. let { data } = await axios.post(`${baseURL}/denet/base/config/getFrontConfig`, {
  518. baseInfo: {
  519. appVersionCode: this.appVersionCode,
  520. mid: this.mid
  521. },
  522. params: {
  523. }
  524. })
  525. if (data.code == 0) {
  526. this.config = data.data;
  527. }
  528. },
  529. },
  530. async asyncData(params) {
  531. let { route } = params;
  532. let { data } = await axios.post(`${baseURL}/denet/post/getDetail`, {
  533. baseInfo: {
  534. appVersionCode: appVersionCode,
  535. mid: function () {
  536. return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
  537. var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
  538. return v.toString(16);
  539. });
  540. }()
  541. },
  542. params: {
  543. postId: route.params.id || ''
  544. }
  545. })
  546. if (data.code == 0) {
  547. if (data.data && data.data.postBizData && typeof data.data.postBizData == 'string') {
  548. data.data.postBizData = JSON.parse(data.data.postBizData)
  549. }
  550. if(data.data.postBizData === null) {
  551. data.data.postBizData = {
  552. postUserInfo: {
  553. }
  554. }
  555. }
  556. return {
  557. detail: data.data,
  558. }
  559. }
  560. },
  561. mounted() {
  562. this.getConfig()
  563. if (!this.detail.postId) {
  564. return
  565. }
  566. console.log(this.detail)
  567. //改变font-size
  568. // (function (doc, win) {
  569. // var docEI = doc.documentElement,
  570. // resizeEvt = 'orientationchange' in window ? 'orientataionchange' : 'resize',
  571. // recalc = function () {
  572. // var clientWidth = docEI.clientWidth;
  573. // if (!clientWidth) return;
  574. // //100是字体大小,1510是开发时浏览器窗口的宽度,等比计算
  575. // docEI.style.fontSize = 10 * (clientWidth / 1510) + 'px';
  576. // }
  577. // if (!doc.addEventListener) return;
  578. // win.addEventListener(resizeEvt, recalc, false);
  579. // doc.addEventListener('DOMContentLoaded', recalc, false);
  580. // })(document, window);
  581. document.documentElement.style.fontSize = '62.5%'
  582. if (this.isMobile()) {
  583. this.setCookieMid();
  584. Report.reportLog({
  585. baseInfo: {
  586. appVersionCode: this.appVersionCode,
  587. mid: this.mid,
  588. pageSource: Report.pageSource.mobileLandingPage,
  589. appType,
  590. machineCode: this.mid
  591. },
  592. params: {
  593. eventData: {
  594. businessType: Report.businessType.pageView
  595. }
  596. }
  597. })
  598. this.show_moblie = true
  599. this.cp_link = window.location.href
  600. // 复制链接
  601. var clipboard = new ClipboardJS('.btn');
  602. clipboard.on('success', function (e) {
  603. Toast('copy success');
  604. console.info('Action:', e.action);
  605. console.info('Text:', e.text);
  606. console.info('Trigger:', e.trigger);
  607. e.clearSelection();
  608. });
  609. clipboard.on('error', function (e) {
  610. this.layer_show = true
  611. console.error('Action:', e.action);
  612. console.error('Trigger:', e.trigger);
  613. });
  614. // 领取列表分页
  615. this.getReceivedList()
  616. } else if (isBrowser() == 'chrome') {
  617. // 领取任务红包
  618. this.setCookieMid()
  619. // 是否被领完
  620. if(this.detail.postBizData.receiveCount < this.detail.postBizData.totalCount){
  621. this.getRedPacket()
  622. }else{
  623. this.show_home = true
  624. this.status = 'nothing'
  625. }
  626. this.setPickupInfo()
  627. Report.reportLog({
  628. baseInfo: {
  629. appVersionCode: this.appVersionCode,
  630. mid: this.mid,
  631. pageSource: Report.pageSource.newUserLandingPage,
  632. appType,
  633. machineCode: this.mid
  634. },
  635. params: {
  636. eventData: {
  637. businessType: Report.businessType.pageView,
  638. }
  639. }
  640. });
  641. } else {
  642. this.show_home = true
  643. this.status = 'no-chrome'
  644. }
  645. }
  646. }
  647. </script>
  648. <style lang="scss" >
  649. html,
  650. body,
  651. #__nuxt,
  652. #__layout {
  653. width: 100%;
  654. height: 100%;
  655. padding: 0;
  656. margin: 0;
  657. }
  658. .moblie {
  659. display: flex;
  660. flex-wrap: wrap;
  661. height: 100%;
  662. align-content: flex-start;
  663. flex-direction: column;
  664. .layer {
  665. position: fixed;
  666. width: 100%;
  667. height: 100%;
  668. top: 0;
  669. left: 0;
  670. background: rgba(0, 0, 0, .5);
  671. .layer-box {
  672. width: 30rem;
  673. height: 17rem;
  674. background: #FFFFFF;
  675. border-radius: 11px;
  676. opacity: 1;
  677. position: absolute;
  678. top: 25rem;
  679. left: 50%;
  680. margin-left: -15rem;
  681. .layer-txt {
  682. margin: 3rem 0;
  683. width: 100%;
  684. padding: 0 2.7rem;
  685. font-weight: 600;
  686. font-size: 1.8rem;
  687. text-align: center;
  688. }
  689. .layer-btn {
  690. width: 19rem;
  691. height: 4rem;
  692. background: #389AFF;
  693. border-radius: 100px;
  694. margin: 0 auto;
  695. text-align: center;
  696. line-height: 4rem;
  697. color: #fff;
  698. font-weight: 600;
  699. font-size: 1.8rem;
  700. }
  701. }
  702. }
  703. .head-area {
  704. width: 100%;
  705. height: 11rem;
  706. text-align: center;
  707. letter-spacing: 0.3px;
  708. font-size: 2rem;
  709. text-align: center;
  710. color: #fff;
  711. background: #389AFF;
  712. border-radius: 0 586px 586px/0 0 104px 104px;
  713. display: flex;
  714. align-items: center;
  715. justify-content: center;
  716. .gift {
  717. margin-right: 1.4rem;
  718. img {
  719. width: 5.2rem;
  720. }
  721. }
  722. .txt {
  723. font-size: 1.8rem;
  724. text-align: left;
  725. }
  726. }
  727. .luck-list-title {
  728. /* margin-top: 47px;*/
  729. margin: 0 16px;
  730. padding: 14px 0 11px 0;
  731. background: #fff;
  732. display: flex;
  733. justify-content: space-between;
  734. color: #B0B0B0;
  735. border-bottom: 1px solid #D1D1D1;
  736. }
  737. .luck-list {
  738. flex: 1;
  739. width: 100%;
  740. overflow-y: auto;
  741. .luck-item {
  742. display: flex;
  743. padding: 12px 0;
  744. margin: 0 16px;
  745. border-bottom: 1px solid #F2F2F2;
  746. justify-content: space-between;
  747. position: relative;
  748. img:first-child {
  749. border-radius: 50%;
  750. }
  751. .luck-king {
  752. position: absolute;
  753. top: 36px;
  754. right: 0px;
  755. display: flex;
  756. align-items: center;
  757. img {
  758. width: 22px;
  759. height: 19px;
  760. margin: 0;
  761. }
  762. span {
  763. font-weight: 500;
  764. font-size: 12px;
  765. line-height: 14px;
  766. letter-spacing: 0.3px;
  767. color: #f5b945;
  768. }
  769. }
  770. img {
  771. width: 42px;
  772. height: 42px;
  773. margin-right: 12px;
  774. }
  775. .luck-content {
  776. flex: auto;
  777. .luck-title {
  778. font-weight: 500;
  779. font-size: 16px;
  780. letter-spacing: 0.3px;
  781. color: #444444;
  782. }
  783. .luck-time {
  784. font-weight: 400;
  785. font-size: 12px;
  786. line-height: 14px;
  787. color: #9b9b9b;
  788. }
  789. }
  790. .luck-money {
  791. display: flex;
  792. height: 17px;
  793. align-items: center;
  794. img {
  795. width: 14px;
  796. height: 14px;
  797. margin-right: 6px;
  798. }
  799. .luck-money-txt {
  800. font-weight: 500;
  801. font-size: 14px;
  802. /* identical to box height */
  803. text-align: right;
  804. letter-spacing: 0.3px;
  805. color: #444444;
  806. }
  807. }
  808. }
  809. .luck-item:last-child {
  810. border: 0;
  811. }
  812. }
  813. .area-cp-link {
  814. background: #fff;
  815. width: 100%;
  816. flex-wrap: wrap;
  817. height: 20rem;
  818. box-shadow: 0px -4px 10px rgba(0, 0, 0, 0.1);
  819. border-top-left-radius: 1rem;
  820. border-top-right-radius: 1rem;
  821. .area-list {
  822. width: 34.3rem;
  823. margin: 1.5rem auto;
  824. .item {
  825. clear: both;
  826. overflow: hidden;
  827. margin: 0.7rem 0;
  828. font-size: 1.6rem;
  829. font-weight: 500;
  830. .icon {
  831. float: left;
  832. margin-right: 0.8rem;
  833. }
  834. .font {
  835. float: left;
  836. margin-right: 0.8rem;
  837. }
  838. .pc {
  839. float: left;
  840. }
  841. }
  842. }
  843. .area-content {
  844. background: #F4F4F4;
  845. padding: 0.7rem 1rem;
  846. margin: 0 auto 1rem;
  847. width: 34.3rem;
  848. font-size: 1.3rem;
  849. border-radius: 0.5rem;
  850. word-break: break-all;
  851. }
  852. .area-btn {
  853. flex: 1;
  854. display: flex;
  855. justify-content: center;
  856. .btn {
  857. width: 34.3rem;
  858. height: 4rem;
  859. background: #389AFF;
  860. border-radius: 100px;
  861. font-size: 1.8rem;
  862. color: #FFFFFF;
  863. }
  864. }
  865. }
  866. }
  867. .content {
  868. width: 100%;
  869. height: 100%;
  870. background-size: 100%;
  871. background-repeat: no-repeat;
  872. position: relative;
  873. font-family: "SF Pro Display";
  874. font-style: normal;
  875. font-weight: 600;
  876. .not-open {
  877. display: flex;
  878. align-items: center;
  879. justify-content: center;
  880. width: 100%;
  881. height: 100%;
  882. img {
  883. width: 20rem;
  884. height: 20rem;
  885. }
  886. }
  887. .logo {
  888. position: absolute;
  889. left: 4rem;
  890. top: 1.5rem;
  891. img {
  892. width: 10.7rem;
  893. height: 3.4rem;
  894. }
  895. }
  896. .key_packet {
  897. animation: key_packet 3s;
  898. animation-delay: 0s;
  899. animation-fill-mode: forwards;
  900. }
  901. .redBag {
  902. display: flex;
  903. justify-content: flex-start;
  904. flex-direction: column;
  905. position: absolute;
  906. top: 14rem;
  907. left: 30.6rem;
  908. width: 37.5rem;
  909. height: 50rem;
  910. border-radius: 2rem;
  911. overflow-y: hidden;
  912. box-shadow: 0 0 5px #888888;
  913. background: #fff;
  914. .money-area {
  915. width: 100%;
  916. position: absolute;
  917. top: 65px;
  918. display: flex;
  919. flex-wrap: wrap;
  920. align-items: center;
  921. justify-content: center;
  922. .txt {
  923. font-weight: 800;
  924. font-size: 16px;
  925. text-align: center;
  926. letter-spacing: 0.3px;
  927. color: #FFFFFF;
  928. }
  929. .coin {
  930. text-align: center;
  931. margin-top: 6px;
  932. margin-bottom: 7px;
  933. display: flex;
  934. justify-content: center;
  935. align-items: center;
  936. width: 90%;
  937. img {
  938. width: 46px;
  939. height: 46px;
  940. border-radius: 50%;
  941. border: 3px solid #FFFFFF;
  942. }
  943. span {
  944. margin-left: 15px;
  945. font-weight: 800;
  946. font-size: 60px;
  947. line-height: 76px;
  948. color: #FFFFFF;
  949. }
  950. }
  951. .people {
  952. font-weight: 800;
  953. font-size: 13px;
  954. line-height: 16px;
  955. letter-spacing: 0.05em;
  956. text-align: center;
  957. color: #FFFFFF;
  958. }
  959. }
  960. .title {
  961. position: absolute;
  962. top: 15px;
  963. left: 15px;
  964. z-index: 3;
  965. display: flex;
  966. align-items: center;
  967. img {
  968. width: 24px;
  969. height: 24px;
  970. border: 2px solid #FFF;
  971. border-radius: 50%;
  972. }
  973. span {
  974. margin-left: 10px;
  975. font-weight: 600;
  976. font-size: 16px;
  977. letter-spacing: 0.3px;
  978. color: #fff;
  979. }
  980. }
  981. img {
  982. width: 100%;
  983. }
  984. .up {
  985. position: absolute;
  986. top: 0;
  987. z-index: 1;
  988. }
  989. .down {
  990. position: absolute;
  991. top: 253px;
  992. }
  993. .open {
  994. width: 335px;
  995. height: 50px;
  996. cursor: pointer;
  997. position: absolute;
  998. bottom: 28px;
  999. left: 50%;
  1000. margin-left: -167.5px;
  1001. z-index: 4;
  1002. }
  1003. .open-gif {
  1004. width: 200px;
  1005. height: 200px;
  1006. text-align: center;
  1007. position: absolute;
  1008. bottom: 70px;
  1009. left: 50%;
  1010. margin-left: -100px;
  1011. z-index: 3;
  1012. }
  1013. }
  1014. .redPacket {
  1015. display: flex;
  1016. justify-content: flex-start;
  1017. flex-direction: column;
  1018. position: absolute;
  1019. top: 9rem;
  1020. left: 50%;
  1021. width: 37.5rem;
  1022. margin-left: -18rem;
  1023. height: 65rem;
  1024. border-radius: 2rem;
  1025. // background: red;
  1026. overflow-y: hidden;
  1027. box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.1);
  1028. background: #fff;
  1029. .top {
  1030. top: 0;
  1031. position: absolute;
  1032. width: 100%;
  1033. z-index: 12;
  1034. }
  1035. .down {
  1036. bottom: 0;
  1037. position: absolute;
  1038. height: 32.3rem;
  1039. z-index: 11;
  1040. }
  1041. .head {
  1042. position: relative;
  1043. .head-title {
  1044. position: absolute;
  1045. top: 0;
  1046. width: 100%;
  1047. display: flex;
  1048. align-items: center;
  1049. justify-content: center;
  1050. height: 3.6rem;
  1051. background: rgba(255, 255, 255, .1);
  1052. img {
  1053. width: 1.8rem;
  1054. height: 1.8rem;
  1055. border-radius: 50%;
  1056. border: 1px solid #fff;
  1057. }
  1058. span {
  1059. margin-left: .8rem;
  1060. font-size: 1.2rem;
  1061. color: #fff;
  1062. }
  1063. }
  1064. .head-txt {
  1065. margin-top: 4.7rem;
  1066. font-size: 2rem;
  1067. text-align: center;
  1068. color: #fff;
  1069. }
  1070. .head-area {
  1071. height: 19rem;
  1072. text-align: center;
  1073. letter-spacing: 0.3px;
  1074. font-size: 2rem;
  1075. text-align: center;
  1076. color: #fff;
  1077. background: #389AFF;
  1078. border-radius: 0 586px 586px/0 0 164px 164px;
  1079. .txt {
  1080. padding-top: 8.5rem;
  1081. }
  1082. }
  1083. .head-money {
  1084. .txt {
  1085. padding-top: 6.8rem;
  1086. font-weight: 800;
  1087. font-size: 1.5rem;
  1088. text-align: center;
  1089. letter-spacing: 0.3px;
  1090. }
  1091. .head-money-area {
  1092. display: flex;
  1093. width: 100%;
  1094. justify-content: center;
  1095. align-items: center;
  1096. img {
  1097. width: 4rem;
  1098. height: 4rem;
  1099. border: 2px solid #FFFFFF;
  1100. border-radius: 100px;
  1101. }
  1102. span {
  1103. margin-left: 1.3rem;
  1104. font-size: 4.6rem;
  1105. word-break: break-all;
  1106. }
  1107. }
  1108. }
  1109. }
  1110. .luck-list-title {
  1111. /* margin-top: 47px;*/
  1112. margin: 0 16px;
  1113. padding: 14px 0 11px 0;
  1114. background: #fff;
  1115. display: flex;
  1116. font-weight: 500;
  1117. justify-content: space-between;
  1118. color: #B0B0B0;
  1119. border-bottom: 1px solid #F2F2F2;
  1120. }
  1121. .luck-list {
  1122. background: #fff;
  1123. overflow-y: auto;
  1124. .luck-item {
  1125. display: flex;
  1126. padding: 12px 0;
  1127. margin: 0 16px;
  1128. border-bottom: 1px solid #F2F2F2;
  1129. justify-content: space-between;
  1130. position: relative;
  1131. img:first-child {
  1132. border-radius: 50%;
  1133. }
  1134. .luck-king {
  1135. position: absolute;
  1136. top: 36px;
  1137. right: 0px;
  1138. display: flex;
  1139. align-items: center;
  1140. img {
  1141. width: 22px;
  1142. height: 19px;
  1143. margin: 0;
  1144. }
  1145. span {
  1146. font-weight: 500;
  1147. font-size: 12px;
  1148. line-height: 14px;
  1149. letter-spacing: 0.3px;
  1150. color: #f5b945;
  1151. }
  1152. }
  1153. img {
  1154. width: 42px;
  1155. height: 42px;
  1156. margin-right: 12px;
  1157. }
  1158. .luck-content {
  1159. flex: auto;
  1160. .luck-title {
  1161. font-weight: 500;
  1162. font-size: 16px;
  1163. letter-spacing: 0.3px;
  1164. color: #444444;
  1165. margin-bottom: 5px;
  1166. }
  1167. .luck-time {
  1168. font-weight: 400;
  1169. font-size: 12px;
  1170. line-height: 14px;
  1171. color: #B0B0B0;
  1172. }
  1173. }
  1174. .luck-money {
  1175. display: flex;
  1176. height: 17px;
  1177. align-items: center;
  1178. img {
  1179. width: 14px;
  1180. height: 14px;
  1181. margin-right: 6px;
  1182. }
  1183. .luck-money-txt {
  1184. font-weight: 500;
  1185. font-size: 14px;
  1186. /* identical to box height */
  1187. text-align: right;
  1188. letter-spacing: 0.3px;
  1189. color: #444444;
  1190. }
  1191. }
  1192. }
  1193. .luck-item:last-child {
  1194. border: 0;
  1195. }
  1196. }
  1197. .area {
  1198. position: absolute;
  1199. z-index: 112;
  1200. width: 100%;
  1201. .title {
  1202. z-index: 11;
  1203. margin-top: 8.5rem;
  1204. text-align: center;
  1205. img {
  1206. width: 3.6rem;
  1207. height: 3.6rem;
  1208. border: 2px solid #fff4db;
  1209. border-radius: 50%;
  1210. }
  1211. span {
  1212. letter-spacing: 0.3px;
  1213. font-size: 1.6rem;
  1214. color: #fff2d3;
  1215. }
  1216. }
  1217. .txt {
  1218. font-size: 4rem;
  1219. text-align: center;
  1220. letter-spacing: 0.03rem;
  1221. color: #fff2d3;
  1222. }
  1223. }
  1224. .key_area {
  1225. animation: key_area 1s;
  1226. animation-delay: 1s;
  1227. animation-fill-mode: forwards;
  1228. }
  1229. }
  1230. .redPacket2 {
  1231. left: 43.6rem;
  1232. margin-left: -18rem;
  1233. }
  1234. .key_install {
  1235. opacity: 0;
  1236. animation: key_install 2s;
  1237. animation-delay: 0s;
  1238. animation-fill-mode: forwards;
  1239. }
  1240. .install {
  1241. position: absolute;
  1242. top: 20rem;
  1243. left: 73.5rem;
  1244. .title {
  1245. font-size: 4.8rem;
  1246. color: #000000;
  1247. letter-spacing: 0.3px;
  1248. }
  1249. .validity {
  1250. margin-top: 1rem;
  1251. color: #FF0000;
  1252. width: 40rem;
  1253. height: 3.3rem;
  1254. line-height: 3.3rem;
  1255. font-weight: normal;
  1256. span {
  1257. font-size: 1.4rem;
  1258. }
  1259. }
  1260. .flow {
  1261. position: absolute;
  1262. margin-top: 4rem;
  1263. .line {
  1264. position: absolute;
  1265. height: 16rem;
  1266. border: 1px solid #e0e0e0;
  1267. top: 3rem;
  1268. left: 1.2rem;
  1269. }
  1270. .area_num {
  1271. display: flex;
  1272. align-items: center;
  1273. .num {
  1274. width: 2.4rem;
  1275. height: 2.4rem;
  1276. background-color: rgba(56, 154, 255, 1);
  1277. border-radius: 50%;
  1278. color: #fff;
  1279. text-align: center;
  1280. line-height: 2.4rem;
  1281. font-size: 1.4rem;
  1282. }
  1283. span {
  1284. margin-left: 1.5rem;
  1285. color: #000000;
  1286. font-size: 1.8rem;
  1287. }
  1288. }
  1289. .tip {
  1290. margin-left: 4rem;
  1291. margin-top: 0.7rem;
  1292. font-size: 1.4rem;
  1293. color: #a4a4a4;
  1294. }
  1295. .install_btn {
  1296. cursor: pointer;
  1297. margin-left: 4rem;
  1298. margin-top: 2rem;
  1299. margin-bottom: 6.7rem;
  1300. width: 23rem;
  1301. height: 5.8rem;
  1302. background: #389aff;
  1303. border-radius: 10rem;
  1304. color: #fff;
  1305. line-height: 5.8rem;
  1306. text-align: center;
  1307. font-size: 2rem;
  1308. }
  1309. }
  1310. .tip {
  1311. margin-top: 0.7rem;
  1312. font-size: 1.4rem;
  1313. color: #a4a4a4;
  1314. }
  1315. .install_btn {
  1316. cursor: pointer;
  1317. margin-top: 2rem;
  1318. margin-bottom: 6.7rem;
  1319. width: 23rem;
  1320. height: 5.8rem;
  1321. background: #389aff;
  1322. border-radius: 10rem;
  1323. color: #fff;
  1324. line-height: 5.8rem;
  1325. text-align: center;
  1326. font-size: 2rem;
  1327. }
  1328. }
  1329. .install-error {
  1330. left: 78.5rem;
  1331. .install_chrome {
  1332. cursor: pointer;
  1333. width: 24.3rem;
  1334. height: 5.8rem;
  1335. font-size: 2rem;
  1336. font-weight: 500;
  1337. letter-spacing: 0.3px;
  1338. display: flex;
  1339. align-items: center;
  1340. background: #FFFFFF;
  1341. border: 1px solid #e8e8e8;
  1342. border-radius: 10rem;
  1343. margin-top: 3.3rem;
  1344. img {
  1345. width: 3.2rem;
  1346. height: 3.2rem;
  1347. margin-left: 3.3rem;
  1348. }
  1349. span {
  1350. margin-left: 1.2rem;
  1351. }
  1352. }
  1353. }
  1354. }
  1355. @keyframes key_area {
  1356. 0% {
  1357. opacity: 1;
  1358. }
  1359. 100% {
  1360. opacity: 0;
  1361. }
  1362. }
  1363. @keyframes key_install {
  1364. 0% {
  1365. opacity: 0;
  1366. }
  1367. 100% {
  1368. opacity: 1;
  1369. }
  1370. }
  1371. @keyframes key_packet {
  1372. 0% {}
  1373. 100% {
  1374. left: 30.6rem;
  1375. margin-left: -18rem;
  1376. }
  1377. }
  1378. </style>