require('../../../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pagesA/profile/mySet/setPersonData/setPersonData"],{"08e0":function(e,t,n){"use strict";n.r(t);var i=n("0bb0"),a=n.n(i);for(var o in i)["default"].indexOf(o)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(o);t["default"]=a.a},"0bb0":function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n("dc92"),a=n("0c59"),o={data:function(){return{id:"",name:"",img:"",email:"",sex:"",post:"",num:"",mobile:"",department_id:"",department_name:"",parent_id:"",parent_name:"",sexList:[{id:1,name:"男"},{id:2,name:"女"}],sexIndex:null,BASE_IMG_URL:a.BASE_IMG_URL}},onShow:function(){this.getInfo()},methods:{getInfo:function(){var e=this;(0,i.netGetUserInfo)().then((function(t){t=t.data,e.id=t.id,e.name=t.name,e.img=t.img,e.email=t.email,e.sex=t.sex,e.post=t.post,e.num=t.num,e.mobile=t.mobile,e.department_name=t.department_name,e.parent_name=t.parent_name,e.department_id=t.department_id,e.parent_id=t.parent_id}))},changeSex:function(e){this.sexIndex=e.detail.value,this.sex=this.sexList[e.detail.value].id},getPhone:function(t){var n=this;if("getPhoneNumber:ok"==t.detail.errMsg){var i=t.detail.encryptedData,a=t.detail.iv,o="";e.login({success:function(e){o=e.code;var t={encryptedData:i,iv:a,code:o};n.bindPhone(t)}})}},bindPhone:function(e){var t=this;(0,i.netBindPhone)(e).then((function(e){t.mobile=e.data.mobile}))},changeHeaderImg:function(){var t=this;e.chooseImage({sizeType:["compressed"],success:function(e){var n=e.tempFilePaths;n.forEach((function(e){t.uploadFile(e)}))}})},uploadFile:function(t){var n=this;e.uploadFile({url:i.uploadUrl,name:"file",header:{token:e.getStorageSync("token")},filePath:t,success:function(t){var i=JSON.parse(t.data);1==i.code?n.img=i.data.url:e.showToast({title:"上传失败",icon:"none"})},fail:function(e){console.log(e)}})},saveInfo:function(){var t=this.id,n=this.name,a=this.img,o=this.email,s=this.sex,c=this.post,r=this.num,d=this.mobile,u=this.department_id,f=this.parent_id;if(n)if(c)if(d){var l={id:t,name:n,img:a,email:o,sex:s,post:c,num:r,mobile:d,department_id:u,parent_id:f};(0,i.netEditUserInfo)(l).then((function(t){e.showToast({title:t.msg,icon:"none"}),setTimeout((function(){e.navigateBack({delta:1})}),2e3)}))}else e.showToast({title:"请填写手机号",icon:"none"});else e.showToast({title:"请填写部门职务",icon:"none"});else e.showToast({title:"请填写姓名",icon:"none"})}}};t.default=o}).call(this,n("543d")["default"])},"0ef0":function(e,t,n){},"76cb":function(e,t,n){"use strict";n.r(t);var i=n("bfc0"),a=n("08e0");for(var o in a)["default"].indexOf(o)<0&&function(e){n.d(t,e,(function(){return a[e]}))}(o);n("c220");var s=n("f0c5"),c=Object(s["a"])(a["default"],i["b"],i["c"],!1,null,"6d5ff1d8",null,!1,i["a"],void 0);t["default"]=c.exports},bfc0:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){}));var i=function(){var e=this.$createElement;this._self._c},a=[]},c1f3:function(e,t,n){"use strict";(function(e,t){var i=n("4ea4");n("8886");i(n("66fd"));var a=i(n("76cb"));e.__webpack_require_UNI_MP_PLUGIN__=n,t(a.default)}).call(this,n("bc2e")["default"],n("543d")["createPage"])},c220:function(e,t,n){"use strict";var i=n("0ef0"),a=n.n(i);a.a}},[["c1f3","common/runtime","common/vendor"]]]);