index.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import Vue from "vue"
  2. import Vuex from "vuex"
  3. import {
  4. assign,
  5. slice,
  6. isEmpty
  7. } from 'lodash-es'
  8. Vue.use(Vuex)
  9. const store = new Vuex.Store({
  10. state: {
  11. list: {}, // 列表以及聊天内容数据
  12. video: null, // 视频通话数据
  13. wornlist: {},
  14. addobj: [],
  15. kpsurlL: 0,
  16. worndatabase: [],
  17. selfRoomInfo: null,
  18. pendingVideoConnect: false,
  19. isVideoTalking: false,
  20. isVideoCallRefused: false,
  21. },
  22. mutations: {
  23. updateVideoInfo(state, payload) {
  24. state.video = assign({}, payload)
  25. state.pendingVideoConnect = !isEmpty(payload)
  26. },
  27. updateVideoSelfRoomInfo(state, payload) {
  28. state.selfRoomInfo = assign({}, payload)
  29. },
  30. updateMessageList(state, payload) {
  31. state.list = slice(payload)
  32. },
  33. updatePendingVideoConnectStatus(state, flag) {
  34. state.pendingVideoConnect = flag
  35. },
  36. updateTalkingStatus(state, flag) {
  37. state.isVideoTalking = flag
  38. },
  39. updateIsRefusedCall(state, flag) {
  40. state.isVideoCallRefused = flag
  41. }
  42. },
  43. actions: {},
  44. getters: {
  45. list: () => {
  46. }
  47. }
  48. })
  49. export default store