chunk-4031c6b3.58ec51e9.js 9.3 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4031c6b3"],{1848:function(t,e,a){"use strict";var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"back-bar border-bottom"},[a("div",{staticClass:"arrow-icon",on:{click:t.onBack}},[a("i",{staticClass:"el-icon-arrow-left"})]),t._v("\n "+t._s(t.title)+"\n "),t.url?a("a",{staticClass:"icon-link",attrs:{href:t.url,target:"_blank"}}):t._e(),t._t("default")],2)},s=[],i={name:"backBar",props:{title:String,url:String},methods:{onBack:function(){this.$router?this.$router.go(-1):this.$emit("onBack")}}},o=i,r=(a("a7de"),a("fc05")),c=Object(r["a"])(o,n,s,!1,null,"bdea7596",null);e["a"]=c.exports},"4faa":function(t,e,a){"use strict";var n=a("ff2f"),s=a.n(n);s.a},"6a90":function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"packet-send-wrap"},["h5"==t.meechatType?a("back-bar",{staticClass:"redpacket-backbar",attrs:{title:t.$t("redPacket.title")},on:{onBack:t.hidePopup}}):t._e(),a("div",{staticClass:"send-wrap",class:[{"is-private":t.isPrivate}]},[a("i",{staticClass:"el-icon-close",on:{click:t.hidePopup}}),a("i",{staticClass:"el-icon-question",on:{click:function(e){t.helpShow=!0}}}),a("h3",{staticClass:"title"},[t._v(t._s(t.$t("redPacket.title")))]),a("p",{staticClass:"redpacket-tips",class:{hidden:!t.tips}},[t._v(t._s(t.tips))]),a("div",{staticClass:"main-box"},[a("div",{staticClass:"input-item"},[a("span",{staticClass:"text"},[t._v("\n "+t._s(t.$t("redPacket.totalAmount"))+"\n ")]),a("div",{staticClass:"packet-box"},[a("input",{directives:[{name:"model",rawName:"v-model.number",value:t.money,expression:"money",modifiers:{number:!0}}],attrs:{type:"number",placeholder:"0.00"},domProps:{value:t.money},on:{input:function(e){e.target.composing||(t.money=t._n(e.target.value))},blur:function(e){return t.$forceUpdate()}}}),a("div",{staticClass:"unit"},[a("div",{class:["cur-unit",{"has-arrow":t.group.eosInfo}]},[t._v(t._s(t.symbol))]),t.group.eosInfo?a("div",{staticClass:"code-menu"},[a("div",{staticClass:"code-item",on:{click:function(e){t.isGameToken=!t.isGameToken}}},[t._v("\n "+t._s(t.isGameToken?"EOS":t.group.eosInfo.token)+"\n ")])]):t._e()])])]),t.isPrivate?t._e():a("p",{staticClass:"input-tips"},[t._v("\n "+t._s(t.$t("redPacket.tip1"))+"\n ")]),t.isPrivate?t._e():a("div",{staticClass:"input-item pack-num-input"},[a("span",{staticClass:"text"},[t._v(t._s(t.$t("redPacket.num")))]),a("div",{staticClass:"packet-box"},[a("input",{directives:[{name:"model",rawName:"v-model.number",value:t.packetNum,expression:"packetNum",modifiers:{number:!0}}],attrs:{type:"number",placeholder:t.$t("redPacket.placeholder1")},domProps:{value:t.packetNum},on:{input:function(e){e.target.composing||(t.packetNum=t._n(e.target.value))},blur:function(e){return t.$forceUpdate()}}}),a("div",{staticClass:"unit"},[t._v(t._s(t.$t("redPacket.unit")))])])]),t.isPrivate?t._e():a("p",{staticClass:"group-user-num"},[t._v("\n "+t._s(t.$t("redPacket.tip2",{num:t.group.membersNum}))+"\n ")]),a("textarea",{directives:[{name:"model",rawName:"v-model",value:t.word,expression:"word"}],staticClass:"words",attrs:{placeholder:t.$t("redPacket.memo")},domProps:{value:t.word},on:{input:function(e){e.target.composing||(t.word=e.target.value)}}}),a("div",{staticClass:"sum"},[t._v("\n "+t._s(t.amountSum)+" "),a("span",[t._v(t._s(t.isGameToken?t.group.eosInfo.token:"EOS"))])]),a("button",{staticClass:"send-btn",class:{"is-disable":!t.amountSum||!t.packetNum,loading:t.isLoading},on:{click:t.sendPacket}},[t.isLoading?a("i",{staticClass:"el-icon-loading"}):t._e(),t._v(" "+t._s(t.$t("redPacket.sendBtn"))+"\n ")])]),a("p",{staticClass:"bot"},[t._v(t._s(t.$t("redPacket.tip3")))])]),a("div",{directives:[{name:"show",rawName:"v-show",value:t.helpShow,expression:"helpShow"}],staticClass:"help-wrap"},[a("i",{staticClass:"el-icon-close",on:{click:function(e){t.helpShow=!1}}}),a("h3",{staticClass:"title"},[t._v(t._s(t.$t("redPacket.helpTitle")))]),a("div",{staticClass:"content"},[a("div",{staticClass:"item"},[t._v("\n "+t._s(t.$t("redPacket.helpRule1"))+"\n ")]),a("div",{staticClass:"item"},[t._v("\n "+t._s(t.$t("redPacket.helpRule2"))+"\n ")]),a("div",{staticClass:"item"},[t._v("\n "+t._s(t.$t("redPacket.helpRule3"))+"\n ")])])])],1)},s=[],i=a("badb"),o=a.n(i),r=(a("46b5"),a("8e5d"),a("4694"),a("dc12"),a("024c")),c=(a("3b70"),a("ad09"),a("dfe5")),u=a.n(c),m=(a("b5aa"),a("4457")),p=a("bd31"),l=a("52c1"),d=a("d690"),h=a.n(d),f=a("a700"),v=a.n(f),k={transfer:function(t,e,a,n,s){var i="transfer",o={authorization:["".concat(t,"@").concat(s)]};return self!==top?b(i,[t,e,a,n,o]):window.EOS[i](t,e,a,n,o)},getCurrencyBalance:function(t,e){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"EOS",n="getCurrencyBalance";return self!==top?b(n,[t,e,a]):window.EOS.getCurrencyBalance(t,e,a)},doSymbolTransfer:function(){var t=Object(m["a"])(regeneratorRuntime.mark(function t(e,a,n,s,i,o){var r,c,u,m;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:if(r="transfer",c={authorization:["".concat(e,"@").concat(i)]},self===top){t.next=6;break}return t.abrupt("return",b(r,[e,a,n,s,c],o));case 6:return t.prev=6,t.next=9,window.EOS.contract(o);case 9:return u=t.sent,t.next=12,u[r](e,a,n,s,c);case 12:return m=t.sent,t.abrupt("return",v.a.resolve(m));case 16:return t.prev=16,t.t0=t["catch"](6),t.abrupt("return",v.a.reject(t.t0));case 19:case"end":return t.stop()}},t,this,[[6,16]])}));function e(e,a,n,s,i,o){return t.apply(this,arguments)}return e}()};function b(t,e){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return window.postMessager.send({action:"meechat:eosAction",data:{action:t,param:e,contract:a}})}var g=k,_=a("33f8"),w=a("1848"),y={name:"packetSend",data:function(){return{visible:!0,helpShow:!1,money:1,packetNum:1,word:this.$t("redPacket.memo"),tips:"",isLoading:!1,isGameToken:!1,meechatType:Object(_["o"])()}},components:{backBar:w["a"]},computed:Object(p["a"])({},Object(l["e"])(["account","group","curSession","scatter"]),Object(l["c"])(["isPrivate"]),{amountSum:function(){return this.money},symbol:function(){return this.isGameToken?this.group.eosInfo.token:"EOS"},minSum:function(){return this.isGameToken?h.a.divide(this.group.eosInfo.min_amount,1e4):.1},maxSum:function(){return this.isGameToken?h.a.divide(this.group.eosInfo.max_amount,1e4):200}}),watch:{money:function(t){t>this.maxSum&&(this.money=this.maxSum,this.showTip("".concat(this.$t("redPacket.maxMoneyTip")," ").concat(this.maxSum," ").concat(this.symbol))),t&&t/this.packetNum<.01&&(this.money=h.a.times(this.packetNum,.01),this.showTip("".concat(this.$t("redPacket.singleMinMoneyTip")," 0.01 ").concat(this.symbol)))},packetNum:function(t,e){this.money&&h.a.divide(this.money,t)<.01&&(this.packetNum=e,this.showTip("".concat(this.$t("redPacket.singleMinMoneyTip")," 0.01 ").concat(this.symbol))),t>100&&(this.packetNum=100,this.showTip("".concat(this.$t("redPacket.maxNumberTip")," 100 个")))}},methods:{hidePopup:function(){this.$emit("hidePopup")},showTip:function(t){var e=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3e3;this.tips=t,setTimeout(function(){e.tips=""},a)},sendPacket:function(){var t=Object(m["a"])(regeneratorRuntime.mark(function t(){var e,a,n,s,i,c,m,p,l,d,h=this;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:if("eos"==Object(_["r"])("loginType")){t.next=3;break}return u()({message:this.$t("redPacket.sendForEosTips"),type:"error"}),t.abrupt("return");case 3:if(!(this.money<this.minSum)){t.next=6;break}return this.showTip("".concat(this.$t("redPacket.minMoneyTip")," ").concat(this.minSum," ").concat(this.symbol)),t.abrupt("return",!1);case 6:return this.isLoading=!0,e=this.amountSum.toFixed(4)+" ".concat(this.symbol),a="meechatadmin",n={type:"redpack",num:this.packetNum,memo:this.word,sid:this.isPrivate?this.curSession:this.group.groupId},s=this.isGameToken?this.group.eosInfo.token_code:"eosio.token",i=this.symbol,t.next=14,g.getCurrencyBalance(s,this.account.name,i);case 14:if(c=t.sent,m=Object(r["a"])(c,1),p=m[0],!p){t.next=26;break}if(l=this.isGameToken?p.replace(new RegExp("\\s"+i),""):p.replace(/\sEOS/,""),!(this.amountSum>Number(l))){t.next=23;break}return u()({message:this.$t("public.noMoney"),type:"error"}),this.isLoading=!1,t.abrupt("return");case 23:this.isGameToken?(d=this.group.eosInfo.token_code,g.doSymbolTransfer(this.account.name,"meechatadmin",e,o()(n),this.account.authority,d).then(function(t){h.hidePopup()}).catch(function(t){if(!t.type){var e=JSON.parse(t),a=e.error.details;u()({message:a[0].message,type:"error"})}}).finally(function(){h.isLoading=!1})):g.transfer(this.account.name,a,e,o()(n),this.account.authority).then(function(t){h.hidePopup()}).catch(function(t){if(!t.type){var e=JSON.parse(t),a=e.error.details;u()({message:a[0].message,type:"error"})}}).finally(function(){h.isLoading=!1}),t.next=28;break;case 26:u()({message:this.$t("public.badNetwork"),type:"error"}),this.isLoading=!1;case 28:case"end":return t.stop()}},t,this)}));function e(){return t.apply(this,arguments)}return e}()},mounted:function(){}},C=y,P=(a("4faa"),a("fc05")),S=Object(P["a"])(C,n,s,!1,null,null,null);e["default"]=S.exports},a7de:function(t,e,a){"use strict";var n=a("b1c0"),s=a.n(n);s.a},b1c0:function(t,e,a){},ff2f:function(t,e,a){}}]);