data_center/public/mobile/assets/pages-user_set-user_set.8b3...

2 lines
7.0 KiB
JavaScript
Raw Normal View History

2023-09-18 09:11:13 +08:00
import{r as e,a as t,o as a,c as s,w as l,x as o,b as u,l as r,t as i,h as n,e as c,f as p,v as d,s as f,F as m,y as h,k as _,d as b,u as x,a8 as y,A as g,z as v,ae as w,aa as k,W as C,a1 as V,ay as S,ai as I,g as j,H as z,az as A,i as B,ah as $,af as R}from"./index.26a6cf84.js";import{_ as T}from"./u-avatar.82f87cbb.js";import{_ as U}from"./u-icon.7191c6e8.js";import{_ as F}from"./u-button.ae3a4a51.js";import{_ as N}from"./u-popup.08086621.js";import{_ as E}from"./plugin-vue_export-helper.21dcd24c.js";import{u as P}from"./useLockFn.4d99e11c.js";var Y=E({name:"u-action-sheet",emits:["update:modelValue","input","click","close"],props:{value:{type:Boolean,default:!1},modelValue:{type:Boolean,default:!1},maskCloseAble:{type:Boolean,default:!0},list:{type:Array,default:()=>[]},tips:{type:Object,default:()=>({text:"",color:"",fontSize:"26"})},cancelBtn:{type:Boolean,default:!0},safeAreaInsetBottom:{type:Boolean,default:!1},borderRadius:{type:[String,Number],default:0},zIndex:{type:[String,Number],default:0},cancelText:{type:String,default:"取消"},labelName:{type:String,default:"text"},blur:{type:[Number,String],default:0}},computed:{valueCom(){return this.modelValue},tipsStyle(){let e={};return this.tips.color&&(e.color=this.tips.color),this.tips.fontSize&&(e.fontSize=this.tips.fontSize+"rpx"),e},itemStyle(){return e=>{let t={};return this.list[e].color&&(t.color=this.list[e].color),this.list[e].fontSize&&(t.fontSize=this.list[e].fontSize+"rpx"),this.list[e].disabled&&(t.color="#c0c4cc"),t}},uZIndex(){return this.zIndex?this.zIndex:this.$u.zIndex.popup}},data:()=>({popupValue:!1}),watch:{valueCom(e,t){this.popupValue=e}},methods:{close(){this.popupClose(),this.$emit("close")},popupClose(){this.$emit("input",!1),this.$emit("update:modelValue",!1)},itemClick(e){this.list[e].disabled||(this.$emit("click",e),this.$emit("input",!1),this.$emit("update:modelValue",!1))}}},[["render",function(b,x,y,g,v,w){const k=h,C=_,V=e(t("u-popup"),N);return a(),s(V,{blur:y.blur,mode:"bottom","border-radius":y.borderRadius,popup:!1,modelValue:v.popupValue,"onUpdate:modelValue":x[2]||(x[2]=e=>v.popupValue=e),maskCloseAble:y.maskCloseAble,length:"auto",safeAreaInsetBottom:y.safeAreaInsetBottom,onClose:w.popupClose,"z-index":w.uZIndex},{default:l((()=>[y.tips.text?(a(),s(C,{key:0,class:"u-tips u-border-bottom",style:o([w.tipsStyle])},{default:l((()=>[u(k,null,{default:l((()=>[r(i(y.tips.text),1)])),_:1})])),_:1},8,["style"])):n("v-if",!0),(a(!0),c(m,null,p(y.list,((e,t)=>(a(),s(C,{key:t,onTouchmove:x[0]||(x[0]=d((()=>{}),["stop","prevent"])),onClick:e=>w.itemClick(t),style:o([w.itemStyle(t)]),class:f(["u-action-sheet-item u-line-1",[t<y.list.length-1?"u-border-bottom":""]]),"hover-stay-time":150},{default:l((()=>[u(k,null,{default:l((()=>[r(i(e[y.labelName]),1)])),_:2},1024),e.subText?(a(),s(k,{key:0,class:"u-action-sheet-item__subtext u-line-1"},{default:l((()=>[r(i(e.subText),1)])),_:2},1024)):n("v-if",!0)])),_:2},1032,["onClick","style","class"])))),128)),y.cancelBtn?(a(),s(C,{key:1,class:"u-gab"})):n("v-if",!0),y.cancelBtn?(a(),s(C,{key:2,onTouchmove:x[1]||(x[1]=d((()=>{}),["stop","prevent"])),class:"u-actionsheet-cancel u-action-sheet-item","hover-class":"u-hover-class","hover-stay-time":150,onClick:w.close},{default:l((()=>[r(i(y.cancelText),1)])),_:1},8,["onClick"])):n("v-if",!0)])),_:1},8,["blur","border-radius","modelValue","maskCloseAble","safeAreaInsetBottom","onClose","z-index"])}],["__scopeId","data-v-72a4be36"]]),Z=(e=>(e.PRIVACY="privacy",e.SERVICE="service",e))(Z||{});var q=E(b({__name:"user_set",setup(o){const c=x(),p=y(),d=g((()=>p.userInfo)),f=v([{text:"修改密码"},{text:"忘记密码"}]),m=v(!0);m.value=w();const h=v(!1),b=e=>{switch(e){case 0:z({url:"/pages/change_password/change_password"});break;case 1:z({url:"/pages/forget_pwd/forget_pwd"})}},N=()=>{if(!d.value.has_password)return z({url:"/pages/change_password/change_password?type=set"});h.value=!0},E=()=>{A({content:"是否退出登录?",confirmColor:"#4173FF",success:({cancel:e})=>{e||(p.logout(),I({url:"/pages/login/login"}))}})},{lockFn:q}=P((async()=>{if(!d.valu