webchat-vue-api
v1.0.9
Published
A Vue.js Api
Downloads
5
Readme
webchat-vue-api
A Vue.js Api
Build Setup
# install dependencies
npm install
# serve with hot reload at localhost:8080
npm run dev
# build for production with minification
npm run build
安装此插件
npm install webchat-vue-api
初始化方法
区分是坐席还是客户. userId(用户id),userName(用户名称),userType(客户类型):agent, $webchatConfig(userId,userName,userType);
#状态管理模式取值: 全局$store取值 挂载webchatMs到Vuex的modules 取值方式:例:获取会话列表:$store.state.webchatMs.global.agentServiceRooms
#发送消息 $webchatsendWebchatMsg(roomId,msgType,content,isSysMessage,businessId)
#撤回消息 $webchatwithDrawWebchatMsg(roomId,msgId,msgIndex)
#回滚消息 $webchatrollbackWebchatMsg(roomId,indexStart,indexEnd)
#客户主动离开房间 $webchatleaveRoom()
#获取所有会话列表数据 $webchatgetRoomList()
#重发消息 $webchatReSendWebchatMsg()
#通过http发送数据--做数据缓存 $sendWebchatMsgHttpData(); #通过http重新发送数据--做数据缓存 $reSendWebchatMsgHttpData();
$SENDSTATE_SUCCESS; $SENDSTATE_LOADING; $SENDSTATE_FAIL;
For detailed explanation on how things work, consult the docs for vue-loader.