index.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. if (!Array) {
  4. const _easycom_u_swiper2 = common_vendor.resolveComponent("u-swiper");
  5. _easycom_u_swiper2();
  6. }
  7. const _easycom_u_swiper = () => "../../node-modules/uview-plus/components/u-swiper/u-swiper.js";
  8. if (!Math) {
  9. _easycom_u_swiper();
  10. }
  11. const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  12. __name: "index",
  13. setup(__props) {
  14. var _a, _b;
  15. (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
  16. (_b = common_vendor.getCurrentInstance()) == null ? void 0 : _b.appContext.config.globalProperties.$config;
  17. const config = common_vendor.ref({ logo: [], file: [] });
  18. const list = common_vendor.ref([]);
  19. const total = common_vendor.ref(0);
  20. const skip = common_vendor.ref(0);
  21. const limit = common_vendor.ref(6);
  22. const page = common_vendor.ref(0);
  23. const is_bottom = common_vendor.ref(false);
  24. common_vendor.ref(0);
  25. common_vendor.onShow(async () => {
  26. await searchConfig();
  27. await clearPage();
  28. await search();
  29. });
  30. common_vendor.onPullDownRefresh(async () => {
  31. await clearPage();
  32. await search();
  33. common_vendor.index.stopPullDownRefresh();
  34. });
  35. const searchConfig = async () => {
  36. config.value = common_vendor.index.getStorageSync("config");
  37. };
  38. const search = async () => {
  39. ({
  40. skip: skip.value,
  41. limit: limit.value,
  42. status: "0"
  43. });
  44. };
  45. const toView = (item) => {
  46. common_vendor.index.navigateTo({
  47. url: `/pagesHome/car/index?id=${item.id || item._id}`
  48. });
  49. };
  50. const toPage = () => {
  51. if (total.value > list.value.length) {
  52. common_vendor.index.showLoading({
  53. title: "加载中",
  54. mask: true
  55. });
  56. page.value = page.value + 1;
  57. skip.value = page.value * limit.value;
  58. search();
  59. common_vendor.index.hideLoading();
  60. } else
  61. is_bottom.value = true;
  62. };
  63. const clearPage = () => {
  64. list.value = [];
  65. skip.value = 0;
  66. limit.value = 6;
  67. page.value = 0;
  68. };
  69. return (_ctx, _cache) => {
  70. return common_vendor.e({
  71. a: common_vendor.p({
  72. list: config.value.file,
  73. height: "240px",
  74. indicator: true,
  75. indicatorMode: "line",
  76. circular: true
  77. }),
  78. b: common_vendor.f(list.value, (item, index, i0) => {
  79. return {
  80. a: item.file && item.file.length > 0 ? item.file[0].url : "",
  81. b: common_vendor.t(item.series || "暂无"),
  82. c: common_vendor.t(item.year || "暂无"),
  83. d: common_vendor.t(item.style || "暂无"),
  84. e: common_vendor.t(item.total_money || "0"),
  85. f: index,
  86. g: common_vendor.o(($event) => toView(item), index)
  87. };
  88. }),
  89. c: is_bottom.value
  90. }, is_bottom.value ? {
  91. d: common_vendor.t(config.value.bottom_title || "没有更多了!")
  92. } : {}, {
  93. e: common_vendor.o(toPage)
  94. });
  95. };
  96. }
  97. });
  98. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-4978fed5"], ["__file", "D:/project/赋强公证/notarization_applet/pages/home/index.vue"]]);
  99. wx.createPage(MiniProgramPage);