Giter VIP home page Giter VIP logo

webim-uniapp-demo's Introduction

webim-uniapp-demo

介绍

demo 包含以下功能

  • 最近通话
  • 通讯录
  • 通知(加好友、加群)
  • 设置

在本地跑起来

拉取代码,在HBuliderX工具中即可运行起来。

数据结构

登录页:
		login: {
			name:'',
			psd: '',
			grant_type: 'password',
		}
		
注册页:
		register: {
			username: '',
			password: ''
		}
		
通讯录页:
	   member:[],   //好友列表
	   
聊天页:
	   chatMsg:[{
			info:{
		        to:''         
			},
			username:'',      //用户名
			yourname:'',      //好友名
			msg: {
				type:'',    
				data:''
			},
			style:'',       //样式
			time:'',
			mid:''        //message ID
	   }]
	   
globalData: 
	userInfo: '',  //用户微信授权信息
	chatMsg: []   //用于存储离线消息
	unReadMessageNum: 0, //未读消息数
	saveFriendList: [],//加好友申请
	saveGroupInvitedList: [], //加群邀请
	isIPX: false //是否为iphone X //是否为iphoneX
	
缓存:
   myUsername: ''    //缓存登录用户名	   
   yourname + myName:''  //以用户名跟好友名为key来缓存聊天记录

项目结构

|- components 自定义组件目录
    |-chat 聊天页面
    |-swipedelete 测滑删除
|-static/images demo中用到的图片 还有表情
|-pages 功能页面
    |-register 注册页
    |-login 登录页
    |-login_token token登录页
    |-chat 最近联系人页(通话)
        |-chatroom 聊天室页
    |-main 联系人页
        |-add_new 加好友页
        |-group 群组页
            |-groupSetting 群组设置页
    |-notificaton 通知页
    |-notificaton_friendDetail 加好友通知页
    |-notificaton_groupDetail 加群组通知页
    |-setting 设置页
        |-setting_general 通用设置页
|-utils 工具类和sdk的一些配置
|-newSDK 环信sdk
|-app.vue 小程序根实例,存放一些全局变量,注册监听事件
|-app.json 注册页面以及全局的一些配置
|-app.css 一些全局样式
|-project.config.json工程的一些配置,和开发者工具 “详情” 中的设置一样

使用音视频

项目中使用了EMLiveplugin,可以支持原生android、ios音视频功能。 导入项目后,需要检查manifest.json/原生插件配置中是否选中了插件,否则需要自己选择nativeplugins中的EMLiveplugin插件,然后点击hbuilderX的运行->运行到手机或模拟器->制作自定义调试基座。 此时hbuilderX会进行打包,等打包成功后,点击运行->运行到手机或模拟器->运行基座选择->自定义调试基座,选择好后重新点击运行->运行到手机或模拟器->找到自己的设备 等安装好后,就可以在群组聊天中点击电话的icon,发起多人会议。

常见问题

  • 小程序开发工具提示错误信息:{type: 206},并提示 illegal buffer,然后socket连接中断并提示{code: 1000, reason: "normal closure"}

    {type: 206}:账号在另外一端服务登陆,socket断连。提示illegal buffer不影响业务功能,后期sdk会屏蔽此提示

webim-uniapp-demo's People

Contributors

qwk-001 avatar myzhangdong avatar alexgreenbar avatar simon-fu 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.