1 |
- import{e as t,f as e,w as a,j as s,B as i,k as l,F as r,r as o,A as n,t as c,u as d,g as u,a9 as h,C as g,i as f,x as p,E as _,c as m,y as b,L as v,s as k,a1 as y,l as x,v as w,Q as C,M as $,R as T,U as A,m as S,G as I}from"./index-b48a414d.js";import{_ as L}from"./_plugin-vue_export-helper.1b428a4d.js";import{_ as F,a as j}from"./uni-list.756201c6.js";import{_ as P}from"./su-image.900c884d.js";import{d as W}from"./phone-international-input.feef99c7.js";import{a as B,_ as M}from"./s-layout.d6dcdc81.js";import"./uni-badge.78cdef34.js";const U=L({name:"UniListChat",emits:["click"],props:{title:{type:String,default:""},note:{type:String,default:""},clickable:{type:Boolean,default:!1},link:{type:[Boolean,String],default:!1},to:{type:String,default:""},badgeText:{type:[String,Number],default:""},badgePositon:{type:String,default:"right"},time:{type:String,default:""},avatarCircle:{type:Boolean,default:!1},avatar:{type:String,default:""},avatarList:{type:Array,default:()=>[]}},computed:{isSingle(){if("dot"===this.badgeText)return"uni-badge--dot";return this.badgeText.toString().length>1?"uni-badge--complex":"uni-badge--single"},computedAvatar(){return this.avatarList.length>4?(this.imageWidth=13.95,"avatarItem--3"):this.avatarList.length>1?(this.imageWidth=21.15,"avatarItem--2"):(this.imageWidth=45,"avatarItem--1")}},data:()=>({isFirstChild:!1,border:!0,imageWidth:50}),mounted(){this.list=this.getForm(),this.list&&(this.list.firstChildAppend||(this.list.firstChildAppend=!0,this.isFirstChild=!0),this.border=this.list.border)},methods:{getForm(t="uniList"){let e=this.$parent,a=e.$options.name;for(;a!==t;){if(e=e.$parent,!e)return!1;a=e.$options.name}return e},onClick(){""===this.to?(this.clickable||this.link)&&this.$emit("click",{data:{}}):this.openPage()},openPage(){-1!==["navigateTo","redirectTo","reLaunch","switchTab"].indexOf(this.link)?this.pageApi(this.link):this.pageApi("navigateTo")},pageApi(t){uni[t]({url:this.to,success:t=>{this.$emit("click",{data:t})},fail:t=>{this.$emit("click",{data:t}),console.error(t.errMsg)}})}}},[["render",function(m,b,v,k,y,x){const w=f,C=p,$=_;return t(),e(w,{"hover-class":v.clickable||v.link?"uni-list-chat--hover":"",class:"uni-list-chat",onClick:g(x.onClick,["stop"])},{default:a((()=>[s(w,{class:i({"uni-list--border":y.border,"uni-list-chat--first":y.isFirstChild})},null,8,["class"]),s(w,{class:"uni-list-chat__container"},{default:a((()=>[s(w,{class:"uni-list-chat__header-warp"},{default:a((()=>[v.avatarCircle||0===v.avatarList.length?(t(),e(w,{key:0,class:i(["uni-list-chat__header",{"header--circle":v.avatarCircle}])},{default:a((()=>[s(C,{class:i(["uni-list-chat__header-image",{"header--circle":v.avatarCircle}]),src:v.avatar,mode:"aspectFill"},null,8,["class","src"])])),_:1},8,["class"])):(t(),e(w,{key:1,class:"uni-list-chat__header"},{default:a((()=>[(t(!0),l(r,null,o(v.avatarList,((l,r)=>(t(),e(w,{key:r,class:i(["uni-list-chat__header-box",x.computedAvatar]),style:n({width:y.imageWidth+"px",height:y.imageWidth+"px"})},{default:a((()=>[s(C,{class:"uni-list-chat__header-image",style:n({width:y.imageWidth+"px",height:y.imageWidth+"px"}),src:l.url,mode:"aspectFill"},null,8,["style","src"])])),_:2},1032,["class","style"])))),128))])),_:1}))])),_:1}),v.badgeText&&"left"===v.badgePositon?(t(),e(w,{key:0,class:i(["uni-list-chat__badge uni-list-chat__badge-pos",[x.isSingle]])},{default:a((()=>[s($,{class:"uni-list-chat__badge-text"},{default:a((()=>[c(d("dot"===v.badgeText?"":v.badgeText),1)])),_:1})])),_:1},8,["class"])):u("",!0),s(w,{class:"uni-list-chat__content"},{default:a((()=>[s(w,{class:"uni-list-chat__content-main"},{default:a((()=>[s($,{class:"uni-list-chat__content-title uni-ellipsis"},{default:a((()=>[c(d(v.title),1)])),_:1}),s($,{class:"uni-list-chat__content-note uni-ellipsis"},{default:a((()=>[c(d(v.note),1)])),_:1})])),_:1}),s(w,{class:"uni-list-chat__content-extra"},{default:a((()=>[h(m.$slots,"default",{},(()=>[s($,{class:"uni-list-chat__content-extra-text"},{default:a((()=>[c(d(v.time),1)])),_:1}),v.badgeText&&"right"===v.badgePositon?(t(),e(w,{key:0,class:i(["uni-list-chat__badge",[x.isSingle,"right"===v.badgePositon?"uni-list-chat--right":""]])},{default:a((()=>[s($,{class:"uni-list-chat__badge-text"},{default:a((()=>[c(d("dot"===v.badgeText?"":v.badgeText),1)])),_:1})])),_:1},8,["class"])):u("",!0)]),!0)])),_:3})])),_:3})])),_:3})])),_:3},8,["hover-class","onClick"])}],["__scopeId","data-v-0b029afc"]]),q=L({__name:"setting",setup(i){const l=m((()=>k.$store("user").isLogin)),r=b({model:{},rules:{},thirdInfo:{}}),o=m((()=>k.$store("user").userInfo));function n(){$({title:"提示",content:"确认退出账号?",success:async function(t){if(!t.confirm)return;const{code:e}=await T.logout();0===e&&(k.$store("user").logout(),A("linkId"),k.$router.go("/pages/index/user"))}})}return v((()=>{(async()=>{const t=await k.$store("user").getInfo();if(r.model=y.clone(t),"H5"!==k.$platform.name){const t=await k.$platform.useProvider("wechat").getInfo();r.thirdInfo=t||{}}})()})),(i,d)=>{const h=_,g=f,p=x(S("uni-list-chat"),U),m=x(S("uni-list-item"),F),b=x(S("su-image"),P),v=x(S("uni-list"),j),y=x(S("uni-forms"),W),$=I,T=x(S("su-fixed"),B),A=x(S("s-layout"),M);return t(),e(A,{title:"用户信息",class:"set-userinfo-wrap"},{default:a((()=>[s(y,{model:r.model,rules:r.rules,labelPosition:"left",border:"",class:"form-box"},{default:a((()=>[s(g,{class:"bg-white"},{default:a((()=>[s(v,{border:!1,class:"ss-p-y-40"},{default:a((()=>{var t,e;return[s(p,{clickable:"","avatar-circle":!0,title:null==(t=r.model)?void 0:t.nickname,avatar:null==(e=r.model)?void 0:e.avatar,note:"个性签名",onClick:d[0]||(d[0]=t=>w(k).$router.go("/pages/user/info"))},{default:a((()=>[s(g,{class:"chat-custom-right"},{default:a((()=>[s(h,{class:"_icon-forward",style:{color:"#bbbbbb","font-size":"32rpx"}})])),_:1})])),_:1},8,["title","avatar"]),s(m,{clickable:"",onClick:d[1]||(d[1]=t=>w(k).$router.go("/pages/user/address/list")),title:"实体收货地址管理",showArrow:"",border:!1}),s(m,{clickable:"",onClick:d[2]||(d[2]=t=>w(k).$router.go("/pages/user/dummyAddress/list")),title:"虚拟收货地址管理",showArrow:"",border:!1}),s(m,{clickable:!o.value.mobile,onClick:d[3]||(d[3]=t=>w(k).$router.go("/pages/user/address/list")),title:"实名认证",showArrow:"",border:!1},{body:a((()=>[C("p",{style:{width:"100%"}},"实名认证 未认证 ")])),_:1},8,["clickable"]),s(m,{title:"我的二维码",clickable:"",onClick:d[4]||(d[4]=t=>w(k).$router.go("/pages/user/qrcode-share")),border:!1},{body:a((()=>{var t;return[C("p",{style:{width:"100%",display:"flex","align-items":"center"}},[c(" 我的二维码 "),s(b,{class:"content-img",style:{border:"1px solid #f4f4f4"},current:0,src:null==(t=r.model)?void 0:t.avatar,height:100,width:100,radius:0,mode:"scaleToFill"},null,8,["src"])])]})),_:1})]})),_:1})])),_:1})])),_:1},8,["model","rules"]),s(T,{bottom:"",placeholder:""},{default:a((()=>[s(g,{class:"ss-p-x-20 ss-p-b-40"},{default:a((()=>[l.value?(t(),e($,{key:0,class:"loginout-btn ss-reset-button",onClick:n},{default:a((()=>[c(" 退出登录 ")])),_:1})):u("",!0)])),_:1})])),_:1})])),_:1})}}},[["__scopeId","data-v-05df63ff"]]);export{q as default};
|