red-packet.vue 43 KB

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