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 🙏

© 2024 – Pkg Stats / Ryan Hefner

ichat-web

v1.1.91

Published

ichat npm pakege

Downloads

10

Readme

ichat-web sdk 使用说明

起步(方式一)

npm install ichat-web

导入

//导入核心依赖
import ichatSdk from 'ichat-web'
//导入动画样式
import 'ichat-web/main.css'

起步(方式二)

// 直接通过cdn链接引入 使用方式同下
<script src="https://yywdd.oss-cn-chengdu.aliyuncs.com/ichat-web.js"></script>
// 引入动画样式
<link
    rel="stylesheet"
    href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"
/>

使用

const ichat = new ichatSdk() //请注意内部使用单例模式创建 
// 实例化时可传入 指定域名进行链接(用于私有化部署)

初始化

// 请注意,所以功能必须在初始化之后才能使用
ichat.initSdk({
    agentId:'xxxxxxxx',
    uuid:'testUuid123',
})

初始化完整参数说明

let option = {
        agentId:'xxxxxxxx',//代理Id sdkId 必传参数 否则无法使用
        uuid:'testUuid123',//客户Id (不传入则使用匿名链条,聊天记录不被保存)建议必传
        name:'testUser',//其它链接参数参数
        otherPara:'123',//其它链接参数参数
        showPopText:true,//是否开启招呼提示
        text:'你好请问有什么可以帮到你?',//提示语
        autoShow:true,//是否自动显示提示
        showTime:3000,//提示显示时间 默认为5000
        tervalTime:5000,//提示间隔时间 默认为10000
        textStyle:'color:red',//气泡文字样式 或直接使用ichat_pop_content类名进行修改 同理也可使用 ichat_pop 类名直接修改气泡本身样式注意覆盖即可
        lang:'zh',//备选en 支持中午和英文切换 默认为英文
        logoUrl:'https://example.com/xxx-oss.jpg'//自定义logo图片 
}

气泡示意图 img_1.png

监听器

// 内置了消息监听器 当时到消息时将通过监听器执行回调 可用于消息处理
// 为防止时间重复触发 请在监听时传入具名函数作为回调 避免重读监听
ichat.$on('onMessage',chatData=>{
  console.log(chatData,'收到了消息')
})

撤销监听

// 为防止时间重复触发 请在监听时传入具名函数作为回调 避免重读监听
// 方式一 单独撤销
ichat.$ff('onMessage',callBack)
//方式二 批量撤销
ichat.$off(['onMessage'])

消息发送

// @params strin|number 目前仅支持 文字信息发送
ichat.sendMessage('this is a test Message!!')

语言切换

// @params String en/zh
ichat.changeLang('en')

主动控制弹窗显隐

// 显示弹窗
ichat.showChatModel()
//关闭隐藏弹窗
ichat.hideChatModel()
//另外提供函数控制 显示隐藏 作用和用户直接点击icon相同
ichat.changeShow()