red-packet.vue 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686
  1. <!-- 红包任务页面 -->
  2. <template>
  3. <div class="content">
  4. <!-- open -->
  5. <div v-show="data.status == 'opened'" class="opened">
  6. <div class="header" :style="{ 'backgroundImage': `url(${require('@/assets/subject/001-back-head-top.svg')})` }">
  7. <div class="title">AWESOME! YOU WILL GET</div>
  8. <div class="money">
  9. <img :src="data.detail.currencyIconPath" alt />
  10. <!-- <span class="big">{{ data.money }}</span> -->
  11. <font-amount :amount="data.money" class="big" :fontSize="46"></font-amount>
  12. <!-- <span class="small">{{ data.detail.currencySymbol || '' }}</span> -->
  13. </div>
  14. </div>
  15. <div class="list">
  16. <div class="item" v-for="item, i in data.detail.taskCondition" v-bind:key="i">
  17. <template v-if="item.type == 1 && item.relatedUsers && item.relatedUsers.length > 0">
  18. <div class="item-content">
  19. <div class="item-follow-title">
  20. <img :src="require('@/assets/svg/icon-follow.svg')" alt />
  21. <div class="item-title">Follow</div>
  22. <img :src="require('@/assets/gif/red-right.gif')" alt class="red-right"
  23. v-show="!data.done.follow && data.done.follow_red" />
  24. <img v-if="data.done.follow" :src="require('@/assets/svg/icon-true.svg')" alt />
  25. <div v-else class="btn" @click="clickFollowAll(item.relatedUsers, 'all')">Follow All</div>
  26. </div>
  27. <div class="item-follow-area">
  28. <template v-for="item2, i in item.relatedUsers" v-bind:key="i">
  29. <div class="item-follow" v-if="item2.finished">
  30. <span :class="{ finished: item2.finished }">@{{ item2.name }}</span>
  31. <img :src="require('@/assets/svg/icon-true-ed.svg')" alt />
  32. </div>
  33. <div class="item-follow" v-else @click="clickFollowAll([{ name: item2.name }])">
  34. <span :class="{ finished: item2.finished }">@{{ item2.name }}</span>
  35. <img :src="require('@/assets/svg/icon-add.svg')" alt />
  36. </div>
  37. </template>
  38. </div>
  39. </div>
  40. </template>
  41. <template v-if="item.type == 2">
  42. <img :src="require('@/assets/svg/icon-like.svg')" alt />
  43. <div class="item-content">
  44. <div class="item-title">Like</div>
  45. </div>
  46. <img :src="require('@/assets/gif/red-right.gif')" alt class="red-right"
  47. v-show="!data.done.like && data.done.like_red" />
  48. <img v-if="data.done.like" :src="require('@/assets/svg/icon-true.svg')" alt />
  49. <div v-else class="btn" @click="clickLikeBtn">Like</div>
  50. </template>
  51. <template v-if="item.type == 3">
  52. <img :src="require('@/assets/svg/icon-retweet.svg')" alt />
  53. <div class="item-content">
  54. <div class="item-title">Retweet</div>
  55. </div>
  56. <img :src="require('@/assets/gif/red-right.gif')" alt class="red-right"
  57. v-show="!data.done.retweet && data.done.retweet_red" />
  58. <img v-if="data.done.retweet" :src="require('@/assets/svg/icon-true.svg')" alt />
  59. <div v-else class="btn" @click="clickRetweetBtn">Retweet</div>
  60. </template>
  61. </div>
  62. </div>
  63. <div class="people" @click="clickRoad">
  64. <div class="txt">
  65. {{ data.detail.receiveCount || 0 }}/{{ data.detail.totalCount || 0 }} Winners,{{
  66. data.detail.receiveAmountValue
  67. }}/{{ data.detail.amountValue }} {{ data.detail.currencySymbol }}</div>
  68. <div class="right" v-if="data.detail.allReceived">
  69. <template v-for="item, i in data.detail.allReceived.slice(0, 3)" v-bind:key="i">
  70. <img :src="item.simpleUserInfoVO.avatarUrl" alt :style="{ right: `${i * 16 + 14}px` }"
  71. v-if="item.simpleUserInfoVO.avatarUrl" />
  72. <img v-else :src="require('@/assets/svg/icon-twitter.svg')" alt :style="{ right: `${i * 16 + 14}px` }" />
  73. </template>
  74. <img :src="require('@/assets/svg/icon-right.svg')" alt class="road" />
  75. </div>
  76. </div>
  77. <div class="footer">
  78. <div class="first">
  79. <div class="validity">Validity</div>
  80. <div class="time">{{ data.detail.validity || '' }}</div>
  81. </div>
  82. <div class="btn" @click="clickGetGiveaways">Get Giveaways</div>
  83. </div>
  84. </div>
  85. <!-- success -->
  86. <div v-if="data.status == 'success'" class="success">
  87. <div class="header" :style="{ 'backgroundImage': `url(${require('@/assets/subject/001-back-head-top.svg')})` }">
  88. <div class="money">
  89. <img :src="data.detail.currencyIconPath" alt />
  90. <font-amount :amount="data.money" class="big" :fontSize="46"></font-amount>
  91. <!-- <span class="small">{{ data.detail.currencySymbol }}</span> -->
  92. </div>
  93. <div class="done" @click="clickDone">
  94. <img :src="require('@/assets/subject/001-icon-done.svg')" alt class="icon-done" />
  95. <span>View Rewards In Wallet</span>
  96. <img :src="require('@/assets/svg/icon-right.svg')" alt class="icon-right" />
  97. </div>
  98. </div>
  99. <div class="luck-list-title">
  100. <div>{{ data.detail.receiveCount || 0 }}/{{ data.detail.totalCount || 0 }} Winners</div>
  101. <div> {{ data.detail.receiveAmountValue }} / {{ data.detail.amountValue || '' }} {{
  102. data.detail.currencySymbol || ''
  103. }}</div>
  104. </div>
  105. <div class="luck-list" @scroll="handleScroll($event)">
  106. <div class="luck-item" v-for="item, i in data.detail.allReceived" v-bind:key="i">
  107. <img v-if="item.simpleUserInfoVO.avatarUrl" :src="item.simpleUserInfoVO.avatarUrl" alt />
  108. <img v-else :src="require('@/assets/svg/icon-twitter.svg')" alt />
  109. <div class="luck-content">
  110. <div class="luck-title" v-if="item.simpleUserInfoVO.nickName">{{ item.simpleUserInfoVO.nickName }}</div>
  111. <div class="luck-title" v-else>Twitter User</div>
  112. <div class="luck-time">{{ moment(item.receiveTimestamp).format('MM-DD HH:mm:ss') }}</div>
  113. </div>
  114. <div class="luck-money">
  115. <img :src="data.detail.currencyIconPath" alt />
  116. <div class="luck-money-txt">{{ showLastTwoPlace(item.amountValue) || 0 }}</div>
  117. </div>
  118. <div class="luck-king" v-if="item.maxAmount">
  119. <img :src="require('@/assets/svg/icon-king-hat.svg')" alt />
  120. <span>Luckiest Draw</span>
  121. </div>
  122. </div>
  123. </div>
  124. </div>
  125. <!-- no-open -->
  126. <div v-else-if="data.status == 'not-open'" class="not-open">
  127. <img :src="require('@/assets/subject/001-card.png')" alt="">
  128. <img class="open-gif" :src="require('@/assets/gif/001.gif')" />
  129. <img :src="require('@/assets/svg/icon-open.svg')" alt="" class="open" @click="clickOpenRedPacket">
  130. <div class="title" v-if="data.detail.postUserInfo">
  131. <img :src="data.detail.postUserInfo.avatarUrl" alt />
  132. <span>{{ data.detail.postUserInfo.nickName || 'FutureDoctor' }}</span>
  133. </div>
  134. <div class="money-area">
  135. <div class="txt">{{ data.detail.currencySymbol }} GIVEAWAY</div>
  136. <div class="coin">
  137. <img :src="data.detail.currencyIconPath" alt />
  138. <font-amount :amount="data.detail.amountValue"></font-amount>
  139. </div>
  140. <div class="people">{{ data.detail.totalCount }} WINNERS TO SHARE</div>
  141. </div>
  142. </div>
  143. <!-- 领取列表 -->
  144. <div v-else-if="data.status == 'luck-peopel-list'" class="luck-peopel-list">
  145. <div class="head">
  146. <img :src="require('@/assets/svg/icon-back.svg')" alt @click="clickBack" />
  147. </div>
  148. <div class="luck-list-title">
  149. <div>{{ data.detail.receiveCount || 0 }}/{{ data.detail.totalCount || 0 }} Winners</div>
  150. <div> {{ data.detail.receiveAmountValue }} / {{ data.detail.amountValue || '' }} {{
  151. data.detail.currencySymbol || ''
  152. }}</div>
  153. </div>
  154. <div class="luck-list" @scroll="handleScroll">
  155. <div class="luck-item" v-for="item, i in data.detail.allReceived" v-bind:key="i">
  156. <img v-if="item.simpleUserInfoVO.avatarUrl" :src="item.simpleUserInfoVO.avatarUrl" alt />
  157. <img v-else :src="require('@/assets/svg/icon-twitter.svg')" alt />
  158. <div class="luck-content">
  159. <div class="luck-title" v-if="item.simpleUserInfoVO.nickName">{{ item.simpleUserInfoVO.nickName }}</div>
  160. <div class="luck-title" v-else>Twitter User</div>
  161. <div class="luck-time">{{ moment(item.receiveTimestamp).format('MM-DD HH:mm:ss') }}</div>
  162. </div>
  163. <div class="luck-money">
  164. <img :src="data.detail.currencyIconPath" alt />
  165. <div class="luck-money-txt">{{ showLastTwoPlace(item.amountValue) }}</div>
  166. </div>
  167. <div class="luck-king" v-if="item.maxAmount">
  168. <img :src="require('@/assets/svg/icon-king-hat.svg')" alt />
  169. <span>Luckiest Draw</span>
  170. </div>
  171. </div>
  172. </div>
  173. </div>
  174. <!-- 红包被领完了 -->
  175. <div v-else-if="data.status == 'close'" class="close">
  176. <div class="header" :style="{ 'backgroundImage': `url(${require('@/assets/subject/001-back-head-top.svg')})` }">
  177. <div class="close-title" v-for="item in data.close_text">{{ item }}</div>
  178. </div>
  179. <div class="luck-list-title">
  180. <div>{{ data.detail.receiveCount || 0 }}/{{ data.detail.totalCount || 0 }} Winners</div>
  181. <div> {{ data.detail.receiveAmountValue }} / {{ data.detail.amountValue || '' }} {{
  182. data.detail.currencySymbol || ''
  183. }}</div>
  184. </div>
  185. <div class="luck-list" @scroll="handleScroll">
  186. <div class="luck-item" v-for="item, i in data.detail.allReceived" v-bind:key="i">
  187. <img v-if="item.simpleUserInfoVO.avatarUrl" :src="item.simpleUserInfoVO.avatarUrl" alt />
  188. <img v-else :src="require('@/assets/svg/icon-twitter.svg')" alt />
  189. <div class="luck-content">
  190. <div class="luck-title" v-if="item.simpleUserInfoVO.nickName">{{ item.simpleUserInfoVO.nickName }}</div>
  191. <div class="luck-title" v-else>Twitter User</div>
  192. <div class="luck-time">{{ moment(item.receiveTimestamp).format('MM-DD HH:mm:ss') }}</div>
  193. </div>
  194. <div class="luck-money">
  195. <img :src="data.detail.currencyIconPath" alt />
  196. <div class="luck-money-txt">{{ showLastTwoPlace(item.amountValue) || 0 }}</div>
  197. </div>
  198. <div class="luck-king" v-if="item.maxAmount">
  199. <img :src="require('@/assets/svg/icon-king-hat.svg')" alt />
  200. <span>Luckiest Draw</span>
  201. </div>
  202. </div>
  203. </div>
  204. </div>
  205. <!-- error -->
  206. <div v-else-if="data.status == 'error'" class="error">
  207. <img :src="require('@/assets/svg/icon-error.svg')" alt />
  208. <div class="txt">
  209. {{ data.error_txt }}
  210. </div>
  211. <div class="retry" v-show="data.retry" @click="clickRetry">
  212. Retry
  213. </div>
  214. </div>
  215. <!-- loading -->
  216. <div v-show="data.loading_show" class="loading">
  217. <img :src="require('@/assets/svg/icon-loading.svg')" alt />
  218. </div>
  219. </div>
  220. <div style="position: fixed; width: 100%; min-height: 30px; color: red; top: 0;">
  221. {{ data.console_str }}
  222. </div>
  223. </template>
  224. <script>
  225. export default {
  226. name: 'redPacket',
  227. }
  228. </script>
  229. <script setup>
  230. import { onMounted, reactive } from "vue";
  231. import { getPostDetail, getRedPacket, finishRedPacket, oneKeyLike, oneKeyReTweet, oneKeyFollow, getTaskDetail, getReceivedList } from '@/http/redPacket.js'
  232. import { getQueryString } from '@/uilts/help.js'
  233. import { message } from 'ant-design-vue';
  234. import FontAmount from '@/view/components/font-amount.vue'
  235. import { getChromeStorage } from '@/uilts/chromeExtension.js'
  236. import Report from "@/log-center/log"
  237. import { srcPublishSuccess } from '@/http/publishApi'
  238. var moment = require('moment');
  239. let data = reactive({
  240. status: '',
  241. loading_show: false,
  242. detail: {},
  243. luck_list_end: false,
  244. page_index: 1,
  245. page_size: 20,
  246. srcContentId: '',
  247. error_txt: `oops, new accounts cannot participate in this event,`,
  248. receiveAmount: 0,
  249. money: 0,
  250. // 状态
  251. done: {
  252. follow: false,
  253. like: false,
  254. retweet: false
  255. }
  256. })
  257. function clickRetry() {
  258. init()
  259. }
  260. async function clickLikeBtn() {
  261. let _userInfo = await checkIsLogin()
  262. if (!_userInfo) {
  263. return
  264. }
  265. data.loading_show = true
  266. oneKeyLike({
  267. params: {
  268. tweetId: data.srcContentId
  269. }
  270. }).then((res) => {
  271. data.loading_show = false
  272. if (res.code == 0) {
  273. if (res.data.result) {
  274. data.done.like = true
  275. } else {
  276. data.done.like = false
  277. }
  278. } else {
  279. data.done.like = false
  280. console.log(res)
  281. }
  282. })
  283. // 埋点
  284. Report.reportLog({
  285. objectType: Report.objectType.like,
  286. pageSource: Report.pageSource.task_page,
  287. businessType: Report.businessType.buttonClick
  288. });
  289. }
  290. function clickDone() {
  291. window.open(`${chrome.runtime.getURL('/iframe/home.html')}`)
  292. // 埋点
  293. Report.reportLog({
  294. objectType: Report.objectType.wallet_button,
  295. pageSource: Report.pageSource.received_success_page,
  296. businessType: Report.businessType.buttonClick
  297. });
  298. }
  299. function handleScroll(e) {
  300. if (data.luck_list_end) {
  301. return
  302. }
  303. e = e.target
  304. if ((e.clientHeight + e.scrollTop) / e.scrollHeight > .8) {
  305. data.luck_list_end = true
  306. data.page_index++
  307. handleReceivedList()
  308. }
  309. }
  310. function handleReceivedList() {
  311. getReceivedList({
  312. params: {
  313. pageNum: data.page_index,
  314. pageSize: data.page_size,
  315. postId: data.postId
  316. }
  317. }).then((res) => {
  318. if (res.code == 0) {
  319. if (res.data.length > 0) {
  320. data.detail.allReceived = data.detail.allReceived.concat(res.data)
  321. data.luck_list_end = false
  322. } else {
  323. data.luck_list_end = true
  324. }
  325. } else {
  326. console.log('getReceivedList', res)
  327. }
  328. })
  329. }
  330. async function clickRetweetBtn() {
  331. let _userInfo = await checkIsLogin()
  332. if (!_userInfo) {
  333. return
  334. }
  335. data.loading_show = true
  336. oneKeyReTweet({
  337. params: {
  338. tweetId: data.srcContentId
  339. }
  340. }).then((res) => {
  341. data.loading_show = false
  342. if (res.code == 0) {
  343. if (res.data.result) {
  344. data.done.retweet = true
  345. } else {
  346. data.done.retweet = false
  347. }
  348. } else {
  349. data.done.retweet = false
  350. console.log(res)
  351. }
  352. })
  353. // 埋点
  354. Report.reportLog({
  355. objectType: Report.objectType.retweet,
  356. pageSource: Report.pageSource.task_page,
  357. businessType: Report.businessType.buttonClick
  358. });
  359. }
  360. function getValidity() {
  361. let _d1, _d2, _d3, _h, _m, _s
  362. if (!data.detail.myReceived.taskEndTimestamp) {
  363. return
  364. }
  365. let timer = setInterval(() => {
  366. let _time = new Date().getTime()
  367. _d3 = data.detail.myReceived.taskEndTimestamp - _time
  368. if (_d3 > 0) {
  369. _d1 = moment(data.detail.myReceived.taskEndTimestamp)
  370. _d2 = moment(_time)
  371. _h = moment.duration(_d1.diff(_d2)).hours()
  372. if (_h < 10) {
  373. _h = '0' + _h
  374. }
  375. _m = moment.duration(_d1.diff(_d2)).minutes()
  376. if (_m < 10) {
  377. _m = '0' + _m
  378. }
  379. _s = moment.duration(_d1.diff(_d2)).seconds()
  380. if (_s < 10) {
  381. _s = '0' + _s
  382. }
  383. data.detail.validity = `${_h}:${_m}:${_s}`
  384. } else {
  385. data.detail.validity = `00:00:00`
  386. clearInterval(timer)
  387. }
  388. }, 1000)
  389. }
  390. async function clickFollowAll(item, is_all) {
  391. let _userInfo = await checkIsLogin()
  392. if (!_userInfo) {
  393. return
  394. }
  395. data.loading_show = true
  396. let arr_name = []
  397. for (let i in item) {
  398. arr_name.push(item[i].name)
  399. }
  400. oneKeyFollow({
  401. params: {
  402. names: arr_name
  403. }
  404. }).then((res) => {
  405. data.loading_show = false
  406. if (res.code == 0) {
  407. res.data.forEach((item1) => {
  408. data.detail.taskCondition[0].relatedUsers.forEach(item2 => {
  409. if (item1.name == item2.name) {
  410. item2.finished = true
  411. }
  412. });
  413. })
  414. let _len = data.detail.taskCondition[0].relatedUsers.filter((item) => { return item.finished == false }).length
  415. if (_len > 0) {
  416. data.done.follow = false
  417. } else {
  418. data.done.follow = true
  419. }
  420. } else {
  421. data.detail.taskCondition[0].relatedUsers.forEach(item => {
  422. item.finished = false
  423. });
  424. }
  425. })
  426. let _log_obj = {
  427. pageSource: Report.pageSource.task_page,
  428. businessType: Report.businessType.buttonClick,
  429. objectType: Report.objectType.follow
  430. }
  431. if (is_all) {
  432. // 埋点
  433. _log_obj.objectType = Report.objectType.follow_button
  434. }
  435. Report.reportLog(_log_obj);
  436. }
  437. // 我领取了的状态
  438. function myReceivedState() {
  439. data.status = 'opened'
  440. data.money = data.detail.myReceived.amountValue
  441. // 我的红包已经过期了 and 大红包可以领取
  442. if (data.detail.myReceived.taskFinishStatus == 2 && !data.detail.receiveTimeExpired) {
  443. data.status = 'not-open'
  444. // 任务已经被领完了
  445. if (data.detail.totalCount == data.detail.receiveCount) {
  446. data.status = 'close'
  447. data.close_text = ['All the rewards have', 'been taken out, come', 'earlier next time! ']
  448. // 埋点
  449. Report.reportLog({
  450. pageSource: Report.pageSource.been_claimed_page,
  451. businessType: Report.businessType.pageView,
  452. });
  453. }
  454. // 我领取未完成
  455. } else if (data.detail.myReceived.taskFinishStatus == 0 && data.detail.status == 1) {
  456. initTaskDetail()
  457. getValidity()
  458. data.detail.taskCondition = JSON.parse(data.detail.taskCondition)
  459. data.detail.amountValue = showLastTwoPlace(data.detail.amountValue)
  460. data.detail.receiveAmountValue = showLastTwoPlace(data.detail.receiveAmountValue)
  461. // 埋点
  462. Report.reportLog({
  463. pageSource: Report.pageSource.task_page,
  464. businessType: Report.businessType.pageView,
  465. });
  466. // 大红包不能领取了 and 我的红包过期了
  467. } else if (data.detail.receiveTimeExpired && data.detail.myReceived.taskFinishStatus == 2) {
  468. data.status = 'close'
  469. data.close_text = ['This Giveaways', `expired on ${moment(data.detail.endTimestamp).format('MM-DD')}`]
  470. // 埋点
  471. Report.reportLog({
  472. pageSource: Report.pageSource.expired_page,
  473. businessType: Report.businessType.pageView,
  474. });
  475. // 我领取成功了
  476. } else if (data.detail.myReceived.taskFinishStatus == 1) {
  477. data.status = 'success'
  478. // 埋点
  479. Report.reportLog({
  480. pageSource: Report.pageSource.received_success_page,
  481. businessType: Report.businessType.pageView,
  482. });
  483. }
  484. }
  485. // 重新绑定
  486. const reSetBindTwtterId = (_params) => {
  487. getChromeStorage('userInfo', (_userInfo) => {
  488. if (_userInfo.uid == _params.uid) {
  489. srcPublishSuccess({
  490. params: {
  491. postId: data.postId,
  492. srcContentId: data.tweetId
  493. }
  494. }).then((res) => {
  495. if (res.code == 0) {
  496. Report.reportLog({
  497. objectType: Report.objectType.tweetPostBinded
  498. });
  499. init()
  500. }
  501. data.console_str.tweet_info = res.msg
  502. })
  503. }
  504. })
  505. }
  506. function showLastTwoPlace(n) {
  507. return n
  508. }
  509. let start_time = new Date().getTime()
  510. data.console_str = {}
  511. function init() {
  512. data.console_str.postId = data.postId
  513. getPostDetail({
  514. params: {
  515. postId: data.postId
  516. }
  517. }).then((res) => {
  518. data.loading_show = false
  519. if (res.code == 0) {
  520. data.srcContentId = res.data.srcContentId
  521. if(!data.srcContentId){
  522. reSetBindTwtterId(res.data)
  523. return
  524. }
  525. data.console_str.time = (new Date().getTime() - start_time) / 1000 + 's'
  526. data.console_str.tweetId = res.data.srcContentId
  527. data.detail = JSON.parse(res.data.postBizData)
  528. data.console_str.status = data.detail.status
  529. console.log(data.detail)
  530. // 红包未开始
  531. if (data.detail.status == 0) {
  532. data.status = 'not-open'
  533. Report.reportLog({
  534. pageSource: Report.pageSource.pending_page,
  535. businessType: Report.businessType.pageView
  536. });
  537. // 任务进行中
  538. } else if (data.detail.status == 1) {
  539. // 我领取过的状态
  540. if (data.detail.myReceived) {
  541. myReceivedState()
  542. } else {
  543. // 任务已经被领完了
  544. if (data.detail.totalCount == data.detail.receiveCount) {
  545. data.status = 'close'
  546. data.close_text = ['All the rewards have', 'been taken out, come', 'earlier next time! ']
  547. // 埋点
  548. Report.reportLog({
  549. pageSource: Report.pageSource.been_claimed_page,
  550. businessType: Report.businessType.pageView,
  551. });
  552. } else if (data.detail.receiveTimeExpired) {
  553. // 大红包不可以领取了
  554. data.status = 'close'
  555. data.close_text = [`This Giveaways`, `expired on ${moment(data.detail.endTimestamp).format('MM-DD')}`]
  556. // 埋点
  557. Report.reportLog({
  558. pageSource: Report.pageSource.expired_page,
  559. businessType: Report.businessType.pageView,
  560. });
  561. } else {
  562. data.status = 'not-open'
  563. Report.reportLog({
  564. pageSource: Report.pageSource.pending_page,
  565. businessType: Report.businessType.pageView
  566. });
  567. }
  568. }
  569. // 任务已经结束了
  570. } else if (data.detail.status == 2) {
  571. // 我领取过的状态
  572. if (data.detail.myReceived) {
  573. myReceivedState()
  574. } else {
  575. data.status = 'close'
  576. data.close_text = [`This Giveaways`, `expired on ${moment(data.detail.endTimestamp).format('MM-DD')}`]
  577. Report.reportLog({
  578. pageSource: Report.pageSource.expired_page,
  579. businessType: Report.businessType.pageView,
  580. });
  581. }
  582. }
  583. } else {
  584. data.console_str.time = (new Date().getTime() - start_time) / 1000
  585. data.console_str.msg = res.msg
  586. handleErrorCode(res)
  587. }
  588. })
  589. }
  590. function initTaskDetail() {
  591. // 任务详情
  592. getTaskDetail({
  593. params: {
  594. postId: data.postId
  595. }
  596. }).then((res) => {
  597. if (res.code.toString()) {
  598. for (let i in res.data) {
  599. switch (res.data[i].type) {
  600. case 1:
  601. data.done.follow = res.data[i].finished
  602. data.detail.taskCondition[0].relatedUsers = res.data[i].detail
  603. break
  604. case 2:
  605. data.done.like = res.data[i].finished
  606. break
  607. case 3:
  608. data.done.retweet = res.data[i].finished
  609. break
  610. }
  611. }
  612. } else {
  613. handleErrorCode(res)
  614. }
  615. })
  616. }
  617. onMounted(() => {
  618. data.postId = getQueryString('postId')
  619. data.tweetId = getQueryString('tweetId')
  620. init()
  621. // data.loading_show = true
  622. })
  623. // 点击领取
  624. function clickOpenRedPacket() {
  625. chrome.runtime.sendMessage({
  626. actionType: 'CONTENT_GET_PINED'
  627. }, res => {
  628. console.log(res);
  629. })
  630. handleRedPacket()
  631. }
  632. function handleRedPacket() {
  633. getRedPacket({
  634. params: {
  635. postId: data.postId
  636. }
  637. }).then((res) => {
  638. if (res.code == 0) {
  639. data.status = 'opened'
  640. data.money = res.data.receiveAmount
  641. init()
  642. } else {
  643. handleErrorCode(res)
  644. }
  645. })
  646. // 埋点
  647. Report.reportLog({
  648. pageSource: Report.pageSource.pending_page,
  649. businessType: Report.businessType.buttonClick,
  650. objectType: Report.objectType.open_button
  651. });
  652. }
  653. chrome.storage.onChanged.addListener(changes => {
  654. if (changes.userInfo) {
  655. // let item = JSON.parse(changes.userInfo.newValue)
  656. data.loading_show = false
  657. init()
  658. }
  659. })
  660. // 校验是否封路
  661. function checkIsLogin() {
  662. return new Promise((resolve) => {
  663. getChromeStorage('userInfo', (_userInfo) => {
  664. if (!_userInfo) {
  665. data.loading_show = true
  666. setTimeout(() => {
  667. data.loading_show = false
  668. }, 3000)
  669. chrome.runtime.sendMessage(
  670. { actionType: "POPUP_LOGIN", data: "" },
  671. (response) => {
  672. console.log("res", response);
  673. }
  674. )
  675. resolve(_userInfo)
  676. } else {
  677. resolve(_userInfo)
  678. }
  679. })
  680. })
  681. }
  682. async function clickGetGiveaways() {
  683. let _userInfo = await checkIsLogin()
  684. if (_userInfo) {
  685. handleFinishRedPacket()
  686. }
  687. }
  688. function handleFinishRedPacket() {
  689. data.loading_show = true
  690. finishRedPacket({
  691. params: {
  692. postId: data.postId
  693. }
  694. }).then((res) => {
  695. data.loading_show = false
  696. if (res.code == 0) {
  697. if (res.data.finished) {
  698. data.status = 'success'
  699. data.receiveAmount = res.data.receiveAmount
  700. // 埋点
  701. Report.reportLog({
  702. pageSource: Report.pageSource.task_page,
  703. businessType: Report.businessType.buttonClick,
  704. objectType: Report.objectType.get_giveaway
  705. }, {
  706. get_giveaway_result: Report.extParams.success
  707. });
  708. init()
  709. } else {
  710. let _data = res.data.conditionResult
  711. for (let i in _data) {
  712. switch (_data[i].type.toString()) {
  713. case '1':
  714. data.detail.taskCondition[0].relatedUsers = _data[i].detail
  715. if (_data[i].finished) {
  716. data.done.follow = true
  717. } else {
  718. // alert('Please complete the task: follow')
  719. data.done.follow_red = true
  720. }
  721. break
  722. case '2':
  723. if (_data[i].finished) {
  724. data.done.like = true
  725. } else {
  726. // alert('Please complete the task: like tweet')
  727. data.done.like_red = true
  728. }
  729. break
  730. case '3':
  731. if (_data[i].finished) {
  732. data.done.retweet = true
  733. } else {
  734. // alert('Please complete the task: Retweet')
  735. data.done.retweet_red = true
  736. }
  737. break
  738. }
  739. }
  740. // 埋点
  741. Report.reportLog({
  742. pageSource: Report.pageSource.task_page,
  743. businessType: Report.businessType.buttonClick,
  744. objectType: Report.objectType.get_giveaway
  745. }, {
  746. get_giveaway_result: Report.extParams.failure
  747. });
  748. }
  749. } else {
  750. // 埋点
  751. Report.reportLog({
  752. pageSource: Report.pageSource.task_page,
  753. businessType: Report.businessType.buttonClick,
  754. objectType: Report.objectType.get_giveaway
  755. }, {
  756. get_giveaway_result: Report.extParams.failure
  757. });
  758. handleErrorCode(res)
  759. }
  760. })
  761. }
  762. function handleErrorCode(res) {
  763. switch (res.code.toString()) {
  764. // 数据异常,请联系管理员
  765. case '-102':
  766. break
  767. //系统错误
  768. case '-101':
  769. break
  770. // 参数不对
  771. case '-103':
  772. break
  773. // 接口被限流
  774. case '-105':
  775. break
  776. // 访问凭证不存在
  777. case '-107':
  778. break
  779. // 重复操作过于频繁
  780. case '-106':
  781. message.error('Clicking too often, wait a moment and click again')
  782. this.loading_show = false
  783. break
  784. // 红包不存在
  785. case '2001':
  786. // message.error(res.msg)
  787. break
  788. // 还未到红包领取时间
  789. case '2002':
  790. // message.error(res.msg)
  791. break
  792. // 已超过红包领取时间
  793. case '2003':
  794. init()
  795. break
  796. // 红包支付状态异常 没有可提交的任务红包
  797. case '2004':
  798. data.status = 'not-open'
  799. break
  800. // 红包活动已结束
  801. case '2006':
  802. init()
  803. break
  804. // 红包金额已经被领取完了
  805. case '2007':
  806. data.status = 'close'
  807. data.close_text = ['All the rewards have', 'been taken out, come', 'earlier next time! ']
  808. // 埋点
  809. Report.reportLog({
  810. pageSource: Report.pageSource.been_claimed_page,
  811. businessType: Report.businessType.pageView,
  812. });
  813. init()
  814. break
  815. // 红包个数已经被领取完了
  816. case '2008':
  817. data.status = 'close'
  818. data.close_text = ['All the rewards have', 'been taken out, come', 'earlier next time! ']
  819. // 埋点
  820. Report.reportLog({
  821. pageSource: Report.pageSource.been_claimed_page,
  822. businessType: Report.businessType.pageView,
  823. });
  824. init()
  825. break
  826. // 该用户不满足领取条件
  827. case '2009':
  828. data.error_txt = [`oops, new accounts cannot participate in this event,`]
  829. data.status = 'error'
  830. data.retry = true
  831. // 埋点
  832. Report.reportLog({
  833. pageSource: Report.pageSource.robot_detection_failed_page,
  834. businessType: Report.businessType.pageView,
  835. });
  836. break
  837. // 无法校验用户Twitter信息
  838. case '2010':
  839. // message.error(res.msg)
  840. break
  841. // 用户已经领过该红包
  842. case '2011':
  843. // message.error(res.msg)
  844. break
  845. // 推文不存在
  846. case '2022':
  847. // message.error(res.msg)
  848. break
  849. // 推文未发布 and 不是红包任务的推文
  850. case '2023':
  851. // message.error(res.msg)
  852. break
  853. // 没有可提交的任务红包
  854. case '2024':
  855. data.status = 'not-open'
  856. break
  857. // 红包任务已完成
  858. case '2025':
  859. break
  860. // 任务已经过期
  861. case '2026':
  862. break
  863. // 任务未完成
  864. case '2027':
  865. break
  866. // 红包金额每人不足1分钱
  867. case '2028':
  868. break
  869. // 推文未发布
  870. case '2029':
  871. message.error('Tweet not posted')
  872. break
  873. // 不是红包任务的推文
  874. case '2030':
  875. break
  876. //用户没有领取过红包,无法重抽
  877. case '2031':
  878. break
  879. }
  880. }
  881. function clickBack() {
  882. data.status = 'opened'
  883. // 埋点
  884. Report.reportLog({
  885. pageSource: Report.pageSource.task_page,
  886. businessType: Report.businessType.pageView,
  887. });
  888. }
  889. function clickRoad() {
  890. data.status = 'luck-peopel-list'
  891. // 埋点
  892. Report.reportLog({
  893. pageSource: Report.pageSource.task_page,
  894. businessType: Report.businessType.buttonClick,
  895. objectType: Report.objectType.received_list
  896. });
  897. // 埋点
  898. Report.reportLog({
  899. pageSource: Report.pageSource.received_list_page,
  900. businessType: Report.businessType.pageView
  901. });
  902. }
  903. </script>
  904. <style lang="scss">
  905. html,
  906. body {
  907. margin: 0;
  908. padding: 0;
  909. width: 375px;
  910. height: 500px;
  911. }
  912. .content {
  913. width: 375px;
  914. height: 500px;
  915. background: #fafafa;
  916. border-radius: 11px;
  917. overflow: hidden;
  918. box-sizing: border-box;
  919. border: 1px solid #DCDCDC;
  920. font-family: "SF Pro Display";
  921. font-style: normal;
  922. .loading {
  923. background: #FFFFFF;
  924. opacity: 0.8;
  925. z-index: 222;
  926. text-align: center;
  927. width: 375px;
  928. height: 500px;
  929. position: fixed;
  930. top: 0;
  931. left: 0;
  932. img {
  933. margin-top: 216px;
  934. width: 70px;
  935. height: 70px;
  936. }
  937. }
  938. .error {
  939. width: 100%;
  940. height: 100%;
  941. text-align: center;
  942. position: relative;
  943. img {
  944. width: 100px;
  945. height: 100px;
  946. margin-top: 100px;
  947. }
  948. .txt {
  949. font-weight: 500;
  950. font-size: 22px;
  951. line-height: 26px;
  952. text-align: center;
  953. letter-spacing: 0.3px;
  954. color: #a8a8a8;
  955. margin: 34px 44px 0 44px;
  956. }
  957. .retry {
  958. position: absolute;
  959. bottom: 30px;
  960. left: 50%;
  961. margin-left: -167.5px;
  962. width: 335px;
  963. height: 46px;
  964. line-height: 46px;
  965. text-align: center;
  966. border-radius: 100px;
  967. border: 1px solid #1D9BF0;
  968. background: rgba(196, 196, 196, 0.01);
  969. color: #1D9BF0;
  970. font-size: 16px;
  971. font-weight: 500;
  972. cursor: pointer;
  973. }
  974. }
  975. .success,
  976. .close,
  977. .luck-peopel-list {
  978. filter: drop-shadow(0px 4px 94px rgba(0, 0, 0, 0.3));
  979. width: 100%;
  980. height: 100%;
  981. border-radius: 11px;
  982. background: #fff;
  983. overflow: hidden;
  984. display: flex;
  985. flex-direction: column;
  986. .close-title {
  987. width: 100%;
  988. font-weight: 600;
  989. font-size: 27px;
  990. line-height: 32px;
  991. text-align: center;
  992. letter-spacing: 0.3px;
  993. color: #ffffff;
  994. }
  995. .head {
  996. padding: 14px 16px;
  997. img {
  998. cursor: pointer;
  999. width: 24px;
  1000. height: 24px;
  1001. }
  1002. }
  1003. .header {
  1004. text-align: center;
  1005. min-height: 150px;
  1006. width: 100%;
  1007. background: #fff;
  1008. // padding-top: 30px;
  1009. background-size: 100% 100%;
  1010. position: relative;
  1011. display: flex;
  1012. align-content: center;
  1013. flex-wrap: wrap;
  1014. .done {
  1015. cursor: pointer;
  1016. position: absolute;
  1017. top: 107px;
  1018. left: 50%;
  1019. margin-left: -150px;
  1020. width: 300px;
  1021. height: 60px;
  1022. display: flex;
  1023. align-items: center;
  1024. border-radius: 100px;
  1025. background: #ffffff;
  1026. box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1);
  1027. justify-content: center;
  1028. span {
  1029. color: #000000;
  1030. font-size: 14px;
  1031. }
  1032. .icon-done {
  1033. width: 24px;
  1034. height: 24px;
  1035. margin-right: 10px;
  1036. }
  1037. .icon-right {
  1038. margin-left: 5px;
  1039. width: 7px;
  1040. height: 14px;
  1041. }
  1042. }
  1043. .title {
  1044. margin-top: 30px;
  1045. color: #fff7e4;
  1046. opacity: 0.6;
  1047. font-weight: 700;
  1048. font-size: 18px;
  1049. line-height: 21px;
  1050. letter-spacing: -0.3px;
  1051. }
  1052. .money {
  1053. margin-bottom: 30px;
  1054. width: 100%;
  1055. display: flex;
  1056. justify-content: center;
  1057. align-items: center;
  1058. img {
  1059. width: 40px;
  1060. height: 40px;
  1061. margin-right: 9px;
  1062. }
  1063. .big {
  1064. font-weight: 700;
  1065. font-size: 46px;
  1066. line-height: 55px;
  1067. /* identical to box height */
  1068. letter-spacing: 0.3px;
  1069. color: #fff;
  1070. }
  1071. .small {
  1072. margin-left: 4px;
  1073. font-weight: 700;
  1074. font-size: 13px;
  1075. line-height: 16px;
  1076. /* identical to box height */
  1077. letter-spacing: 0.5px;
  1078. color: #fff;
  1079. }
  1080. }
  1081. }
  1082. .luck-list-title {
  1083. /* margin-top: 47px;*/
  1084. margin: 0 16px;
  1085. padding: 14px 0 11px 0;
  1086. background: #fff;
  1087. display: flex;
  1088. justify-content: space-between;
  1089. color: #B0B0B0;
  1090. border-bottom: 1px solid #D1D1D1;
  1091. div:last-child {
  1092. text-align: right;
  1093. }
  1094. }
  1095. .luck-list {
  1096. background: #fff;
  1097. overflow: auto;
  1098. .luck-item {
  1099. display: flex;
  1100. padding: 12px 0;
  1101. margin: 0 16px;
  1102. border-bottom: 1px solid #d1d1d1;
  1103. justify-content: space-between;
  1104. position: relative;
  1105. img:first-child {
  1106. border-radius: 50%;
  1107. }
  1108. .luck-king {
  1109. position: absolute;
  1110. top: 36px;
  1111. right: 0px;
  1112. display: flex;
  1113. align-items: center;
  1114. img {
  1115. width: 22px;
  1116. height: 19px;
  1117. margin: 0;
  1118. }
  1119. span {
  1120. font-weight: 500;
  1121. font-size: 12px;
  1122. line-height: 14px;
  1123. letter-spacing: 0.3px;
  1124. color: #f5b945;
  1125. }
  1126. }
  1127. img {
  1128. width: 42px;
  1129. height: 42px;
  1130. margin-right: 12px;
  1131. }
  1132. .luck-content {
  1133. flex: auto;
  1134. .luck-title {
  1135. font-weight: 500;
  1136. font-size: 16px;
  1137. letter-spacing: 0.3px;
  1138. color: #444444;
  1139. }
  1140. .luck-time {
  1141. font-weight: 400;
  1142. font-size: 12px;
  1143. line-height: 14px;
  1144. color: #9b9b9b;
  1145. }
  1146. }
  1147. .luck-money {
  1148. display: flex;
  1149. height: 17px;
  1150. align-items: center;
  1151. height: 100%;
  1152. img {
  1153. width: 14px;
  1154. height: 14px;
  1155. margin-right: 6px;
  1156. }
  1157. .luck-money-txt {
  1158. font-weight: 500;
  1159. font-size: 14px;
  1160. word-break: break-all;
  1161. /* identical to box height */
  1162. text-align: right;
  1163. letter-spacing: 0.3px;
  1164. color: #444444;
  1165. }
  1166. }
  1167. }
  1168. .luck-item:last-child {
  1169. border: 0;
  1170. }
  1171. }
  1172. }
  1173. .success {
  1174. .luck-list-title {
  1175. margin-top: 17px;
  1176. margin-bottom: 11px;
  1177. border-bottom: 1px solid #D1D1D1;
  1178. }
  1179. }
  1180. .opened {
  1181. filter: drop-shadow(0px 4px 94px rgba(0, 0, 0, 0.3));
  1182. width: 100%;
  1183. height: 100%;
  1184. display: flex;
  1185. flex-direction: column;
  1186. justify-content: space-between;
  1187. border-radius: 11px;
  1188. overflow: hidden;
  1189. .header {
  1190. text-align: center;
  1191. min-height: 150px;
  1192. width: 100%;
  1193. background: #fff;
  1194. // padding-top: 30px;
  1195. background-size: 100% 100%;
  1196. display: flex;
  1197. flex-wrap: wrap;
  1198. align-content: center;
  1199. .title {
  1200. color: #fff;
  1201. opacity: 0.6;
  1202. width: 100%;
  1203. font-weight: 700;
  1204. font-size: 18px;
  1205. line-height: 21px;
  1206. letter-spacing: -0.3px;
  1207. margin-bottom: 10px;
  1208. }
  1209. .money {
  1210. width: 100%;
  1211. display: flex;
  1212. justify-content: center;
  1213. align-items: center;
  1214. img {
  1215. margin-right: 9px;
  1216. width: 40px;
  1217. height: 40px;
  1218. }
  1219. .big {
  1220. font-weight: 700;
  1221. font-size: 46px;
  1222. line-height: 55px;
  1223. /* identical to box height */
  1224. letter-spacing: 0.3px;
  1225. color: #fff;
  1226. }
  1227. .small {
  1228. margin-left: 4px;
  1229. font-weight: 700;
  1230. font-size: 13px;
  1231. line-height: 16px;
  1232. /* identical to box height */
  1233. letter-spacing: 0.5px;
  1234. color: #fff;
  1235. }
  1236. }
  1237. }
  1238. .list {
  1239. padding: 0 16px 0 16px;
  1240. background: #ffffff;
  1241. flex: 1;
  1242. .item {
  1243. display: flex;
  1244. align-items: center;
  1245. min-height: 50px;
  1246. border-bottom: 1px solid #f0f0f0;
  1247. img {
  1248. width: 24px;
  1249. height: 24px;
  1250. }
  1251. .red-right {
  1252. width: 35px;
  1253. height: 24px;
  1254. }
  1255. .item-content {
  1256. width: 100%;
  1257. flex: 1;
  1258. .item-follow-title {
  1259. display: flex;
  1260. align-items: center;
  1261. margin-top: 20px;
  1262. margin-bottom: 11px;
  1263. position: relative;
  1264. .btn {
  1265. // position: absolute;
  1266. // right: 0;
  1267. }
  1268. }
  1269. .item-title {
  1270. flex: 1;
  1271. margin-left: 10px;
  1272. font-weight: 500;
  1273. font-size: 16px;
  1274. letter-spacing: 0.3px;
  1275. color: #000000;
  1276. }
  1277. .item-follow-area {
  1278. display: flex;
  1279. flex-wrap: wrap;
  1280. .item-follow {
  1281. cursor: pointer;
  1282. border: 1px solid #ebebeb;
  1283. border-radius: 1000px;
  1284. height: 26px;
  1285. margin-right: 5px;
  1286. margin-bottom: 5px;
  1287. display: flex;
  1288. align-items: center;
  1289. .finished {
  1290. text-decoration: line-through;
  1291. color: #949494;
  1292. }
  1293. span {
  1294. margin-left: 8px;
  1295. margin-right: 2px;
  1296. color: #1D9BF0;
  1297. opacity: 1;
  1298. }
  1299. img {
  1300. width: 16px;
  1301. height: 16px;
  1302. margin-right: 7px;
  1303. }
  1304. }
  1305. }
  1306. span {
  1307. font-weight: 400;
  1308. font-size: 11px;
  1309. line-height: 13px;
  1310. letter-spacing: 0.3px;
  1311. color: #000000;
  1312. opacity: 0.4;
  1313. }
  1314. }
  1315. .btn {
  1316. width: 90px;
  1317. height: 29px;
  1318. line-height: 29px;
  1319. background: rgba(56, 154, 255, 0.1);
  1320. border-radius: 500px;
  1321. text-align: center;
  1322. letter-spacing: 0.3px;
  1323. color: #1D9BF0;
  1324. cursor: pointer;
  1325. }
  1326. }
  1327. }
  1328. .people {
  1329. cursor: pointer;
  1330. padding-left: 16px;
  1331. height: 38px;
  1332. line-height: 38px;
  1333. background: #fff;
  1334. border-bottom: 1px solid #f0f0f0;
  1335. box-shadow: 0px 1px 0px #f2f2f2;
  1336. display: flex;
  1337. align-items: center;
  1338. justify-content: space-between;
  1339. .txt {
  1340. width: 90%;
  1341. font-weight: 400;
  1342. font-size: 12px;
  1343. line-height: 14px;
  1344. letter-spacing: 0.3px;
  1345. color: #000000;
  1346. opacity: 0.4;
  1347. }
  1348. .right {
  1349. flex: 1;
  1350. cursor: pointer;
  1351. margin-right: 22px;
  1352. display: flex;
  1353. align-items: center;
  1354. position: relative;
  1355. img {
  1356. position: absolute;
  1357. width: 22px;
  1358. height: 22px;
  1359. border: 2px solid #fff;
  1360. border-radius: 50%;
  1361. }
  1362. .road {
  1363. right: 0;
  1364. width: 7px;
  1365. height: 14px;
  1366. }
  1367. }
  1368. }
  1369. .footer {
  1370. background: #ffffff;
  1371. display: flex;
  1372. padding: 15px 22px 15px 17px;
  1373. .first {
  1374. flex: 1;
  1375. .validity {
  1376. font-weight: 400;
  1377. font-size: 12px;
  1378. line-height: 14px;
  1379. letter-spacing: 0.3px;
  1380. color: #000000;
  1381. opacity: 0.4;
  1382. margin: 2px 0 8px 0;
  1383. }
  1384. .time {
  1385. font-weight: 500;
  1386. font-size: 13px;
  1387. line-height: 16px;
  1388. /* identical to box height */
  1389. color: #000000;
  1390. }
  1391. }
  1392. .btn {
  1393. background: #1D9BF0;
  1394. border-radius: 100px;
  1395. color: #fff;
  1396. width: 258px;
  1397. height: 52px;
  1398. font-weight: 600;
  1399. font-size: 18px;
  1400. line-height: 52px;
  1401. text-align: center;
  1402. cursor: pointer;
  1403. }
  1404. }
  1405. }
  1406. .not-open {
  1407. width: 100%;
  1408. height: 100%;
  1409. filter: drop-shadow(0px 2px 20px rgba(0, 0, 0, 0.1));
  1410. position: relative;
  1411. overflow: hidden;
  1412. border-radius: 11px;
  1413. .money-area {
  1414. width: 100%;
  1415. position: absolute;
  1416. top: 65px;
  1417. display: flex;
  1418. flex-wrap: wrap;
  1419. align-items: center;
  1420. justify-content: center;
  1421. .txt {
  1422. font-weight: 800;
  1423. font-size: 16px;
  1424. text-align: center;
  1425. letter-spacing: 0.3px;
  1426. color: #FFFFFF;
  1427. }
  1428. .coin {
  1429. text-align: center;
  1430. margin-top: 6px;
  1431. margin-bottom: 7px;
  1432. display: flex;
  1433. justify-content: center;
  1434. align-items: center;
  1435. width: 90%;
  1436. img {
  1437. width: 46px;
  1438. height: 46px;
  1439. border-radius: 50%;
  1440. border: 3px solid #FFFFFF;
  1441. }
  1442. span {
  1443. margin-left: 15px;
  1444. font-weight: 800;
  1445. font-size: 60px;
  1446. line-height: 76px;
  1447. color: #FFFFFF;
  1448. }
  1449. }
  1450. .people {
  1451. font-weight: 800;
  1452. font-size: 13px;
  1453. line-height: 16px;
  1454. letter-spacing: 0.05em;
  1455. text-align: center;
  1456. color: #FFFFFF;
  1457. }
  1458. }
  1459. .title {
  1460. position: absolute;
  1461. top: 15px;
  1462. left: 15px;
  1463. z-index: 3;
  1464. display: flex;
  1465. align-items: center;
  1466. img {
  1467. width: 24px;
  1468. height: 24px;
  1469. border: 2px solid #FFF;
  1470. border-radius: 50%;
  1471. }
  1472. span {
  1473. margin-left: 10px;
  1474. font-weight: 600;
  1475. font-size: 16px;
  1476. letter-spacing: 0.3px;
  1477. color: #fff;
  1478. }
  1479. }
  1480. // .txt {
  1481. // width: 100%;
  1482. // position: absolute;
  1483. // font-style: normal;
  1484. // font-weight: 700;
  1485. // font-size: 42px;
  1486. // line-height: 50px;
  1487. // text-align: center;
  1488. // color: #FFF2D3;
  1489. // top: 90px;
  1490. // z-index: 3;
  1491. // }
  1492. img {
  1493. width: 100%;
  1494. }
  1495. .up {
  1496. position: absolute;
  1497. top: 0;
  1498. // box-shadow: 0px 4px 44px rgba(0, 0, 0, 0.1);
  1499. z-index: 1;
  1500. }
  1501. .down {
  1502. position: absolute;
  1503. top: 253px;
  1504. }
  1505. .open {
  1506. width: 335px;
  1507. height: 50px;
  1508. cursor: pointer;
  1509. position: absolute;
  1510. bottom: 28px;
  1511. left: 50%;
  1512. margin-left: -167.5px;
  1513. z-index: 4;
  1514. }
  1515. .open-gif {
  1516. width: 200px;
  1517. height: 200px;
  1518. text-align: center;
  1519. position: absolute;
  1520. bottom: 70px;
  1521. left: 50%;
  1522. margin-left: -100px;
  1523. z-index: 3;
  1524. }
  1525. }
  1526. }
  1527. </style>