(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-me-changeAvatar"],{"318d":function(a,t,e){var n=e("c2c1");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[a.i,n,""]]),n.locals&&(a.exports=n.locals);var i=e("967d").default;i("441163c8",n,!0,{sourceMap:!1,shadowMode:!1})},"8a30":function(a,t,e){"use strict";e.d(t,"b",(function(){return n})),e.d(t,"c",(function(){return i})),e.d(t,"a",(function(){}));var n=function(){var a=this,t=a.$createElement,e=a._self._c||t;return e("v-uni-view",[e("v-uni-view",{staticClass:"container"},[e("v-uni-view",{staticClass:"row",on:{click:function(t){arguments[0]=t=a.$handleEvent(t),a.changeAvatar()}}},[e("v-uni-view",{staticClass:"content"},[e("v-uni-text",{staticClass:"title"},[a._v(a._s("头像("+(""==a.selecting_avatar?"待选)":"已选)")))]),e("v-uni-view",{staticClass:"avatar_container"},[e("v-uni-image",{staticClass:"avatar",attrs:{src:""!=a.selecting_avatar?a.selecting_avatar:a.avatar}})],1),e("v-uni-text",{staticClass:"arrow"},[a._v(">")])],1)],1),e("v-uni-view",{staticClass:"row"},[e("v-uni-button",{staticClass:"btn danger",on:{click:function(t){arguments[0]=t=a.$handleEvent(t),a.cancel()}}},[a._v("取消")]),e("v-uni-button",{staticClass:"btn",on:{click:function(t){arguments[0]=t=a.$handleEvent(t),a.uploadAvatar()}}},[a._v("上传")])],1)],1)],1)},i=[]},9215:function(a,t,e){"use strict";e("6a54");var n=e("f5bd").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(e("9b1b")),o=n(e("f51f")),c=e("8f59"),r=e("bf7f"),s={data:function(){return{avatar:this.$store.getters.avatar,selecting_avatar:""}},onLoad:function(){},computed:{},methods:(0,i.default)((0,i.default)({},(0,c.mapActions)(["updateAvatar"])),{},{changeAvatar:function(){var a=this;uni.chooseImage({count:1,sizeType:["original","compressed"],sourceType:["album"],success:function(t){a.selecting_avatar=t.tempFilePaths[0],console.log(a.selecting_avatar)}})},uploadAvatar:function(){if(""!=this.selecting_avatar){var a=this;uni.showLoading({title:"正在上传"}),uni.uploadFile({url:o.default.getImageUrl()+"/uploadWithName",filePath:a.selecting_avatar,name:"image",formData:{password:o.default.getImagePassword(),imageName:"avatar-of-user-"+a.$store.getters.user.id,image:a.selecting_avatar},success:function(t){var e=JSON.parse(t.data);if(200==e.code){uni.hideLoading();var n=o.default.getImageUrl()+"/images/"+e.content.url;a.updateAvatar(n),a.selecting_avatar=n,(0,r.updateUserInfo)({token:a.$store.getters.token,avatar:n}),uni.hideLoading(),uni.showToast({title:"上传成功！",icon:"success",mask:!1,duration:2e3})}else uni.hideLoading(),uni.showToast({title:e.message,icon:"error"})},fail:function(a){uni.hideLoading(),console.log("请求失败_______________",a)}})}else uni.showToast({title:"请选择图片",icon:"none",duration:1e3})},cancel:function(){uni.navigateBack({animationType:"slide-out-left"})}})};t.default=s},"9f52":function(a,t,e){"use strict";e.r(t);var n=e("9215"),i=e.n(n);for(var o in n)["default"].indexOf(o)<0&&function(a){e.d(t,a,(function(){return n[a]}))}(o);t["default"]=i.a},a3a9:function(a,t,e){"use strict";e.r(t);var n=e("8a30"),i=e("9f52");for(var o in i)["default"].indexOf(o)<0&&function(a){e.d(t,a,(function(){return i[a]}))}(o);e("a6f4");var c=e("828b"),r=Object(c["a"])(i["default"],n["b"],n["c"],!1,null,"a6c858ec",null,!1,n["a"],void 0);t["default"]=r.exports},a6f4:function(a,t,e){"use strict";var n=e("318d"),i=e.n(n);i.a},c2c1:function(a,t,e){var n=e("c86c");t=n(!1),t.push([a.i,".container[data-v-a6c858ec]{padding-top:%?20?%;\n\t/* display: flex; */align-items:center;justify-content:center}.title[data-v-a6c858ec]{margin:auto;margin-left:%?15?%;color:#8f8f94;font-size:100%;font-weight:600}.arrow[data-v-a6c858ec]{margin-top:auto;margin-bottom:auto;color:#8f8f94;margin-right:%?5?%;margin-left:%?20?%;font-weight:600}.avatar_container[data-v-a6c858ec]{margin-left:auto;margin-right:0}.avatar[data-v-a6c858ec]{width:%?120?%;height:%?120?%;border-radius:%?20?%}.row[data-v-a6c858ec]{display:flex;align-items:center;justify-content:center}.row .content[data-v-a6c858ec]{line-height:%?120?%;width:90%;float:left;display:flex;border-bottom-color:#c8c7cc;border-bottom-style:inset}.btn[data-v-a6c858ec]{color:#fff;margin-top:%?30?%;background-color:#4cd964}.danger[data-v-a6c858ec]{background-color:#d94b4d}",""]),a.exports=t}}]);