index.vue 30 KB

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