v2board/public/p__profile.async.js

1 line
14 KiB
JavaScript
Raw Normal View History

2019-11-29 02:44:59 +08:00
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[19],{"9Emu":function(e,a,t){"use strict";t.r(a);var n=t("jehZ"),s=t.n(n),i=(t("BoS7"),t("Sdc0")),r=(t("+L6B"),t("2/Rp")),l=(t("5Dmo"),t("3S7+")),c=(t("Pwec"),t("CtXQ")),o=(t("miYZ"),t("tsqr")),m=t("q1tI"),d=t.n(m),p=t("Bl7J"),h=t("t3Un"),u=t("3a4m"),v=t.n(u),E=t("/MKj");class f extends d.a.Component{constructor(){super(...arguments),this.state={loading:!0}}componentDidMount(){this.fetchData()}fetchData(){this.props.dispatch({type:"header/getUserInfo",complete:()=>{this.setState({loading:!1})}})}changePassword(){if(this.refs.re_password.value!==this.refs.new_password.value)return o["a"].error("\u4e24\u6b21\u65b0\u5bc6\u7801\u8f93\u5165\u4e0d\u540c");Object(h["b"])("/user/changePassword",{old_password:this.refs.old_password.value,new_password:this.refs.new_password.value}).then(e=>{200===e.code&&(o["a"].success("\u4fee\u6539\u6210\u529f\uff0c\u8bf7\u91cd\u65b0\u767b\u9646"),v.a.push("/login"))})}update(e,a){this.setState({[e+"_loading"]:!0},()=>{Object(h["b"])("/user/update",{[e]:a}).then(a=>{200===a.code&&(this.fetchData(),this.setState({[e+"_loading"]:!1}))})})}render(){return d.a.createElement(p["a"],s()({},this.props,{loading:this.state.loading}),d.a.createElement("main",{id:"main-container"},d.a.createElement("div",{className:"content content-full"},d.a.createElement("h2",{className:"font-w300 mt-4 mb-3"},"\u4e2a\u4eba\u4e2d\u5fc3"),d.a.createElement("div",{className:"row"},d.a.createElement("div",{className:"col-lg-12 animated fadeIn"},d.a.createElement("div",{className:"block block-bordered"},d.a.createElement("div",{className:"block-content pb-3"},d.a.createElement("i",{className:"fa fa-wallet fa-2x text-gray-light float-right"}),d.a.createElement("div",{className:"pb-sm-3"},d.a.createElement("p",{className:"text-muted w-75"},"\u6211\u7684\u94b1\u5305"),d.a.createElement("p",{className:"display-4 text-black font-w300 mb-2"},(this.props.header.userInfo.balance+this.props.header.userInfo.commission_balance/100).toFixed(2),d.a.createElement("span",{className:"font-size-h5 text-muted ml-4"},"CNY")),d.a.createElement(l["a"],{placement:"right",title:d.a.createElement("div",null,d.a.createElement("div",null,"\u8d26\u6237\u4f59\u989d\uff1a",(this.props.header.userInfo.balance/100).toFixed(2)),d.a.createElement("div",null,"\u63a8\u5e7f\u4f63\u91d1\uff1a",(this.props.header.userInfo.commission_balance/100).toFixed(2)))},d.a.createElement("span",{className:"text-muted",style:{cursor:"pointer"}},"\u94b1\u5305\u7ec4\u6210\u90e8\u5206 ",d.a.createElement(c["a"],{type:"question-circle"})))))))),d.a.createElement("div",{className:"block block-rounded block-bordered"},d.a.createElement("div",{className:"block-header block-header-default"},d.a.createElement("h3",{className:"block-title"},"\u4fee\u6539\u5bc6\u7801"),d.a.createElement("div",{className:"block-options"},d.a.createElement(r["a"],{type:"primary",onClick:()=>this.changePassword()},"\u4fdd\u5b58"))),d.a.createElement("div",{className:"block-content"},d.a.createElement("div",{className:"row push"},d.a.createElement("div",{className:"col-lg-8 col-xl-5"},d.a.createElement("div",{className:"form-group"},d.a.createElement("label",{for:"example-text-input"},"\u65e7\u5bc6\u7801"),d.a.createElement("input",{type:"password",className:"form-control",placeholder:"\u8bf7\u8f93\u5165\u65e7\u5bc6\u7801",ref:"old_password"})),d.a.createElement("div",{className:"form-group"},d.a.createElement("label",{for:"example-text-input"},"\u65b0\u5bc6\u7801"),d.a.createElement("input",{type:"password",className:"form-control",placeholder:"\u8bf7\u8f93\u5165\u65b0\u5bc6\u7801",ref:"new_password"})),d.a.createElement("div",{className:"form-group"},d.a.createElement("label",{for:"example-text-input"},"\u65b0\u5bc6\u7801"),d.a.createElement("input",{type:"password",className:"form-control",placeholder:"\u8bf7\u786e\u8ba4\u65b0\u5bc6\u7801",ref:"re_password"})))))),d.a.createElement("div",{className:"block block-rounded block-bordered"},d.a.createElement("div",{className:"block-header block-header-default"},d.a.createElement("h3",{className:"bloc