You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.1 KiB

// pages/chat/index.js
Page({
data: {
chatList: []
},
onLoad: function (options) {
this.loadChatList();
},
loadChatList: function () {
// 模拟加载消息列表
const chatList = [
{
id: 1,
name: '系统消息',
avatar: 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0',
content: '欢迎使用消息中心功能',
time: '刚刚',
unread: true
},
{
id: 2,
name: '客服小王',
avatar: 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0',
content: '您好,有什么可以帮助您的吗?',
time: '10分钟前',
unread: false
}
];
this.setData({
chatList: chatList
});
},
onChatItemTap: function (e) {
// 跳转到聊天详情页
wx.showToast({
title: '聊天功能开发中',
icon: 'none'
});
},
onPullDownRefresh: function () {
this.loadChatList();
wx.stopPullDownRefresh();
}
});