live.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. getDate() {
  15. const _this = this;
  16. httpCloud({
  17. name: "server",
  18. type: "getLiveData",
  19. data: {},
  20. call(res) {
  21. const obj = res || {};
  22. _this.setData({
  23. liveData: obj
  24. })
  25. }
  26. })
  27. },
  28. liveing() {
  29. this.setData({
  30. isLive: true
  31. })
  32. },
  33. liveerr() {
  34. this.setData({
  35. isLive: false
  36. })
  37. },
  38. /**
  39. * 生命周期函数--监听页面加载
  40. */
  41. onLoad(options) {
  42. wx.setNavigationBarTitle({
  43. title: decodeURIComponent(options.title || "盛世中华 何以中国")
  44. })
  45. this.getDate();
  46. },
  47. /**
  48. * 生命周期函数--监听页面初次渲染完成
  49. */
  50. onReady() {
  51. },
  52. /**
  53. * 生命周期函数--监听页面显示
  54. */
  55. onShow() {
  56. },
  57. /**
  58. * 生命周期函数--监听页面隐藏
  59. */
  60. onHide() {
  61. },
  62. /**
  63. * 生命周期函数--监听页面卸载
  64. */
  65. onUnload() {
  66. },
  67. /**
  68. * 页面相关事件处理函数--监听用户下拉动作
  69. */
  70. onPullDownRefresh() {
  71. },
  72. /**
  73. * 页面上拉触底事件的处理函数
  74. */
  75. onReachBottom() {
  76. },
  77. /**
  78. * 用户点击右上角分享
  79. */
  80. onShareAppMessage() {
  81. }
  82. })