聊天完成
This commit is contained in:
@@ -8,12 +8,12 @@
|
||||
import GoEasyIM from './goeasy-im-1.0.9';
|
||||
import restApi from './restapi';
|
||||
|
||||
function Friend(uuid, name, avatar,time = "", text = "",date = "") {
|
||||
function Friend(uuid, name, avatar,time = "", text = "",date = "",unReadMessage = 0) {
|
||||
this.uuid = uuid;
|
||||
this.name = name;
|
||||
this.avatar = avatar;
|
||||
this.online = false;
|
||||
this.unReadMessage = 0;
|
||||
this.unReadMessage = parseInt(unReadMessage);
|
||||
this.text = text;
|
||||
this.time = time;
|
||||
this.date = date
|
||||
@@ -107,7 +107,7 @@ IMService.prototype.initialContacts = function (friendList) {
|
||||
},
|
||||
success(res){
|
||||
console.log(res)
|
||||
that.friends[i[0]] = new Friend(res.data.data.member_id, res.data.data.member_nickname, res.data.data.member_avatar,i[1],i[2]);
|
||||
that.friends[i[0]] = new Friend(res.data.data.member_id, res.data.data.member_nickname, res.data.data.member_avatar,i[1],i[2],i[3]);
|
||||
console.log(that.friends)
|
||||
let sorts = function (friends){
|
||||
let paixu = function (a,b){
|
||||
@@ -301,7 +301,7 @@ IMService.prototype.initialIMListeners = function () {
|
||||
sorts(that.friendsarr)
|
||||
let arr = []
|
||||
for(let i in that.friends){
|
||||
arr.push([that.friends[i].uuid,that.friends[i].time,that.friends[i].text,that.friends[i].date])
|
||||
arr.push([that.friends[i].uuid,that.friends[i].time,that.friends[i].text,that.friends[i].date,that.friends[i].unReadMessage])
|
||||
}
|
||||
console.log(arr)
|
||||
uni.setStorageSync('imlist',JSON.stringify(arr))
|
||||
@@ -326,7 +326,7 @@ IMService.prototype.initialIMListeners = function () {
|
||||
sorts(that.friendsarr)
|
||||
let arr = []
|
||||
for(let i in that.friends){
|
||||
arr.push([that.friends[i].uuid,that.friends[i].time,that.friends[i].text,that.friends[i].date])
|
||||
arr.push([that.friends[i].uuid,that.friends[i].time,that.friends[i].text,that.friends[i].date,that.friends[i].unReadMessage])
|
||||
}
|
||||
console.log(arr)
|
||||
uni.setStorageSync('imlist',JSON.stringify(arr))
|
||||
|
||||
Reference in New Issue
Block a user