<template>
  <scroll-view
    :scroll-y="true"
    @scrolltolower="lower"
    :enable-back-to-top="true"
    :enable-flex="true"
    style="height: 100%; padding: 10px; padding-bottom: 0px;"
  >
    
  </scroll-view>
</template>

<script>
export default {
  data() {
    return {
      mc: "",
      secondary: "",
      pageTitle: "直播列表",
      page: 1,
      list: [],
      pageCount: 1,
      loading: true,
    };
  },
  onLoad(option) {
    uni.showNavigationBarLoading();
    this.init();
    this.mc = this.$uiConfig.mainColor;
    this.secondary = this.$uiConfig.secondary;
    this.initPage();
    this.init();
  },
  methods: {
    initPage() {
      let currentPages = getCurrentPages();
      let u = "/" + currentPages[currentPages.length - 1].route;
      let pages = uni.getStorageSync("basedata")
        ? uni.getStorageSync("basedata").bar_title
        : [];
      pages.forEach((x) => {
        if (x.value == u) {
          this.pageTitle = x.new_name ? x.new_name : x.name;
        }
      });
      uni.setNavigationBarTitle({
        title: this.pageTitle,
      });
    },
    init() {
      let h = this.apiheader();
      if (page < pageCount) {
        this.request(
          {
            url: "",
            header: h,
            data: {
              r: "api/live/index",
              page: this.page,
            },
          },
          (res) => {
            this.list = res.data.list;
            this.pageCount = 1;
            uni.hideNavigationBarLoading();
          }
        );
      }
    },
  },
};
</script>

<style></style>
