1 |
- import{z as e,av as a,c as s,f as l,g as t,w as r,ah as n,E as o,i as u,k as c,B as i,u as d,v as f,j as m,y as p,N as b,o as y,s as g,a7 as _,m as v,x as h,l as x,r as k,F as w,t as V,aw as B,ax as $,P as I,V as S,ay as U,an as j,W as C,n as M,J as P,ap as E,I as z,K as F,L as W}from"./index-ba48620e.js";import{_ as O}from"./su-image.d4b7cd31.js";import{a as T,b as A,d as G}from"./phone-international-input.dd3ca29e.js";import{_ as H}from"./_plugin-vue_export-helper.1b428a4d.js";import{a as L,_ as N}from"./s-layout.04b95866.js";import"./useGoods.edb8879f.js";const J=H({__name:"su-radio",props:{customStyle:{type:Object,default:()=>({})},ui:{type:String,default:"check"},modelValue:{type:[String,Number,Boolean],default:!1},disabled:{type:Boolean,default:!1},bg:{type:String,default:"ui-BG-Main"},unbg:{type:String,default:"borderss"},src:{type:String,default:""},label:{type:String,default:""},labelStyle:{type:Object,default:()=>({})},none:{type:Boolean,default:!1}},emits:["change","update:modelValue"],setup(b,{emit:y}){const g=e({currentValue:!1}),_=y,v=b;a((()=>{g.currentValue=v.modelValue,_("update:modelValue",g.currentValue)}));const h=s((()=>g.currentValue)),x=()=>{v.disabled||(g.currentValue=!g.currentValue,_("update:modelValue",g.currentValue),_("change",{label:v.label,value:g.currentValue}))};return(e,a)=>{const s=m,y=p;return l(),t(s,{class:o(["ui-radio ss-flex ss-col-center",[{disabled:b.disabled},{img:b.src},b.ui]]),onClick:x,style:i([b.customStyle])},{default:r((()=>[n(e.$slots,"leftLabel",{},void 0,!0),b.none?u("",!0):(l(),t(s,{key:0,class:o(["ui-radio-input",[h.value?"cur "+b.bg:b.unbg,b.src?"radius":"round"]])},null,8,["class"])),b.src?(l(),t(y,{key:1,class:"ui-radio-img radius",src:b.src,mode:"aspectFill"},null,8,["src"])):(l(),t(s,{key:2,class:"ui-radio-content"},{default:r((()=>[n(e.$slots,"default",{},(()=>[c(s,{class:"ui-label-text",style:i([b.labelStyle])},{default:r((()=>[d(f(b.label),1)])),_:1},8,["style"])]),!0)])),_:3})),b.ui.includes("card")?(l(),t(s,{key:3,class:o(["ui-radio-bg round",[h.value?"cur "+b.bg:""]])},null,8,["class"])):u("",!0)])),_:3},8,["class","style"])}}},[["__scopeId","data-v-2c6d6010"]]),K="color:#BBBBBB;font-size:28rpx;line-height:normal",q=H({__name:"info",setup(a){const n=e({verifyUsername:!0,usernameErrorMsg:"",model:{},rules:{},thirdInfo:{}}),o=[{name:"男",value:"1"},{name:"女",value:"2"}],i=s((()=>g.$store("user").userInfo));function H(e){n.model.sex=e.detail.value}const q=()=>{V("changeMobile")};function D(){B({success:async e=>{const a=e.tempFilePaths[0];await async function(e){if(!e)return;let{data:a}=await $.uploadFile(e);n.model.avatar=a}(a)}})}function Q(){V("changePassword")}async function R(){await g.$platform.useProvider("wechat").bind()}function X(){I({title:"解绑提醒",content:"解绑后您将无法通过微信登录此账号",cancelText:"再想想",confirmText:"确定",success:async function(e){if(!e.confirm)return;await g.$platform.useProvider("wechat").unbind(n.thirdInfo.openid)&&await ae()}})}let Y=b("");async function Z(e){const a=e.detail.value;if(""==a||a==Y.value)return!1;if(a===n.username)return n.usernameErrorMsg="",n.verifyUsername=!0,!1;Y.value=a;const{data:s}=await S.verifyUsername(a);s?(n.usernameErrorMsg="",n.verifyUsername=s):(n.usernameErrorMsg="用户名已被使用!",n.verifyUsername=s)}async function ee(){const{code:e}=await U.updateUser({avatar:n.model.avatar,nickname:n.model.nickname,username:n.model.username,sex:n.model.sex});0===e&&n.model.username!==n.username&&(j({icon:"success",title:"修改成功,请重新登录"}),setTimeout((function(){g.$store("user").logout(),C(),g.$router.go("/pages/index/user")}),1e3)),0===e&&await ae()}const ae=async()=>{const e=await g.$store("user").getInfo();if(n.model=_.clone(e),n.username=e.username,"H5"!==g.$platform.name){let e=await g.$platform.useProvider("wechat").getInfo();n.thirdInfo=e||{}}};return y((async e=>{ae()})),(e,a)=>{const s=v(M("su-image"),O),b=P,y=m,_=p,V=v(M("uni-easyinput"),T),B=v(M("uni-forms-item"),A),$=F,I=W,S=E,U=v(M("su-radio"),J),j=z,C=v(M("uni-forms"),G),Y=v(M("su-fixed"),L),ae=v(M("s-layout"),N);return l(),t(ae,{title:"用户信息",class:"set-userinfo-wrap"},{default:r((()=>[c(C,{model:n.model,rules:n.rules,labelPosition:"left",border:"",class:"form-box"},{default:r((()=>[c(y,{class:"ss-flex ss-row-center ss-col-center ss-p-t-60 ss-p-b-0 bg-white"},{default:r((()=>[c(y,{class:"header-box-content"},{default:r((()=>{var e;return[c(s,{class:"content-img",isPreview:"",current:0,src:null==(e=n.model)?void 0:e.avatar,height:160,width:160,radius:80,mode:"scaleToFill"},null,8,["src"]),c(y,{class:"avatar-action"},{default:r((()=>[c(b,{class:"ss-reset-button avatar-action-btn",onClick:D},{default:r((()=>[d("修改")])),_:1})])),_:1})]})),_:1})])),_:1}),c(y,{class:"bg-white ss-p-x-30"},{default:r((()=>[c(B,{name:"username",label:"用户名","error-message":n.usernameErrorMsg},{default:r((()=>[c(V,{modelValue:n.model.username,"onUpdate:modelValue":a[0]||(a[0]=e=>n.model.username=e),placeholder:"设置用户名",inputBorder:!1,placeholderStyle:K,onBlur:Z,clearable:!1},{right:r((()=>[n.verifyUsername?(l(),t(y,{key:1,class:"icon"},{default:r((()=>[c(_,{src:h(g).$url.static("/static/images/chenggong.png")},null,8,["src"])])),_:1})):(l(),t(y,{key:0,class:"icon"},{default:r((()=>[c(_,{style:"",src:h(g).$url.static("/static/images/shibai.png")},null,8,["src"])])),_:1}))])),_:1},8,["modelValue"])])),_:1},8,["error-message"]),c(B,{name:"nickname",label:"昵称"},{default:r((()=>[c(V,{modelValue:n.model.nickname,"onUpdate:modelValue":a[1]||(a[1]=e=>n.model.nickname=e),type:"nickname",placeholder:"设置昵称",inputBorder:!1,placeholderStyle:K,clearable:!1},null,8,["modelValue"])])),_:1}),c(B,{name:"sex",label:"性别"},{default:r((()=>[c(y,{class:"ss-flex ss-col-center ss-h-100"},{default:r((()=>[c(S,{onChange:H,class:"ss-flex ss-col-center"},{default:r((()=>[(l(),x(w,null,k(o,(e=>c(I,{class:"radio",key:e.value},{default:r((()=>[c(y,{class:"ss-flex ss-col-center ss-m-r-32"},{default:r((()=>{var a;return[c($,{value:e.value,color:"var(--ui-BG-Main)",style:{transform:"scale(0.8)"},checked:parseInt(e.value)===(null==(a=n.model)?void 0:a.sex)},null,8,["value","checked"]),c(y,{class:"gender-name"},{default:r((()=>[d(f(e.name),1)])),_:2},1024)]})),_:2},1024)])),_:2},1024))),64))])),_:1})])),_:1})])),_:1}),c(B,{name:"mobile",label:"手机号",onClick:q},{default:r((()=>[c(V,{modelValue:i.value.mobile,"onUpdate:modelValue":a[2]||(a[2]=e=>i.value.mobile=e),placeholder:"请绑定手机号",inputBorder:!1,disabled:"",styles:{disableColor:"#fff"},placeholderStyle:K,clearable:!1},{right:r((()=>[c(y,{class:"ss-flex ss-col-center"},{default:r((()=>{var e;return[(null==(e=i.value.verification)?void 0:e.mobile)?(l(),t(U,{key:0,modelValue:!0})):(l(),t(b,{key:1,class:"ss-reset-button ss-flex ss-col-center ss-row-center"},{default:r((()=>[c(j,{class:"_icon-forward",style:{color:"#bbbbbb","font-size":"26rpx"}})])),_:1}))]})),_:1})])),_:1},8,["modelValue"])])),_:1}),c(B,{name:"password",label:"登录密码",onClick:Q},{default:r((()=>[c(V,{modelValue:i.value.password,"onUpdate:modelValue":a[3]||(a[3]=e=>i.value.password=e),placeholder:"点击修改登录密码",inputBorder:!1,styles:{disableColor:"#fff"},disabled:"",placeholderStyle:"color:#BBBBBB;font-size:28rpx;line-height:normal",clearable:!1},{right:r((()=>[c(y,{class:"ss-flex ss-col-center"},{default:r((()=>{var e;return[(null==(e=i.value.verification)?void 0:e.password)?(l(),t(U,{key:0,class:"ss-flex",modelValue:!0})):(l(),t(b,{key:1,class:"ss-reset-button ss-flex ss-col-center ss-row-center"},{default:r((()=>[c(j,{class:"_icon-forward",style:{color:"#bbbbbb","font-size":"26rpx"}})])),_:1}))]})),_:1})])),_:1},8,["modelValue"])])),_:1})])),_:1})])),_:1},8,["model","rules"]),"H5"!==h(g).$platform.name?(l(),t(y,{key:0},{default:r((()=>[c(y,{class:"title-box ss-p-l-30"},{default:r((()=>[d("第三方账号绑定")])),_:1}),c(y,{class:"account-list ss-flex ss-row-between"},{default:r((()=>["WechatOfficialAccount"===h(g).$platform.name?(l(),t(y,{key:0,class:"ss-flex ss-col-center"},{default:r((()=>[c(_,{class:"list-img",src:h(g).$url.static("/static/images/WechatOfficialAccount.png")},null,8,["src"]),c(j,{class:"list-name"},{default:r((()=>[d("微信公众号")])),_:1})])),_:1})):u("",!0),"WechatMiniProgram"===h(g).$platform.name?(l(),t(y,{key:1,class:"ss-flex ss-col-center"},{default:r((()=>[c(_,{class:"list-img",src:h(g).$url.static("/static/images/WechatMiniProgram.png")},null,8,["src"]),c(j,{class:"list-name"},{default:r((()=>[d("微信小程序")])),_:1})])),_:1})):u("",!0),"App"===h(g).$platform.name?(l(),t(y,{key:2,class:"ss-flex ss-col-center"},{default:r((()=>[c(_,{class:"list-img",src:h(g).$url.static("/static/images/wechat.png")},null,8,["src"]),c(j,{class:"list-name"},{default:r((()=>[d("微信开放平台")])),_:1})])),_:1})):u("",!0),c(y,{class:"ss-flex ss-col-center"},{default:r((()=>[n.thirdInfo?(l(),t(y,{key:0,class:"info ss-flex ss-col-center"},{default:r((()=>[c(_,{class:"avatar ss-m-r-20",src:h(g).$url.cdn(n.thirdInfo.avatar)},null,8,["src"]),c(j,{class:"name"},{default:r((()=>[d(f(n.thirdInfo.nickname),1)])),_:1})])),_:1})):u("",!0),c(y,{class:"bind-box ss-m-l-20"},{default:r((()=>[n.thirdInfo.openid?(l(),t(b,{key:0,class:"ss-reset-button relieve-btn",onClick:X},{default:r((()=>[d(" 解绑 ")])),_:1})):(l(),t(b,{key:1,class:"ss-reset-button bind-btn",onClick:R},{default:r((()=>[d("绑定")])),_:1}))])),_:1})])),_:1})])),_:1})])),_:1})):u("",!0),c(Y,{bottom:"",placeholder:"",bg:"none"},{default:r((()=>[c(y,{class:"footer-box ss-p-20"},{default:r((()=>[c(b,{class:"ss-rest-button logout-btn",onClick:ee},{default:r((()=>[d("保存")])),_:1})])),_:1})])),_:1})])),_:1})}}},[["__scopeId","data-v-714dbf0b"]]);export{q as default};
|