index.vue 31 KB

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