2 lines
7.0 KiB
JavaScript
Executable File
2 lines
7.0 KiB
JavaScript
Executable File
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.value.is_auth)try{V({title:"请稍后..."}),m.value&&$.getUrl(),await p.getUser(),R()}catch(e){R(),uni.$u.toast(e)}}));return k((()=>{p.getUser()})),C((async e=>{const{code:t}=e;if(m.value&&t){V({title:"请稍后..."});try{await S({code:t}),await p.getUser()}catch(a){}I({url:"/pages/user_set/user_set"})}})),(o,p)=>{const x=e(t("u-avatar"),T),y=_,g=e(t("u-icon"),U),v=B,w=e(t("u-button"),F),k=e(t("u-action-sheet"),Y);return a(),s(y,{class:"user-set"},{default:l((()=>[u(v,{url:"/pages/user_data/user_data"},{default:l((()=>[u(y,{class:"item flex bg-white mt-[20rpx]"},{default:l((()=>[u(x,{src:j(d).avatar,shape:"square",size:100},null,8,["src"]),u(y,{class:"ml-[20rpx] flex flex-1 justify-between items-center"},{default:l((()=>[u(y,null,{default:l((()=>[u(y,{class:"mb-[15rpx] text-xl font-medium"},{default:l((()=>[r(i(j(d).nickname),1)])),_:1}),u(y,{class:"text-content text-xs"},{default:l((()=>[r("账号:"+i(j(d).account),1)])),_:1})])),_:1}),u(g,{name:"arrow-right",color:"#666"})])),_:1})])),_:1})])),_:1}),u(y,{class:"item bg-white mt-[20rpx] btn-border flex flex-1 justify-between",onClick:N},{default:l((()=>[u(y,{class:""},{default:l((()=>[r("登录密码")])),_:1}),u(g,{name:"arrow-right",color:"#666"})])),_:1}),m.value?(a(),s(y,{key:0,class:"item bg-white flex flex-1 justify-between",onClick:j(q)},{default:l((()=>[u(y,{class:""},{default:l((()=>[r("绑定微信")])),_:1}),u(y,{class:"flex justify-between"},{default:l((()=>[u(y,{class:"text-muted mr-[20rpx]"},{default:l((()=>[r(i(j(d).is_auth?"已绑定":"未绑定"),1)])),_:1}),0==j(d).is_auth?(a(),s(g,{key:0,name:"arrow-right",color:"#666"})):n("v-if",!0)])),_:1})])),_:1},8,["onClick"])):n("v-if",!0),u(v,{url:`/pages/agreement/agreement?type=${j(Z).PRIVACY}`},{default:l((()=>[u(y,{class:"item bg-white mt-[20rpx] btn-border flex flex-1 justify-between"},{default:l((()=>[u(y,{class:""},{default:l((()=>[r("隐私政策")])),_:1}),u(g,{name:"arrow-right",color:"#666"})])),_:1})])),_:1},8,["url"]),u(v,{url:`/pages/agreement/agreement?type=${j(Z).SERVICE}`},{default:l((()=>[u(y,{class:"item bg-white btn-border flex flex-1 justify-between"},{default:l((()=>[u(y,{class:""},{default:l((()=>[r("服务协议")])),_:1}),u(g,{name:"arrow-right",color:"#666"})])),_:1})])),_:1},8,["url"]),u(v,{url:"/pages/as_us/as_us"},{default:l((()=>[u(y,{class:"item bg-white flex flex-1 justify-between"},{default:l((()=>[u(y,{class:""},{default:l((()=>[r("关于我们")])),_:1}),u(y,{class:"flex justify-between"},{default:l((()=>[u(y,{class:"text-muted mr-[20rpx]"},{default:l((()=>[r(i(j(c).config.version),1)])),_:1}),u(g,{name:"arrow-right",color:"#666"})])),_:1})])),_:1})])),_:1}),u(y,{class:"mt-[60rpx] mx-[26rpx]"},{default:l((()=>[u(w,{type:"primary",shape:"circle",onClick:E},{default:l((()=>[r(" 退出登录 ")])),_:1})])),_:1}),u(k,{list:f.value,modelValue:h.value,"onUpdate:modelValue":p[0]||(p[0]=e=>h.value=e),onClick:b,"safe-area-inset-bottom":!0},null,8,["list","modelValue"])])),_:1})}}}),[["__scopeId","data-v-44350111"]]);export{q as default};
|