npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ux-feature-avatar

v1.1.3

Published

头像组件

Readme

头像组件


支持特性

  • [x] 挂件
  • [x] 勋章
  • [x] 卡片

对接

提供两种对接方案:(推荐使用第二种,只需要在承载页加载我们的  公共节点( 前端公共配置 Node23)即可,每次不用升级直接  用到头像组件新特性)

一. 通过 npm 安装

npm install ux-feature-avatar --save

import AvatarCmp from 'ux-feature-avatar'
class AvatarDemo extends Component {
    render() {
        const avatar_config = {
           "name": "啦啦啦",
            "avatar": {
                "hasAvatar":'true',
                "img": '//cache.tms.beisen.cn/Image/101055/ec2102b9dc444140b78bff744420517a_l.jpeg',
                "color": "#f0c75a"
            },
            "blessingType": 1,//祝福类型  1生日 2入职 3节日
            enableFeatures: true,//是否开通送祝福
            // simpleMode: false,//只显示头像
            "medalurl": medalUrl,
            enableJump:true,//是否支持跳转个人主页
            "userId": 112984691,
            "size": 80,
            decorationType: 3,//挂件类型,为4文化标签,3系统勋章,2企业勋章,1祝福
            // showHonorCard: false,
            "udc": bless: { ext: { type: "bless", "from": "prfile-avatar", to: userid } },//祝福挂件打点标记
                medal: { ext: { type: "medal", desc: "view-wall", from: "profile-avatar" } }//勋章挂件打点标记
            }
        }

             return <div className="_avatar-wrap">
                    <AvatarCmp {...avatar_config} />
             </div >


    }
}
ReactDOM.render(< AvatarDemo/>, document.getElementById('app'))

二. 通过动态标签引入

//通过动态插入标签方式加载头像组件
export function loadAvatarCmp(id, callback) {
    const featureAvatarVersion = window.__italent_common_cmps__ && window.__italent_common_cmps__.featureAvatar_version || '1.0.19'
    if (!document.getElementById(id) || !window.AvatarCmp) {
        const script = document.createElement('script');
        script.type = "text/javascript"
        script.id = id
        if (script.readyState) {
            script.onreadystatechange = function () {
                if (script.readyState == 'loaded' || script.readyState == 'completed') {
                    script.onreadystatechange = null;
                    callback && callback()
                }
            }
        } else {
            script.onload = function () {
                callback && callback()
            }
        }
        script.src = `//stnew.beisen.com/ux/upaas/ux-feature-avatar/release/dist/main-${featureAvatarVersion}.min.js`;
        document.body.appendChild(script)
    } else {
        callback && callback()
    }
}

class AvatarDemo extends Component {
    constructor(porps){
        super(props)
        this.state={
            AvatarCmp:''
        }
    }
    componentDidMount(){
        loadAvatarCmp('__common_feature_avatar',()=>{
            this.setState({
                AvatarCmp:window.AvatarCmp
            })
        })
    }
    render() {
        const avatar_config = {
           "name": "啦啦啦",
            "avatar": {
                "hasAvatar":'true',
                "img": '//cache.tms.beisen.cn/Image/101055/ec2102b9dc444140b78bff744420517a_l.jpeg',
                "color": "#f0c75a"
            },
            "blessingType": 1,//祝福类型
            enableFeatures: true,//是否开通送祝福
            // simpleMode: false,//只显示头像
            "medalurl": medalUrl,
            "userId": 112984691,
            "size": 80,
            decorationType: 3,//挂件类型,为4文化标签,3系统勋章,2企业勋章,1祝福
            // showHonorCard: false,
            "udc": bless: { ext: { type: "bless", "from": "prfile-avatar", to: userid } },//祝福挂件打点标记
                medal: { ext: { type: "medal", desc: "view-wall", from: "profile-avatar" } }//勋章挂件打点标记
            }
        }
        const {AvatarCmp} =this.state;

             return <div className="_avatar-wrap">
                    {AvatarCmp&&<AvatarCmp {...avatar_config} />}
             </div >


    }
}
ReactDOM.render(< AvatarDemo/>, document.getElementById('app'))
如需协助对接可以直接联系我 [email protected]

CHANGELOG

1.0.68

  • 调用祝福㊗ ️ 时 追加参数,添加祝福类型