red-packet.vue 62 KB

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