webpackJsonp([36],{h4aP:function(t,a,e){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var s=e("Dd8w"),i=e.n(s),n=e("NYxO"),o=e("ZohY"),c=e("7ZeY"),r={components:{topBar:o.a,Select:c.a},data:function(){return{amount:50,active:1,otherAmount:"",payway:"",showPayway:!1,type:0,paywayName:""}},computed:i()({gmRecharge:function(){return this.$store.state.gmRecharge||{gm_cnt:0,gm_rate:1,pay_type:[]}},gmPayPost:function(){return this.$store.state.gmPayPost},list:function(){return this.gmRecharge.pay_type.filter(function(t,a){return t.id=a,t})}},Object(n.b)(["baseInfo","failMsg"])),watch:{list:function(){this.paywayName=this.list[this.type].name,this.payway=this.list[this.type].payway},gmPayPost:function(){switch(this.gmPayPost.pay_type){case"alipayh5":var t=document.createDocumentFragment(),a=document.createElement("div");a.innerHTML=this.gmPayPost.token,t.appendChild(a),document.querySelector("body").appendChild(t.firstChild),document.querySelector("#alipaysubmit").submit();break;case"wxpayh5":window.location.href=this.gmPayPost.token}},failMsg:function(){this.failMsg&&this.Toast(this.failMsg,200)}},methods:{changeAmount:function(t){this.otherAmount="",this.active=t,this.amount=[0,50,100,200,500,1e3][t]},inputAmount:function(){isNaN(this.otherAmount)&&(this.otherAmount=this.otherAmount.substring(0,this.otherAmount.length-1)),isNaN(this.otherAmount)||(this.amount=this.otherAmount),this.active=6},paypost:function(){this.$store.dispatch("gmPayPost",{payway:this.payway,amount:this.amount})},setType:function(t){this.showPayway=!1,this.paywayName=t.name,this.payway=t.payway,this.type=t.id}},created:function(){this.$store.dispatch("gmRecharge")}},h={render:function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("div",[e("top-bar",{attrs:{title:t.baseInfo.gm_name+"充值",barStyle:"",back:""}},[e("router-link",{attrs:{slot:"right",to:{path:"/me/gmrecharge"}},slot:"right"},[t._v("记录")])],1),t._v(" "),e("div",{staticClass:"maincontainer"},[e("div",{staticClass:"pay_main"},[e("div",{staticClass:"pay_cnt"},[t._v("\n "+t._s(t.baseInfo.gm_name)+"余额:"),e("span",[t._v(t._s(t.gmRecharge.gm_cnt))])]),t._v(" "),e("div",{staticClass:"pay_way",on:{click:function(a){t.showPayway=!0}}},[t._v("\n 支付方式:\n "),e("span",[t._v(t._s(t.paywayName))])]),t._v(" "),e("ul",{staticClass:"pay_items"},[e("li",[e("a",{class:{active:1===t.active},attrs:{href:"javascript:;"},on:{click:function(a){t.changeAmount(1)}}},[t._v("50元")])]),t._v(" "),e("li",[e("a",{class:{active:2===t.active},attrs:{href:"javascript:;"},on:{click:function(a){t.changeAmount(2)}}},[t._v("100元")])]),t._v(" "),e("li",[e("a",{class:{active:3===t.active},attrs:{href:"javascript:;"},on:{click:function(a){t.changeAmount(3)}}},[t._v("200元")])]),t._v(" "),e("li",[e("a",{class:{active:4===t.active},attrs:{href:"javascript:;"},on:{click:function(a){t.changeAmount(4)}}},[t._v("500元")])]),t._v(" "),e("li",[e("a",{class:{active:5===t.active},attrs:{href:"javascript:;"},on:{click:function(a){t.changeAmount(5)}}},[t._v("1000元")])]),t._v(" "),e("li",[e("input",{directives:[{name:"model",rawName:"v-model",value:t.otherAmount,expression:"otherAmount"}],class:{active:6===t.active},attrs:{type:"text",placeholder:"其他金额"},domProps:{value:t.otherAmount},on:{input:[function(a){a.target.composing||(t.otherAmount=a.target.value)},t.inputAmount]}})])]),t._v(" "),e("div",{staticClass:"pay_amount"},[t._v("\n 可获得 "),e("span",[t._v(t._s(t.amount*t.gmRecharge.gm_rate)+" "+t._s(t.baseInfo.gm_name))])])]),t._v(" "),e("div",{staticClass:"pay_gray"},[e("div",{staticClass:"pay_btn"},[e("button",{on:{click:t.paypost}},[t._v("充值")])])])]),t._v(" "),e("Select",{directives:[{name:"show",rawName:"v-show",value:t.showPayway,expression:"showPayway"}],attrs:{list:t.list,select:t.type},on:{change:t.setType}})],1)},staticRenderFns:[]};var u=e("VU/8")(r,h,!1,function(t){e("igK+")},"data-v-5ff11a88",null);a.default=u.exports},"igK+":function(t,a){}});