微信小程序调用出错,去掉setData就没错了
im.getQuery().withLastMessagesRefreshed().containsMembers([userId]).find().then(function (conversations) {
// console.log(conversations);
that.setData({
conversations: conversations
});
// 默认按每个对话的最后更新日期(收到最后一条消息的时间)倒序排列
// conversations.map(function (conversation) {
// console.log(conversation.lastMessage.summary, conversation.unreadMessagesCount, conversation.lastMessageAt.format("yyyy-MM-dd hh:mm:ss"));
// });
}).catch(console.error.bind(console));