index.vue 30 KB

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