"use strict";const e=require("../../../common/vendor.js"),t=require("../../../request/api.js");require("../../../request/http.js");const a=require("../../../common/assets.js"),i={data:()=>({avatarTop:"",contentTop:"",avatar:"",avatarUrl:"",nickname:"",mobile:"",sexList:["男","女"],sex:"",profile:""}),onLoad(){this.avatarTop=e.inject("navHeight")+.08*e.inject("windowWidth"),this.contentTop=this.avatarTop+.1*e.inject("windowWidth"),this.getUserInfoData()},methods:{chooseAvatar(e){console.log(e),this.avatar=e.detail.avatarUrl},sexChange(e){console.log(e);let t=e.detail.value;this.sex=this.sexList[t]},clickNext(){if(this.avatar||this.avatarUrl)if(this.nickname)if(this.sex)if(this.profile)if(this.avatar){let a={avatar:this.avatar,nickname:this.nickname,gender:"男"==this.sex?"male":"female",phone:this.mobile,bio:this.profile,isFile:1};t.updateBasicInfo(a).then((t=>{e.index.navigateTo({url:"/pages/mine/investPreference/investPreference"})})).catch((e=>{}))}else{let a={nickname:this.nickname,gender:"男"==this.sex?"male":"female",phone:this.mobile,bio:this.profile};t.updateBasicInfo(a).then((t=>{e.index.navigateTo({url:"/pages/mine/investPreference/investPreference"})})).catch((e=>{}))}else e.index.showToast({title:"请输入个人简介",icon:"none"});else e.index.showToast({title:"请选择性别",icon:"none"});else e.index.showToast({title:"请输入昵称",icon:"none"});else e.index.showToast({title:"请选择头像",icon:"none"})},getUserInfoData(){t.userInfo().then((t=>{200==t.code?(this.avatarUrl=t.data.basic_info.avatar_url,this.nickname=t.data.basic_info.nickname,this.mobile=t.data.basic_info.phone,this.sex="male"==t.data.basic_info.gender?"男":"女",this.profile=t.data.basic_info.bio):e.wx$1.showToast({title:t.message,icon:"none"})})).catch((e=>{}))}}};if(!Array){e.resolveComponent("navBar")()}Math;const n=e._export_sfc(i,[["render",function(t,i,n,s,o,r){return{a:e.p({leftText:"信息完善"}),b:a._imports_0,c:o.avatar?o.avatar:o.avatarUrl,d:a._imports_1$3,e:e.o(((...e)=>r.chooseAvatar&&r.chooseAvatar(...e))),f:e.s("top:"+o.avatarTop+"px;"),g:o.nickname,h:e.o((e=>o.nickname=e.detail.value)),i:e.t(o.mobile),j:e.t(o.sex),k:a._imports_2$5,l:o.sexList,m:e.o(((...e)=>r.sexChange&&r.sexChange(...e))),n:o.profile,o:e.o((e=>o.profile=e.detail.value)),p:e.s("top:"+o.contentTop+"px;"),q:e.o((e=>r.clickNext()))}}]]);wx.createPage(n);
