1 |
- import{f as t,g as e,w as s,k as a,E as i,l,F as n,r,B as o,u as c,v as u,i as d,ah as h,G as g,j as f,y as m,I as _,c as p,aw as b,z as k,O as y,o as w,aA as v,s as $,a6 as x,Q as C,m as A,x as S,U as T,aB as I,t as P,P as W,V as j,X as L,aC as F,n as U,J as B}from"./index-a116b7fa.js";import{_ as O}from"./_plugin-vue_export-helper.1b428a4d.js";import{_ as M,a as z}from"./uni-list.78aaa36c.js";import{_ as H}from"./su-image.cf5517c4.js";import{d as G}from"./phone-international-input.b9f6c8e6.js";import{a as q,_ as E}from"./s-layout.4ae51839.js";import"./uni-badge.9d757a16.js";import"./useGoods.6b315a78.js";const J=O({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,s=e.$options.name;for(;s!==t;){if(e=e.$parent,!e)return!1;s=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(p,b,k,y,w,v){const $=f,x=m,C=_;return t(),e($,{"hover-class":k.clickable||k.link?"uni-list-chat--hover":"",class:"uni-list-chat",onClick:g(v.onClick,["stop"])},{default:s((()=>[a($,{class:i({"uni-list--border":w.border,"uni-list-chat--first":w.isFirstChild})},null,8,["class"]),a($,{class:"uni-list-chat__container"},{default:s((()=>[a($,{class:"uni-list-chat__header-warp"},{default:s((()=>[k.avatarCircle||0===k.avatarList.length?(t(),e($,{key:0,class:i(["uni-list-chat__header",{"header--circle":k.avatarCircle}])},{default:s((()=>[a(x,{class:i(["uni-list-chat__header-image",{"header--circle":k.avatarCircle}]),src:k.avatar,mode:"aspectFill"},null,8,["class","src"])])),_:1},8,["class"])):(t(),e($,{key:1,class:"uni-list-chat__header"},{default:s((()=>[(t(!0),l(n,null,r(k.avatarList,((l,n)=>(t(),e($,{key:n,class:i(["uni-list-chat__header-box",v.computedAvatar]),style:o({width:w.imageWidth+"px",height:w.imageWidth+"px"})},{default:s((()=>[a(x,{class:"uni-list-chat__header-image",style:o({width:w.imageWidth+"px",height:w.imageWidth+"px"}),src:l.url,mode:"aspectFill"},null,8,["style","src"])])),_:2},1032,["class","style"])))),128))])),_:1}))])),_:1}),k.badgeText&&"left"===k.badgePositon?(t(),e($,{key:0,class:i(["uni-list-chat__badge uni-list-chat__badge-pos",[v.isSingle]])},{default:s((()=>[a(C,{class:"uni-list-chat__badge-text"},{default:s((()=>[c(u("dot"===k.badgeText?"":k.badgeText),1)])),_:1})])),_:1},8,["class"])):d("",!0),a($,{class:"uni-list-chat__content"},{default:s((()=>[a($,{class:"uni-list-chat__content-main"},{default:s((()=>[a(C,{class:"uni-list-chat__content-title uni-ellipsis"},{default:s((()=>[c(u(k.title),1)])),_:1}),a(C,{class:"uni-list-chat__content-note uni-ellipsis"},{default:s((()=>[c(u(k.note),1)])),_:1})])),_:1}),a($,{class:"uni-list-chat__content-extra"},{default:s((()=>[h(p.$slots,"default",{},(()=>[a(C,{class:"uni-list-chat__content-extra-text"},{default:s((()=>[c(u(k.time),1)])),_:1}),k.badgeText&&"right"===k.badgePositon?(t(),e($,{key:0,class:i(["uni-list-chat__badge",[v.isSingle,"right"===k.badgePositon?"uni-list-chat--right":""]])},{default:s((()=>[a(C,{class:"uni-list-chat__badge-text"},{default:s((()=>[c(u("dot"===k.badgeText?"":k.badgeText),1)])),_:1})])),_:1},8,["class"])):d("",!0)]),!0)])),_:3})])),_:3})])),_:3})])),_:3},8,["hover-class","onClick"])}],["__scopeId","data-v-0b029afc"]]),N=O({__name:"setting",setup(i){const l=p((()=>$.$store("user").isLogin)),{t:n}=b(),r=p((()=>$.$store("user").userInfo)),o=p((()=>$.$store("user").userWallet)),h=p((()=>{let t=r.value.alipayAccount;if(!t)return!1;if(/^\d{11}$/.test(t))return`${t.substring(0,3)}****${t.substring(7)}`;if(/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(t)){const e=t.indexOf("@");if(e<=3)return t;return`${t.substring(0,Math.ceil(e/2))}***${t.substring(e)}`}})),g=p((()=>{let t=r.value.bankAccount;return!!t&&(8===t.length?t.substring(0,2)+"********"+t.substr(-2):t.substring(0,4)+"******"+t.substr(-4))})),O=()=>{P("alipayAccount")},N=()=>{P("bankAccount")},Q=k({model:{},rules:{},thirdInfo:{}});async function R(){await $.$platform.useProvider("wechat").bind()&&await X()}function V(){W({title:n("user.unbind_reminder"),content:n("rules.unbind_warning"),cancelText:n("common.cancel"),confirmText:n("common.confirm"),success:async function(t){if(!t.confirm)return;await $.$platform.useProvider("wechat").unbind(Q.thirdInfo.openid)&&await X()}})}const X=async()=>{const t=await $.$store("user").getInfo();if(Q.model=x.clone(t),"H5"!==$.$platform.name){const t=await $.$platform.useProvider("wechat").getInfo();Q.thirdInfo=t||{}}};function D(){W({title:n("setting.prompt"),content:n("setting.confirm_logout"),cancelText:n("common.cancel"),confirmText:n("common.confirm"),success:async function(t){if(!t.confirm)return;const{code:e}=await j.logout();0===e&&($.$store("user").logout(),L("linkId"),$.$router.go("/pages/index/user"))}})}async function K(t){const{code:e,data:s}=await j.getConsumerRedirectUrl();0===e&&(window.location.href=s)}const Y=p((()=>C("userLanguage")));return y((()=>{X()})),w((()=>{v("alipayAccountChangeComplete",X),v("bankAccountChangeComplete",X)})),(i,n)=>{const r=_,p=f,b=A(U("uni-list-chat"),J),k=A(U("uni-list-item"),M),y=A(U("su-image"),H),w=A(U("uni-list"),z),v=A(U("uni-forms"),G),x=m,C=B,P=A(U("su-fixed"),q),W=A(U("s-layout"),E);return t(),e(W,{title:i.$t("setting.set"),class:"set-userinfo-wrap"},{default:s((()=>[a(v,{model:Q.model,rules:Q.rules,labelPosition:"left",border:"",class:"form-box"},{default:s((()=>[a(p,{class:"bg-white"},{default:s((()=>[a(w,{border:!1,class:""},{default:s((()=>{var l,f;return[a(b,{clickable:"","avatar-circle":!0,title:null==(l=Q.model)?void 0:l.nickname,avatar:null==(f=Q.model)?void 0:f.avatar,note:i.$t("setting.signature"),onClick:n[0]||(n[0]=t=>S($).$router.go("/pages/user/info"))},{default:s((()=>[a(p,{class:"chat-custom-right"},{default:s((()=>[a(r,{class:"_icon-forward",style:{color:"#bbbbbb","font-size":"32rpx"}})])),_:1})])),_:1},8,["title","avatar","note"]),a(k,{clickable:"",onClick:n[1]||(n[1]=t=>S($).$router.go("/pages/user/address/list")),title:i.$t("setting.physical_address_management"),showArrow:"",border:!1},null,8,["title"]),a(k,{clickable:"",onClick:n[2]||(n[2]=t=>S($).$router.go("/pages/user/dummyAddress/list")),title:i.$t("setting.virtual_address_management"),showArrow:"",border:!1},null,8,["title"]),a(k,{title:"支付宝账号",showArrow:"",clickable:"",border:!1,onClick:O},{body:s((()=>[T("p",{style:{width:"100%"}},u(i.$t("setting.alipay_account"))+" "+u(h.value?h.value:"未绑定"),1)])),_:1}),a(k,{title:"银行卡",showArrow:"",clickable:"",border:!1,onClick:N},{body:s((()=>[T("p",{style:{width:"100%"}},u(i.$t("setting.bank_card"))+" "+u(g.value?g.value:"未绑定"),1)])),_:1}),o.value.isPtSystemUser?(t(),e(k,{key:0,clickable:!0,onClick:n[3]||(n[3]=t=>K()),title:"进入平台",showArrow:"",border:!1},{body:s((()=>[T("p",{style:{width:"100%"}},u(i.$t("setting.enter_platform")),1)])),_:1})):d("",!0),o.value.isShSystemUser?(t(),e(k,{key:1,clickable:!0,onClick:n[4]||(n[4]=t=>K()),title:"进入商家后台",showArrow:"",border:!1},{body:s((()=>[T("p",{style:{width:"100%"}},u(i.$t("setting.enter_merchant_backend")),1)])),_:1})):d("",!0),S(I)()?(t(),e(k,{key:2,clickable:!0,onClick:n[5]||(n[5]=t=>(console.log(Y.value),void("en-US"===Y.value?F("zh-Hans"):F("en-US")))),title:"切换语言",showArrow:"",border:!1},{body:s((()=>[T("p",{style:{width:"100%"}},u("en-US"===Y.value?"Switch to Chinese":"切换为英文"),1)])),_:1})):d("",!0),a(k,{title:"我的二维码",clickable:"",onClick:n[6]||(n[6]=t=>S($).$router.go("/pages/user/qrcode-share")),border:!1},{body:s((()=>{var t;return[T("p",{style:{width:"100%",display:"flex","align-items":"center"}},[c(u(i.$t("setting.enter_merchant_backend"))+" ",1),a(y,{class:"content-img",style:{border:"1px solid #f4f4f4"},current:0,src:null==(t=Q.model)?void 0:t.avatar,height:100,width:100,radius:0,mode:"scaleToFill"},null,8,["src"])])]})),_:1})]})),_:1})])),_:1})])),_:1},8,["model","rules"]),"H5"!==S($).$platform.name?(t(),e(p,{key:0},{default:s((()=>[a(p,{class:"title-box ss-p-l-30"},{default:s((()=>[c(u(i.$t("setting.third_party_account_binding")),1)])),_:1}),a(p,{class:"account-list ss-flex ss-row-between"},{default:s((()=>["WechatOfficialAccount"===S($).$platform.name?(t(),e(p,{key:0,class:"ss-flex ss-col-center"},{default:s((()=>[a(x,{class:"list-img",src:S($).$url.static("/static/images/WechatOfficialAccount.png")},null,8,["src"]),a(r,{class:"list-name"},{default:s((()=>[c(u(i.$t("setting.wechat_public_account")),1)])),_:1})])),_:1})):d("",!0),"WechatMiniProgram"===S($).$platform.name?(t(),e(p,{key:1,class:"ss-flex ss-col-center"},{default:s((()=>[a(x,{class:"list-img",src:S($).$url.static("/static/images/WechatMiniProgram.png")},null,8,["src"]),a(r,{class:"list-name"},{default:s((()=>[c(u(i.$t("setting.wechat_mini_program")),1)])),_:1})])),_:1})):d("",!0),"App"===S($).$platform.name?(t(),e(p,{key:2,class:"ss-flex ss-col-center"},{default:s((()=>[a(x,{class:"list-img",src:S($).$url.static("/static/images/wechat.png")},null,8,["src"]),a(r,{class:"list-name"},{default:s((()=>[c(u(i.$t("setting.wechat_open_platform")),1)])),_:1})])),_:1})):d("",!0),a(p,{class:"ss-flex ss-col-center"},{default:s((()=>[Q.thirdInfo?(t(),e(p,{key:0,class:"info ss-flex ss-col-center"},{default:s((()=>[a(x,{class:"avatar ss-m-r-20",src:S($).$url.cdn(Q.thirdInfo.avatar)},null,8,["src"]),a(r,{class:"name"},{default:s((()=>[c(u(Q.thirdInfo.nickname),1)])),_:1})])),_:1})):d("",!0),a(p,{class:"bind-box ss-m-l-20"},{default:s((()=>[Q.thirdInfo.openid?(t(),e(C,{key:0,class:"ss-reset-button relieve-btn",onClick:V},{default:s((()=>[c(u(i.$t("setting.unbind")),1)])),_:1})):(t(),e(C,{key:1,class:"ss-reset-button bind-btn",onClick:R},{default:s((()=>[c(u(i.$t("setting.bind")),1)])),_:1}))])),_:1})])),_:1})])),_:1})])),_:1})):d("",!0),a(P,{bottom:"",placeholder:""},{default:s((()=>[a(p,{class:"ss-p-x-20 ss-p-b-40"},{default:s((()=>[l.value?(t(),e(C,{key:0,class:"loginout-btn ss-reset-button",onClick:D},{default:s((()=>[c(u(i.$t("user.log_out")),1)])),_:1})):d("",!0)])),_:1})])),_:1})])),_:1},8,["title"])}}},[["__scopeId","data-v-c533c27e"]]);export{N as default};
|