|
|
|
@ -22,7 +22,7 @@
|
|
|
|
|
uid: window.uid,
|
|
|
|
|
appkey: window.appKey,
|
|
|
|
|
credential: window.password,
|
|
|
|
|
touid: window.touid,
|
|
|
|
|
touid: window.uid,
|
|
|
|
|
pluginUrl: '/service_contact_list.html?uid='
|
|
|
|
|
+ window.uid,
|
|
|
|
|
onLoginSuccess: function (data) {
|
|
|
|
@ -38,9 +38,12 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function switchTouid(touid) {
|
|
|
|
|
window.uid = touid;
|
|
|
|
|
window.touid = touid;
|
|
|
|
|
WKIT.switchTouid({
|
|
|
|
|
touid: touid
|
|
|
|
|
touid: window.touid,
|
|
|
|
|
logo: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1531805782509&di=98f7fa48980696f8eddf7eb617a834a3&imgtype=0&src=http%3A%2F%2Fi2.hdslb.com%2Fbfs%2Fface%2F98dbd049061292bca8625caf91cff1b41ee999cd.jpg',
|
|
|
|
|
Avatar: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1531805782509&di=98f7fa48980696f8eddf7eb617a834a3&imgtype=0&src=http%3A%2F%2Fi2.hdslb.com%2Fbfs%2Fface%2F98dbd049061292bca8625caf91cff1b41ee999cd.jpg',
|
|
|
|
|
toAvatar: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1531805782509&di=98f7fa48980696f8eddf7eb617a834a3&imgtype=0&src=http%3A%2F%2Fi2.hdslb.com%2Fbfs%2Fface%2F98dbd049061292bca8625caf91cff1b41ee999cd.jpg'
|
|
|
|
|
});
|
|
|
|
|
WKIT.Conn.sdk.Chat.setReadState({
|
|
|
|
|
touid: touid,
|
|
|
|
@ -82,20 +85,12 @@
|
|
|
|
|
var unreads = data.data;
|
|
|
|
|
var uids = "";
|
|
|
|
|
for (var i = unreads.length - 1; i >= 0; i--) {
|
|
|
|
|
window.sdk.unreadMap[getName(
|
|
|
|
|
WKIT.Conn.sdk.Base.getNick(
|
|
|
|
|
unreads[i].contact))].msgCount =
|
|
|
|
|
unreads[i].msgCount;
|
|
|
|
|
var nick = getName(
|
|
|
|
|
WKIT.Conn.sdk.Base.getNick(
|
|
|
|
|
unreads[i].contact));
|
|
|
|
|
if (nick.length <= 6) {
|
|
|
|
|
window.sdk.unreadMap[getName(WKIT.Conn.sdk.Base.getNick(unreads[i].contact))].msgCount = unreads[i].msgCount;
|
|
|
|
|
var nick = getName(WKIT.Conn.sdk.Base.getNick(unreads[i].contact));
|
|
|
|
|
if (nick.substring(nick.length - 5, nick.length - 4) == '_') {
|
|
|
|
|
uids += nick + ",";
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
uids +=
|
|
|
|
|
nick.substring(0, uid.length - 5)
|
|
|
|
|
+ ",";
|
|
|
|
|
uids += nick.substring(0, uid.length - 5) + ",";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
window.sdk.loadContactList(uids);
|
|
|
|
@ -109,7 +104,7 @@
|
|
|
|
|
function updateContractList(data) {
|
|
|
|
|
var msg = data.msgs[0];
|
|
|
|
|
var msg_uid = getName(WKIT.Conn.sdk.Base.getNick(msg.from))
|
|
|
|
|
if (window.uid = msg_uid) {
|
|
|
|
|
if (window.uid == msg_uid) {
|
|
|
|
|
WKIT.Conn.sdk.Chat.setReadState({
|
|
|
|
|
touid: msg_uid,
|
|
|
|
|
timestamp: Math.floor((+new Date()) / 1000),
|
|
|
|
@ -119,15 +114,15 @@
|
|
|
|
|
console.log('set read state fail', error);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}else {
|
|
|
|
|
if (window.sdk.unreadMap[msg_uid]) {
|
|
|
|
|
window.sdk.unreadMap[msg_uid].msgCount = window.sdk.unreadMap[msg_uid].msgCount + 1;
|
|
|
|
|
} else {
|
|
|
|
|
var unreadMapEle = {msgCount: 1}
|
|
|
|
|
window.sdk.unreadMap[msg_uid] = unreadMapEle;
|
|
|
|
|
}
|
|
|
|
|
window.sdk.loadContactList(msg_uid.substr(0, msg_uid - 6));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (window.sdk.unreadMap[msg_uid]) {
|
|
|
|
|
window.sdk.unreadMap[msg_uid].msgCount = window.sdk.unreadMap[msg_uid].msgCount + 1;
|
|
|
|
|
} else {
|
|
|
|
|
var unreadMapEle = {msgCount: 1}
|
|
|
|
|
window.sdk.unreadMap[msg_uid] = unreadMapEle;
|
|
|
|
|
}
|
|
|
|
|
window.sdk.loadContactList(msg_uid.substr(0, msg_uid - 6));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function initLayout() {
|
|
|
|
|