内网开发
This commit is contained in:
@@ -63,18 +63,31 @@ const store = new Vuex.Store({
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
createRoom(context,room){
|
||||
_im.createRoom(room).then((res) => {
|
||||
|
||||
})
|
||||
},
|
||||
joinRoom(context,room){
|
||||
_im.joinRoom(room).then((res) => {
|
||||
|
||||
})
|
||||
},
|
||||
getRoomInfo(context,room){
|
||||
|
||||
},
|
||||
onP2PMessage(context, data) {
|
||||
console.log("========================store 收到信息")
|
||||
console.log(data)
|
||||
// console.log("========================store 收到信息")
|
||||
publicFc.getPush(data)
|
||||
|
||||
},
|
||||
sendMsg(context, data) {
|
||||
console.log("========================")
|
||||
// console.log("======================== store:sendMsg")
|
||||
// console.log(data)
|
||||
// console.log("========================")
|
||||
// console.log("========================")
|
||||
// console.error(data)
|
||||
_im.sendP2PMessage(_im.createP2PTextMessage(data.userId, data.data.content))
|
||||
_im.sendP2PMessage(_im.createP2PTextMessage(data.userId, data.data))
|
||||
},
|
||||
sendP2PMessageReciveAck(context, data) {
|
||||
_im.sendP2PMessageReciveAck(data)
|
||||
@@ -161,10 +174,10 @@ const store = new Vuex.Store({
|
||||
context.commit('update_ChatList', data)
|
||||
},
|
||||
updateChatListInfoById(context, data) { //修改聊天记录
|
||||
console.log("*********************** 修改聊天记录 2 ********************")
|
||||
console.log("*********************** 修改聊天记录 2 ********************")
|
||||
console.log("*********************** 修改聊天记录 2 ********************")
|
||||
console.log(data)
|
||||
// console.log("*********************** 修改聊天记录 2 ********************")
|
||||
// console.log("*********************** 修改聊天记录 2 ********************")
|
||||
// console.log("*********************** 修改聊天记录 2 ********************")
|
||||
// console.log(data)
|
||||
var getKey = data.userId
|
||||
var retdata = publicFc.getKeyObjectStorage(context.state.userInfo.userId + '_' +
|
||||
'chatlistData')
|
||||
@@ -174,7 +187,7 @@ const store = new Vuex.Store({
|
||||
retdata));
|
||||
},
|
||||
createChatObj(context, data) {
|
||||
console.log("初始化聊天记录")
|
||||
// console.log("初始化聊天记录")
|
||||
// console.log("context.state.userInfo.userId:", context.state.userInfo.userId)
|
||||
// console.log("data.userId:", data.userId)
|
||||
var userId = data.userId
|
||||
@@ -187,11 +200,9 @@ const store = new Vuex.Store({
|
||||
// console.log("===========data2:",JSON.stringify(data2[userId]))
|
||||
|
||||
var _num=0
|
||||
console.error(data2[userId])
|
||||
if (!data2[userId]) {
|
||||
data2[userId] = new Object()
|
||||
}else{
|
||||
console.warn(data2[userId].num)
|
||||
// _num=data2[userId].num+1
|
||||
}
|
||||
uni.setStorageSync(context.state.userInfo.userId + '_' + 'chatlistData', JSON.stringify(
|
||||
@@ -201,7 +212,6 @@ const store = new Vuex.Store({
|
||||
'chatData')
|
||||
return new Promise((resolve, reject) => {
|
||||
if (!data1[userId]) {
|
||||
console.log('初始化聊天')
|
||||
switch (windowType) {
|
||||
case 'SINGLE':
|
||||
|
||||
@@ -229,7 +239,7 @@ const store = new Vuex.Store({
|
||||
.userId + '_' + 'chatData', JSON
|
||||
.stringify(data1));
|
||||
// 创建记录
|
||||
console.log("============= 创建记录 ")
|
||||
// console.log("============= 创建记录 ")
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user