red-packet.vue 67 KB

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