index.vue 32 KB

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