// pages/channelDetails/channelDetails.js
const {
  pageByDevice
} = require('./../../utils/api.js');
const app = getApp();
Page({

  data: {
    nvabarData: {
      showCapsule: 1, //是否显示左上角图标   1表示显示    0表示不显示
      title: '', //导航栏 中间的标题
    },
    navBarHeight: app.globalData.navBarHeight,
    MenuButtonTop: app.globalData.MenuButtonTop,
    thisChannel: {},
    pageIndex: 1,
    channelList: [],
  },

  onLoad() {
    var that = this;
    wx.getStorage({
      key: "channelDeta",
      success(res) {
        that.setData({
          thisChannel: res.data
        });
        pageByDevice({
          channelId: res.data.channelId,
          pageNum: 1,
          pageSize: 300
        }).then((res) => {
          that.setData({
            channelList: res.records
          })
          wx.removeStorage({
            key: 'channelDeta',
          })
        })
      }
    })
  },

})