live.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. // pages/live/live.js
  2. import {
  3. httpCloud
  4. } from "../../utils/httpFunc";
  5. Page({
  6. /**
  7. * 页面的初始数据
  8. */
  9. data: {
  10. isLive: false,
  11. liveData: {},
  12. list: []
  13. },
  14. activity: "",
  15. id: "",
  16. getDate() {
  17. const _this = this;
  18. httpCloud({
  19. name: "server",
  20. type: "getLiveData",
  21. data: {
  22. activityName: _this.activity,
  23. id: _this.id
  24. },
  25. call(res) {
  26. console.log(res)
  27. const obj = res || {};
  28. _this.setData({
  29. liveData: obj
  30. })
  31. wx.setNavigationBarTitle({
  32. title: decodeURIComponent(obj.title)
  33. })
  34. }
  35. })
  36. },
  37. liveing() {
  38. this.setData({
  39. isLive: true
  40. })
  41. },
  42. liveerr() {
  43. this.setData({
  44. isLive: false
  45. })
  46. },
  47. /**
  48. * 生命周期函数--监听页面加载
  49. */
  50. onLoad(options) {
  51. this.activity = options.activityName;
  52. this.id = options.id;
  53. this.getDate();
  54. },
  55. /**
  56. * 生命周期函数--监听页面初次渲染完成
  57. */
  58. onReady() {
  59. },
  60. /**
  61. * 生命周期函数--监听页面显示
  62. */
  63. onShow() {
  64. },
  65. /**
  66. * 生命周期函数--监听页面隐藏
  67. */
  68. onHide() {
  69. },
  70. /**
  71. * 生命周期函数--监听页面卸载
  72. */
  73. onUnload() {
  74. },
  75. /**
  76. * 页面相关事件处理函数--监听用户下拉动作
  77. */
  78. onPullDownRefresh() {
  79. },
  80. /**
  81. * 页面上拉触底事件的处理函数
  82. */
  83. onReachBottom() {
  84. },
  85. /**
  86. * 用户点击右上角分享
  87. */
  88. onShareAppMessage() {
  89. }
  90. })