text: (function(e){function t(t){for(var a,r,s=t[0],c=t[1],u=t[2],l=0,p=[];l<s.length;l++)r=s[l],o[r]&&p.push(o[r][0]),o[r]=0;for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&(e[a]=c[a]);d&&d(t);while(p.length)p.shift()();return i.push.apply(i,u||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],a=!0,r=1;r<n.length;r++){var s=n[r];0!==o[s]&&(a=!1)}a&&(i.splice(t--,1),e=c(c.s=n[0]))}return e}var a={},r={app:0},o={app:0},i=[];function s(e){return c.p+"assets/js/"+({}[e]||e)+"."+{"chunk-285b042c":"95db52e6","chunk-2d0d3dbd":"4fb4bec4","chunk-49718590":"23e4388e","chunk-4b8a5e2e":"c65b3819","chunk-8721c828":"6a5b065d","chunk-9bf7590a":"3b83d8f7"}[e]+".js"}function c(t){if(a[t])return a[t].exports;var n=a[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,c),n.l=!0,n.exports}c.e=function(e){var t=[],n={"chunk-49718590":1,"chunk-4b8a5e2e":1,"chunk-8721c828":1};r[e]?t.push(r[e]):0!==r[e]&&n[e]&&t.push(r[e]=new Promise(function(t,n){for(var a="assets/css/"+({}[e]||e)+"."+{"chunk-285b042c":"31d6cfe0","chunk-2d0d3dbd":"31d6cfe0","chunk-49718590":"9acdc05b","chunk-4b8a5e2e":"f42e92fa","chunk-8721c828":"e8983b05","chunk-9bf7590a":"31d6cfe0"}[e]+".css",o=c.p+a,i=document.getElementsByTagName("link"),s=0;s<i.length;s++){var u=i[s],l=u.getAttribute("data-href")||u.getAttribute("href");if("stylesheet"===u.rel&&(l===a||l===o))return t()}var p=document.getElementsByTagName("style");for(s=0;s<p.length;s++){u=p[s],l=u.getAttribute("data-href");if(l===a||l===o)return t()}var d=document.createElement("link");d.rel="stylesheet",d.type="text/css",d.onload=t,d.onerror=function(t){var a=t&&t.target&&t.target.src||o,i=new Error("Loading CSS chunk "+e+" failed.\n("+a+")");i.code="CSS_CHUNK_LOAD_FAILED",i.request=a,delete r[e],d.parentNode.removeChild(d),n(i)},d.href=o;var f=document.getElementsByTagName("head")[0];f.appendChild(d)}).then(function(){r[e]=0}));var a=o[e];if(0!==a)if(a)t.push(a[2]);else{var i=new Promise(function(t,n){a=o[e]=[t,n]});t.push(a[2]=i);var u,l=document.createElement("script");l.charset="utf-8",l.timeout=120,c.nc&&l.setAttribute("nonce",c.nc),l.src=s(e),u=function(t){l.onerror=l.onload=null,clearTimeout(p);var n=o[e];if(0!==n){if(n){var a=t&&("load"===t.type?"missing":t.type),r=t&&t.target&&t.target.src,i=new Error("Loading chunk "+e+" failed.\n("+a+": "+r+")");i.type=a,i.request=r,n[1](i)}o[e]=void 0}};var p=setTimeout(function(){u({type:"timeout",target:l})},12e4);l.onerror=l.onload=u,document.head.appendChild(l)}return Promise.all(t)},c.m=e,c.c=a,c.d=function(e,t,n){c.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},c.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.t=function(e,t){if(1&t&&(e=c(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(c.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)c.d(n,a,function(t){return e[t]}.bind(null,a));return n},c.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return c.d(t,"a",t),t},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.p="",c.oe=function(e){throw console.error(e),e};var u=window["webpackJsonp"]=window["webpackJsonp"]||[],l=u.push.bind(u);u.push=t,u=u.slice();for(var p=0;p<u.length;p++)t(u[p]);var d=l;i.push([0,"chunk-vendors"]),n()})({0:function(e,t,n){e.exports=n("56d7")},"034f":function(e,t,n){"use strict";var a=n("64a9"),r=n.n(a);r.a},1:function(e,t){},2:function(e,t){},3:function(e,t){},4:function(e,t){},4730:function(e,t,n){"use strict";var a=n("f9c2"),r=n.n(a);r.a},"56d7":function(e,t,n){"use strict";n.r(t);n("cadf"),n("551c"),n("f751"),n("097d");var a=n("a026"),r=n("bc3a"),o=n.n(r),i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"app"}},[n("transition",{attrs:{name:"fade",mode:"out-in"}},[n("router-view")],1)],1)},s=[],c=(n("034f"),n("2877")),u={},l=Object(c["a"])(u,i,s,!1,null,null,null),p=l.exports,d=n("8c4f"),f=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("p",{staticClass:"page-container"},[e._v("404 page not found")])},m=[],y=(n("b2b1"),{}),h=Object(c["a"])(y,f,m,!1,null,null,null),g=h.exports,b=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-row",{staticClass:"container"},[n("el-col",{staticClass:"header",attrs:{span:24}},[n("el-col",{staticClass:"logo logo-width",attrs:{span:10}},[n("el-button",{staticStyle:{"font-size":"25px",color:"white"},attrs:{type:"text"},on:{click:function(t){return e.$router.push("/")}}},[e._v(e._s(e.sysName)+"\n                ")])],1),n("el-col",{staticClass:"userinfo",attrs:{span:4}},[n("el-popover",{attrs:{placement:"bottom",width:"400",trigger:"click"}},[n("el-row",{directives:[{name:"loading",rawName:"v-loading",value:e.Loading,expression:"Loading"}]},[n("div",{staticClass:"omission",staticStyle:{"text-align":"center"}},[e._v(e._s("地址："+e.Address))]),n("div",{staticStyle:{"text-align":"center"}},[e._v(e._s("当前区块链高度："+e.BlockNumber))]),n("div",{staticStyle:{"text-align":"center"}},[e._v(e._s("余额："+e.Balance))]),n("div",{staticStyle:{"text-align":"center"}},[e.created?e._e():n("el-button",{attrs:{type:"primary",size:"medium",loading:e.Trading,round:"",plain:""},on:{click:e.CreatePlayer}},[e._v("创建用户\n                            ")]),e.created?n("el-link",{attrs:{type:"primary"},on:{click:function(t){return e.$router.push("/UserInfo")}}},[e._v("更多信息")]):e._e()],1)]),n("span",{staticClass:"el-dropdown-link userinfo-inner",attrs:{slot:"reference"},slot:"reference"},[n("img",{attrs:{src:"https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"},on:{click:e.getBalance}}),""!==e.Address?n("el-button",{attrs:{slot:"reference",type:"success",icon:"el-icon-check",circle:"",size:"mini"},slot:"reference"},[e._v(e._s("已连接"))]):e._e()],1)],1)],1)],1),n("el-col",{staticClass:"main",attrs:{span:24}},[n("aside",{staticClass:"menu-expanded"},[n("el-menu",{staticClass:"el-menu-vertical-demo",attrs:{"default-active":e.$route.path,"unique-opened":"",router:""},on:{open:e.handleopen,close:e.handleclose,select:e.handleselect}},[e._l(e.$router.options.routes,function(t,a){return t.hidden?e._e():[t.leaf?e._e():n("el-submenu",{attrs:{index:a+""}},[n("template",{slot:"title"},[n("i",{class:t.iconCls}),e._v(e._s(t.name))]),e._l(t.children,function(t){return t.hidden?e._e():n("el-menu-item",{key:t.path,attrs:{index:t.path}},[n("i",{class:t.iconCls}),e._v(e._s(t.name)+"\n                            ")])})],2),t.leaf&&t.children.length>0?n("el-menu-item",{attrs:{index:t.children[0].path}},[n("i",{class:t.iconCls}),e._v(e._s(t.children[0].name)+"\n                        ")]):e._e()]})],2)],1),n("section",{staticClass:"content-container"},[n("div",{staticClass:"grid-content bg-purple-light"},[n("el-col",{staticClass:"content-wrapper",attrs:{span:24}},[n("transition",{attrs:{name:"fade",mode:"out-in"}},[n("router-view")],1)],1)],1)])])],1)},v=[],_=(n("8e6e"),n("ac6a"),n("456d"),n("bd86")),w=n("2f62");function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function C(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(n,!0).forEach(function(t){Object(_["a"])(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var E={data:function(){return{sysName:"Prophet",Loading:!0,created:!0,Hash:"",Trading:!1}},computed:C({},Object(w["c"])(["Address","Balance","BlockNumber"])),created:function(){},methods:C({handleopen:function(){},handleclose:function(){},handleselect:function(e,t){}},Object(w["b"])(["modifyBalance"]),{getBalance:function(){var e=this,t=this.$Connection();this.$getPlayer().then(function(n){t.eth.getBlockNumber().then(function(t){e.modifyBalance({Balance:n[0],BlockNumber:t})})}),this.getPlayerLogs()},getPlayerLogs:function(){var e=this;this.$getPlayerLogs().then(function(t){e.created=0!==t.length,e.Loading=!1})},CreatePlayer:function(){var e=this;this.$CreatePlayer().on("transactionHash",function(t){e.notify(t),e.Hash=t,e.Trading=!0}).on("confirmation",function(e,t){}).on("receipt",function(t){e.notify1("成功","交易成功","success"),e.Trading=!1,e.created=!0}).on("error",function(t){e.notify1("失败","交易失败，详情见MetaMask","error",0)})},notify:function(e){var t=this.$createElement;this.$notify({title:"交易Hash,详情见MetaMask",message:t("i",{style:"color: teal"},e)})},notify1:function(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:4500;this.$notify({title:e,message:t,type:n,duration:a})},logout:function(){var e=this;this.$confirm("确认退出吗?","提示",{}).then(function(){e.$router.push("/login")}).catch(function(){})}}),mounted:function(){}},O=E,P=(n("917c"),Object(c["a"])(O,b,v,!1,null,"7251c95f",null)),$=P.exports;a["default"].use(d["a"]);var j=new d["a"]({mode:"hash",base:"",routes:[{path:"/",component:$,name:"",iconCls:"el-icon-orange",leaf:!0,redirect:{path:"/Hello"},children:[{path:"/AllEvent",component:function(){return n.e("chunk-9bf7590a").then(n.bind(null,"7f09"))},name:"概览"},{path:"/EventInfo/:id",component:function(){return n.e("chunk-2d0d3dbd").then(n.bind(null,"5f0f"))},name:"详情信息"},{path:"/UserInfo",component:function(){return n.e("chunk-8721c828").then(n.bind(null,"ee96"))},name:"个人信息"},{path:"/Hello",component:function(){return n.e("chunk-49718590").then(n.bind(null,"3ba4"))},name:"欢迎界面"}]},{path:"/",component:$,name:"菜单",children:[{path:"/Oneself",iconCls:"el-icon-orange",component:function(){return n.e("chunk-285b042c").then(n.bind(null,"1811"))},name:"我的事件"},{path:"/Initiate",iconCls:"el-icon-orange",component:function(){return n.e("chunk-4b8a5e2e").then(n.bind(null,"0c4f"))},name:"创建事件"}]},{path:"/404",name:"404",component:g,hidden:!0},{path:"*",hidden:!0,redirect:{path:"/404"}}]}),x=j;a["default"].use(w["a"]);var I=new w["a"].Store({state:{Address:"",Balance:"",BlockNumber:""},mutations:{modifyBalance:function(e,t){e.Balance=t["Balance"],e.BlockNumber=t["BlockNumber"],e.Address=ethereum.selectedAddress}},actions:{}}),M=n("5c96"),B=n.n(M),S=(n("0fae"),n("a481"),n("7618"));function D(e,t){if(0===arguments.length)return null;var n,a=t||"{y}-{m}-{d} {h}:{i}:{s}";"object"===Object(S["a"])(e)?n=e:(10==="".concat(e).length&&(e=1e3*parseInt(e)),n=new Date(e));var r={y:n.getFullYear(),m:n.getMonth()+1,d:n.getDate(),h:n.getHours(),i:n.getMinutes(),s:n.getSeconds(),a:n.getDay()},o=a.replace(/{(y|m|d|h|i|s|a)+}/g,function(e,t){var n=r[t];return"a"===t?["日","一","二","三","四","五","六"][n]:(e.length>0&&n<10&&(n="0".concat(n)),n||0)});return o}function T(e){for(var t={},n=[],a=0;a<e.length;a++)t[e[a]]||(t[e[a]]=!0,n.push(e[a]));return n}var A,N,L,R=n("6314"),V="0xc026E2dFF8cA4cdaaC9e52e8063e93eAEe1eBA07",H=[{constant:!1,inputs:[{name:"content",type:"string"},{name:"option",type:"string[]"},{name:"Validity",type:"uint256"},{name:"addr",type:"address"}],name:"InitiateEvent",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"id",type:"uint256"}],name:"Reward",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"addr",type:"address"}],name:"getPlayer",outputs:[{name:"",type:"uint256"},{name:"",type:"uint256[]"},{name:"",type:"uint256[]"},{name:"",type:"uint256[]"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getTotalEvent",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"id",type:"uint256"},{name:"option",type:"uint256"}],name:"Report",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"id",type:"uint256"},{name:"option",type:"uint256"},{name:"finance",type:"uint256"}],name:"Vote",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"id",type:"uint256"}],name:"getEvent",outputs:[{components:[{name:"ID",type:"uint256"},{name:"Sponsor",type:"address"},{name:"Content",type:"string"},{name:"Option",type:"string[]"},{name:"Reporter",type:"address"},{name:"StartDate",type:"uint256"},{name:"Deadline",type:"uint256"},{name:"Voters",type:"address[]"},{name:"PrizePool",type:"uint256"},{name:"Report",type:"bool"},{name:"Result",type:"uint256"}],name:"",type:"tuple"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"id",type:"uint256"},{name:"option",type:"uint256"}],name:"getEventOptionInfo",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"id",type:"uint256"},{name:"addr",type:"address"}],name:"getVote",outputs:[{components:[{name:"Voted",type:"bool"},{name:"Time",type:"uint256"},{name:"Option",type:"uint256"},{name:"Finance",type:"uint256"},{name:"Reward",type:"bool"}],name:"",type:"tuple"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"addr",type:"address"}],name:"getPlayerLogs",outputs:[{components:[{name:"Time",type:"uint256"},{name:"ID",type:"uint256"},{name:"action",type:"string"},{name:"Change",type:"int256"},{name:"Balance",type:"uint256"}],name:"",type:"tuple[]"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[],name:"CreatePlayer",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"}];function z(){return"undefined"!==typeof web3?"undefined"!==ethereum.selectedAddress?"3"===ethereum.networkVersion?(A=new R(web3.currentProvider),ethereum.enable(),N=ethereum.selectedAddress,L=new A.eth.Contract(H,V)):alert("请选择Ropsten测试网络！"):alert("请解锁MetaMask并创建账号！"):alert("请在浏览器安装MetaMask插件！"),A}function F(){return L.methods.CreatePlayer().send({from:N})}function q(e,t,n,a){return L.methods.InitiateEvent(e,t,n,a).send({from:N})}function U(e,t,n){return L.methods.Vote(e,t,n).send({from:N})}function J(e,t){return L.methods.Report(e,t).send({from:N})}function K(e){return L.methods.Reward(e).send({from:N})}function Y(){return L.methods.getTotalEvent().call({from:N})}function G(e){return L.methods.getEvent(e).call({from:N})}function Q(e,t){return L.methods.getEventOptionInfo(e,t).call({from:N})}function W(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:N;return L.methods.getPlayer(e).call({from:N})}function X(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:N;return L.methods.getVote(e,t).call({from:N})}function Z(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:N;return L.methods.getPlayerLogs(e).call({from:N})}var ee=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("el-card",{staticClass:"box-card"},[n("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[n("span",[e._v(e._s(e.Event["Content"]))])]),e._l(e.Event["Option"],function(t,a){return n("span",{key:a,staticClass:"text item"},[n("el-col",{attrs:{span:6}},[n("div",{staticClass:"grid-content bg-purple"},[n("el-tag",{attrs:{type:"info",effect:"plain"}},[e._v(e._s(a+1)+"."+e._s(t))])],1)])],1)}),n("br"),n("el-divider"),n("el-row",{attrs:{gutter:20}},[n("el-col",{attrs:{span:parseInt(e.width1)}},[n("div",{staticClass:"grid-content bg-purple",staticStyle:{"text-align":"center"}},[n("el-progress",{attrs:{type:"dashboard",percentage:e.percentage(e.Event),color:e.Event["Report"]?"#ff4645":e.colors}}),e._t("Progress")],2)]),n("el-col",{attrs:{span:parseInt(e.width2)}},[n("div",{staticClass:"grid-content bg-purple"},[e._v("\n                        "+e._s("成交额："+e.Event["PrizePool"])),n("br"),e._v("\n                        "+e._s("参与人数："+e.$Deduplication(e.Event["Voters"]).length)),n("br"),e._v("\n                        "+e._s("开始时间："+e.$parseTime(parseInt(e.Event["StartDate"])))),n("br"),e._v("\n                        "+e._s("截至时间："+e.$parseTime(parseInt(e.Event["Deadline"])))),n("br"),n("br"),e.info?n("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.$router.push("/EventInfo/"+e.Event["ID"])}}},[e._v("查看详情")]):e._e(),e._t("Info"),n("br")],2)]),n("el-col",{attrs:{span:parseInt(e.width3)}},[e._t("Option")],2)],1),e._t("Voters")],2)],1)},te=[],ne={props:["Event","info","width1","width2","width3"],data:function(){return{Current:(new Date).getTime(),Report:!0,colors:[{color:"#6affd6",percentage:20},{color:"#79ffa8",percentage:40},{color:"#7fff72",percentage:60},{color:"#c3ff74",percentage:80},{color:"#ffe851",percentage:100},{color:"#ffb450",percentage:101}]}},methods:{percentage:function(e){var t=1e3*parseInt(e["StartDate"]),n=1e3*parseInt(e["Deadline"]),a=parseInt((this.Current-t)/(n-t)*100);return a>100?100:a}}},ae=ne,re=(n("4730"),Object(c["a"])(ae,ee,te,!1,null,null,null)),oe=re.exports;a["default"].component("Event",oe),a["default"].prototype.$parseTime=D,a["default"].prototype.$Deduplication=T,a["default"].prototype.$Connection=z,a["default"].prototype.$CreatePlayer=F,a["default"].prototype.$InitiateEvent=q,a["default"].prototype.$Vote=U,a["default"].prototype.$Report=J,a["default"].prototype.$Reward=K,a["default"].prototype.$getTotalEvent=Y,a["default"].prototype.$getEvent=G,a["default"].prototype.$getEventOptionInfo=Q,a["default"].prototype.$getPlayer=W,a["default"].prototype.$getVote=X,a["default"].prototype.$getPlayerLogs=Z,a["default"].prototype.axios=o.a,a["default"].use(B.a),a["default"].config.productionTip=!1;var ie=new a["default"]({router:x,store:I,render:function(e){return e(p)}}).$mount("#app");t["default"]=ie},"64a9":function(e,t,n){},"6b56":function(e,t,n){},"917c":function(e,t,n){"use strict";var a=n("6b56"),r=n.n(a);r.a},b2b1:function(e,t,n){"use strict";var a=n("d3f3"),r=n.n(a);r.a},d3f3:function(e,t,n){},f9c2:function(e,t,n){}});
  //# sourceMappingURL=app.81acf006.js.map