index.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. import {
  2. ApiModel
  3. } from "../../../utils/api";
  4. const _Http = new ApiModel();
  5. Page({
  6. options:{
  7. addGlobalClass: true,
  8. },
  9. /**
  10. * 页面的初始数据
  11. */
  12. data: {
  13. tiveList: [], //直播列表
  14. },
  15. /**
  16. * 生命周期函数--监听页面加载
  17. */
  18. onLoad(options) {
  19. //获取直播列表
  20. _Http.basic({
  21. "classname": "publicmethod.live.live",
  22. "method": "getHomeLive",
  23. "content": {
  24. "getdatafromdbanyway": true,
  25. "livestatus": ""
  26. }
  27. }, false).then(res => {
  28. console.log("直播列表", res)
  29. if (res.msg != '成功') {
  30. wx.showToast({
  31. title: res.data,
  32. icon: "none"
  33. });
  34. } else {
  35. this.setData({
  36. tiveList: res.data
  37. })
  38. }
  39. })
  40. },
  41. /**
  42. * 生命周期函数--监听页面初次渲染完成
  43. */
  44. onReady() {
  45. },
  46. /**
  47. * 生命周期函数--监听页面显示
  48. */
  49. onShow() {
  50. this.getTabBar().init();
  51. },
  52. /**
  53. * 生命周期函数--监听页面隐藏
  54. */
  55. onHide() {
  56. },
  57. /**
  58. * 生命周期函数--监听页面卸载
  59. */
  60. onUnload() {
  61. },
  62. /**
  63. * 页面相关事件处理函数--监听用户下拉动作
  64. */
  65. onPullDownRefresh() {
  66. },
  67. /**
  68. * 页面上拉触底事件的处理函数
  69. */
  70. onReachBottom() {
  71. },
  72. /**
  73. * 用户点击右上角分享
  74. */
  75. onShareAppMessage() {
  76. }
  77. })