red-packet.vue 57 KB

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