Files
PC-202306242200\Administrator dac42e3b0c first commit
2026-03-28 23:09:02 +08:00

128 lines
4.1 KiB
JavaScript

"use strict";
const common_vendor = require("../../common/vendor.js");
require("../../store/index.js");
const api_api = require("../../api/api.js");
require("../../uni_modules/uview-plus/index.js");
if (!Array) {
const _easycom_up_subsection2 = common_vendor.resolveComponent("up-subsection");
const _easycom_u__image2 = common_vendor.resolveComponent("u--image");
const _easycom_up_divider2 = common_vendor.resolveComponent("up-divider");
const _easycom_z_paging2 = common_vendor.resolveComponent("z-paging");
(_easycom_up_subsection2 + _easycom_u__image2 + _easycom_up_divider2 + _easycom_z_paging2)();
}
const _easycom_up_subsection = () => "../../uni_modules/uview-plus/components/u-subsection/u-subsection.js";
const _easycom_u__image = () => "../../uni_modules/uview-plus/components/u--image/u--image.js";
const _easycom_up_divider = () => "../../uni_modules/uview-plus/components/u-divider/u-divider.js";
const _easycom_z_paging = () => "../../uni_modules/z-paging/components/z-paging/z-paging.js";
if (!Math) {
(_easycom_up_subsection + _easycom_u__image + _easycom_up_divider + _easycom_z_paging)();
}
const _sfc_main = {
__name: "shareList",
setup(__props) {
const paging = common_vendor.ref(null);
let dataList = common_vendor.ref([]);
let total = common_vendor.ref(0);
let dataFrom = common_vendor.reactive({
type: 1
});
const list = common_vendor.ref([
{
name: "直推",
id: 1
},
{
name: "间推",
id: 2
}
]);
let toNav = (e) => {
common_vendor.index.navigateTo({
url: "./detail?id=" + e.id
});
};
let isPagingRefNotFound = () => {
return !paging.value;
};
common_vendor.onPullDownRefresh(() => {
if (isPagingRefNotFound())
return;
paging.value.reload().catch(() => {
});
});
common_vendor.onPageScroll((e) => {
if (isPagingRefNotFound())
return;
paging.value.updatePageScrollTop(e.scrollTop);
e.scrollTop < 10 && paging.value.doChatRecordLoadMore();
});
common_vendor.onReachBottom(() => {
if (isPagingRefNotFound())
return;
paging.value.pageReachBottom();
});
const queryList = (pageNo, pageSize) => {
common_vendor.index.getStorageSync("user");
const params = {
current: pageNo,
pageSize,
...dataFrom
};
api_api.shareList(params).then((res) => {
paging.value.complete(res.records);
total.value = res.total;
}).catch((res) => {
paging.value.complete(false);
});
};
const current = common_vendor.ref(0);
const upChange = (e) => {
current.value = e;
dataFrom.type = list.value[e].id;
paging.value.reload();
};
return (_ctx, _cache) => {
return {
a: common_vendor.o(upChange),
b: common_vendor.p({
list: list.value,
keyName: "name",
current: current.value
}),
c: common_vendor.t(common_vendor.unref(total)),
d: common_vendor.f(common_vendor.unref(dataList), (item, index, i0) => {
return {
a: "0fb9a866-2-" + i0 + ",0fb9a866-0",
b: common_vendor.p({
width: "100rpx",
height: "100rpx",
src: item.avatar,
shape: "circle"
}),
c: common_vendor.t(item.nickName),
d: common_vendor.t(item.userName),
e: "0fb9a866-3-" + i0 + ",0fb9a866-0",
f: common_vendor.t(item.phone),
g: common_vendor.t(item.level),
h: common_vendor.t(item.createTime),
i: index,
j: common_vendor.o(($event) => common_vendor.unref(toNav)(item))
};
}),
e: () => ({
r: paging,
k: "paging"
}),
f: common_vendor.o(queryList),
g: common_vendor.o(($event) => common_vendor.isRef(dataList) ? dataList.value = $event : dataList = $event),
h: common_vendor.p({
["use-page-scroll"]: true,
modelValue: common_vendor.unref(dataList)
})
};
};
}
};
_sfc_main.__runtimeHooks = 1;
my.createPage(_sfc_main);