"use strict";const e=require("../../common/vendor.js"),o=require("../../api/api.js"),n=require("../../utils/fun.js");if(!Array){(e.resolveComponent("up-avatar")+e.resolveComponent("up-cell")+e.resolveComponent("up-cell-group")+e.resolveComponent("up-button"))()}Math||((()=>"../../uni_modules/uview-plus/components/u-avatar/u-avatar.js")+(()=>"../../uni_modules/uview-plus/components/u-cell/u-cell.js")+(()=>"../../uni_modules/uview-plus/components/u-cell-group/u-cell-group.js")+(()=>"../../uni_modules/uview-plus/components/u-button/u-button.js"))();const t={__name:"sett",setup(t){let l=e.ref({});e.onShow((async()=>{s()}));const s=async()=>{let e=await o.userInfo();l.value=e},u=async e=>{let t=await n.uploadFiles(e.detail.avatarUrl);o.updateAvatar({avatar:t}).then((e=>{s()})),console.log(t)},a=()=>{e.index.showModal({title:"修改昵称",content:l.value.nickName,editable:!0,success:function(e){e.confirm?(o.updateNickName({nickName:e.content}).then((e=>{s()})),console.log(e),console.log("用户点击确定")):e.cancel&&console.log("用户点击取消")}})},i=()=>{e.index.showModal({title:"提示",content:"是否确认退出登录？",success:o=>{o.confirm?(e.index.clearStorageSync(),e.index.reLaunch({url:"/pages/home/home"})):o.cancel&&console.log("用户点击取消")}})};return(o,n)=>({a:e.p({src:e.unref(l).avatar}),b:e.p({title:"头像",isLink:!0,size:"min"}),c:e.o(u),d:e.t(e.unref(l).nickName),e:e.o(a),f:e.p({title:"昵称",isLink:!0,size:"min"}),g:e.t(e.unref(l).phone||"-"),h:e.p({title:"手机号",size:"min",border:!1}),i:e.p({border:!1}),j:e.o(i),k:e.p({type:"error",text:"退出登录"})})}};wx.createPage(t);
