// pages/chat-group-detail/chat-group-detail.js let disp = require("../../utils/broadcast"); Page({ /** * 页面的初始数据 */ data: { username: { your: "", }, }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { let username = JSON.parse(options.username); this.setData({ username: username }); wx.setNavigationBarTitle({ title: username.your }); }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady() { }, /** * 生命周期函数--监听页面显示 */ onShow() { }, /** * 生命周期函数--监听页面隐藏 */ onHide() { }, /** * 生命周期函数--监听页面卸载 */ onUnload() { disp.fire("em.chatroom.leave"); }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh() { wx.showNavigationBarLoading(); this.selectComponent('#groupchat').getMore(); // 停止下拉动作 wx.hideNavigationBarLoading(); wx.stopPullDownRefresh(); }, /** * 页面上拉触底事件的处理函数 */ onReachBottom() { }, })