2025-08-29 09:51:02 +08:00
|
|
|
"use strict";
|
|
|
|
|
const common_vendor = require("../../vendor.js");
|
|
|
|
|
if (!Array) {
|
|
|
|
|
const _easycom_hs_empty2 = common_vendor.resolveComponent("hs-empty");
|
|
|
|
|
const _easycom_u_loading_icon2 = common_vendor.resolveComponent("u-loading-icon");
|
|
|
|
|
(_easycom_hs_empty2 + _easycom_u_loading_icon2)();
|
|
|
|
|
}
|
|
|
|
|
const _easycom_hs_empty = () => "../../../components/hs-empty/hs-empty.js";
|
|
|
|
|
const _easycom_u_loading_icon = () => "../../../node-modules/uview-plus/components/u-loading-icon/u-loading-icon.js";
|
|
|
|
|
if (!Math) {
|
|
|
|
|
(_easycom_hs_empty + _easycom_u_loading_icon)();
|
|
|
|
|
}
|
|
|
|
|
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
|
|
|
__name: "cc-scroll-loading",
|
|
|
|
|
props: {
|
|
|
|
|
meta: {
|
|
|
|
|
type: Object,
|
|
|
|
|
default: {}
|
|
|
|
|
// 参数
|
|
|
|
|
},
|
|
|
|
|
showLoad: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
default: true
|
|
|
|
|
// 是否显示加载状态
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
emits: ["load"],
|
|
|
|
|
setup(__props, { emit }) {
|
|
|
|
|
const props = __props;
|
|
|
|
|
const loadingStatusTest = common_vendor.ref("");
|
|
|
|
|
const loadingStatus = common_vendor.ref(false);
|
|
|
|
|
const params = common_vendor.ref({
|
|
|
|
|
page: 1,
|
|
|
|
|
perPage: 20
|
|
|
|
|
});
|
|
|
|
|
common_vendor.watch(
|
|
|
|
|
() => props == null ? void 0 : props.meta,
|
|
|
|
|
() => {
|
|
|
|
|
const { current_page, last_page } = props.meta;
|
|
|
|
|
const hasNextPage = current_page < last_page;
|
|
|
|
|
loadingStatus.value = hasNextPage;
|
|
|
|
|
loadingStatusTest.value = hasNextPage ? "上拉加载更多" : "已经到底啦~";
|
|
|
|
|
console.log(props == null ? void 0 : props.meta, "meta数据变化");
|
|
|
|
|
}
|
|
|
|
|
);
|
2025-10-29 13:53:05 +08:00
|
|
|
common_vendor.onMounted(() => {
|
|
|
|
|
const { current_page, last_page } = props.meta;
|
|
|
|
|
const hasNextPage = current_page < last_page;
|
|
|
|
|
loadingStatus.value = hasNextPage;
|
|
|
|
|
loadingStatusTest.value = hasNextPage ? "上拉加载更多" : "已经到底啦~";
|
|
|
|
|
});
|
2025-08-29 09:51:02 +08:00
|
|
|
const handleLoad = () => {
|
|
|
|
|
const { current_page, last_page } = props.meta;
|
|
|
|
|
const hasNextPage = current_page < last_page;
|
|
|
|
|
loadingStatus.value = hasNextPage;
|
|
|
|
|
loadingStatusTest.value = hasNextPage ? "上拉加载更多" : "已经到底啦~";
|
|
|
|
|
if (hasNextPage) {
|
|
|
|
|
params.value.page = current_page + 1;
|
|
|
|
|
emit("load", params.value);
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
loadingStatus.value = false;
|
|
|
|
|
loadingStatusTest.value = "";
|
|
|
|
|
}, 1e3);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
common_vendor.onReachBottom(handleLoad);
|
|
|
|
|
return (_ctx, _cache) => {
|
|
|
|
|
var _a, _b;
|
|
|
|
|
return common_vendor.e({
|
|
|
|
|
a: !((_a = props.meta) == null ? void 0 : _a.total)
|
2025-10-29 13:53:05 +08:00
|
|
|
}, !((_b = props.meta) == null ? void 0 : _b.total) ? {
|
2025-08-29 09:51:02 +08:00
|
|
|
b: common_vendor.p({
|
2025-10-29 13:53:05 +08:00
|
|
|
height: "30vh"
|
|
|
|
|
})
|
|
|
|
|
} : common_vendor.e({
|
|
|
|
|
c: common_vendor.p({
|
2025-08-29 09:51:02 +08:00
|
|
|
text: loadingStatusTest.value,
|
|
|
|
|
mode: "circle",
|
|
|
|
|
size: "30rpx",
|
|
|
|
|
show: loadingStatus.value
|
|
|
|
|
}),
|
2025-10-29 13:53:05 +08:00
|
|
|
d: !loadingStatus.value
|
2025-08-29 09:51:02 +08:00
|
|
|
}, !loadingStatus.value ? {
|
2025-10-29 13:53:05 +08:00
|
|
|
e: common_vendor.t(loadingStatusTest.value)
|
2025-08-29 09:51:02 +08:00
|
|
|
} : {}));
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-60d51fde"], ["__file", "/Users/zsq/Sources/github/2025property-pay/pay-customer/src/common/components/cc-scroll-loading/cc-scroll-loading.vue"]]);
|
|
|
|
|
wx.createComponent(Component);
|