red-packet.vue 49 KB

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