chat-group-detail.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. // pages/chat-group-detail/chat-group-detail.js
  2. let disp = require("../../utils/broadcast");
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. username: {
  9. your: "",
  10. },
  11. },
  12. /**
  13. * 生命周期函数--监听页面加载
  14. */
  15. onLoad(options) {
  16. let username = JSON.parse(options.username);
  17. this.setData({ username: username });
  18. wx.setNavigationBarTitle({
  19. title: username.your
  20. });
  21. },
  22. /**
  23. * 生命周期函数--监听页面初次渲染完成
  24. */
  25. onReady() {
  26. },
  27. /**
  28. * 生命周期函数--监听页面显示
  29. */
  30. onShow() {
  31. },
  32. /**
  33. * 生命周期函数--监听页面隐藏
  34. */
  35. onHide() {
  36. },
  37. /**
  38. * 生命周期函数--监听页面卸载
  39. */
  40. onUnload() {
  41. disp.fire("em.chatroom.leave");
  42. },
  43. /**
  44. * 页面相关事件处理函数--监听用户下拉动作
  45. */
  46. onPullDownRefresh() {
  47. wx.showNavigationBarLoading();
  48. this.selectComponent('#groupchat').getMore();
  49. // 停止下拉动作
  50. wx.hideNavigationBarLoading();
  51. wx.stopPullDownRefresh();
  52. },
  53. /**
  54. * 页面上拉触底事件的处理函数
  55. */
  56. onReachBottom() {
  57. },
  58. })