52,797
社区成员
发帖
与我相关
我的任务
分享
function initConversationList() {
_html = "";
$scope.ConversationList.forEach(function (item) {
var img= "/img/abcb0b4769b-2901-4fec-a3b5-4d430dc0bdb6.jpg";
if (item.getConversationType().valueOf() == "4") {
$.ajax({
type: "get",
url: "/home/selectuserInfo?id=" + item.getTargetId(),
dataType: "json"
}).done(function (data) {
if (data.HeadImgUrl != null) {
img= data.HeadImgUrl
}
});
_html += String.stringFormat(conversationStr, item.getConversationType().valueOf(), item.getTargetId(), item.getConversationTitle(), img, item.getUnreadMessageCount() == 0 ? "hidden" : "", item.getUnreadMessageCount(), item.getConversationTitle(), new Date(+item.getLatestTime()).toString().split(" ")[4]);
}
else {
_html += String.stringFormat(conversationStr, item.getConversationType().valueOf(), item.getTargetId(), item.getConversationTitle(), "/img/abcb0b4769b-2901-4fec-a3b5-4d430dc0bdb6.jpg", item.getUnreadMessageCount() == 0 ? "hidden" : "", item.getUnreadMessageCount(), item.getConversationTitle(), new Date(+item.getLatestTime()).toString().split(" ")[4]);
}
});
alert(_html);
$("#conversationlist").html(_html);
}