red-packet.vue 78 KB

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