Giter Club home page Giter Club logo

webim-vue-demo's Introduction

Easemob WebIM Demo

webim vue demo简介

webim-vue demo是基于环信sdk开发的一款具有单聊、群聊、聊天室、音视频等功能的应用,为了vue用户能够快速集成环信 im sdk和音视频sdk,我们特使用了vue+vuex,为大家提供参考,我们也提供了react版demo

运行起来

  • 说明:音视频功能需要使用https。
# install dependencies
npm install

# serve with hot reload at localhost:8080
npm start || HTTPS=true npm start

# build for production with minification
npm run build

# build for production and view the bundle analyzer report
npm run build --report

项目结构

目录 说明
build 打包后的文件
config 项目的配置
node_modules 项目依赖
static 资源文件
travis CI脚本
src 项目源文件
components 项目组件
config 表情和项目中ui配置
pages 项目页面
router 路由
store vuex store
utils sdk 引入和配置

主要功能点说明

sdk集成

代码目录:src/utils/WebIM.js

  • 引入sdk和配置文件,实例化。
  • 注册监听事件

发送消息

代码目录:src/components/chat/index.vue

  • 在chat组件里实现发消息以及消息上屏,index为发送消息,message为显示消息上屏
  • 具体发送消息的方法在 src/store/chat

音视频

代码目录: src/components/emediaModal

  • index为单人音视频, multiAVModal为多人音视频,

群组

代码目录:src/components/group

  • 群组发送消息和单人是一样的只是type不同
  • group下为群组设置的代码

消息存储

  • 消息存储在 store > chat > msgList
  • 关于持久化:这个demo采用的sdk消息漫游的增值服务,可以拉取历史消息,当然你也可以采用indexdb来做本地存储,同时也可以开通实时回调服务,将消息同步到自己的服务器。

写在最后

第一期已经完成了绝大部门im基础功能,大家也可以取查看官方详细文档 当然由于接触vue时间有限,这个demo只是给大家一个参考,很多地方的实现并不是很多,大家就自行发挥吧,后续会持续优化和更新。

webim-vue-demo's People

Contributors

myzhangdong avatar qwk-001 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.