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

common-chatbox-v3

v1.0.0

Published

Common ChatBox V3

Downloads

359

Readme

ChatBox组件

安装依赖

npm install common-chatbox-v3

开始使用

main.js文件中引入并注册
import ChatBox from 'common-chatbox-v3';
import 'common-chatbox-v3/dist/style.css';
Vue.use(ChatBox);

参数说明

isHedgehood: 是否是Hedgehood
sendAvatar: 头像链接,如果有就传递
unreadCount: 未读消息数量(根据socket实时变化)
token: 当前系统的token
profileUrl:profile请求相关Url
baseUrl:Ticket系统的baseUrl
translateLists: 翻译列表
ticketAdd: 是否有新消息(根据socket实时变化)
ticketId: ticketId
inHelpCenter: 是否是在Help Center页面,如果是,则不会打开chatbox
@showMask: 切换显示Mask
@toHelpCenter: 跳转到Help Center界面
@resetUnreadCount: 点击Icon重置未读消息数

使用方法

<template>
  <chat-box v-if="show" :isHedgehood="isHedgehood" :sendAvatar="sendAvatar" :unreadCount="unreadCount" :token="tokens" :profileUrl="profileUrl" :baseUrl="baseUrl" :translateLists="translateLists" @showMask="showMask" :ticketAdd="ticketAdd" :ticketId="ticketId" :inHelpCenter="inHelpCenter" @toHelpCenter="toHelpCenter" @resetUnreadCount="resetUnreadCount"></chat-box>
</template>

<script>
export default {
  components: {
    Conversation,
  },
  data() {
    return {
       baseUrl: process.env.VUE_APP_TICKET_URL,
      profileUrl: process.env.VUE_APP_PROFILE_URL,
      tokens: getIdToken(),
      translateLists: [],
      show: true,
      record: null,
      isHedgehood: false,
      sendAvatar: '',
      unreadCount: 0,
      ticketAdd: 0,
      ticketCurrentId: 0,
      ticketId: 0,
      inHelpCenter: false,
    };
  },
  created() {
    // this.lists = this.lists.reverse();
    this.values =
      'This customer called support because he had an issue with signing in. I helped him and it’s all good now.';
    this.getLists();
  },
  methods: {
    toHelpCenter() {
      this.$router.push({ path: '/' });
    },
    resetUnreadCount() {
      this.unreadCount = 0;
    },
    showMask(value) {
      this.$store.commit('SHOW_MASK', value);
    },
    async getLanuage() {
      let params = {
        tab: 'ticket',
        language: window.localStorage.getItem('language') ? window.localStorage.getItem('language') : 'English',
      }
      await getLanguageJson(params).then(res => {
        this.show = true;
        if (res.code === 200) {
          let result = JSON.parse(new Buffer.from(res.data, 'base64'));
          this.translateLists = result;
        }
      }).catch(()=>{
        this.show = true;
      })
    }
  },
};
</script>