fortune.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. require("../../store/index.js");
  4. const store_modules_system = require("../../store/modules/system.js");
  5. if (!Array) {
  6. const _easycom_up_tabs2 = common_vendor.resolveComponent("up-tabs");
  7. const _easycom_up_sticky2 = common_vendor.resolveComponent("up-sticky");
  8. const _easycom_custom_layout2 = common_vendor.resolveComponent("custom-layout");
  9. (_easycom_up_tabs2 + _easycom_up_sticky2 + _easycom_custom_layout2)();
  10. }
  11. const _easycom_up_tabs = () => "../../uni_modules/uview-plus/components/u-tabs/u-tabs.js";
  12. const _easycom_up_sticky = () => "../../uni_modules/uview-plus/components/u-sticky/u-sticky.js";
  13. const _easycom_custom_layout = () => "../../components/custom-layout/custom-layout.js";
  14. if (!Math) {
  15. (fortuneInfo + _easycom_up_tabs + _easycom_up_sticky + _easycom_custom_layout)();
  16. }
  17. const fortuneInfo = () => "./components/fortuneInfo.js";
  18. const _sfc_main = {
  19. __name: "fortune",
  20. setup(__props) {
  21. const store = store_modules_system.useSystemStore();
  22. const {
  23. bgColor
  24. } = common_vendor.storeToRefs(store);
  25. common_vendor.ref(1);
  26. const tabs = common_vendor.ref([
  27. {
  28. state: -1,
  29. name: "热门新款"
  30. },
  31. {
  32. state: 1,
  33. name: "简约"
  34. },
  35. {
  36. state: 2,
  37. name: "卡通"
  38. },
  39. {
  40. state: 3,
  41. name: "复古"
  42. },
  43. {
  44. state: 4,
  45. name: "运动"
  46. },
  47. {
  48. state: 5,
  49. name: "艺术"
  50. },
  51. {
  52. state: 6,
  53. name: "节日"
  54. }
  55. ]);
  56. common_vendor.ref(-1);
  57. const dataList = common_vendor.ref([{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}]);
  58. const num = common_vendor.ref(1);
  59. const layout = common_vendor.ref();
  60. const onQueryList = (event) => {
  61. const {
  62. pageNo,
  63. pageSize
  64. } = event;
  65. if (pageNo > 1) {
  66. if (num.value < 2) {
  67. num.value++;
  68. layout.value.complete(dataList.value);
  69. } else {
  70. layout.value.complete([]);
  71. }
  72. } else {
  73. num.value = 2;
  74. layout.value.complete(dataList.value);
  75. }
  76. };
  77. const scrollTop = common_vendor.ref(0);
  78. const onScroll = (event) => {
  79. scrollTop.value = event;
  80. };
  81. common_vendor.onMounted(() => {
  82. });
  83. return (_ctx, _cache) => {
  84. return {
  85. a: common_vendor.o(_ctx.click),
  86. b: common_vendor.p({
  87. list: tabs.value
  88. }),
  89. c: common_vendor.p({
  90. ["offset-top"]: "0",
  91. ["customNav-height"]: "0",
  92. ["bg-color"]: scrollTop.value > 170 ? common_vendor.unref(bgColor) : ""
  93. }),
  94. d: common_vendor.f(dataList.value, (item, index, i0) => {
  95. return {
  96. a: index
  97. };
  98. }),
  99. e: common_vendor.sr(layout, "35adc31d-0", {
  100. "k": "layout"
  101. }),
  102. f: common_vendor.o(onQueryList),
  103. g: common_vendor.o(onScroll),
  104. h: common_vendor.o(($event) => dataList.value = $event),
  105. i: common_vendor.p({
  106. showBottom: true,
  107. title: "启运",
  108. modelValue: dataList.value
  109. })
  110. };
  111. };
  112. }
  113. };
  114. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-35adc31d"]]);
  115. wx.createPage(MiniProgramPage);