index.vue 33 KB

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