index.vue 31 KB

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