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

kit-callcenter-web

v1.0.3

Published

云呼叫中心组件

Downloads

8

Readme

Kit-CallCenter-Web

web呼叫中心组件

下载依赖

$ npm install kit-callcenter-web react react-dom react-router react-router-dom axios antd styled-components --save

使用

import { CallCenter } from "kit-callcenter-web";

const App = () => {
  return (
    <CallCenter {...props} />
  )
}

// props声明:
interface CallCenterProps {
	appkey: string,
	appId: string, // 即云信服务的唯一标识appKey, 在云信管理后台应用信息中查看
	account: string, // 帐号, 应用内唯一
	token: string, // 生成该accout的认证token,采用sha1算法,参数是:appSecret、sipPassword、nonce、curTime组成的字符串
	sipPassword?: string, // 该账号对应的密码
	appSecret?: string, // 该应用对应的凭证,在云信管理后台应用信息中查看
	curTime: number, // 用于生成token,当前时间戳
	debug?: boolean, // 是否开启调试模式
	componentTag?: number | string // 保证组件的唯一性
	didNumber?: string // 配置的运营商出局号码,没有设置为''即可
	register: boolean, // 初始化完成后是否主动登陆,该值如果设置为false,需要用户在ua.init({})之后,主动调用ua.register()接口
	no_answer_timeout?: number // 接收呼叫时,自己应答的超时时间,sdk默认是60秒(即60s之内,ua不应答,sdk会主动挂断该呼叫)  
	onKicked?: () => void // 被踢回调
	onLogout?: () => void // 退出登录
	onDisconnect?: () => void // 断线回调
	baseDomain: string // 请求domain
}

其他方法

import { render, unmountComponentAtNode } from 'kit-callcenter-web'

// render 用于在非react框架中渲染
const view = document.getElementById('view')
render(view: HTMLElement, props: CallCenterProps)

// unmountComponentAtNode 用于卸载组件
unmountComponentAtNode(view)

除此之外,组件还提供了 commonjs 与 umd 的输出方式。

// commonjs
const { CallCenter, render } = require('kit-callcenter-web')

// umd
const { CallCenter, render } = window.NECallCenter

FAQ

如果遇到样式丢失问题,需要手动导入 antd 的样式

import 'antd/dist/index.less'

组件预览