"use strict";var s=require("../common/vendor.js"),u=require("../api/user.js");require("../common/request.js");const o={data(){return{user:{avatar:null,phone:""}}},onLoad(){this.getUserInfo()},methods:{bindblur(e){this.user.nickName=e.detail.value},bindinput(e){this.user.nickName=e.detail.value},onChooseAvatar(e){let{avatarUrl:n}=e.detail;s.index.uploadFile({url:s.index.getStorageSync("requestPath")+"/app/common/uploadOSS",filePath:n,name:"file",formData:{user:"test"},success:i=>{this.user.avatar=JSON.parse(i.data).url}})},submit(){this.user.isWeixinAuth=1,u.editUser(this.user).then(e=>{e.code==200?(s.index.setStorageSync("avatar",this.avatar),s.index.setStorageSync("nickName",this.nickName),s.index.showToast({icon:"success",title:"\u4FEE\u6539\u6210\u529F"}),this.getUserInfo()):s.index.showToast({icon:"none",title:"\u8BF7\u6C42\u5931\u8D25"})},e=>{})},getUserInfo(){u.getUserInfo().then(e=>{e.code==200?e.user!=null?this.user=e.user:this.utils.loginOut():s.index.showToast({icon:"none",title:"\u8BF7\u6C42\u5931\u8D25"})},e=>{})}}};function c(e,n,i,h,a,t){return s.e({a:a.user.avatar==null?"https://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/22cb9518a55040dea74d8f730551a7a2.jpg":a.user.avatar,b:s.o((...r)=>t.onChooseAvatar&&t.onChooseAvatar(...r)),c:s.o((...r)=>t.bindblur&&t.bindblur(...r)),d:s.o([r=>a.user.nickName=r.detail.value,(...r)=>t.bindinput&&t.bindinput(...r)]),e:a.user.nickName,f:a.user!=null},a.user!=null?{g:s.t(e.$parsePhone(a.user.phone))}:{},{h:s.o(r=>t.submit())})}var l=s._export_sfc(o,[["render",c],["__scopeId","data-v-2a25b94e"],["__file","E:/Project/2023/\u95EE\u8BCA\u5E73\u53F0/his_user_miniapp/pages_user/personInfo.vue"]]);wx.createPage(l);
