"use strict";
const common_vendor = require("../../common/vendor.js");
if (!Array) {
  const _easycom_custom_nav_bar2 = common_vendor.resolveComponent("custom-nav-bar");
  const _easycom_custom_refresher2 = common_vendor.resolveComponent("custom-refresher");
  const _easycom_custom_nomore2 = common_vendor.resolveComponent("custom-nomore");
  const _easycom_z_paging2 = common_vendor.resolveComponent("z-paging");
  (_easycom_custom_nav_bar2 + _easycom_custom_refresher2 + _easycom_custom_nomore2 + _easycom_z_paging2)();
}
const _easycom_custom_nav_bar = () => "./custom-nav-bar.js";
const _easycom_custom_refresher = () => "./custom-refresher.js";
const _easycom_custom_nomore = () => "./custom-nomore.js";
const _easycom_z_paging = () => "../../uni_modules/z-paging/components/z-paging/z-paging.js";
if (!Math) {
  (_easycom_custom_nav_bar + _easycom_custom_refresher + _easycom_custom_nomore + _easycom_z_paging)();
}
const _sfc_main = {
  __name: "custom-layout",
  props: {
    title: {
      type: String,
      default: ""
    },
    titleColor: {
      type: String,
      default: "#000000"
    },
    modelValue: {
      type: Array,
      default: []
    },
    topHeight: {
      type: Number,
      default: 80
    },
    refresheronly: {
      type: Boolean,
      default: false
    },
    refresherEnabled: {
      type: Boolean,
      default: true
    },
    showBottom: {
      type: Boolean,
      default: false
    },
    backgroundColor: {
      type: String,
      default: "linear-gradient(to top right, #CDDC39, #8BC34A, #FFEB3B)"
    },
    // 返回按钮相关配置
    back: {
      type: Object,
      default: function() {
        return {
          // 是否显示返回按钮，默认显示
          show: true
          // 返回按钮的图片地址
          // imgUrl: require('../../static/images/ico_back.png')
        };
      }
    },
    showPageBottom: {
      type: Boolean,
      default: false
    }
  },
  emits: ["update:modelValue", "layoutquery", "refresh", "scroll"],
  setup(__props, { expose: __expose, emit: __emit }) {
    const emit = __emit;
    const props = __props;
    const tableData = common_vendor.computed({
      // 自定义组件内部获取父组件传递的数据
      get: () => props.modelValue ? props.modelValue : [],
      // 数据发生变化时同步修改父组件中的数据
      set: (val) => {
        emit("update:modelValue", val);
      }
    });
    const navbar = common_vendor.ref();
    function onScroll(event) {
      navbar.value.scrollScroll(event.detail.scrollTop);
      emit("scroll", event.detail.scrollTop);
    }
    function onQuery(pageNo, pageSize) {
      emit("layoutquery", {
        pageNo,
        pageSize
      });
    }
    function onRefresh() {
      emit("refresh");
    }
    const paging = common_vendor.ref();
    function complete(list) {
      paging.value.complete(list);
    }
    __expose({
      complete
    });
    return (_ctx, _cache) => {
      return common_vendor.e({
        a: common_vendor.sr(navbar, "1a976688-1,1a976688-0", {
          "k": "navbar"
        }),
        b: common_vendor.p({
          ["background-color"]: __props.backgroundColor,
          back: __props.back,
          backgroundImageShow: true,
          topHeight: __props.topHeight,
          title: __props.title,
          ["title-color"]: __props.titleColor
        }),
        c: __props.showPageBottom
      }, __props.showPageBottom ? {} : {}, {
        d: common_vendor.w(({
          refresherStatus
        }, s0, i0) => {
          return {
            a: "1a976688-2-" + i0 + ",1a976688-0",
            b: common_vendor.p({
              status: refresherStatus
            }),
            c: i0,
            d: s0
          };
        }, {
          name: "refresher",
          path: "d",
          vueId: "1a976688-0"
        }),
        e: common_vendor.sr(paging, "1a976688-0", {
          "k": "paging"
        }),
        f: common_vendor.o(onRefresh),
        g: common_vendor.o(onScroll),
        h: common_vendor.o(onQuery),
        i: common_vendor.o(($event) => tableData.value = $event),
        j: common_vendor.p({
          refresherEnabled: __props.refresherEnabled,
          refresherOnly: __props.refresheronly,
          modelValue: tableData.value
        })
      });
    };
  }
};
wx.createComponent(_sfc_main);
