-
Notifications
You must be signed in to change notification settings - Fork 0
/
src__pages__JIU__Activity.async.js
1 lines (1 loc) · 6 KB
/
src__pages__JIU__Activity.async.js
1
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[5185],{77914:function(e,t,n){n.r(t),n.d(t,{default:function(){return A}});var i=n(15009),o=n.n(i),r=n(99289),s=n.n(r),a=n(5574),c=n.n(a),u=n.p+"static/jiu.4c2ba2ff.png",l=n.p+"static/jiu1.0e98bf07.jpg",m=n.p+"static/jiu2.bd28813e.jpg",p=n.p+"static/jiu3.503ae7ce.jpg",d=n.p+"static/jiu4.a17ecd68.jpg",k=n(23144),h=n(3990),f=n(81876),y=n(64119),T=n(11774),j=n(59530),x=n(21612),g=n(9361),S=n(28459),v=n(91978),b=n(68508),P=n(62435),q=n(86074),M=x.Z.Header,U=x.Z.Content,A=function(){var e=(0,j.useSearchParams)(),t=c()(e,2),n=t[0],i=t[1],r=n.get("tab")?n.get("tab"):void 0,a=(0,j.useDispatch)(),A=(0,j.useSelector)((function(e){return e.global.contractKit})),w=(0,j.useSelector)((function(e){return e.jiu.activeKey})),O=(0,j.useSelector)((function(e){return e.jiu.tokenPriceMap})),I=g.Z.useToken().token,J=I.colorBgContainer,C=I.borderRadiusLG,N=(0,P.useMemo)((function(){return[{key:"4",label:"活动4",comp:(0,q.jsx)(k.cS,{params:{title:"JIU币价预言家,JIU要赢百万",src:"https://docs.qq.com/doc/DWmtnTXl3dFdmS0ZL",finish:!0,inputType:2,inputLabel:"预言哪一天JIU币价会突破$0.0001",inputPlaceholder:"",inputPrefix:"",inputTip:"当前JIU价格:".concat(O["jiutokenmain-JIU"]?"$"+O["jiutokenmain-JIU"].toFixed(6):"NA"),ruleType:2,receiveAccount:"jiutothemoon",transferTokenContract:"jiutokenmain",transferTokenSym:"JIU",transferTokenPrecision:4,transferTokenMinAmount:1,liqMid:24,liqTokenKey:0,liqSym:"DFS",liqTokenMinAmount:0,holdTokenContract:"eosio.token",holdTokenMinAmount:0,holdTokenSym:"DFS",allTokenMinAmount:1}})},{key:"3",label:"活动3",comp:(0,q.jsx)(k.cS,{params:{title:"NO.3:关于原始底池LP产出JIU的处置提案",src:"https://docs.qq.com/doc/DWkZ1c09yT3lMelhO",finish:!0,inputType:1,inputLabel:"选择方案",inputPlaceholder:"",inputPrefix:"",inputTip:"",schemes:{scheme1:"支持",scheme2:"不支持"},ruleType:2,receiveAccount:"jiutothemoon",transferTokenContract:"jiutokenmain",transferTokenSym:"JIU",transferTokenMinAmount:10,transferTokenPrecision:4,liqMid:24,liqTokenKey:1,liqSym:"JIU",liqTokenMinAmount:0,holdTokenContract:"jiutokenmain",holdTokenSym:"JIU",holdTokenMinAmount:0,allTokenMinAmount:1e5}})},{key:"2",label:"活动2",comp:(0,q.jsx)(k.cS,{params:{title:"NO.2:JIU常用LOGO投票",src:"https://docs.qq.com/doc/DWkNvdURZVUFMWnFW",finish:!0,inputType:1,inputLabel:"选择方案",inputPlaceholder:"",inputPrefix:"",inputTip:"",schemes:{scheme1:"方案1",scheme2:"方案2",scheme3:"方案3"},ruleType:1,receiveAccount:"jiutothemoon",transferTokenContract:"jiutokenmain",transferTokenSym:"JIU",transferTokenMinAmount:1,transferTokenPrecision:4,liqMid:24,liqTokenKey:0,liqSym:"DFS",liqTokenMinAmount:1}})},{key:"1",label:"活动1",comp:(0,q.jsx)(k.cS,{params:{title:"NO.1:JIU全新LOGO创作方向投票",src:"https://docs.qq.com/doc/DWnFyUHJsa2l4YlRD",finish:!0,inputType:1,inputLabel:"选择方案",inputPlaceholder:"",inputPrefix:"",inputTip:"",schemes:{scheme1:"方案1",scheme2:"方案2",scheme3:"方案3",scheme4:"方案4",scheme5:"方案5",scheme6:"方案6"},ruleType:1,receiveAccount:"jiutothemoon",transferTokenContract:"jiutokenmain",transferTokenSym:"JIU",transferTokenPrecision:4,transferTokenMinAmount:1,liqMid:24,liqTokenKey:0,liqSym:"DFS",liqTokenMinAmount:1}})}]}),[O]),D=(0,P.useCallback)(function(){var e=s()(o()().mark((function e(t){var n,i,r,s,c,u;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.load("swapswapswap");case 2:return n=e.sent,i=n.table("markets"),e.next=6,i.all();case 6:r=e.sent,"usdtusdtusdt-USDT",c="eosio.token-DFS",u=[],(s={})["usdtusdtusdt-USDT"]=1,s[c]=(0,y.ri)(r[0].reserve0)/(0,y.ri)(r[0].reserve1),r.forEach((function(e){var t=e.contract0.toString()+"-"+e.sym0.toString().split(",")[1],n=e.contract1.toString()+"-"+e.sym1.toString().split(",")[1],i=(0,y.ri)(e.reserve0),o=(0,y.ri)(e.reserve1);"eosio.token"===e.contract0.toString()?s.hasOwnProperty(n)||(s[n]=i/o*s[c]):"eosio.token"===e.contract1.toString()?s.hasOwnProperty(t)||(s[t]=o/i*s[c]):"usdtusdtusdt"===e.contract0.toString()?s.hasOwnProperty(n)||(s[n]=i/o):"usdtusdtusdt"===e.contract1.toString()?s.hasOwnProperty(t)||(s[t]=o/i):u.push({key0:t,key1:n,value0:i,value1:o})})),u.forEach((function(e){s.hasOwnProperty(e.key0)&&!s.hasOwnProperty(e.key1)?s[e.key1]=e.value0/e.value1*s[e.key0]:!s.hasOwnProperty(e.key0)&&s.hasOwnProperty(e.key1)?s[e.key0]=e.value1/e.value0*s[e.key1]:s.hasOwnProperty(e.key0)||s.hasOwnProperty(e.key1)||(s[e.key0]=0,s[e.key1]=0)})),a(f.N.setTokenPriceMap(s)),a(h.N.setMarkets(i));case 17:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[]),L=(0,P.useCallback)((function(e){a(f.N.setActiveKey(e.key))}),[]),F=(0,P.useCallback)((function(){var e=N.find((function(e){return e.key===w}));return e?e.comp:(0,q.jsx)("div",{children:"活动不存在"})}),[w,N]),Z=(0,P.useCallback)((function(e){var t={};t.tab=e||w,i(t)}),[w]);return(0,P.useEffect)((function(){A&&D(A)}),[D,A]),(0,P.useEffect)((function(){var e=n.get("tab");e&&a(f.N.setActiveKey(e)),Z(e)}),[]),(0,P.useEffect)((function(){Z(w)}),[w,Z]),(0,q.jsx)(T._z,{className:"activity",ghost:!0,children:(0,q.jsx)(S.ZP,{theme:{components:{Layout:{headerBg:"#ffffff",headerPadding:"0 15px"}}},children:(0,q.jsxs)(x.Z,{style:{maxWidth:"450px",marginLeft:"auto",marginRight:"auto"},children:[(0,q.jsxs)(v.Z,{autoplay:!0,children:[(0,q.jsx)("img",{src:l}),(0,q.jsx)("img",{src:m}),(0,q.jsx)("img",{src:p}),(0,q.jsx)("img",{src:d})]}),(0,q.jsxs)(M,{style:{display:"flex",alignItems:"center",marginBottom:"0px",borderBottomLeftRadius:C,borderBottomRightRadius:C},children:[(0,q.jsxs)("div",{className:"flex items-center",children:[(0,q.jsx)("img",{src:u,width:"40",className:"mr-3"}),(0,q.jsx)("span",{className:" font-bold text-lg",children:"JIU"})]}),(0,q.jsx)(b.Z,{theme:"light",mode:"horizontal",selectedKeys:[r],items:N,style:{flex:1,minWidth:0,display:"flex",justifyContent:"center"},onClick:L})]}),(0,q.jsx)(U,{children:(0,q.jsx)("div",{style:{background:J,padding:0,borderRadius:C},children:(0,q.jsx)("div",{className:"mt-2 p-3",children:F()})})})]})})})}}}]);