You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
2.3 KiB
65 lines
2.3 KiB
"use strict";
|
|
const common_vendor = require("../../../common/vendor.js");
|
|
const config_api = require("../../../config/api.js");
|
|
if (!Array) {
|
|
const _easycom_u_loadmore2 = common_vendor.resolveComponent("u-loadmore");
|
|
const _easycom_nodata2 = common_vendor.resolveComponent("nodata");
|
|
(_easycom_u_loadmore2 + _easycom_nodata2)();
|
|
}
|
|
const _easycom_u_loadmore = () => "../../../uni_modules/uview-plus/components/u-loadmore/u-loadmore.js";
|
|
const _easycom_nodata = () => "../../../components/nodata/nodata.js";
|
|
if (!Math) {
|
|
(notice + _easycom_u_loadmore + _easycom_nodata)();
|
|
}
|
|
const notice = () => "../../tabbar/index/comp/notice.js";
|
|
const _sfc_main = {
|
|
__name: "notice",
|
|
setup(__props) {
|
|
let status = common_vendor.ref("loading");
|
|
let params = common_vendor.ref({
|
|
"pageNo": 1,
|
|
"pageSize": 30
|
|
});
|
|
let noticeList = common_vendor.ref([]);
|
|
const total = common_vendor.ref(0);
|
|
async function getNoticeListFn() {
|
|
const { data: res } = await config_api.getNoticeList(params.value);
|
|
noticeList.value.push(...res.list);
|
|
total.value = res.total;
|
|
if (noticeList.value.length >= total.value)
|
|
status.value = "nomore";
|
|
console.log(res);
|
|
}
|
|
getNoticeListFn();
|
|
async function initList() {
|
|
params.value.pageNo = 1;
|
|
noticeList.value = [];
|
|
await getNoticeListFn();
|
|
}
|
|
common_vendor.onPullDownRefresh(async () => {
|
|
await initList();
|
|
common_vendor.index.stopPullDownRefresh();
|
|
});
|
|
common_vendor.onReachBottom(() => {
|
|
if (total.value > noticeList.value.length) {
|
|
getNoticeListFn();
|
|
}
|
|
});
|
|
return (_ctx, _cache) => {
|
|
return common_vendor.e({
|
|
a: common_vendor.p({
|
|
list: common_vendor.unref(noticeList)
|
|
}),
|
|
b: common_vendor.unref(noticeList).length > 0
|
|
}, common_vendor.unref(noticeList).length > 0 ? {
|
|
c: common_vendor.p({
|
|
status: common_vendor.unref(status)
|
|
})
|
|
} : {}, {
|
|
d: !common_vendor.unref(noticeList).length && common_vendor.unref(status) == "nomore"
|
|
}, !common_vendor.unref(noticeList).length && common_vendor.unref(status) == "nomore" ? {} : {});
|
|
};
|
|
}
|
|
};
|
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-f812fd22"]]);
|
|
wx.createPage(MiniProgramPage);
|