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