import{_ as e,r as a,b as t,c as l,d as s,e as r,f as o,g as d,i,h as u,w as m,j as p,k as n,m as c,n as f,E as v,p as b,q as _}from"./index.286e9b79.js";import{v as j}from"./loading.c49775a6.js";import{E as g,a as h}from"./form.ad10dcd5.js";import{E as y,a as V}from"./tab-pane.1cc0f769.js";/* empty css                       */import{E as x,a as w}from"./checkbox.f06171a4.js";import{E as k}from"./text.b43d8d63.js";import{E}from"./switch.197584d0.js";import"./form-item.9355e6dc.js";import{E as q}from"./image-viewer.b538fe01.js";import{_ as U}from"./material.90ee622d.js";import{_ as C}from"./page-header.29890ed0.js";import{g as I,p as D}from"./http.f588794f.js";import"./_initCloneObject.fb8fbaea.js";import"./strings.8c60bfae.js";import"./event.776e7e11.js";import"./isEqual.57d72c4a.js";import"./validator.18338d56.js";import"./debounce.caafe00b.js";import"./index.ed3ed02e.js";import"./position.1bd00850.js";import"./scroll.a50153b5.js";import"./pagination.22bb50f6.js";import"./select.297a82d5.js";import"./input.31de1b37.js";import"./index.27150c7e.js";import"./token.34cb8214.js";import"./_baseIteratee.9ead53a1.js";/* empty css            */import"./progress.27d0e11c.js";import"./cloneDeep.15b627aa.js";import"./dialog.ec9503d2.js";import"./overlay.2c1583ac.js";import"./message-box.6a8eb828.js";import"./divider.948c4b18.js";const F={class:"editor-card"},O={class:"editor-card-box"},P={class:"avatar-uploader"},R={class:"image-slot"},z={style:{width:"100%"}},A={style:{width:"100%"}},B={style:{width:"100%"}},G={style:{width:"100%"}},H={class:"tool"},J={class:"tool-box"},K=e({__name:"setting",setup(e){let K=a(!1),L=a(!1),M=a("0"),N=a(),Q=t({data:{users_bind_mobile:"1",users_agree:"1",users_verify:[],users_oauth:[],avatar:""}});const S=t({});L.value=!0,I("users.users/setting").then((e=>{L.value=!1,e.code&&(Q.data=e.data)}));const T=async()=>{N.value&&await N.value.validate(((e,a)=>{if(L.value=!1,e){if(Q.data.users_verify.length<=0)return v.error("用户登录方式，至少需要选择一项"),!1;L.value=!0,D("users.users/setting",Q.data).then((e=>{L.value=!1,e.code?v.success("操作成功"):v.error(e.msg)})).catch((e=>{v.error(e)}))}else v.error("请完善内容")}))},W=a(!1),X=()=>{W.value=!0},Y=e=>{W.value=!1,Q.data.avatar=e[0].photo},Z=()=>{};return(e,a)=>{const t=C,v=U,I=q,D=l("Plus"),$=b,ee=g,ae=E,te=k,le=x,se=w,re=y,oe=V,de=h,ie=_,ue=j;return s(),r("div",null,[o(t,{title:"基础设置"}),o(v,{modelValue:d(W),"onUpdate:modelValue":a[0]||(a[0]=e=>i(W)?W.value=e:null),limit:1,onChange:Y,onClose:Z},null,8,["modelValue"]),u("div",F,[m((s(),p(de,{model:d(Q).data,rules:d(S),ref_key:"ruleFormRef",ref:N},{default:n((()=>[u("div",O,[o(oe,{modelValue:d(M),"onUpdate:modelValue":a[5]||(a[5]=e=>i(M)?M.value=e:M=e)},{default:n((()=>[o(re,{label:"基本信息",name:"0"},{default:n((()=>[o(ee,{label:"会员头像","label-width":"100px",style:{"align-items":"center"}},{default:n((()=>[u("div",P,[u("div",{class:"avatar-uploader-box",onClick:X},[d(Q).data.avatar?(s(),p(I,{key:0,src:d(Q).data.avatar,fit:"contain",class:"avatar"},{error:n((()=>[u("div",R,[(s(),p(c("icon-picture")))])])),_:1},8,["src"])):(s(),p($,{key:1,class:"avatar-uploader-icon"},{default:n((()=>[o(D)])),_:1}))])])])),_:1}),o(ee,{label:"绑定手机",required:!0,"label-width":"100px"},{default:n((()=>[u("div",z,[o(ae,{modelValue:d(Q).data.users_bind_mobile,"onUpdate:modelValue":a[1]||(a[1]=e=>d(Q).data.users_bind_mobile=e),"active-value":1,"inactive-value":0},null,8,["modelValue"])]),o(te,{type:"info"},{default:n((()=>[f("开启后新用户和老用户未绑定手机，则强制绑定手机")])),_:1})])),_:1}),o(ee,{label:"政策协议",required:!0,"label-width":"100px"},{default:n((()=>[u("div",A,[o(ae,{modelValue:d(Q).data.users_agree,"onUpdate:modelValue":a[2]||(a[2]=e=>d(Q).data.users_agree=e),"active-value":1,"inactive-value":0},null,8,["modelValue"])]),o(te,{type:"info"},{default:n((()=>[f("登录/注册页面，是否显示服务协议和隐私政策")])),_:1})])),_:1}),o(ee,{label:"登录方式",required:!0,"label-width":"100px"},{default:n((()=>[u("div",B,[o(se,{modelValue:d(Q).data.users_verify,"onUpdate:modelValue":a[3]||(a[3]=e=>d(Q).data.users_verify=e)},{default:n((()=>[o(le,{label:"user"},{default:n((()=>[f("帐号登录")])),_:1}),o(le,{label:"code"},{default:n((()=>[f("短信登录")])),_:1})])),_:1},8,["modelValue"])]),o(te,{type:"info"},{default:n((()=>[f("登录界面用户登录方式，至少需要选择一项")])),_:1})])),_:1}),o(ee,{label:"快捷登录",required:!0,"label-width":"100px"},{default:n((()=>[u("div",G,[o(se,{modelValue:d(Q).data.users_oauth,"onUpdate:modelValue":a[4]||(a[4]=e=>d(Q).data.users_oauth=e)},{default:n((()=>[o(le,{label:"weixin"},{default:n((()=>[f("微信登录")])),_:1})])),_:1},8,["modelValue"])]),o(te,{type:"info"},{default:n((()=>[f(" 登录界面将支持第三方登录，用户授权即自动注册账号 ")])),_:1})])),_:1})])),_:1})])),_:1},8,["modelValue"])])])),_:1},8,["model","rules"])),[[ue,d(K)]])]),u("div",H,[u("div",J,[o(ie,{type:"primary",loading:d(L),onClick:T},{default:n((()=>[f("保存")])),_:1},8,["loading"])])])])}}},[["__scopeId","data-v-a96cf5bf"]]);export{K as default};
