text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7d0d9ea8"],{"4fcd":function(t,s,e){},e8d4:function(t,s,e){"use strict";e.r(s);var o=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",[e("b-row",[e("b-col",[e("b-nav",{attrs:{tabs:"",align:"center"}},[e("b-nav-item",{attrs:{active:"",to:"profile"}},[t._v("profile")]),e("b-nav-item",{attrs:{to:"posts"}},[t._v("帖子")]),e("b-nav-item",{attrs:{to:"following"}},[t._v("关注")]),e("b-nav-item",{attrs:{to:"collection"}},[t._v("收藏")])],1)],1)],1),e("b-row",[e("b-col",{attrs:{md:"4"}},[e("div",[e("br"),e("img",{staticStyle:{width:"200px",height:"200px",display:"block"},attrs:{src:t.user.head_portrait,alt:""}}),t.currUser?e("b-form-file",{staticClass:"mt-3",attrs:{plain:""},model:{value:t.icon,callback:function(s){t.icon=s},expression:"icon"}},[t._v("更换头像")]):t._e(),t.currUser?e("b-button",{attrs:{variant:"success"},on:{click:t.submitIcon}},[t._v(" 更改头像")]):t._e(),t.others&&!t.following?e("b-button",{attrs:{variant:"success"},on:{click:t.follow}},[t._v("关注")]):t._e(),t.others&&t.following?e("b-button",{attrs:{variant:"danger"},on:{click:t.unfollow}},[t._v("取关")]):t._e()],1)]),e("b-col",{attrs:{md:"8"}},[e("b-row",[e("b-col",[e("div",{staticClass:"profile_card"},[e("div",[e("h4",[t._v("我的信息")])]),e("br"),e("b-row",{staticStyle:{"min-height":"20px"}},[e("b-col",{attrs:{cols:"4"}},[t._v(" 用户名 ")]),e("b-col",{attrs:{cols:"8"}},[t.show?e("p",[t._v(t._s(t.user.username))]):t._e(),t.input?e("b-input-group",[e("b-form-input",{attrs:{placeholder:t.user.username},model:{value:t.userName,callback:function(s){t.userName=s},expression:"userName"}})],1):t._e()],1)],1),e("br"),t.input?e("b-row",[e("b-col",{attrs:{cols:"4"}},[t._v(" 密码 ")]),e("b-col",{attrs:{cols:"8"}},[e("b-input-group",[e("b-form-input",{model:{value:t.password,callback:function(s){t.password=s},expression:"password"}}),e("b-input-group-append",[e("b-button",{attrs:{variant:"outline-secondary"},on:{click:t.submitPassword}},[t._v("更改")])],1)],1)],1)],1):t._e(),e("br"),e("b-row",{staticStyle:{"min-height":"20px"}},[e("b-col",{attrs:{cols:"4"}},[t._v(" 个人简介： ")]),e("b-col",{attrs:{cols:"8"}},[t.show?e("p",[t._v(t._s(t.user.comment))]):t._e(),t.input?e("b-form-textarea",{attrs:{id:"textarea",placeholder:t.user.comment,rows:"3","max-rows":"10"},model:{value:t.introduction,callback:function(s){t.introduction=s},expression:"introduction"}}):t._e()],1)],1),e("br"),e("b-row",[e("b-col",{staticStyle:{padding:"0 10%"}},[t.currUser?e("b-button",{staticStyle:{float:"center"},attrs:{variant:"success"},on:{click:t.click}},[t._v(" "+t._s(t.state)+" ")]):t._e()],1)],1)],1)])],1)],1)],1)],1)},r=[],n=e("ac34"),a=e("7ae9a"),i={data:function(){return{user:{},userName:"",password:"",state:"修改",input:!1,icon:null,introduction:"",following:!0}},computed:{show:function(){return!this.input},currUser:function(){return this.$route.params.userId==this.$store.getters.getId},others:function(){return!this.currUser}},methods:{follow:function(){var t=this;Object(n["b"])(this.$route.params.userId).then((function(s){s.data.flag&&(alert("关注成功"),t.following=!0)}))},unfollow:function(){var t=this;Object(n["e"])(this.$route.params.userId).then((function(s){s.data.flag&&(alert("取关成功"),t.following=!1)}))},click:function(t){t.preventDefault(),"修改"==this.state?(this.state="保存",this.input="true"):(this.state="修改",this.input=!1,this.submitComment())},submitComment:function(){Object(n["t"])(this.introduction).then((function(t){t.data.flag&&alert("简介修改成功")}))},submitPassword:function(){Object(n["s"])(a(this.password)).then((function(t){t.data.resultInfo&&alert("密码修改成功")}))},submitIcon:function(){var t=new FormData;t.append("file",this.icon),Object(n["w"])(t).then((function(t){t.data.flag&&alert("头像修改成功")}))}},mounted:function(){var t=this;Object(n["o"])(this.$route.params.userId).then((function(s){t.user=s.data})),Object(n["q"])(this.$route.params.userId).then((function(s){t.following=s.data})),this.userName=this.user.username,this.password=this.user.password,this.introduction=this.user.comment}},c=i,u=(e("f333"),e("2877")),l=Object(u["a"])(c,o,r,!1,null,"2f614936",null);s["default"]=l.exports},f333:function(t,s,e){"use strict";var o=e("4fcd"),r=e.n(o);r.a}}]);
  //# sourceMappingURL=chunk-7d0d9ea8.2fcd68fb.js.map