red-packet.vue 78 KB

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