luck-draw.vue 93 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923
  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"
  9. :style="{ 'backgroundImage': `url(${require('@/assets/subject/002-back-head-top-1.svg')})` }">
  10. <!-- -->
  11. <img :src="require('@/assets/subject/001-icon-red-packet.svg')" alt="">
  12. <div class="txt">
  13. <p>Complete tasks</p>
  14. <p>to Draw Prizes</p>
  15. </div>
  16. </div>
  17. <div class="list">
  18. <template v-for="item, i in state.detail.taskCondition" v-bind:key="i">
  19. <div class="item" v-if="item.type == 1 && item.relatedUsers && item.relatedUsers.length > 0">
  20. <div class="item-content">
  21. <div class="item-follow-title">
  22. <img :src="require('@/assets/svg/icon-task-twitter.svg')" alt />
  23. <!-- <img :src="require('@/assets/svg/icon-follow.svg')" alt /> -->
  24. <div class="item-title">Follow</div>
  25. <img :src="require('@/assets/gif/red-right.gif')" alt class="red-right"
  26. v-show="!state.done.follow && state.done.follow_red" />
  27. <img v-if="state.done.follow" :src="require('@/assets/svg/icon-true.svg')" alt />
  28. <div v-else class="btn" @click="clickFollowAll(item.relatedUsers, 'all')">Follow All
  29. </div>
  30. </div>
  31. <div class="item-follow-area">
  32. <template v-for="item2, i in item.relatedUsers" v-bind:key="i">
  33. <div class="item-follow" v-if="item2.finished">
  34. <span :class="{ finished: item2.finished }">@{{ item2.name }}</span>
  35. <img :src="require('@/assets/svg/icon-true-ed.svg')" alt />
  36. </div>
  37. <div class="item-follow" v-else @click="clickFollowAll([item2])">
  38. <span :class="{ finished: item2.finished }">@{{ item2.name }}</span>
  39. <img :src="require('@/assets/svg/icon-add.svg')" alt />
  40. </div>
  41. </template>
  42. </div>
  43. </div>
  44. </div>
  45. <div class="item" v-if="item.type == 2">
  46. <img :src="require('@/assets/svg/icon-task-twitter.svg')" alt />
  47. <!-- <img :src="require('@/assets/svg/icon-like.svg')" alt /> -->
  48. <div class="item-content">
  49. <div class="item-title">Like</div>
  50. </div>
  51. <img :src="require('@/assets/gif/red-right.gif')" alt class="red-right"
  52. v-show="!state.done.like && state.done.like_red" />
  53. <img v-if="state.done.like" :src="require('@/assets/svg/icon-true.svg')" alt />
  54. <div v-else class="btn" @click="clickLikeBtn">Like</div>
  55. </div>
  56. <div class="item" v-if="item.type == 3">
  57. <img :src="require('@/assets/svg/icon-task-twitter.svg')" alt />
  58. <!-- <img :src="require('@/assets/svg/icon-retweet.svg')" alt /> -->
  59. <div class="item-content">
  60. <div class="item-title">Retweet</div>
  61. </div>
  62. <img :src="require('@/assets/gif/red-right.gif')" alt class="red-right"
  63. v-show="!state.done.retweet && state.done.retweet_red" />
  64. <img v-if="state.done.retweet" :src="require('@/assets/svg/icon-true.svg')" alt />
  65. <div v-else class="btn" @click="clickRetweetBtn">Retweet</div>
  66. </div>
  67. <!-- Comment、艾特 friends -->
  68. <div class="item" v-if="item.type == 9">
  69. <img :src="require('@/assets/svg/icon-task-twitter.svg')" alt />
  70. <div class="item-content">
  71. <div class="item-title">Comment and Tag 3 friends</div>
  72. </div>
  73. <img :src="require('@/assets/gif/red-right.gif')" alt class="red-right"
  74. v-show="!state.done.reply && state.done.reply_red" />
  75. <img v-if="state.done.reply" :src="require('@/assets/svg/icon-true.svg')" alt />
  76. <div v-else class="btn" @click="clickReply(item)">Comment</div>
  77. </div>
  78. <!-- repost feacebook -->
  79. <div class="item" v-if="item.type == 8">
  80. <img :src="require('@/assets/svg/icon-task-facebook.svg')" alt />
  81. <div class="item-content">
  82. <div class="item-title">Repost to Facebook</div>
  83. </div>
  84. <img :src="require('@/assets/gif/red-right.gif')" alt class="red-right"
  85. v-show="!state.done.repost_facebook && state.done.repost_facebook_red" />
  86. <img v-if="state.done.repost_facebook" :src="require('@/assets/svg/icon-true.svg')" alt />
  87. <div v-else class="btn" @click="clickRepostFacebook(item)">Repost</div>
  88. </div>
  89. <!-- join discord -->
  90. <div class="item" v-if="item.type == 7">
  91. <img :src="require('@/assets/svg/icon-discord-mini.svg')" alt />
  92. <div class="item-content">
  93. <div class="item-title">Join Discord</div>
  94. </div>
  95. <img :src="require('@/assets/gif/red-right.gif')" alt class="red-right"
  96. v-show="!state.done.join_discord && state.done.join_discord_red" />
  97. <img v-if="state.done.join_discord" :src="require('@/assets/svg/icon-true.svg')" alt />
  98. <template v-else>
  99. <div v-if="joinDiscordIng" class="loading-wrapper">
  100. <img class="icon-loading" :src="require('@/assets/svg/icon-loading-gray.svg')" />
  101. </div>
  102. <div v-else class="btn" @click="joinDiscord">
  103. Join
  104. </div>
  105. </template>
  106. </div>
  107. </template>
  108. </div>
  109. <!-- <div class="people" @click="clickRoad">
  110. <div class="txt">
  111. {{ state.detail.receiveCount || 0 }}/{{ state.detail.totalCount || 0 }} Winners,{{
  112. state.detail.receiveAmountValue
  113. }}/{{ state.detail.amountValue }} {{ state.detail.currencySymbol }}</div>
  114. <div class="right" v-if="state.detail.allReceived">
  115. <img :src="require('@/assets/svg/icon-right.svg')" alt class="road" />
  116. </div>
  117. </div> -->
  118. <div class="footer">
  119. <div class="btn" @click="clickGetGiveaways">Complete</div>
  120. </div>
  121. </div>
  122. <!-- success -->
  123. <div v-if="state.status == 'success'" class="success">
  124. <div class="header"
  125. :style="{ 'backgroundImage': `url(${require('@/assets/subject/002-back-head-top-180.svg')})` }">
  126. <div class="success-title">
  127. 🎉 Awesome! You are Winner!
  128. </div>
  129. <div class="money">
  130. <img :src="state.detail.currencyIconPath" alt />
  131. <font-amount :amount="state.receiveAmount" class="big" :fontSize="46"></font-amount>
  132. <!-- <span class="small">{{ state.detail.currencySymbol }}</span> -->
  133. </div>
  134. <div class="done" @click="clickDone">
  135. <img :src="require('@/assets/subject/001-icon-done.svg')" alt class="icon-done" />
  136. <span>View Rewards In Wallet</span>
  137. <img :src="require('@/assets/svg/icon-right.svg')" alt class="icon-right" />
  138. </div>
  139. </div>
  140. <div class="luck-list-title">
  141. <div>{{ state.detail.receiveCount || 0 }}/{{ state.detail.totalCount || 0 }} Winners</div>
  142. <div class="right">
  143. <span class="text">
  144. <a-tooltip :title="state.detail.receiveAmountValue">
  145. {{ getBit(state.detail.receiveAmountValue) }}
  146. </a-tooltip>
  147. /
  148. <a-tooltip :title="state.detail.amountValue">
  149. {{ getBit(state.detail.amountValue) || '' }}
  150. </a-tooltip>
  151. </span>
  152. {{ state.detail.currencySymbol || '' }}
  153. </div>
  154. </div>
  155. <div class="luck-list max" @scroll="handleScroll($event)">
  156. <div class="luck-item" v-for="item, i in state.detail.allReceived" v-bind:key="i">
  157. <img v-if="item.simpleUserInfoVO.avatarUrl" :src="item.simpleUserInfoVO.avatarUrl"
  158. @click="openTwitterDetail(item)" alt />
  159. <img v-else :src="require('@/assets/svg/icon-twitter.svg')" alt />
  160. <img class="win" :src="require('@/assets/svg/icon-win-1.svg')" v-if="i==0" alt/>
  161. <img class="win" :src="require('@/assets/svg/icon-win-2.svg')" v-if="i==1" alt/>
  162. <img class="win" :src="require('@/assets/svg/icon-win-3.svg')" v-if="i==2" alt/>
  163. <div class="luck-content">
  164. <div class="luck-title" v-if="item.simpleUserInfoVO.nickName">{{ item.simpleUserInfoVO.nickName
  165. }}</div>
  166. <div class="luck-title" v-else>Twitter User</div>
  167. <div class="luck-time">{{ moment(item.receiveTimestamp).format('MM-DD HH:mm') }}</div>
  168. </div>
  169. <div class="luck-money">
  170. <img :src="state.detail.currencyIconPath" alt />
  171. <div class="luck-money-txt">
  172. <a-tooltip :title="item.amountValue">
  173. {{ getBit(item.amountValue) }}
  174. </a-tooltip>
  175. </div>
  176. </div>
  177. <div class="luck-king" v-if="item.maxAmount">
  178. <img :src="require('@/assets/svg/icon-king-hat.svg')" alt />
  179. <span>Luckiest Draw</span>
  180. </div>
  181. </div>
  182. </div>
  183. <get-more></get-more>
  184. </div>
  185. <!-- no-open -->
  186. <div v-else-if="state.status == 'not-open'" class="not-open">
  187. <img :src="require('@/assets/subject/002-card.svg')" alt="">
  188. <img class="open-gif" :src="require('@/assets/gif/002.png')" />
  189. <img :src="require('@/assets/svg/icon-participate.svg')" alt="" class="open" @click="clickOpenRedPacket">
  190. <div class="title" v-if="state.detail.postUserInfo">
  191. <img :src="state.detail.postUserInfo.avatarUrl" alt />
  192. <span>{{ state.detail.postUserInfo.nickName || 'FutureDoctor' }}</span>
  193. </div>
  194. <div class="money-area">
  195. <div class="txt">{{ state.detail.currencySymbol }} GIVEAWAY</div>
  196. <div class="coin">
  197. <img :src="state.detail.currencyIconPath" alt />
  198. <font-amount :amount="state.detail.amountValue" style="color:#fff;"></font-amount>
  199. </div>
  200. <!-- <div class="people">{{ state.detail.totalCount }} WINNERS TO SHARE</div> -->
  201. <div class="mark-area">
  202. <div class="time">
  203. <img :src="require('@/assets/svg/icon-time.svg')" />
  204. <span>{{ moment(state.detail.endTimestamp).format('HH:mm:ss') }}</span>
  205. </div>
  206. <div class="win">
  207. <img :src="require('@/assets/svg/icon-win.svg')" />
  208. <span>{{ state.detail.totalCount }}WINNERS</span>
  209. </div>
  210. </div>
  211. </div>
  212. </div>
  213. <!-- 领取列表 -->
  214. <div v-else-if="state.status == 'luck-peopel-list'" class="luck-peopel-list">
  215. <div class="head">
  216. <img :src="require('@/assets/svg/icon-back.svg')" alt />
  217. </div>
  218. <div class="luck-list-title">
  219. <div>{{ state.detail.receiveCount || 0 }}/{{ state.detail.totalCount || 0 }} Winners</div>
  220. <div class="right">
  221. <span class="text">
  222. <a-tooltip :title="state.detail.receiveAmountValue">
  223. {{ getBit(state.detail.receiveAmountValue) }}
  224. </a-tooltip>
  225. /
  226. <a-tooltip :title="state.detail.amountValue">
  227. {{ getBit(state.detail.amountValue) || '' }}
  228. </a-tooltip>
  229. </span> {{
  230. state.detail.currencySymbol || ''
  231. }}
  232. </div>
  233. </div>
  234. <div class="luck-list" @scroll="handleScroll">
  235. <div class="luck-item" v-for="item, i in state.detail.allReceived" v-bind:key="i">
  236. <img v-if="item.simpleUserInfoVO.avatarUrl" :src="item.simpleUserInfoVO.avatarUrl" alt
  237. @click="openTwitterDetail(item)" />
  238. <img v-else :src="require('@/assets/svg/icon-twitter.svg')" alt />
  239. <img class="win" :src="require('@/assets/svg/icon-win-1.svg')" v-if="i==0" alt/>
  240. <img class="win" :src="require('@/assets/svg/icon-win-2.svg')" v-if="i==1" alt/>
  241. <img class="win" :src="require('@/assets/svg/icon-win-3.svg')" v-if="i==2" alt/>
  242. <div class="luck-content">
  243. <div class="luck-title" v-if="item.simpleUserInfoVO.nickName">{{ item.simpleUserInfoVO.nickName
  244. }}</div>
  245. <div class="luck-title" v-else>Twitter User</div>
  246. <div class="luck-time">{{ moment(item.receiveTimestamp).format('MM-DD HH:mm:ss') }}</div>
  247. </div>
  248. <div class="luck-money">
  249. <img :src="state.detail.currencyIconPath" alt />
  250. <div class="luck-money-txt">
  251. <a-tooltip :title="item.amountValue">
  252. {{ getBit(item.amountValue) }}
  253. </a-tooltip>
  254. </div>
  255. </div>
  256. <div class="luck-king" v-if="item.maxAmount">
  257. <img :src="require('@/assets/svg/icon-king-hat.svg')" alt />
  258. <span>Luckiest Draw</span>
  259. </div>
  260. </div>
  261. </div>
  262. </div>
  263. <!-- 关闭状态 -->
  264. <div v-else-if="state.status == 'close'" class="close">
  265. <!-- 红包被领完了 -->
  266. <div class="header"
  267. :style="{ 'backgroundImage': `url(${require('@/assets/subject/002-back-head-top.svg')})` }"
  268. v-if="state.close_status == '已经过期了'">
  269. <div class="rabbit">
  270. <img class="flower" :src="require('@/assets/svg/icon-flower.svg')" alt />
  271. <p>This Draw is Complete</p>
  272. </div>
  273. </div>
  274. <!-- 没有抽中 -->
  275. <div class="header"
  276. :style="{ 'backgroundImage': `url(${require('@/assets/subject/002-back-head-top.svg')})` }"
  277. v-if="state.close_status == '没有抽中'">
  278. <div class="rabbit">
  279. <img :src="require('@/assets/subject/001-icon-rabbit.svg')" alt />
  280. <p>Good Luck Next Time!</p>
  281. </div>
  282. </div>
  283. <!-- 等待结果 -->
  284. <div class="header"
  285. :style="{ 'backgroundImage': `url(${require('@/assets/subject/002-back-head-top.svg')})` }"
  286. v-if="state.close_status == '等待结果'">
  287. </div>
  288. <div class="load-result" v-if="state.close_status == '等待结果'">
  289. <div class="title">
  290. <img :src="require('@/assets/svg/icon-enter-ed.svg')" alt />
  291. <span>Participate Successful</span>
  292. </div>
  293. <!-- 票 -->
  294. <div class="ticket">
  295. <div class="div-ticket">
  296. <img :src="require('@/assets/svg/icon-ticket.svg')" alt />
  297. </div>
  298. </div>
  299. <p>Announcement Winner</p>
  300. <div class="time">
  301. <img :src="require('@/assets/svg/icon-win-time.svg')" alt />
  302. <span>{{ moment(state.detail.endTimestamp).format('HH:mm:ss') || '' }}</span>
  303. </div>
  304. <get-more :style_type="2"></get-more>
  305. <div class="notification_switch">
  306. <span>Announcement Notification</span>
  307. <a-switch v-model:checked="state.notification_switch" />
  308. </div>
  309. </div>
  310. <div class="luck-list-title" v-show="state.close_status != '等待结果'">
  311. <div>{{ state.detail.receiveCount || 0 }}/{{ state.detail.totalCount || 0 }} Winners</div>
  312. <div class="right">
  313. <span class="text">
  314. <a-tooltip :title="state.detail.receiveAmountValue">
  315. {{ getBit(state.detail.receiveAmountValue) }}
  316. </a-tooltip>
  317. /
  318. <a-tooltip :title="state.detail.amountValue">
  319. {{ getBit(state.detail.amountValue || '') }}
  320. </a-tooltip>
  321. </span> {{
  322. state.detail.currencySymbol || ''
  323. }}
  324. </div>
  325. </div>
  326. <div class="luck-list max" @scroll="handleScroll" v-show="state.close_status != '等待结果'">
  327. <div class="luck-item" v-for="item, i in state.detail.allReceived" v-bind:key="i">
  328. <img v-if="item.simpleUserInfoVO.avatarUrl" :src="item.simpleUserInfoVO.avatarUrl" alt
  329. @click="openTwitterDetail(item)" />
  330. <img v-else :src="require('@/assets/svg/icon-twitter.svg')" alt />
  331. <img class="win" :src="require('@/assets/svg/icon-win-1.svg')" v-if="i==0" alt/>
  332. <img class="win" :src="require('@/assets/svg/icon-win-2.svg')" v-if="i==1" alt/>
  333. <img class="win" :src="require('@/assets/svg/icon-win-3.svg')" v-if="i==2" alt/>
  334. <div class="luck-content">
  335. <div class="luck-title" v-if="item.simpleUserInfoVO.nickName">{{ item.simpleUserInfoVO.nickName
  336. }}</div>
  337. <div class="luck-title" v-else>Twitter User</div>
  338. <div class="luck-time">{{ moment(item.receiveTimestamp).format('MM-DD HH:mm:ss') }}</div>
  339. </div>
  340. <div class="luck-money">
  341. <img :src="state.detail.currencyIconPath" alt />
  342. <div class="luck-money-txt">
  343. <a-tooltip :title="item.amountValue">
  344. {{ getBit(item.amountValue) }}
  345. </a-tooltip>
  346. </div>
  347. </div>
  348. <div class="luck-king" v-if="item.maxAmount">
  349. <img :src="require('@/assets/svg/icon-king-hat.svg')" alt />
  350. <span>Luckiest Draw</span>
  351. </div>
  352. </div>
  353. <div class="empty" v-show="state.detail.allReceived && state.detail.allReceived.length == 0">
  354. <img :src="require('@/assets/svg/icon-error.svg')" alt />
  355. </div>
  356. </div>
  357. <get-more v-if="state.close_status != '等待结果'"></get-more>
  358. </div>
  359. <!-- error -->
  360. <div v-else-if="state.status == 'error'" class="error">
  361. <img :src="require('@/assets/svg/icon-error.svg')" alt />
  362. <div class="txt">
  363. {{ state.error_txt }}
  364. </div>
  365. <div class="retry" v-show="state.retry" @click="clickRetry">
  366. Retry
  367. </div>
  368. </div>
  369. <!-- loading -->
  370. <div v-show="state.loading_show" class="loading">
  371. <img :src="require('@/assets/svg/icon-loading.svg')" alt />
  372. </div>
  373. <div v-show="state.loading_redbag" class="redbag">
  374. <img :src="require('@/assets/img/icon-loading-redbag.gif')" alt />
  375. </div>
  376. </div>
  377. <div style="width: 100%; height: 30px; position: fixed; color: red; top:0;"
  378. v-if="state.process_mode != 'production'">
  379. {{ state.detail.validity }}</div>
  380. </template>
  381. <script>
  382. export default {
  383. name: 'redPacket',
  384. }
  385. </script>
  386. <script setup>
  387. import { onMounted, reactive, ref } from "vue";
  388. import { getPostDetail, getRedPacket, finishRedPacket, oneKeyLike, oneKeyReTweet, oneKeyFollow, getTaskDetail, getReceivedList, addFinishEvent } from '@/http/redPacket.js'
  389. import { getQueryString, guid, getBit } from '@/uilts/help.js'
  390. import { message } from 'ant-design-vue';
  391. import FontAmount from '@/view/components/font-amount.vue'
  392. import GetMore from '@/view/iframe/publish/components/get-more.vue'
  393. import { setChromeStorage, getChromeStorage } from '@/uilts/chromeExtension.js'
  394. import Report from "@/log-center/log"
  395. import { srcPublishSuccess } from '@/http/publishApi'
  396. import { discordAuthUrl, checkGuildJoined } from '@/http/discordApi'
  397. import { discordAuthRedirectUri, faceShareRedirectUrl } from '@/http/configAPI'
  398. import { getFrontConfig } from "@/http/account";
  399. import GlobalTip from '@/view/components/global-tip.vue'
  400. var moment = require('moment');
  401. let discordAuthorizeRequired = false;
  402. let joinDiscordActionState = 'default'; //authAndJoinIng joinIng reAuth
  403. let joinDiscordIng = ref(false);
  404. let facebookAppConfig = {
  405. facebookAppId: "",
  406. faceShareRedirectUrl
  407. };
  408. let state = reactive({
  409. status: '',
  410. userId: '',
  411. loading_show: false,
  412. loading_redbag: false,
  413. detail: {},
  414. luck_list_end: false,
  415. page_index: 1,
  416. page_size: 20,
  417. srcContentId: '',
  418. error_txt: `oops, new accounts cannot participate in this event,`,
  419. receiveAmount: 0,
  420. money: 0,
  421. // 状态
  422. done: {
  423. follow: false,
  424. like: false,
  425. retweet: false,
  426. join_discord: false,
  427. repost_facebook: false,
  428. reply: false
  429. },
  430. notification_switch: false,
  431. open_timer_status: false
  432. })
  433. let fullName = '';
  434. function clickRetry() {
  435. init()
  436. }
  437. let follow_open_tabs = []
  438. async function clickLikeBtn() {
  439. let _userInfo = await checkIsLogin()
  440. if (!_userInfo) {
  441. return
  442. }
  443. state.detail.finishTaskTypeV2 = state.detail.finishTaskTypeV2.toString() || ''
  444. if (state.window_origin.indexOf('facebook.com') >= 0) {
  445. state.detail.finishTaskTypeV2 = '2'
  446. }
  447. switch (state.detail.finishTaskTypeV2) {
  448. case '1':
  449. state.loading_show = true
  450. oneKeyLike({
  451. params: {
  452. tweetId: state.srcContentId
  453. }
  454. }).then((res) => {
  455. state.loading_show = false
  456. if (res.code == 0) {
  457. if (res.data.result) {
  458. state.done.like = true
  459. } else {
  460. state.done.like = false
  461. window.open(`https://twitter.com/intent/like?tweet_id=${state.tweetId}`)
  462. }
  463. } else {
  464. window.open(`https://twitter.com/intent/like?tweet_id=${state.tweetId}`)
  465. state.done.like = false
  466. }
  467. }).catch(() => {
  468. state.loading_show = false
  469. })
  470. break
  471. case '2':
  472. window.open(`https://twitter.com/intent/like?tweet_id=${state.tweetId}`)
  473. break
  474. case '3':
  475. state.loading_show = true
  476. chrome.tabs.getCurrent((tab) => {
  477. chrome.tabs.sendMessage(tab.id, {
  478. actionType: "IFRAME_TWITTER_API_DO_TASK", task_data: {
  479. tweet_Id: state.tweetId
  480. }, task_type: 'like'
  481. }, (res) => { console.log(res) });
  482. })
  483. break
  484. default:
  485. window.open(`https://twitter.com/intent/like?tweet_id=${state.tweetId}`)
  486. break
  487. }
  488. // 埋点
  489. Report.reportLog({
  490. objectType: Report.objectType.like,
  491. pageSource: Report.pageSource.task_page,
  492. businessType: Report.businessType.buttonClick,
  493. postId: state.postId,
  494. srcContentId: state.tweetId,
  495. senderId: state.userId,
  496. });
  497. }
  498. function clickDone() {
  499. window.open(`${chrome.runtime.getURL('/iframe/home.html')}`)
  500. // 埋点
  501. Report.reportLog({
  502. objectType: Report.objectType.wallet_button,
  503. pageSource: Report.pageSource.received_success_page,
  504. businessType: Report.businessType.buttonClick,
  505. postId: state.postId,
  506. srcContentId: state.tweetId,
  507. senderId: state.userId,
  508. });
  509. }
  510. function handleScroll(e) {
  511. if (state.luck_list_end) {
  512. return
  513. }
  514. e = e.target
  515. if ((e.clientHeight + e.scrollTop) / e.scrollHeight > .8) {
  516. state.luck_list_end = true
  517. state.page_index++
  518. handleReceivedList()
  519. }
  520. }
  521. function handleReceivedList() {
  522. getReceivedList({
  523. params: {
  524. pageNum: state.page_index,
  525. pageSize: state.page_size,
  526. postId: state.postId
  527. }
  528. }).then((res) => {
  529. if (res.code == 0) {
  530. if (res.data.length > 0) {
  531. state.detail.allReceived = state.detail.allReceived.concat(res.data)
  532. state.luck_list_end = false
  533. } else {
  534. state.luck_list_end = true
  535. }
  536. } else {
  537. console.log('getReceivedList', res)
  538. }
  539. })
  540. }
  541. const openTwitterDetail = (item) => {
  542. if (item.simpleUserInfoVO.nickName) {
  543. window.open(`https://twitter.com/${item.simpleUserInfoVO.nickName}`)
  544. }
  545. }
  546. async function clickRetweetBtn() {
  547. let _userInfo = await checkIsLogin()
  548. if (!_userInfo) {
  549. return
  550. }
  551. state.detail.finishTaskTypeV2 = state.detail.finishTaskTypeV2.toString() || ''
  552. if (state.window_origin.indexOf('facebook.com') >= 0) {
  553. state.detail.finishTaskTypeV2 = '2'
  554. }
  555. switch (state.detail.finishTaskTypeV2) {
  556. case '1':
  557. state.loading_show = true
  558. oneKeyReTweet({
  559. params: {
  560. tweetId: state.srcContentId
  561. }
  562. }).then((res) => {
  563. state.loading_show = false
  564. if (res.code == 0) {
  565. if (res.data.result) {
  566. state.done.retweet = true
  567. } else {
  568. window.open(`https://twitter.com/intent/retweet?tweet_id=${state.tweetId}`)
  569. state.done.retweet = false
  570. }
  571. } else {
  572. window.open(`https://twitter.com/retweet/like?tweet_id=${state.tweetId}`)
  573. state.done.retweet = false
  574. }
  575. }).catch(() => {
  576. state.loading_show = false
  577. })
  578. break;
  579. case '2':
  580. window.open(`https://twitter.com/intent/retweet?tweet_id=${state.tweetId}`)
  581. break
  582. case '3':
  583. state.loading_show = true
  584. chrome.tabs.getCurrent((tab) => {
  585. chrome.tabs.sendMessage(tab.id, {
  586. actionType: "IFRAME_TWITTER_API_DO_TASK", task_data: {
  587. tweet_Id: state.tweetId
  588. }, task_type: 'retweet'
  589. }, (res) => { console.log(res) });
  590. })
  591. break
  592. default:
  593. window.open(`https://twitter.com/intent/retweet?tweet_id=${state.tweetId}`)
  594. break;
  595. }
  596. // 埋点
  597. Report.reportLog({
  598. objectType: Report.objectType.retweet,
  599. pageSource: Report.pageSource.task_page,
  600. businessType: Report.businessType.buttonClick,
  601. postId: state.postId,
  602. srcContentId: state.tweetId,
  603. senderId: state.userId,
  604. });
  605. }
  606. function onTweetReplyClick(params) {
  607. let replyData = {
  608. postId: state.postId,
  609. type: params.type,
  610. taskLuckdropId: state.detail.taskLuckdropId
  611. }
  612. window.parent.postMessage({ actionType: "IFRAME_RED_PACKET_ON_TWEET_REPLY_CLICK", data: replyData }, "*");
  613. }
  614. async function clickReply(params) {
  615. let _userInfo = await checkIsLogin()
  616. if (!_userInfo) {
  617. return
  618. }
  619. let replyData = {
  620. postId: state.postId,
  621. type: params.type,
  622. taskLuckdropId: state.detail.taskLuckdropId
  623. }
  624. if (state.window_origin.indexOf('facebook.com') > -1) {
  625. let url = `https://twitter.com/${state.tweet_author}/status/${state.tweetId}?actionType=denetFacebookToTwitterReply&deReplyParams=${JSON.stringify(replyData)}`
  626. window.open(url)
  627. } else {
  628. window.parent.postMessage({ actionType: "IFRAME_RED_PACKET_REPLY_CLICK", data: replyData }, "*");
  629. }
  630. }
  631. /**
  632. * 点击repost facebook
  633. */
  634. async function clickRepostFacebook(params) {
  635. let _userInfo = await checkIsLogin()
  636. if (!_userInfo) {
  637. return
  638. }
  639. let deUrlParams = {
  640. fullName,
  641. tweetId: state.tweetId
  642. }
  643. let href = `${state.postRedirectUrl}?deUrlParams=${JSON.stringify(deUrlParams)}`;
  644. console.log(href);
  645. let shareUrlparams = {
  646. href,
  647. type: params.type,
  648. taskLuckdropId: state.detail.taskLuckdropId
  649. }
  650. setChromeStorage({
  651. shareFacebookData: JSON.stringify({
  652. contentStr: state.srcContent
  653. })
  654. })
  655. let shareUrl = feacebookShareUrl(shareUrlparams);
  656. openShareFacebookWindow({ url: shareUrl });
  657. }
  658. /**
  659. * 分享到facebook
  660. */
  661. function openShareFacebookWindow({ url }) {
  662. const width = 800;
  663. chrome.windows.create({
  664. width,
  665. type: 'normal',
  666. url
  667. }, function (window) {
  668. })
  669. }
  670. /**
  671. * 分享fecebook 地址
  672. */
  673. function feacebookShareUrl(params = {}) {
  674. let { href = '', type = '', taskLuckdropId } = params;
  675. let cbParams = JSON.stringify({
  676. type,
  677. taskLuckdropId
  678. })
  679. let shareUrl = `https://www.facebook.com/dialog/share?app_id=${facebookAppConfig.facebookAppId}&display=popup&href=${href}&redirect_uri=${facebookAppConfig.faceShareRedirectUrl}?params=${cbParams}`;
  680. return shareUrl;
  681. }
  682. /**
  683. * 分享成功
  684. */
  685. function facebookShareSuccess(params) {
  686. let { taskLuckdropId } = params;
  687. if (taskLuckdropId == state.detail.taskLuckdropId) {
  688. state.done.repost_facebook = true;
  689. state.done.repost_facebook_red = false;
  690. }
  691. }
  692. function getValidity() {
  693. let _d1, _d2, _d3, _h, _m, _s
  694. if (!state.detail.myReceived.taskEndTimestamp) {
  695. return
  696. }
  697. let timer = setInterval(() => {
  698. let _time = new Date().getTime()
  699. _d3 = state.detail.myReceived.taskEndTimestamp - _time
  700. if (_d3 > 0) {
  701. _d1 = moment(state.detail.myReceived.taskEndTimestamp)
  702. _d2 = moment(_time)
  703. _h = moment.duration(_d1.diff(_d2)).hours()
  704. if (_h < 10) {
  705. _h = '0' + _h
  706. }
  707. _m = moment.duration(_d1.diff(_d2)).minutes()
  708. if (_m < 10) {
  709. _m = '0' + _m
  710. }
  711. _s = moment.duration(_d1.diff(_d2)).seconds()
  712. if (_s < 10) {
  713. _s = '0' + _s
  714. }
  715. state.detail.validity = `${_h}:${_m}:${_s}`
  716. } else {
  717. state.detail.validity = `00:00:00`
  718. clearInterval(timer)
  719. }
  720. }, 1000)
  721. }
  722. const openFollowTabs = (arr_name) => {
  723. let array_finish = arr_name.filter((item) => { return !item.finished })
  724. // let array_finish = state.detail.taskCondition[0].relatedUsers.filter((item) => { return item.finished == false })
  725. let url
  726. if (array_finish.length > 0) {
  727. state.done.follow = false
  728. // 打开标签页的方法
  729. array_finish.forEach((item) => {
  730. url = `https://twitter.com/intent/follow?screen_name=${item.name}&tweet_id=${state.tweetId}`
  731. chrome.tabs.create({ url }, (tab) => {
  732. if (follow_open_tabs.filter((item) => { return item.url == tab.url }).length == 0) {
  733. follow_open_tabs.push(tab)
  734. }
  735. })
  736. })
  737. }
  738. }
  739. async function clickFollowAll(item, is_all) {
  740. let _userInfo = await checkIsLogin()
  741. if (!_userInfo) {
  742. return
  743. }
  744. let arr_name = []
  745. for (let i in item) {
  746. if (!item[i].finished) {
  747. arr_name.push(item[i])
  748. }
  749. }
  750. // ----
  751. state.detail.finishTaskTypeV2 = state.detail.finishTaskTypeV2.toString() || ''
  752. if (state.window_origin.indexOf('facebook.com') >= 0) {
  753. state.detail.finishTaskTypeV2 = '2'
  754. }
  755. switch (state.detail.finishTaskTypeV2) {
  756. case '1':
  757. // openapi
  758. state.loading_show = true
  759. oneKeyFollow({
  760. params: {
  761. names: arr_name
  762. }
  763. }).then((res) => {
  764. state.loading_show = false
  765. if (res.code == 0) {
  766. res.data.forEach((item1) => {
  767. state.detail.taskCondition[0].relatedUsers.forEach(item2 => {
  768. if (item1.name == item2.name && item1.finished) {
  769. item2.finished = true
  770. }
  771. });
  772. })
  773. openFollowTabs(arr_name)
  774. }
  775. }).catch(() => {
  776. state.loading_show = false
  777. })
  778. break
  779. case '2':
  780. openFollowTabs(arr_name)
  781. break
  782. case '3':
  783. if (arr_name.filter((item) => { return !item.twitterUserId }).length > 0) {
  784. openFollowTabs(arr_name)
  785. return
  786. }
  787. let follow_data = []
  788. arr_name.forEach((item) => {
  789. follow_data.push(item)
  790. })
  791. state.loading_show = true
  792. chrome.tabs.getCurrent((tab) => {
  793. chrome.tabs.sendMessage(tab.id, {
  794. actionType: "IFRAME_TWITTER_API_DO_TASK",
  795. task_data: {
  796. tweet_Id: state.tweetId,
  797. follow_data: follow_data,
  798. },
  799. task_type: 'follow'
  800. }, (res) => { console.log(res) });
  801. })
  802. break
  803. default:
  804. openFollowTabs(arr_name)
  805. break
  806. }
  807. // -------- 埋点 --------
  808. let _log_obj = {
  809. pageSource: Report.pageSource.task_page,
  810. businessType: Report.businessType.buttonClick,
  811. objectType: Report.objectType.follow
  812. }
  813. if (is_all) {
  814. _log_obj.objectType = Report.objectType.follow_button
  815. }
  816. Report.reportLog(_log_obj, {
  817. postId: state.postId,
  818. srcContentId: state.tweetId,
  819. senderId: state.userId,
  820. });
  821. }
  822. // 重新绑定
  823. const reSetBindTwtterId = (_params) => {
  824. getChromeStorage('userInfo', (_userInfo) => {
  825. if (_userInfo && _userInfo.uid == _params.uid) {
  826. srcPublishSuccess({
  827. params: {
  828. postId: state.postId,
  829. srcContentId: state.tweetId
  830. }
  831. }).then((res) => {
  832. if (res.code == 0 || res.code == 3003) {
  833. Report.reportLog({
  834. objectType: Report.objectType.tweetPostBinded
  835. });
  836. init({ from: 'reSetBindTwtterId' })
  837. }
  838. })
  839. }
  840. })
  841. }
  842. const showCloseEndTimePage = () => {
  843. state.status = 'close'
  844. state.close_status = '已经过期了'
  845. state.close_text = [`This Giveaways`, `expired on ${moment(state.detail.endTimestamp).format('MM-DD')}`]
  846. }
  847. const showCloseEndTimePageReport = () => {
  848. // 埋点
  849. Report.reportLog({
  850. pageSource: Report.pageSource.expired_page,
  851. businessType: Report.businessType.pageView,
  852. postId: state.postId,
  853. srcContentId: state.tweetId,
  854. senderId: state.userId,
  855. });
  856. }
  857. const showSuccessPage = () => {
  858. state.status = 'success'
  859. state.open_timer_status = true
  860. // 埋点
  861. Report.reportLog({
  862. pageSource: Report.pageSource.received_success_page,
  863. businessType: Report.businessType.pageView,
  864. postId: state.postId,
  865. srcContentId: state.tweetId,
  866. senderId: state.userId,
  867. });
  868. }
  869. const showNotOpenPage = () => {
  870. state.status = 'not-open'
  871. Report.reportLog({
  872. pageSource: Report.pageSource.pending_page,
  873. businessType: Report.businessType.pageView,
  874. postId: state.postId,
  875. srcContentId: state.tweetId,
  876. senderId: state.userId,
  877. });
  878. }
  879. const showOpenedPage = () => {
  880. state.status = 'opened'
  881. initTaskDetail()
  882. }
  883. const showOpenedPageReport = () => {
  884. // 埋点
  885. Report.reportLog({
  886. pageSource: Report.pageSource.task_page,
  887. businessType: Report.businessType.pageView,
  888. postId: state.postId,
  889. srcContentId: state.tweetId,
  890. senderId: state.userId,
  891. });
  892. }
  893. const showRabbitPage = () => {
  894. state.status = 'close'
  895. state.close_status = '没有抽中'
  896. state.open_timer_status = true
  897. }
  898. const showRabbitPageReport = () => {
  899. Report.reportLog({
  900. pageSource: Report.pageSource.received_empty_rewards_page,
  901. businessType: Report.businessType.pageView,
  902. postId: state.postId,
  903. srcContentId: state.tweetId,
  904. senderId: state.userId,
  905. });
  906. }
  907. const handleStatusPage = () => {
  908. // status 红包状态(0:未开始,1:进行中,2:已结束,3:已终止,4:终止退款进行中)
  909. // myReceived 我是否领取过
  910. // taskFinishStatus 任务完成状态(0:未完成,1:已完成,2:已过期)
  911. // receiveTimeExpired 是否已经过了红包的领取截止时间
  912. // endTimestamp 开奖时间
  913. // ---- 判断结构 ----
  914. // 如果 红包状态 = 未开始
  915. // 显示未打开页面 return
  916. // 如果 我领取过了
  917. // 如果 任务完成状态 = 未完成
  918. // 显示任务未完成页面
  919. // 如果 任务完成状态 = 已经完成
  920. // 如果 领取到红包金额 = 0 & 红包状态 = 已结束
  921. // 显示兔子页面
  922. // 否则如果 红包状态 = 已结束
  923. // 显示成功页面
  924. // 如果 红包状态 = 进行中
  925. // 显示等待结果页面
  926. // 如果 任务完成状态 = 已经过期
  927. // 如果 红包状态 = 进行中
  928. // 显示未打开页面
  929. // 否则
  930. // 显示已经过期页面
  931. // 如果 我没有领取过 & 红包状态 = 进行中
  932. // 如果 过了红包的领取截止时间 = true
  933. // 显示已经过期页面
  934. // 如果 过了红包的领取截止时间 = false
  935. // 显示未打开页面
  936. // 如果 我没有领取过 & 红包状态 = 已结束 | 已终止 | 终止退款进行中
  937. // 显示过期页面
  938. // -------- 华丽的分割线 --------
  939. // 如果 红包状态 = 未开始
  940. if (state.detail.status == 0) {
  941. showNotOpenPage()
  942. return
  943. }
  944. // 如果 我领取过了
  945. if (state.detail.myReceived) {
  946. state.receiveAmount = state.detail.myReceived.amountValue || 0
  947. state.detail.taskCondition = JSON.parse(state.detail.taskCondition)
  948. // 如果 任务完成状态 = 未完成
  949. if (state.detail.myReceived.taskFinishStatus == 0) {
  950. // 显示任务未完成页面
  951. showOpenedPage()
  952. showOpenedPageReport()
  953. if (state.process_mode != 'production') {
  954. getValidity()
  955. }
  956. //如果 任务完成状态 = 已经完成
  957. } else if (state.detail.myReceived.taskFinishStatus == 1) {
  958. // 领取到空红包 & 红包状态 = 已结束
  959. if (state.receiveAmount == 0 && state.status == 2) {
  960. showRabbitPage()
  961. showRabbitPageReport()
  962. } else if (state.detail.status == 2) {
  963. // 显示成功页面
  964. showSuccessPage()
  965. }
  966. // 如果 红包状态 = 进行中
  967. else if (state.detail.status == 1) {
  968. // 显示等待结果页面
  969. showLoadResult()
  970. open_timer()
  971. }
  972. // 如果 任务完成状态 = 已经过期
  973. } else {
  974. // 如果 红包状态 = 进行中
  975. if (state.detail.status == 1) {
  976. // 显示未打开页面
  977. showNotOpenPage()
  978. // 否则
  979. } else {
  980. // 显示已经过期页面
  981. showCloseEndTimePage()
  982. showCloseEndTimePageReport()
  983. }
  984. }
  985. // 如果 我没有领取过
  986. } else {
  987. // 如果 红包状态 = 进行中
  988. if (state.detail.status == 1) {
  989. // 如果 过了红包的领取截止时间 = true
  990. if (state.detail.receiveTimeExpired) {
  991. // 显示过期页面
  992. showCloseEndTimePage()
  993. showCloseEndTimePageReport()
  994. // 如果 过了红包的领取截止时间 = false
  995. } else {
  996. // 显示未打开页面
  997. showNotOpenPage()
  998. }
  999. // 红包状态 = 已经结束了 | 已经终止 | 终止退款中
  1000. } else {
  1001. // 显示过期页面
  1002. showCloseEndTimePage()
  1003. showCloseEndTimePageReport()
  1004. }
  1005. }
  1006. }
  1007. function setFrontConfig() {
  1008. getFrontConfig({
  1009. params: {},
  1010. }).then((res) => {
  1011. if (res.code == 0) {
  1012. facebookAppConfig.facebookAppId = res.data.fbClientId;
  1013. }
  1014. });
  1015. };
  1016. function init(initParams) {
  1017. let { type } = initParams || {};
  1018. onRuntimeMsg();
  1019. onPageVisbile();
  1020. onWindowMessage();
  1021. setFrontConfig();
  1022. getPostDetail({
  1023. params: {
  1024. postId: state.postId
  1025. }
  1026. }).then((res) => {
  1027. state.loading_show = false
  1028. // 领取0元为空红包继续流程
  1029. // ---- 完成任务接口 ----
  1030. // 如果金额是0
  1031. // 显示没有抽中
  1032. if (res.code == 0) {
  1033. state.srcContent = res.data.srcContent;
  1034. state.postRedirectUrl = res.data.postRedirectUrl;
  1035. // 判断推特id,绑定逻辑
  1036. state.srcContentId = res.data.srcContentId
  1037. if (!state.srcContentId) {
  1038. reSetBindTwtterId(res.data)
  1039. return
  1040. }
  1041. state.detail = JSON.parse(res.data.postBizData)
  1042. state.detail.taskCondition = state.detail.taskCondition || []
  1043. state.tweetId = state.srcContentId;
  1044. state.userId = res.data.srcUserId;
  1045. state.tweet_author = state.detail.postUserInfo && state.detail.postUserInfo.nickName || '';
  1046. // 不要删除这个console
  1047. console.log('postBizData', state.detail)
  1048. checkFacebookReply();
  1049. handleStatusPage()
  1050. } else {
  1051. handleErrorCode(res)
  1052. }
  1053. }).finally(() => {
  1054. state.loading_redbag = false
  1055. })
  1056. }
  1057. function initTaskDetail() {
  1058. getChromeStorage('userInfo', (_userInfo) => {
  1059. if (_userInfo && _userInfo.uid) {
  1060. // 任务详情
  1061. getTaskDetail({
  1062. params: {
  1063. postId: state.postId
  1064. }
  1065. }).then((res) => {
  1066. if (res.code.toString()) {
  1067. for (let i in res.data) {
  1068. switch (res.data[i].type) {
  1069. case 1:
  1070. state.done.follow = res.data[i].finished
  1071. state.detail.taskCondition[0].relatedUsers = res.data[i].detail
  1072. break
  1073. case 2:
  1074. state.done.like = res.data[i].finished
  1075. break
  1076. case 3:
  1077. state.done.retweet = res.data[i].finished
  1078. break
  1079. case 7:
  1080. state.done.join_discord = res.data[i].finished
  1081. discordAuthorizeRequired = res.data[i].discordAuthorizeRequired
  1082. break
  1083. case 8:
  1084. state.done.repost_facebook = res.data[i].finished;
  1085. break;
  1086. case 9:
  1087. state.done.reply = res.data[i].finished;
  1088. if (!state.done.reply) {
  1089. onTweetReplyClick({ type: 9 });
  1090. }
  1091. break;
  1092. }
  1093. }
  1094. } else {
  1095. handleErrorCode(res)
  1096. }
  1097. })
  1098. }
  1099. })
  1100. }
  1101. let tab_index = 0
  1102. const doTaskReport = (req, sender) => {
  1103. state.loading_show = false
  1104. let follow_name = req.task_data.follow_name || ''
  1105. // 1 Twitter follow Twitter ScreenName
  1106. // 2 Tweet like
  1107. // 3 Retweet
  1108. let event_type = 0
  1109. switch (req.task_type) {
  1110. case 'retweet':
  1111. event_type = 3
  1112. state.done.retweet = req.task_done
  1113. if (!req.task_done && req.do_type == 'api') {
  1114. window.open(`https://twitter.com/intent/retweet?tweet_id=${state.tweetId}`)
  1115. }
  1116. break;
  1117. case 'like':
  1118. event_type = 2
  1119. state.done.like = req.task_done
  1120. //
  1121. if (!req.task_done && req.do_type == 'api') {
  1122. window.open(`https://twitter.com/intent/like?tweet_id=${state.tweetId}`)
  1123. }
  1124. break
  1125. case 'follow':
  1126. event_type = 1
  1127. // for (let i = 0; i < follow_open_tabs.length; i++) {
  1128. // if (follow_open_tabs[i].id == sender.tab.id) {
  1129. // follow_open_tabs.splice(i, 1)
  1130. // break
  1131. // }
  1132. // }
  1133. // chrome.tabs.getCurrent((tab) => {
  1134. // if (follow_open_tabs.length > 0) {
  1135. // tab_index = follow_open_tabs[follow_open_tabs.length - 1].index
  1136. // } else {
  1137. // tab_index = tab.index
  1138. // }
  1139. // chrome.tabs.highlight({ windowId: tab.windowId, tabs: tab_index })
  1140. // })
  1141. let has_no_finished = false
  1142. state.detail.taskCondition[0].relatedUsers.forEach((item) => {
  1143. if (follow_name == item.name) {
  1144. item.finished = req.task_done
  1145. }
  1146. })
  1147. state.detail.taskCondition[0].relatedUsers.forEach((item) => {
  1148. if (!item.finished) {
  1149. has_no_finished = true
  1150. }
  1151. })
  1152. if (!has_no_finished) {
  1153. state.done.follow = true
  1154. state.done.follow_red = false
  1155. openFollowTabs(state.detail.taskCondition[0].relatedUsers)
  1156. }
  1157. break
  1158. }
  1159. if (req.do_type != 'api') {
  1160. chrome.tabs.remove(sender.tab.id)
  1161. }
  1162. if (req.task_done) {
  1163. addFinishEvent({
  1164. params: {
  1165. eventData: follow_name,
  1166. eventType: event_type,
  1167. luckdropId: state.detail.taskLuckdropId
  1168. }
  1169. })
  1170. }
  1171. }
  1172. let open_timer_flag = false
  1173. // 倒计时开奖
  1174. const open_timer = () => {
  1175. if (open_timer_flag) {
  1176. return
  1177. }
  1178. open_timer_flag = true
  1179. let new_time
  1180. let open_time
  1181. let timer = setInterval(() => {
  1182. open_time = state.detail.endTimestamp || ''
  1183. if (!open_time || state.close_status == '没有抽中') {
  1184. return
  1185. }
  1186. new_time = new Date().getTime()
  1187. // 到时间了
  1188. if (new_time >= open_time) {
  1189. // 调用detail 查看结果
  1190. init()
  1191. if (state.open_timer_status == true) {
  1192. clearInterval(timer)
  1193. }
  1194. }
  1195. }, 1000)
  1196. }
  1197. const showLoadResult = () => {
  1198. state.status = 'close'
  1199. state.close_status = '等待结果'
  1200. }
  1201. onMounted(() => {
  1202. state.process_mode = process.env.NODE_ENV
  1203. state.postId = getQueryString('postId')
  1204. state.window_origin = getQueryString('window_origin') || '';
  1205. if (state.window_origin.indexOf('twitter.com') > -1) {
  1206. state.tweetId = getQueryString('tweetId')
  1207. state.tweet_author = getQueryString('tweet_author');
  1208. }
  1209. getTweetAuthor()
  1210. init()
  1211. // state.loading_show = true
  1212. // state.status = 'success'
  1213. // state.status = 'close'
  1214. // state.close_status = '等待结果'
  1215. // state.close_status = '没有抽中'
  1216. // state.close_status = '已过期'
  1217. })
  1218. function getTweetAuthor() {
  1219. if (state.window_origin.indexOf('twitter.com') > -1) {
  1220. window.parent.postMessage({
  1221. actionType: "IFRAME_RED_PACKET_GET_TWEET_AUTHOR", data: {
  1222. postId: state.postId,
  1223. taskLuckdropId: state.detail.taskLuckdropId
  1224. }
  1225. }, "*");
  1226. }
  1227. }
  1228. function checkFacebookReply() {
  1229. console.log('checkFacebookReply')
  1230. if (state.window_origin.indexOf('twitter.com') > -1) {
  1231. window.parent.postMessage({
  1232. actionType: "IFRAME_RED_PACKET_CHECK_FACEBOOK_REPLY", data: {
  1233. postId: state.postId
  1234. }
  1235. }, "*");
  1236. }
  1237. }
  1238. // 点击领取
  1239. function clickOpenRedPacket() {
  1240. callEventPageMethod('CONTENT_GET_PINED', {})
  1241. handleRedPacket()
  1242. }
  1243. function handleRedPacket() {
  1244. state.loading_show = true
  1245. getRedPacket({
  1246. params: {
  1247. postId: state.postId
  1248. }
  1249. }).then((res) => {
  1250. state.loading_show = false
  1251. if (res.code == 0) {
  1252. showOpenedPage()
  1253. init()
  1254. } else {
  1255. handleErrorCode(res)
  1256. }
  1257. }).catch(() => {
  1258. state.loading_show = false
  1259. })
  1260. // 埋点
  1261. Report.reportLog({
  1262. pageSource: Report.pageSource.pending_page,
  1263. businessType: Report.businessType.buttonClick,
  1264. objectType: Report.objectType.open_button,
  1265. postId: state.postId,
  1266. srcContentId: state.tweetId,
  1267. senderId: state.userId,
  1268. });
  1269. }
  1270. chrome.storage.onChanged.addListener(changes => {
  1271. if (changes.userInfo) {
  1272. // let item = JSON.parse(changes.userInfo.newValue)
  1273. state.loading_show = false
  1274. init()
  1275. }
  1276. })
  1277. // 校验是否封路
  1278. function checkIsLogin() {
  1279. return new Promise((resolve) => {
  1280. getChromeStorage('userInfo', (_userInfo) => {
  1281. if (!_userInfo) {
  1282. state.loading_show = true
  1283. setTimeout(() => {
  1284. state.loading_show = false
  1285. }, 3000)
  1286. chrome.runtime.sendMessage(
  1287. { actionType: "POPUP_LOGIN", data: "" },
  1288. (response) => {
  1289. console.log("res", response);
  1290. }
  1291. )
  1292. resolve(_userInfo)
  1293. } else {
  1294. resolve(_userInfo)
  1295. }
  1296. })
  1297. })
  1298. }
  1299. async function clickGetGiveaways() {
  1300. let _userInfo = await checkIsLogin()
  1301. if (_userInfo) {
  1302. handleFinishRedPacket()
  1303. }
  1304. }
  1305. function handleFinishRedPacket() {
  1306. state.loading_show = true
  1307. finishRedPacket({
  1308. params: {
  1309. postId: state.postId
  1310. }
  1311. }).then((res) => {
  1312. if (res.code == 0) {
  1313. if (res.data.finished) {
  1314. state.receiveAmount = res.data.receiveAmount
  1315. init()
  1316. // 埋点
  1317. Report.reportLog({
  1318. pageSource: Report.pageSource.task_page,
  1319. businessType: Report.businessType.buttonClick,
  1320. objectType: Report.objectType.get_giveaway,
  1321. postId: state.postId,
  1322. srcContentId: state.tweetId,
  1323. senderId: state.userId,
  1324. }, {
  1325. get_giveaway_result: Report.extParams.success
  1326. });
  1327. } else {
  1328. state.loading_show = false
  1329. let _data = res.data.conditionResult
  1330. for (let i in _data) {
  1331. switch (_data[i].type.toString()) {
  1332. case '1':
  1333. state.detail.taskCondition[0].relatedUsers = _data[i].detail
  1334. if (_data[i].finished) {
  1335. state.done.follow = true
  1336. state.done.follow_red = false
  1337. } else {
  1338. // alert('Please complete the task: follow')
  1339. state.done.follow = false
  1340. state.done.follow_red = true
  1341. }
  1342. break
  1343. case '2':
  1344. if (_data[i].finished) {
  1345. state.done.like = true
  1346. state.done.like_red = false
  1347. } else {
  1348. // alert('Please complete the task: like tweet')
  1349. state.done.like = false
  1350. state.done.like_red = true
  1351. }
  1352. break
  1353. case '3':
  1354. if (_data[i].finished) {
  1355. state.done.retweet = true
  1356. state.done.retweet_red = false
  1357. } else {
  1358. // alert('Please complete the task: Retweet')
  1359. state.done.retweet_red = true
  1360. state.done.retweet = false
  1361. }
  1362. break
  1363. case '7':
  1364. //join discord
  1365. discordAuthorizeRequired = _data[i].discordAuthorizeRequired;
  1366. if (_data[i].finished) {
  1367. state.done.join_discord = true
  1368. state.done.join_discord_red = false
  1369. } else {
  1370. state.done.join_discord = false;
  1371. state.done.join_discord_red = true
  1372. }
  1373. break
  1374. case '8':
  1375. //repost feacebook
  1376. if (_data[i].finished) {
  1377. state.done.repost_facebook = true
  1378. state.done.repost_facebook_red = false
  1379. } else {
  1380. state.done.repost_facebook = false;
  1381. state.done.repost_facebook_red = true
  1382. }
  1383. break
  1384. case '9':
  1385. //reply
  1386. if (_data[i].finished) {
  1387. state.done.reply = true
  1388. state.done.reply_red = false
  1389. } else {
  1390. state.done.reply = false;
  1391. state.done.reply_red = true
  1392. }
  1393. break
  1394. }
  1395. }
  1396. // 埋点
  1397. Report.reportLog({
  1398. pageSource: Report.pageSource.task_page,
  1399. businessType: Report.businessType.buttonClick,
  1400. objectType: Report.objectType.get_giveaway,
  1401. postId: state.postId,
  1402. srcContentId: state.tweetId,
  1403. senderId: state.userId,
  1404. }, {
  1405. get_giveaway_result: Report.extParams.failure,
  1406. });
  1407. if (discordAuthorizeRequired) {
  1408. discordAuth('reAuth');
  1409. }
  1410. }
  1411. } else {
  1412. state.loading_show = false
  1413. // 埋点
  1414. Report.reportLog({
  1415. pageSource: Report.pageSource.task_page,
  1416. businessType: Report.businessType.buttonClick,
  1417. objectType: Report.objectType.get_giveaway,
  1418. postId: state.postId,
  1419. srcContentId: state.tweetId,
  1420. senderId: state.userId,
  1421. }, {
  1422. get_giveaway_result: Report.extParams.failure,
  1423. });
  1424. handleErrorCode(res)
  1425. }
  1426. }).catch(() => {
  1427. state.loading_show = false
  1428. })
  1429. }
  1430. function handleErrorCode(res) {
  1431. switch (res.code.toString()) {
  1432. // 数据异常,请联系管理员
  1433. case '-102':
  1434. break
  1435. //系统错误
  1436. case '-101':
  1437. break
  1438. // 参数不对
  1439. case '-103':
  1440. break
  1441. // 接口被限流
  1442. case '-105':
  1443. break
  1444. // 访问凭证不存在
  1445. case '-107':
  1446. break
  1447. // 重复操作过于频繁
  1448. case '-106':
  1449. message.error('Clicking too often, wait a moment and click again')
  1450. state.loading_show = false
  1451. break
  1452. // 红包不存在
  1453. case '2001':
  1454. // message.error(res.msg)
  1455. break
  1456. // 还未到红包领取时间
  1457. case '2002':
  1458. // message.error(res.msg)
  1459. break
  1460. // 已超过红包领取时间
  1461. case '2003':
  1462. init()
  1463. break
  1464. // 红包支付状态异常 没有可提交的任务红包
  1465. case '2004':
  1466. init()
  1467. break
  1468. // 红包活动已结束
  1469. case '2006':
  1470. init()
  1471. break
  1472. // 红包金额已经被领取完了
  1473. case '2007':
  1474. state.status = 'close'
  1475. state.close_status = '已经过期了'
  1476. state.close_text = [`This Giveaways`, `expired on ${moment(state.detail.endTimestamp).format('MM-DD')}`]
  1477. init()
  1478. break
  1479. // 红包个数已经被领取完了
  1480. case '2008':
  1481. state.status = 'close'
  1482. state.close_status = '已经过期了'
  1483. state.close_text = [`This Giveaways`, `expired on ${moment(state.detail.endTimestamp).format('MM-DD')}`]
  1484. init()
  1485. break
  1486. // 该用户不满足领取条件
  1487. case '2009':
  1488. state.error_txt = [`oops, new accounts cannot participate in this event,`]
  1489. state.status = 'error'
  1490. state.retry = true
  1491. // 埋点
  1492. Report.reportLog({
  1493. pageSource: Report.pageSource.robot_detection_failed_page,
  1494. businessType: Report.businessType.pageView,
  1495. postId: state.postId,
  1496. srcContentId: state.tweetId,
  1497. senderId: state.userId,
  1498. });
  1499. break
  1500. // 无法校验用户Twitter信息
  1501. case '2010':
  1502. // message.error(res.msg)
  1503. break
  1504. // 用户已经领过该红包
  1505. case '2011':
  1506. // message.error(res.msg)
  1507. break
  1508. // 推文不存在
  1509. case '2022':
  1510. // message.error(res.msg)
  1511. break
  1512. // 推文未发布 and 不是红包任务的推文
  1513. case '2023':
  1514. // message.error(res.msg)
  1515. break
  1516. // 没有可提交的任务红包
  1517. case '2024':
  1518. state.status = 'not-open'
  1519. break
  1520. // 红包任务已完成
  1521. case '2025':
  1522. break
  1523. // 任务已经过期
  1524. case '2026':
  1525. break
  1526. // 任务未完成
  1527. case '2027':
  1528. break
  1529. // 红包金额每人不足1分钱
  1530. case '2028':
  1531. break
  1532. // 推文未发布
  1533. case '2029':
  1534. message.error('Tweet not posted')
  1535. break
  1536. // 不是红包任务的推文
  1537. case '2030':
  1538. break
  1539. case '2037':
  1540. showCloseEndTimePage()
  1541. init()
  1542. break
  1543. //用户没有领取过红包,无法重抽
  1544. case '2031':
  1545. break
  1546. // 需要重新授权 discord
  1547. case '1010':
  1548. discordAuth('reAuth');
  1549. break
  1550. }
  1551. }
  1552. // function clickBack() {
  1553. // state.status = 'opened'
  1554. // // 埋点
  1555. // Report.reportLog({
  1556. // pageSource: Report.pageSource.task_page,
  1557. // businessType: Report.businessType.pageView,
  1558. // });
  1559. // }
  1560. // function clickRoad() {
  1561. // state.status = 'luck-peopel-list'
  1562. // // 埋点
  1563. // Report.reportLog({
  1564. // pageSource: Report.pageSource.task_page,
  1565. // businessType: Report.businessType.buttonClick,
  1566. // objectType: Report.objectType.received_list
  1567. // });
  1568. // // 埋点
  1569. // Report.reportLog({
  1570. // pageSource: Report.pageSource.received_list_page,
  1571. // businessType: Report.businessType.pageView
  1572. // });
  1573. // }
  1574. function onWindowMessage() {
  1575. window.addEventListener("message", function (event) {
  1576. if (event.data) {
  1577. switch (event.data.actionType) {
  1578. case 'CONTENT_RED_PACKET_REPLY_RASK_FINSH':
  1579. state.done.reply = true;
  1580. state.done.reply_red = false;
  1581. break;
  1582. case 'CONTENT_RED_PACKET_GET_TWEET_AUTHOR':
  1583. fullName = event.data.data.fullName
  1584. break;
  1585. case 'CONTENT_RED_PACKET_FACEBOOK_REPLY':
  1586. clickReply(event.data.data)
  1587. break;
  1588. }
  1589. }
  1590. });
  1591. }
  1592. function onPageVisbile() {
  1593. document.addEventListener('visibilitychange', function () {
  1594. let isHidden = document.hidden;
  1595. if (!isHidden) {
  1596. checkJoinDiscord();
  1597. }
  1598. });
  1599. }
  1600. function onRuntimeMsg() {
  1601. chrome.runtime.onMessage.addListener((req, sender, sendResponse) => {
  1602. sendResponse('');
  1603. switch (req.actionType) {
  1604. case 'BACK_DISCORD_LOGIN_SUCCESS':
  1605. discordLoginSuccess();
  1606. break;
  1607. case 'BG_FACEBOOK_SHARE_SUCCESS':
  1608. facebookShareSuccess(req.data);
  1609. break;
  1610. case 'DO_TASK':
  1611. if (!req.task_type || state.tweetId != req.tweet_Id) {
  1612. return
  1613. }
  1614. state.loading_show = false
  1615. doTaskReport(req, sender);
  1616. break;
  1617. case 'CONTENT_RED_PACKET_REPLY_RASK_FINSH':
  1618. if (req.data && req.data.postId == state.postId) {
  1619. state.done.reply = true;
  1620. state.done.reply_red = false;
  1621. }
  1622. break;
  1623. }
  1624. })
  1625. }
  1626. /**
  1627. * 检查是否加入discord
  1628. */
  1629. function checkJoinDiscord() {
  1630. // 如果上次的状态是 joinIng 检查是否真正join
  1631. if (joinDiscordActionState == 'joinIng') {
  1632. joinDiscordActionState = 'default';
  1633. let url = getInviteUrl();
  1634. if (url) {
  1635. joinDiscordIng.value = true;
  1636. checkGuildJoinedStatus({ url }, (res = {}) => {
  1637. joinDiscordIng.value = false;
  1638. if (res.code == 0) {
  1639. let { joined } = res.data || {};
  1640. if (joined) {
  1641. state.done.join_discord = true;
  1642. } else {
  1643. state.done.join_discord = false;
  1644. }
  1645. } else if (res.code == 1010) {
  1646. discordAuth('reAuth');
  1647. }
  1648. })
  1649. }
  1650. }
  1651. }
  1652. const checkGuildJoinedStatus = ({ url }, cb) => {
  1653. checkGuildJoined({
  1654. params: {
  1655. inviteUrl: url
  1656. }
  1657. }).then(res => {
  1658. cb && cb(res);
  1659. }).catch(err => {
  1660. cb && cb({ catch: true })
  1661. })
  1662. }
  1663. /**
  1664. * 加入discord 事件
  1665. */
  1666. async function joinDiscord() {
  1667. let _userInfo = await checkIsLogin();
  1668. if (!_userInfo) {
  1669. return
  1670. }
  1671. if (joinDiscordIng.value) {
  1672. return;
  1673. }
  1674. let url = getInviteUrl();
  1675. if (url) {
  1676. joinDiscordIng.value = true;
  1677. checkGuildJoinedStatus({ url }, (res) => {
  1678. setTimeout(() => {
  1679. joinDiscordIng.value = false;
  1680. }, 1500);
  1681. if (res.code == 0) {
  1682. let { joined } = res.data || {};
  1683. if (joined) {
  1684. state.done.join_discord = true;
  1685. } else {
  1686. state.done.join_discord = false;
  1687. if (discordAuthorizeRequired) {
  1688. discordAuth('authAndJoinIng');
  1689. } else {
  1690. openInviteUrl();
  1691. }
  1692. }
  1693. } else if (res.code == 1010) {
  1694. discordAuth('authAndJoinIng');
  1695. }
  1696. if (res.catch) {
  1697. //判断是否需要授权
  1698. if (discordAuthorizeRequired) {
  1699. discordAuth('authAndJoinIng');
  1700. } else {
  1701. openInviteUrl();
  1702. }
  1703. }
  1704. })
  1705. }
  1706. }
  1707. /**
  1708. * discord授权
  1709. */
  1710. function discordAuth(actionState = 'default') {
  1711. let state = guid();
  1712. discordAuthUrl({
  1713. params: {
  1714. redirectUrl: discordAuthRedirectUri,
  1715. state
  1716. }
  1717. }).then(res => {
  1718. if (res.code == 0) {
  1719. let { authorizeUrl = '' } = res.data || {};
  1720. if (authorizeUrl) {
  1721. joinDiscordActionState = actionState;
  1722. const width = 500;
  1723. chrome.windows.create({
  1724. width,
  1725. type: 'normal',
  1726. url: authorizeUrl
  1727. }, function (window) {
  1728. let windowId = window.id;
  1729. callEventPageMethod("RED_PACKET_SAVE_DISCORD_AUTH_WINDOW_ID", {
  1730. windowId: windowId
  1731. }, function (response) {
  1732. });
  1733. })
  1734. }
  1735. }
  1736. })
  1737. }
  1738. /**
  1739. * sendMessage
  1740. */
  1741. const callEventPageMethod = (actionType, data, callback) => {
  1742. chrome.runtime.sendMessage(
  1743. {
  1744. actionType: actionType,
  1745. data: data
  1746. },
  1747. function (response) {
  1748. if (typeof callback === "function") callback(response);
  1749. }
  1750. );
  1751. };
  1752. /**
  1753. * discord 授权成功
  1754. */
  1755. function discordLoginSuccess() {
  1756. console.log('discordloginSuccess');
  1757. // 如果是授权并join 默认打开 邀请链接
  1758. if (joinDiscordActionState == 'authAndJoinIng') {
  1759. openInviteUrl();
  1760. }
  1761. if (discordAuthorizeRequired) {
  1762. discordAuthorizeRequired = false;
  1763. }
  1764. }
  1765. /**
  1766. * 获取discord邀请链接
  1767. */
  1768. function getInviteUrl() {
  1769. let inviteData = state.detail.taskCondition.find(item => {
  1770. return item.type == 7;
  1771. });
  1772. let url;
  1773. if (inviteData && inviteData.bizData) {
  1774. url = JSON.parse(inviteData.bizData).inviteUrl;
  1775. }
  1776. return url;
  1777. }
  1778. /**
  1779. * 打开邀请discord链接
  1780. */
  1781. function openInviteUrl() {
  1782. joinDiscordActionState = 'joinIng';
  1783. let url = getInviteUrl();
  1784. if (url) {
  1785. if (!url.startsWith('http')) {
  1786. url = 'https://' + url;
  1787. }
  1788. window.open(url);
  1789. }
  1790. }
  1791. </script>
  1792. <style lang="scss" scoped>
  1793. html,
  1794. body {
  1795. margin: 0;
  1796. padding: 0;
  1797. width: 375px;
  1798. height: 500px;
  1799. background-color: unset !important;
  1800. }
  1801. :deep() .ant-switch {
  1802. background-color: #E9ECEE;
  1803. height: 14px;
  1804. line-height: 16px;
  1805. min-width: 36px;
  1806. }
  1807. :deep() .ant-switch-checked {
  1808. background-color: #AED8F5 !important;
  1809. }
  1810. :deep() .ant-switch::after {
  1811. width: 20px;
  1812. height: 20px;
  1813. top: -4px;
  1814. left: -1px;
  1815. }
  1816. :deep() .ant-switch-checked::after {
  1817. background-color: #1D9BF0 !important;
  1818. margin-left: 3px;
  1819. left: 100% !important;
  1820. }
  1821. .content {
  1822. position: relative;
  1823. width: 375px;
  1824. height: 500px;
  1825. background: #fafafa;
  1826. border-radius: 11px;
  1827. overflow: hidden;
  1828. box-sizing: border-box;
  1829. border: 1px solid #DCDCDC;
  1830. font-family: "SF Pro Display";
  1831. font-style: normal;
  1832. .loading {
  1833. background: #FFFFFF;
  1834. opacity: 0.8;
  1835. z-index: 222;
  1836. text-align: center;
  1837. width: 375px;
  1838. height: 500px;
  1839. position: fixed;
  1840. top: 0;
  1841. left: 0;
  1842. img {
  1843. margin-top: 216px;
  1844. width: 70px;
  1845. height: 70px;
  1846. }
  1847. }
  1848. .redbag {
  1849. z-index: 222;
  1850. text-align: center;
  1851. width: 375px;
  1852. height: 500px;
  1853. position: fixed;
  1854. top: 0;
  1855. left: 0;
  1856. img {
  1857. margin-top: 172px;
  1858. width: 130px;
  1859. height: 130px;
  1860. }
  1861. }
  1862. .error {
  1863. width: 100%;
  1864. height: 100%;
  1865. text-align: center;
  1866. position: relative;
  1867. img {
  1868. width: 100px;
  1869. height: 100px;
  1870. margin-top: 100px;
  1871. }
  1872. .txt {
  1873. font-weight: 500;
  1874. font-size: 22px;
  1875. line-height: 26px;
  1876. text-align: center;
  1877. letter-spacing: 0.3px;
  1878. color: #a8a8a8;
  1879. margin: 34px 44px 0 44px;
  1880. }
  1881. .retry {
  1882. position: absolute;
  1883. bottom: 30px;
  1884. left: 50%;
  1885. margin-left: -167.5px;
  1886. width: 335px;
  1887. height: 46px;
  1888. line-height: 46px;
  1889. text-align: center;
  1890. border-radius: 100px;
  1891. border: 1px solid #1D9BF0;
  1892. background: rgba(196, 196, 196, 0.01);
  1893. color: #1D9BF0;
  1894. font-size: 16px;
  1895. font-weight: 500;
  1896. cursor: pointer;
  1897. }
  1898. }
  1899. .success,
  1900. .close,
  1901. .luck-peopel-list {
  1902. filter: drop-shadow(0px 4px 94px rgba(0, 0, 0, 0.3));
  1903. width: 100%;
  1904. height: 100%;
  1905. border-radius: 11px;
  1906. background: #fff;
  1907. overflow: hidden;
  1908. display: flex;
  1909. flex-direction: column;
  1910. .close-title {
  1911. width: 100%;
  1912. font-weight: 600;
  1913. font-size: 27px;
  1914. line-height: 32px;
  1915. text-align: center;
  1916. letter-spacing: 0.3px;
  1917. color: #ffffff;
  1918. }
  1919. .head {
  1920. padding: 14px 16px;
  1921. img {
  1922. cursor: pointer;
  1923. width: 24px;
  1924. height: 24px;
  1925. }
  1926. }
  1927. .header {
  1928. text-align: center;
  1929. min-height: 160px;
  1930. width: 100%;
  1931. background: #fff;
  1932. // padding-top: 30px;
  1933. background-size: 100% 100%;
  1934. position: relative;
  1935. display: flex;
  1936. align-content: center;
  1937. flex-wrap: wrap;
  1938. .rabbit {
  1939. width: 100%;
  1940. height: 100%;
  1941. display: flex;
  1942. align-items: center;
  1943. align-content: center;
  1944. flex-wrap: wrap;
  1945. justify-content: center;
  1946. img {
  1947. width: 150px;
  1948. height: 80px;
  1949. margin-bottom: 6px;
  1950. }
  1951. .flower {
  1952. width: 62px;
  1953. height: 62px;
  1954. }
  1955. p {
  1956. width: 100%;
  1957. margin: 0;
  1958. padding: 0;
  1959. font-size: 22px;
  1960. font-weight: 800;
  1961. color: #fff;
  1962. text-align: center;
  1963. letter-spacing: 0.3px;
  1964. }
  1965. }
  1966. .done {
  1967. cursor: pointer;
  1968. position: absolute;
  1969. top: 107px;
  1970. left: 50%;
  1971. margin-left: -150px;
  1972. width: 300px;
  1973. height: 60px;
  1974. display: flex;
  1975. align-items: center;
  1976. border-radius: 100px;
  1977. background: #ffffff;
  1978. box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1);
  1979. justify-content: center;
  1980. span {
  1981. color: #000000;
  1982. font-size: 14px;
  1983. }
  1984. .icon-done {
  1985. width: 24px;
  1986. height: 24px;
  1987. margin-right: 10px;
  1988. }
  1989. .icon-right {
  1990. margin-left: 5px;
  1991. width: 7px;
  1992. height: 14px;
  1993. }
  1994. }
  1995. .title {
  1996. margin-top: 30px;
  1997. color: #fff7e4;
  1998. opacity: 0.6;
  1999. font-weight: 700;
  2000. font-size: 18px;
  2001. line-height: 21px;
  2002. letter-spacing: -0.3px;
  2003. }
  2004. .money {
  2005. margin-bottom: 30px;
  2006. width: 100%;
  2007. display: flex;
  2008. justify-content: center;
  2009. align-items: center;
  2010. img {
  2011. width: 40px;
  2012. height: 40px;
  2013. margin-right: 9px;
  2014. border-radius: 50%;
  2015. border: solid 2px #fff;
  2016. }
  2017. .big {
  2018. font-weight: 700;
  2019. font-size: 46px;
  2020. line-height: 55px;
  2021. /* identical to box height */
  2022. letter-spacing: 0.3px;
  2023. color: #fff;
  2024. }
  2025. .small {
  2026. margin-left: 4px;
  2027. font-weight: 700;
  2028. font-size: 13px;
  2029. line-height: 16px;
  2030. /* identical to box height */
  2031. letter-spacing: 0.5px;
  2032. color: #fff;
  2033. }
  2034. }
  2035. }
  2036. .luck-list-title {
  2037. /* margin-top: 47px;*/
  2038. margin: 0 16px;
  2039. padding: 14px 0 11px 0;
  2040. background: #fff;
  2041. display: flex;
  2042. justify-content: space-between;
  2043. color: #B0B0B0;
  2044. font-weight: 500;
  2045. border-bottom: 1px solid #F2F2F2;
  2046. div:last-child {
  2047. text-align: right;
  2048. }
  2049. .text {
  2050. cursor: pointer;
  2051. }
  2052. }
  2053. .luck-list {
  2054. background: #fff;
  2055. overflow: auto;
  2056. &.max {
  2057. height: 250px;
  2058. }
  2059. .empty {
  2060. width: 100%;
  2061. height: 100%;
  2062. text-align: center;
  2063. img {
  2064. margin-top: 70px;
  2065. width: 100px;
  2066. height: 100px;
  2067. }
  2068. }
  2069. .luck-item {
  2070. display: flex;
  2071. padding: 10px 0;
  2072. margin: 0 16px;
  2073. border-bottom: 1px solid #F2F2F2;
  2074. justify-content: space-between;
  2075. position: relative;
  2076. .win{
  2077. position: absolute;
  2078. left:28px;
  2079. bottom: 7px;
  2080. width: 20px;
  2081. height: 20px;
  2082. }
  2083. img:first-child {
  2084. border-radius: 50%;
  2085. }
  2086. .luck-king {
  2087. position: absolute;
  2088. top: 36px;
  2089. right: 0px;
  2090. display: flex;
  2091. align-items: center;
  2092. img {
  2093. width: 22px;
  2094. height: 19px;
  2095. margin: 0;
  2096. }
  2097. span {
  2098. font-weight: 500;
  2099. font-size: 12px;
  2100. line-height: 14px;
  2101. letter-spacing: 0.3px;
  2102. color: #f5b945;
  2103. }
  2104. }
  2105. img {
  2106. cursor: pointer;
  2107. width: 42px;
  2108. height: 42px;
  2109. margin-right: 12px;
  2110. }
  2111. .luck-content {
  2112. flex: auto;
  2113. .luck-title {
  2114. color: #444444;
  2115. font-weight: 500;
  2116. font-size: 16px;
  2117. letter-spacing: 0.3px;
  2118. margin-bottom: 5px;
  2119. }
  2120. .luck-time {
  2121. font-weight: 400;
  2122. font-size: 12px;
  2123. line-height: 14px;
  2124. color: #B0B0B0;
  2125. }
  2126. }
  2127. .luck-money {
  2128. display: flex;
  2129. height: 17px;
  2130. align-items: center;
  2131. height: 100%;
  2132. img {
  2133. width: 14px;
  2134. height: 14px;
  2135. margin-right: 6px;
  2136. }
  2137. .luck-money-txt {
  2138. font-weight: 500;
  2139. font-size: 14px;
  2140. word-break: break-all;
  2141. /* identical to box height */
  2142. text-align: right;
  2143. letter-spacing: 0.3px;
  2144. color: #444444;
  2145. }
  2146. }
  2147. }
  2148. .luck-item:last-child {
  2149. border: 0;
  2150. }
  2151. }
  2152. }
  2153. .close {
  2154. position: relative;
  2155. .load-result {
  2156. position: absolute;
  2157. width: 100%;
  2158. height: 100%;
  2159. top: 0;
  2160. left: 0;
  2161. text-align: center;
  2162. display: flex;
  2163. flex-wrap: wrap;
  2164. justify-content: center;
  2165. align-content: flex-start;
  2166. .title {
  2167. width: 100%;
  2168. display: flex;
  2169. justify-content: center;
  2170. align-items: center;
  2171. margin-top: 36px;
  2172. img {
  2173. width: 26px;
  2174. height: 26px;
  2175. margin-right: 10px;
  2176. }
  2177. span {
  2178. color: #FFFFFF;
  2179. font-size: 18px;
  2180. font-weight: 800;
  2181. letter-spacing: 0.3px;
  2182. }
  2183. }
  2184. .ticket {
  2185. display: flex;
  2186. justify-content: center;
  2187. align-items: center;
  2188. width: 100%;
  2189. height: 163px;
  2190. img {
  2191. width: 250px;
  2192. height: 103px;
  2193. animation: myfirst 0.5s;
  2194. }
  2195. }
  2196. .div-ticket {
  2197. position: relative;
  2198. overflow: hidden;
  2199. transition-delay: 1s;
  2200. }
  2201. .div-ticket:after {
  2202. position: absolute;
  2203. right: -100%;
  2204. /*改变left的值,让其相对box影藏*/
  2205. top: 0;
  2206. width: 30%;
  2207. height: 100%;
  2208. content: "";
  2209. /* Safari 5.1 - 6.0 */
  2210. background: -webkit-linear-gradient(left, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, .3) 50%, rgba(255, 255, 255, 0) 100%);
  2211. /* Opera 11.1 - 12.0 */
  2212. background: -o-linear-gradient(left, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, .3) 50%, rgba(255, 255, 255, 0) 100%);
  2213. /* Firefox 3.6 - 15 */
  2214. background: -moz-linear-gradient(left, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, .3) 50%, rgba(255, 255, 255, 0) 100%);
  2215. /* 标准的语法 */
  2216. background: linear-gradient(to right, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, .3) 50%, rgba(255, 255, 255, 0) 100%);
  2217. transform: skewX(45deg);
  2218. animation: div_light 1s;
  2219. animation-delay: 0.5s;
  2220. }
  2221. // .div-ticket:hover:after {
  2222. // right: 150%;
  2223. // transition: 1s ease;
  2224. // }
  2225. p {
  2226. width: 100%;
  2227. margin: 0;
  2228. padding: 0;
  2229. color: #FCAB40;
  2230. text-align: center;
  2231. letter-spacing: 0.3px;
  2232. font-size: 18px;
  2233. font-weight: 700;
  2234. }
  2235. .time {
  2236. width: 100%;
  2237. display: flex;
  2238. justify-content: center;
  2239. align-items: center;
  2240. margin-top: 16px;
  2241. img {
  2242. width: 22px;
  2243. height: 22px;
  2244. margin-right: 10px;
  2245. }
  2246. span {
  2247. font-weight: 800;
  2248. font-size: 28px;
  2249. color: #3F3F3F;
  2250. }
  2251. }
  2252. .notification_switch {
  2253. border-top: 1px solid #EFEFEF;
  2254. justify-content: space-between;
  2255. position: absolute;
  2256. height: 48px;
  2257. width: 100%;
  2258. display: flex;
  2259. align-items: center;
  2260. bottom: 0;
  2261. padding: 0 22px 0 16px;
  2262. }
  2263. }
  2264. }
  2265. .success {
  2266. .header {
  2267. min-height: 180px;
  2268. align-content: flex-start;
  2269. .success-title {
  2270. color: #FFFFFF;
  2271. font-weight: 800;
  2272. font-size: 21px;
  2273. line-height: 27px;
  2274. margin-top: 28px;
  2275. text-align: center;
  2276. width: 100%;
  2277. }
  2278. .done {
  2279. top: 130px;
  2280. }
  2281. }
  2282. .luck-list-title {
  2283. margin-top: 10px;
  2284. border-bottom: 1px solid #ECECEC;
  2285. }
  2286. }
  2287. .opened {
  2288. filter: drop-shadow(0px 4px 94px rgba(0, 0, 0, 0.3));
  2289. width: 100%;
  2290. height: 100%;
  2291. display: flex;
  2292. flex-direction: column;
  2293. justify-content: space-between;
  2294. border-radius: 11px;
  2295. overflow: hidden;
  2296. .header {
  2297. text-align: center;
  2298. min-height: 110px;
  2299. width: 100%;
  2300. background: #fff;
  2301. // padding-top: 30px;
  2302. background-size: 100% 100%;
  2303. display: flex;
  2304. flex-wrap: wrap;
  2305. align-content: center;
  2306. justify-content: center;
  2307. img {
  2308. width: 52px;
  2309. height: 52px;
  2310. margin-right: 14px;
  2311. }
  2312. .txt {
  2313. color: #FFFFFF;
  2314. font-weight: 700;
  2315. font-size: 18px;
  2316. letter-spacing: 0.3px;
  2317. p {
  2318. margin: 0;
  2319. padding: 0;
  2320. text-align: left;
  2321. }
  2322. }
  2323. }
  2324. .list {
  2325. overflow-y: auto;
  2326. padding: 0 16px 0 16px;
  2327. background: #ffffff;
  2328. flex: 1;
  2329. .item {
  2330. display: flex;
  2331. align-items: center;
  2332. // min-height: 50px;
  2333. border-bottom: 1px solid #f0f0f0;
  2334. padding: 12px 0;
  2335. box-sizing: border-box;
  2336. img {
  2337. width: 24px;
  2338. height: 24px;
  2339. }
  2340. .red-right {
  2341. width: 35px;
  2342. height: 24px;
  2343. }
  2344. .item-content {
  2345. width: 100%;
  2346. flex: 1;
  2347. .item-follow-title {
  2348. display: flex;
  2349. align-items: center;
  2350. margin-top: 20px;
  2351. margin-bottom: 11px;
  2352. position: relative;
  2353. .btn {
  2354. // position: absolute;
  2355. // right: 0;
  2356. }
  2357. }
  2358. .item-title {
  2359. flex: 1;
  2360. margin-left: 10px;
  2361. font-weight: 500;
  2362. font-size: 15px;
  2363. letter-spacing: 0.3px;
  2364. color: #000000;
  2365. }
  2366. .item-follow-area {
  2367. display: flex;
  2368. flex-wrap: wrap;
  2369. .item-follow {
  2370. cursor: pointer;
  2371. border: 1px solid #ebebeb;
  2372. border-radius: 1000px;
  2373. height: 26px;
  2374. margin-right: 5px;
  2375. margin-bottom: 5px;
  2376. display: flex;
  2377. align-items: center;
  2378. .finished {
  2379. text-decoration: line-through;
  2380. color: #949494;
  2381. }
  2382. span {
  2383. margin-left: 8px;
  2384. margin-right: 2px;
  2385. color: #1D9BF0;
  2386. opacity: 1;
  2387. }
  2388. img {
  2389. width: 16px;
  2390. height: 16px;
  2391. margin-right: 7px;
  2392. }
  2393. }
  2394. }
  2395. span {
  2396. font-weight: 400;
  2397. font-size: 11px;
  2398. line-height: 13px;
  2399. letter-spacing: 0.3px;
  2400. color: #000000;
  2401. opacity: 0.4;
  2402. }
  2403. }
  2404. .btn {
  2405. width: 90px;
  2406. height: 29px;
  2407. line-height: 29px;
  2408. background: rgba(56, 154, 255, 0.1);
  2409. border-radius: 500px;
  2410. text-align: center;
  2411. letter-spacing: 0.3px;
  2412. color: #1D9BF0;
  2413. cursor: pointer;
  2414. }
  2415. .loading-wrapper {
  2416. width: 90px;
  2417. text-align: center;
  2418. .icon-loading {
  2419. animation: loading 1s infinite linear;
  2420. }
  2421. }
  2422. }
  2423. }
  2424. .people {
  2425. cursor: pointer;
  2426. padding-left: 16px;
  2427. height: 38px;
  2428. line-height: 38px;
  2429. background: #fff;
  2430. box-shadow: 0px 1px 0px #f2f2f2;
  2431. display: flex;
  2432. align-items: center;
  2433. justify-content: space-between;
  2434. .txt {
  2435. width: 90%;
  2436. font-weight: 400;
  2437. font-size: 12px;
  2438. line-height: 14px;
  2439. letter-spacing: 0.3px;
  2440. color: #000000;
  2441. opacity: 0.4;
  2442. }
  2443. }
  2444. .footer {
  2445. background: #ffffff;
  2446. display: flex;
  2447. padding: 15px 22px 15px 17px;
  2448. .btn {
  2449. background: #1D9BF0;
  2450. border-radius: 100px;
  2451. color: #fff;
  2452. width: 100%;
  2453. height: 48px;
  2454. font-weight: 600;
  2455. font-size: 18px;
  2456. line-height: 48px;
  2457. text-align: center;
  2458. cursor: pointer;
  2459. }
  2460. .grey {
  2461. background: #DDDDDD;
  2462. cursor: auto;
  2463. }
  2464. }
  2465. }
  2466. .not-open {
  2467. width: 100%;
  2468. height: 100%;
  2469. filter: drop-shadow(0px 2px 20px rgba(0, 0, 0, 0.1));
  2470. position: relative;
  2471. overflow: hidden;
  2472. border-radius: 11px;
  2473. .money-area {
  2474. width: 100%;
  2475. position: absolute;
  2476. top: 65px;
  2477. display: flex;
  2478. flex-wrap: wrap;
  2479. align-items: center;
  2480. justify-content: center;
  2481. .mark-area {
  2482. width: 100%;
  2483. display: flex;
  2484. justify-content: center;
  2485. img {
  2486. width: 16px;
  2487. height: 16px;
  2488. margin-right: 4px;
  2489. }
  2490. .time {
  2491. display: flex;
  2492. align-items: center;
  2493. span {
  2494. color: #FFFFFF;
  2495. font-weight: 800;
  2496. font-size: 17px;
  2497. letter-spacing: 0.05em;
  2498. line-height: 22px;
  2499. }
  2500. }
  2501. .win {
  2502. display: flex;
  2503. align-items: center;
  2504. margin-left: 12px;
  2505. color: #FFCC4D;
  2506. letter-spacing: 0.05em;
  2507. line-height: 22px;
  2508. font-size: 17px;
  2509. font-weight: 800;
  2510. }
  2511. }
  2512. .txt {
  2513. font-weight: 800;
  2514. font-size: 16px;
  2515. text-align: center;
  2516. letter-spacing: 0.3px;
  2517. color: #FFFFFF;
  2518. }
  2519. .coin {
  2520. text-align: center;
  2521. margin-top: 6px;
  2522. margin-bottom: 7px;
  2523. display: flex;
  2524. justify-content: center;
  2525. align-items: center;
  2526. width: 90%;
  2527. img {
  2528. width: 46px;
  2529. height: 46px;
  2530. border-radius: 50%;
  2531. border: 3px solid #FFFFFF;
  2532. }
  2533. span {
  2534. margin-left: 12px;
  2535. font-weight: 800;
  2536. font-size: 60px;
  2537. line-height: 76px;
  2538. color: #FFFFFF;
  2539. }
  2540. }
  2541. .people {
  2542. font-weight: 800;
  2543. font-size: 13px;
  2544. line-height: 16px;
  2545. letter-spacing: 0.05em;
  2546. text-align: center;
  2547. color: #FFFFFF;
  2548. }
  2549. }
  2550. .title {
  2551. position: absolute;
  2552. top: 15px;
  2553. left: 15px;
  2554. z-index: 3;
  2555. display: flex;
  2556. align-items: center;
  2557. img {
  2558. width: 24px;
  2559. height: 24px;
  2560. border: 2px solid #FFF;
  2561. border-radius: 50%;
  2562. }
  2563. span {
  2564. margin-left: 10px;
  2565. font-weight: 600;
  2566. font-size: 16px;
  2567. letter-spacing: 0.3px;
  2568. color: #fff;
  2569. }
  2570. }
  2571. // .txt {
  2572. // width: 100%;
  2573. // position: absolute;
  2574. // font-style: normal;
  2575. // font-weight: 700;
  2576. // font-size: 42px;
  2577. // line-height: 50px;
  2578. // text-align: center;
  2579. // color: #FFF2D3;
  2580. // top: 90px;
  2581. // z-index: 3;
  2582. // }
  2583. img {
  2584. width: 100%;
  2585. }
  2586. .up {
  2587. position: absolute;
  2588. top: 0;
  2589. // box-shadow: 0px 4px 44px rgba(0, 0, 0, 0.1);
  2590. z-index: 1;
  2591. }
  2592. .down {
  2593. position: absolute;
  2594. top: 253px;
  2595. }
  2596. .open {
  2597. width: 335px;
  2598. height: 50px;
  2599. cursor: pointer;
  2600. position: absolute;
  2601. bottom: 28px;
  2602. left: 50%;
  2603. margin-left: -167.5px;
  2604. z-index: 4;
  2605. }
  2606. .open-gif {
  2607. width: 200px;
  2608. height: 200px;
  2609. text-align: center;
  2610. position: absolute;
  2611. bottom: 80px;
  2612. left: 50%;
  2613. margin-left: -100px;
  2614. z-index: 3;
  2615. }
  2616. }
  2617. @keyframes loading {
  2618. from {
  2619. transform: rotate(0deg);
  2620. }
  2621. to {
  2622. transform: rotate(360deg);
  2623. }
  2624. }
  2625. }
  2626. @keyframes div_light {
  2627. 0% {
  2628. right: -100%;
  2629. }
  2630. 100% {
  2631. right: 150%;
  2632. }
  2633. }
  2634. @keyframes myfirst {
  2635. 0% {
  2636. width: 250px;
  2637. height: 103px;
  2638. }
  2639. 50% {
  2640. width: 300px;
  2641. height: 153px;
  2642. }
  2643. 100% {
  2644. width: 250px;
  2645. height: 103px;
  2646. }
  2647. }
  2648. .none {
  2649. display: flex;
  2650. align-item: center;
  2651. justify-content: center;
  2652. width: 100%;
  2653. height: 100%;
  2654. }
  2655. </style>