index.vue 34 KB

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