2 lines
1.3 KiB
JavaScript
2 lines
1.3 KiB
JavaScript
"use strict";const e=require("../../../common/vendor.js"),t=require("../../index.js"),a=require("../../hooks/useModal.js"),r={__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(r){const u=e.computed((()=>t.sheep.$store("user").userInfo)),o=e.computed((()=>t.sheep.$store("user").isLogin)),s=r,n=e.computed((()=>{const{bgType:e,bgImg:t,bgColor:a}=s.styles;return{background:"img"===e?`url(${t}) no-repeat top center / 100% 100%`:a}}));function l(){a.showAuthModal("changeMobile")}return(s,p)=>{var c;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((a=>e.unref(t.sheep).$router.go("/modules/mall/user/info"))),c:e.t((null==(c=u.value)?void 0:c.nickname)||r.nickname),d:e.o(((...t)=>e.unref(a.showShareModal)&&e.unref(a.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:`${r.data.space}px`})})}}},u=e._export_sfc(r,[["__scopeId","data-v-113fad8b"]]);wx.createComponent(u);
|