1 |
- import{f as t,g as e,w as a,k as s,E as i,l,F as r,r as o,B as n,u as c,v as d,i as u,ah as h,G as g,j as f,y as p,I as m,c as _,z as b,O as v,s as k,a7 as y,m as x,x as w,U as C,P as $,V as T,X as A,n as I,J as S}from"./index-ba48620e.js";import{_ as j}from"./_plugin-vue_export-helper.1b428a4d.js";import{_ as F,a as L}from"./uni-list.8a8104ea.js";import{_ as P}from"./su-image.d4b7cd31.js";import{d as W}from"./phone-international-input.dd3ca29e.js";import{a as B,_ as z}from"./s-layout.04b95866.js";import"./uni-badge.539e0aa6.js";import"./useGoods.edb8879f.js";const G=j({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(_,b,v,k,y,x){const w=f,C=p,$=m;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(_.$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"]]),O=j({__name:"setting",setup(i){const l=_((()=>k.$store("user").isLogin)),r=b({model:{},rules:{},thirdInfo:{}}),o=_((()=>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=m,g=f,p=x(I("uni-list-chat"),G),_=x(I("uni-list-item"),F),b=x(I("su-image"),P),v=x(I("uni-list"),L),y=x(I("uni-forms"),W),$=S,T=x(I("su-fixed"),B),A=x(I("s-layout"),z);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(_,{clickable:"",onClick:d[1]||(d[1]=t=>w(k).$router.go("/pages/user/address/list")),title:"实体收货地址管理",showArrow:"",border:!1}),s(_,{clickable:"",onClick:d[2]||(d[2]=t=>w(k).$router.go("/pages/user/dummyAddress/list")),title:"虚拟收货地址管理",showArrow:"",border:!1}),s(_,{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(_,{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{O as default};
|