index.vue 34 KB

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