2 lines
1.3 KiB
JavaScript
2 lines
1.3 KiB
JavaScript
|
"use strict";const e=require("../../../../../common/vendor.js"),t=require("../../index.js"),r=require("../../hooks/useModal.js"),a={__name:"s-user-card",props:{data:{type:Object,default:()=>({})},styles:{type:Object,default:()=>({})},avatar:{type:String,default:""},nickname:{type:String,default:"请先登录"},vip:{type:[String,Number],default:"1"},collectNum:{type:[String,Number],default:"1"},likeNum:{type:[String,Number],default:"1"}},setup(a){const u=e.computed((()=>t.sheep.$store("user").userInfo)),o=e.computed((()=>t.sheep.$store("user").isLogin)),s=a,n=e.computed((()=>{const{bgType:e,bgImg:t,bgColor:r}=s.styles;return{background:"img"===e?`url(${t}) no-repeat top center / 100% 100%`:r}}));function l(){r.showAuthModal("changeMobile")}return(s,c)=>{var p;return e.e({a:o.value?e.unref(t.sheep).$url.cdn(u.value.avatar):e.unref(t.sheep).$url.static("/static/img/shop/default_avatar.png"),b:e.o((r=>e.unref(t.sheep).$router.go("/modules/mall/user/info"))),c:e.t((null==(p=u.value)?void 0:p.nickname)||a.nickname),d:e.o(((...t)=>e.unref(r.showShareModal)&&e.unref(r.showShareModal)(...t))),e:o.value&&!u.value.mobile},o.value&&!u.value.mobile?{f:e.o(l)}:{},{g:e.s(n.value),h:e.s({marginLeft:`${a.data.space}px`})})}}},u=e._export_sfc(a,[["__scopeId","data-v-c4693d64"]]);wx.createComponent(u);
|