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

4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
2 weeks ago
4 months ago
  1. "use strict";
  2. const common_vendor = require("../../../common/vendor.js");
  3. const config_api = require("../../../config/api.js");
  4. if (!Array) {
  5. const _easycom_u_loadmore2 = common_vendor.resolveComponent("u-loadmore");
  6. const _easycom_nodata2 = common_vendor.resolveComponent("nodata");
  7. (_easycom_u_loadmore2 + _easycom_nodata2)();
  8. }
  9. const _easycom_u_loadmore = () => "../../../uni_modules/uview-plus/components/u-loadmore/u-loadmore.js";
  10. const _easycom_nodata = () => "../../../components/nodata/nodata.js";
  11. if (!Math) {
  12. (notice + _easycom_u_loadmore + _easycom_nodata)();
  13. }
  14. const notice = () => "../../tabbar/index/comp/notice.js";
  15. const _sfc_main = {
  16. __name: "notice",
  17. setup(__props) {
  18. let status = common_vendor.ref("loading");
  19. let params = common_vendor.ref({
  20. "pageNo": 1,
  21. "pageSize": 30
  22. });
  23. let noticeList = common_vendor.ref([]);
  24. const total = common_vendor.ref(0);
  25. async function getNoticeListFn() {
  26. const { data: res } = await config_api.getNoticeList(params.value);
  27. noticeList.value.push(...res.list);
  28. total.value = res.total;
  29. if (noticeList.value.length >= total.value)
  30. status.value = "nomore";
  31. console.log(res);
  32. }
  33. getNoticeListFn();
  34. async function initList() {
  35. params.value.pageNo = 1;
  36. noticeList.value = [];
  37. await getNoticeListFn();
  38. }
  39. common_vendor.onPullDownRefresh(async () => {
  40. await initList();
  41. common_vendor.index.stopPullDownRefresh();
  42. });
  43. common_vendor.onReachBottom(() => {
  44. if (total.value > noticeList.value.length) {
  45. getNoticeListFn();
  46. }
  47. });
  48. return (_ctx, _cache) => {
  49. return common_vendor.e({
  50. a: common_vendor.p({
  51. list: common_vendor.unref(noticeList)
  52. }),
  53. b: common_vendor.unref(noticeList).length > 0
  54. }, common_vendor.unref(noticeList).length > 0 ? {
  55. c: common_vendor.p({
  56. status: common_vendor.unref(status)
  57. })
  58. } : {}, {
  59. d: !common_vendor.unref(noticeList).length && common_vendor.unref(status) == "nomore"
  60. }, !common_vendor.unref(noticeList).length && common_vendor.unref(status) == "nomore" ? {} : {});
  61. };
  62. }
  63. };
  64. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-f812fd22"]]);
  65. wx.createPage(MiniProgramPage);