(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/info/figure"],{"5eb8":function(e,n,t){"use strict";(function(e){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=t("f8e9"),o=t("eb73"),a=function(){t.e("components/TopBar/TopBar").then(function(){return resolve(t("f619"))}.bind(null,t)).catch(t.oe)},c=function(){t.e("components/invinbg-image-cropper/invinbg-image-cropper").then(function(){return resolve(t("3d91"))}.bind(null,t)).catch(t.oe)},s={components:{TopBar:a,ImageCropper:c},data:function(){return{assetsUrl:this.$util.assetsUrl,nickname:"",introduce:"",code:"",icon:"",btnText:"下一步",tempFilePath:"",cropFilePath:""}},methods:{sure:function(){var n=this;if("从相册上传"===this.btnText)e.chooseImage({count:1,sizeType:["original","compressed"],sourceType:["album","camera"],success:function(e){n.tempFilePath=e.tempFiles[0].path}});else{if(""===this.icon)return void e.showToast({title:"请上传头像",icon:"none"});if(""===this.nickname)return void e.showToast({title:"请填写昵称",icon:"none"});if(""===this.introduce)return void e.showToast({title:"请填写个人简介",icon:"none"});e.showLoading({mask:!0});var t=JSON.parse(e.getStorageSync("user"));t.nick=this.nickname,t.desc=this.introduce,t.shareCode=this.code,t.icon=this.icon;var i={completeUser:t,weiXinStatusEnum:"NoWeiXin"};e.showLoading({title:"保存中",mask:!0}),this.$api.login.saveFigure(i).then((function(i){e.setStorageSync("regStep","SocialData"),e.setStorageSync("LL_Ukn",i.data.ukn),e.setStorageSync("user",JSON.stringify(t)),n.$api.login.editHead({completeUser:t,icon:n.icon}).then((function(n){e.hideLoading()})),e.reLaunch({url:"/pages/info/datum"})})).catch((function(e){}))}},randNick:function(){var e=this;this.$api.login.randNick({}).then((function(n){e.nickname=n.data.nick})).catch((function(e){}))},confirm:function(n){var t=this;this.tempFilePath="",this.cropFilePath=n.detail.tempFilePath,this.btnText="下一步",this.$refs.popup.close();var a=this,c=(0,i.getPolicy)(),s=(0,o.encode)(JSON.stringify(c)),u=(0,i.getKey)(0,this.cropFilePath.split(".")[1]);a.$api.public.aliossToken({}).then((function(n){var o={key:u,policy:s,OSSAccessKeyId:n.data.accessKeyId,signature:(0,i.computeSignature)(n.data.accessKeySecret,s),"x-oss-security-token":n.data.securityToken,success_action_status:"200"};e.uploadFile({url:"https://zhenyanapp-gen.oss-cn-qingdao.aliyuncs.com",filePath:t.cropFilePath,name:"file",header:{"Content-Type":"multipart/form-data"},formData:o,success:function(e){200===e.statusCode&&(a.icon="".concat(a.$store.state.imageCdn,"/").concat(u))},fail:function(e){console.log(e)}})}))},cancel:function(){console.log("canceled")},showHeadPopup:function(){this.btnText="从相册上传",this.$refs.popup.open()},hideHeadPopup:function(){this.btnText="下一步",this.$refs.popup.close()}}};n.default=s}).call(this,t("543d")["default"])},"727a":function(e,n,t){"use strict";t.r(n);var i=t("a8a5"),o=t("ba63");for(var a in o)"default"!==a&&function(e){t.d(n,e,(function(){return o[e]}))}(a);t("a12b");var c,s=t("f0c5"),u=Object(s["a"])(o["default"],i["b"],i["c"],!1,null,"17b62462",null,!1,i["a"],c);n["default"]=u.exports},"85ca":function(e,n,t){},a12b:function(e,n,t){"use strict";var i=t("85ca"),o=t.n(i);o.a},a701:function(e,n,t){"use strict";(function(e){t("39a3");i(t("66fd"));var n=i(t("727a"));function i(e){return e&&e.__esModule?e:{default:e}}wx.__webpack_require_UNI_MP_PLUGIN__=t,e(n.default)}).call(this,t("543d")["createPage"])},a8a5:function(e,n,t){"use strict";t.d(n,"b",(function(){return o})),t.d(n,"c",(function(){return a})),t.d(n,"a",(function(){return i}));var i={TopBar:function(){return t.e("components/TopBar/TopBar").then(t.bind(null,"f619"))},uniPopup:function(){return t.e("node-modules/@dcloudio/uni-ui/lib/uni-popup/uni-popup").then(t.bind(null,"8eb5"))}},o=function(){var e=this,n=e.$createElement;e._self._c},a=[]},ba63:function(e,n,t){"use strict";t.r(n);var i=t("5eb8"),o=t.n(i);for(var a in i)"default"!==a&&function(e){t.d(n,e,(function(){return i[e]}))}(a);n["default"]=o.a}},[["a701","common/runtime","common/vendor"]]]);