v2board/public/p__plan__$plan_id.async.js

1 line
14 KiB
JavaScript
Raw Normal View History

2019-12-13 17:43:26 +08:00
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[21],{"+URf":function(e,t,a){"use strict";a.r(t);var i=a("jehZ"),n=a.n(i),s=(a("Pwec"),a("CtXQ")),r=(a("7Kak"),a("9yH6")),c=a("p0pE"),l=a.n(c),m=a("q1tI"),o=a.n(m),d=a("Bl7J"),h=a("/MKj"),p=a("t3Un"),u=a("LbTH"),v=a("3a4m"),b=a.n(v);class E extends o.a.Component{constructor(){super(...arguments),this.state={submit:{plan_id:this.props.match.params.plan_id},loading:!1,layout_login:!0}}componentDidMount(){Object(p["b"])("/user/plan/info",{plan_id:this.props.match.params.plan_id}).then(e=>{200===e.code&&this.setState(l()({},e.data,{layout_login:!1}),()=>{this.setState({submit:l()({},this.state.submit,{cycle:this.getFirstPrice()})})})})}getFirstPrice(){return this.state.month_price?"month_price":this.state.quarter_price?"quarter_price":this.state.half_year_price?"half_year_price":this.state.year_price?"year_price":void 0}submit(){this.setState({loading:!0},()=>{Object(p["b"])("/user/order/save",this.state.submit).then(e=>{if(200!==e.code)return this.setState({loading:!1});this.setState({loading:!1}),b.a.push("/order/"+e.data)})})}submitOnChange(e,t){this.setState({submit:l()({},this.state.submit,{[e]:t})})}render(){return console.log(this.state),o.a.createElement(d["a"],n()({},this.props,{loading:this.state.layout_login}),o.a.createElement("main",{id:"main-container"},o.a.createElement("div",{className:"content content-full"},o.a.createElement("h2",{className:"font-w300 mt-4 mb-3"},"\u914d\u7f6e\u8ba2\u9605"),o.a.createElement("div",{className:"row",id:"cashier"},o.a.createElement("div",{className:"col-md-8 col-sm-12"},o.a.createElement("div",{className:"block block-link-pop block-rounded block-bordered px-3 py-3 block-fx-shadow"},o.a.createElement("h4",{className:"mb-0"},this.state.name),this.state.content?o.a.createElement("div",{dangerouslySetInnerHTML:{__html:this.state.content},className:"mt-4"}):""),o.a.createElement("h3",{className:"font-w300 mt-4 mb-3"},"\u4ed8\u6b3e\u5468\u671f"),o.a.createElement("div",{className:"mb-3"},o.a.createElement(r["a"].Group,{defaultValue:this.getFirstPrice(),size:"large",onChange:e=>this.submitOnChange("cycle",e.target.value)},this.state.month_price?o.a.createElement(r["a"].Button,{value:"month_price"},"\u6708\u4ed8"):"",this.state.quarter_price?o.a.createElement(r["a"].Button,{value:"quarter_price"},"\u5b63\u4ed8"):"",this.state.half_year_price?o.a.createElement(r["a"].Button,{value:"half_year_price"},"\u534a\u5e74\u4ed8"):"",this.state.year_price?o.a.createElement(r["a"].Button,{value:"year_price"},"\u5e74\u4ed8"):""))),o.a.createElement("div",{className:"col-md-4 col-sm-12"},o.a.createElement("div",{className:"block block-link-pop block-rounded block-bordered px-3 py-3 text-light",style:{background:"#35383D"}},o.a.createElement("h5",{className:"text-light mb-3"},"\u8ba2\u5355\u603b\u989d"),o.a.createElement("div",{className:"row no-gutters pb-3",style:{borderBottom:"1px solid #646669"}},o.a.createElement("div",{className:"col-8"},this.state.name," x ",u["a"].cycleText[this.state.submit.cycle]),o.a.createElement("div",{className:"col-4 text-right"},"\xa5",0===this.state.type?(this.state.price/100).toFixed(2):(this.state[this.state.submit.cycle]/100).toFixed(2))),o.a.createElement("div",{className:"pt-3",style:{color:"#646669"}},"\u603b\u8ba1"),o.a.createElement("h1",{className:"text-light mt-3 mb-3"},"\xa5 ",(this.state[this.state.submit.cycle]/100).toFixed(2)," CNY"),o.a.createElement("button",{type:"button",className:"btn btn-block btn-primary",disabled:this.state.loading,onClick:()=>this.submit()},this.state.loading?o.a.createElement(s["a"],{type:"loading"}):o.a.createElement("span",null,o.a.createElement("i",{className:"far fa-check-circle"})," \u4e0b\u5355"))))))))}}t["default"]=Object(h["c"])()(E)},Bl7J:function(e,t,a){"use strict";var i=a("q1tI"),n=a.n(i),s=a("3a4m"),r=a.n(s),c=a("/MKj"),l=a("20nU"),m=a("yWgo");class o extends n.a.Component{constructor(){super(...arguments),this.state={nav:[]}}componentDidMount(){var e=[{title:"\u4eea\u8868\u76d8",type:"item",href:"/dashboard",icon:n.a.createElement("i",{className:"nav-ma