1 |
- import{y as e,aj as a,c as s,e as l,f as t,w as o,a9 as n,B as r,g as c,j as u,A as i,t as d,u as f,i as m,x as p,o as b,s as _,a1 as y,l as g,k as h,r as v,F as x,v as k,q as w,ak as B,M as V,al as $,m as I,G as S,ae as C,E as j,H as P,I as F}from"./index-b48a414d.js";import{_ as M}from"./su-image.900c884d.js";import{a as z,b as A,d as O}from"./phone-international-input.feef99c7.js";import{_ as T}from"./_plugin-vue_export-helper.1b428a4d.js";import{F as U,a as W,_ as G}from"./s-layout.d6dcdc81.js";const H=T({__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:_}){const y=e({currentValue:!1}),g=_,h=b;a((()=>{y.currentValue=h.modelValue,g("update:modelValue",y.currentValue)}));const v=s((()=>y.currentValue)),x=()=>{h.disabled||(y.currentValue=!y.currentValue,g("update:modelValue",y.currentValue),g("change",{label:h.label,value:y.currentValue}))};return(e,a)=>{const s=m,_=p;return l(),t(s,{class:r(["ui-radio ss-flex ss-col-center",[{disabled:b.disabled},{img:b.src},b.ui]]),onClick:x,style:i([b.customStyle])},{default:o((()=>[n(e.$slots,"leftLabel",{},void 0,!0),b.none?c("",!0):(l(),t(s,{key:0,class:r(["ui-radio-input",[v.value?"cur "+b.bg:b.unbg,b.src?"radius":"round"]])},null,8,["class"])),b.src?(l(),t(_,{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:o((()=>[n(e.$slots,"default",{},(()=>[u(s,{class:"ui-label-text",style:i([b.labelStyle])},{default:o((()=>[d(f(b.label),1)])),_:1},8,["style"])]),!0)])),_:3})),b.ui.includes("card")?(l(),t(s,{key:3,class:r(["ui-radio-bg round",[v.value?"cur "+b.bg:""]])},null,8,["class"])):c("",!0)])),_:3},8,["class","style"])}}},[["__scopeId","data-v-2c6d6010"]]),q=T({__name:"info",setup(a){const n=e({model:{},rules:{},thirdInfo:{}}),r=[{name:"男",value:"1"},{name:"女",value:"2"}],i=s((()=>_.$store("user").userInfo));function T(e){n.model.sex=e.detail.value}const q=()=>{w("changeMobile")};function E(){B({success:async e=>{const a=e.tempFilePaths[0];await async function(e){if(!e)return;let{data:a}=await U.uploadFile(e);n.model.avatar=a}(a)}})}function L(){w("changePassword")}async function N(){await _.$platform.useProvider("wechat").bind()}function D(){V({title:"解绑提醒",content:"解绑后您将无法通过微信登录此账号",cancelText:"再想想",confirmText:"确定",success:async function(e){if(!e.confirm)return;await _.$platform.useProvider("wechat").unbind(n.thirdInfo.openid)&&await K()}})}async function J(){const{code:e}=await $.updateUser({avatar:n.model.avatar,nickname:n.model.nickname,sex:n.model.sex});0===e&&await K()}const K=async()=>{const e=await _.$store("user").getInfo();if(n.model=y.clone(e),"H5"!==_.$platform.name){let e=await _.$platform.useProvider("wechat").getInfo();n.thirdInfo=e||{}}};return b((async e=>{K(),setTimeout(K,2e3)})),(e,a)=>{const s=g(I("su-image"),M),b=S,y=m,w=g(I("uni-easyinput"),z),B=g(I("uni-forms-item"),A),V=P,$=F,U=C,K=g(I("su-radio"),H),Q=j,R=g(I("uni-forms"),O),X=p,Y=g(I("su-fixed"),W),Z=g(I("s-layout"),G);return l(),t(Z,{title:"用户信息",class:"set-userinfo-wrap"},{default:o((()=>[u(R,{model:n.model,rules:n.rules,labelPosition:"left",border:"",class:"form-box"},{default:o((()=>[u(y,{class:"ss-flex ss-row-center ss-col-center ss-p-t-60 ss-p-b-0 bg-white"},{default:o((()=>[u(y,{class:"header-box-content"},{default:o((()=>{var e;return[u(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"]),u(y,{class:"avatar-action"},{default:o((()=>[u(b,{class:"ss-reset-button avatar-action-btn",onClick:E},{default:o((()=>[d("修改")])),_:1})])),_:1})]})),_:1})])),_:1}),u(y,{class:"bg-white ss-p-x-30"},{default:o((()=>[u(B,{name:"nickname",label:"昵称"},{default:o((()=>[u(w,{modelValue:n.model.nickname,"onUpdate:modelValue":a[0]||(a[0]=e=>n.model.nickname=e),type:"nickname",placeholder:"设置昵称",inputBorder:!1,placeholderStyle:"color:#BBBBBB;font-size:28rpx;line-height:normal"},null,8,["modelValue"])])),_:1}),u(B,{name:"sex",label:"性别"},{default:o((()=>[u(y,{class:"ss-flex ss-col-center ss-h-100"},{default:o((()=>[u(U,{onChange:T,class:"ss-flex ss-col-center"},{default:o((()=>[(l(),h(x,null,v(r,(e=>u($,{class:"radio",key:e.value},{default:o((()=>[u(y,{class:"ss-flex ss-col-center ss-m-r-32"},{default:o((()=>{var a;return[u(V,{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"]),u(y,{class:"gender-name"},{default:o((()=>[d(f(e.name),1)])),_:2},1024)]})),_:2},1024)])),_:2},1024))),64))])),_:1})])),_:1})])),_:1}),u(B,{name:"mobile",label:"手机号",onClick:q},{default:o((()=>[u(w,{modelValue:i.value.mobile,"onUpdate:modelValue":a[1]||(a[1]=e=>i.value.mobile=e),placeholder:"请绑定手机号",inputBorder:!1,disabled:"",styles:{disableColor:"#fff"},placeholderStyle:"color:#BBBBBB;font-size:28rpx;line-height:normal",clearable:!1},{right:o((()=>[u(y,{class:"ss-flex ss-col-center"},{default:o((()=>{var e;return[(null==(e=i.value.verification)?void 0:e.mobile)?(l(),t(K,{key:0,modelValue:!0})):(l(),t(b,{key:1,class:"ss-reset-button ss-flex ss-col-center ss-row-center"},{default:o((()=>[u(Q,{class:"_icon-forward",style:{color:"#bbbbbb","font-size":"26rpx"}})])),_:1}))]})),_:1})])),_:1},8,["modelValue"])])),_:1}),u(B,{name:"password",label:"登录密码",onClick:L},{default:o((()=>[u(w,{modelValue:i.value.password,"onUpdate:modelValue":a[2]||(a[2]=e=>i.value.password=e),placeholder:"点击修改登录密码",inputBorder:!1,styles:{disableColor:"#fff"},disabled:"",placeholderStyle:"color:#BBBBBB;font-size:28rpx;line-height:normal",clearable:!1},{right:o((()=>[u(y,{class:"ss-flex ss-col-center"},{default:o((()=>{var e;return[(null==(e=i.value.verification)?void 0:e.password)?(l(),t(K,{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:o((()=>[u(Q,{class:"_icon-forward",style:{color:"#bbbbbb","font-size":"26rpx"}})])),_:1}))]})),_:1})])),_:1},8,["modelValue"])])),_:1})])),_:1})])),_:1},8,["model","rules"]),"H5"!==k(_).$platform.name?(l(),t(y,{key:0},{default:o((()=>[u(y,{class:"title-box ss-p-l-30"},{default:o((()=>[d("第三方账号绑定")])),_:1}),u(y,{class:"account-list ss-flex ss-row-between"},{default:o((()=>["WechatOfficialAccount"===k(_).$platform.name?(l(),t(y,{key:0,class:"ss-flex ss-col-center"},{default:o((()=>[u(X,{class:"list-img",src:k(_).$url.static("/static/images/WechatOfficialAccount.png")},null,8,["src"]),u(Q,{class:"list-name"},{default:o((()=>[d("微信公众号")])),_:1})])),_:1})):c("",!0),"WechatMiniProgram"===k(_).$platform.name?(l(),t(y,{key:1,class:"ss-flex ss-col-center"},{default:o((()=>[u(X,{class:"list-img",src:k(_).$url.static("/static/images/WechatMiniProgram.png")},null,8,["src"]),u(Q,{class:"list-name"},{default:o((()=>[d("微信小程序")])),_:1})])),_:1})):c("",!0),"App"===k(_).$platform.name?(l(),t(y,{key:2,class:"ss-flex ss-col-center"},{default:o((()=>[u(X,{class:"list-img",src:k(_).$url.static("/static/images/wechat.png")},null,8,["src"]),u(Q,{class:"list-name"},{default:o((()=>[d("微信开放平台")])),_:1})])),_:1})):c("",!0),u(y,{class:"ss-flex ss-col-center"},{default:o((()=>[n.thirdInfo?(l(),t(y,{key:0,class:"info ss-flex ss-col-center"},{default:o((()=>[u(X,{class:"avatar ss-m-r-20",src:k(_).$url.cdn(n.thirdInfo.avatar)},null,8,["src"]),u(Q,{class:"name"},{default:o((()=>[d(f(n.thirdInfo.nickname),1)])),_:1})])),_:1})):c("",!0),u(y,{class:"bind-box ss-m-l-20"},{default:o((()=>[n.thirdInfo.openid?(l(),t(b,{key:0,class:"ss-reset-button relieve-btn",onClick:D},{default:o((()=>[d(" 解绑 ")])),_:1})):(l(),t(b,{key:1,class:"ss-reset-button bind-btn",onClick:N},{default:o((()=>[d("绑定")])),_:1}))])),_:1})])),_:1})])),_:1})])),_:1})):c("",!0),u(Y,{bottom:"",placeholder:"",bg:"none"},{default:o((()=>[u(y,{class:"footer-box ss-p-20"},{default:o((()=>[u(b,{class:"ss-rest-button logout-btn",onClick:J},{default:o((()=>[d("保存")])),_:1})])),_:1})])),_:1})])),_:1})}}},[["__scopeId","data-v-7463c856"]]);export{q as default};
|