index.js 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. require("../../store/index.js");
  4. const common_assets = require("../../common/assets.js");
  5. const store_modules_system = require("../../store/modules/system.js");
  6. if (!Array) {
  7. const _easycom_up_icon2 = common_vendor.resolveComponent("up-icon");
  8. const _easycom_up_tabs2 = common_vendor.resolveComponent("up-tabs");
  9. const _easycom_up_sticky2 = common_vendor.resolveComponent("up-sticky");
  10. const _easycom_custom_layout2 = common_vendor.resolveComponent("custom-layout");
  11. (_easycom_up_icon2 + _easycom_up_tabs2 + _easycom_up_sticky2 + _easycom_custom_layout2)();
  12. }
  13. const _easycom_up_icon = () => "../../uni_modules/uview-plus/components/u-icon/u-icon.js";
  14. const _easycom_up_tabs = () => "../../uni_modules/uview-plus/components/u-tabs/u-tabs.js";
  15. const _easycom_up_sticky = () => "../../uni_modules/uview-plus/components/u-sticky/u-sticky.js";
  16. const _easycom_custom_layout = () => "../../components/custom-layout/custom-layout.js";
  17. if (!Math) {
  18. (_easycom_up_icon + _easycom_up_tabs + _easycom_up_sticky + _easycom_custom_layout)();
  19. }
  20. const _sfc_main = {
  21. __name: "index",
  22. setup(__props) {
  23. const store = store_modules_system.useSystemStore();
  24. const {
  25. bgColor
  26. } = common_vendor.storeToRefs(store);
  27. const tabs = common_vendor.ref([
  28. {
  29. state: -1,
  30. name: "热门新款"
  31. },
  32. {
  33. state: 1,
  34. name: "简约"
  35. },
  36. {
  37. state: 2,
  38. name: "卡通"
  39. },
  40. {
  41. state: 3,
  42. name: "复古"
  43. },
  44. {
  45. state: 4,
  46. name: "运动"
  47. },
  48. {
  49. state: 5,
  50. name: "艺术"
  51. },
  52. {
  53. state: 6,
  54. name: "运动"
  55. },
  56. {
  57. state: 7,
  58. name: "艺术"
  59. }
  60. ]);
  61. const dataList = common_vendor.ref([{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}]);
  62. const num = common_vendor.ref(1);
  63. const layout = common_vendor.ref();
  64. const onQueryList = (event) => {
  65. const {
  66. pageNo,
  67. pageSize
  68. } = event;
  69. if (pageNo > 1) {
  70. if (num.value < 2) {
  71. num.value++;
  72. layout.value.complete(dataList.value);
  73. } else {
  74. layout.value.complete([]);
  75. }
  76. } else {
  77. num.value = 2;
  78. layout.value.complete(dataList.value);
  79. }
  80. };
  81. const onFortune = () => {
  82. common_vendor.index.navigateTo({
  83. url: "/pages/fortune/index"
  84. });
  85. };
  86. const scrollTop = common_vendor.ref(0);
  87. const onScroll = (event) => {
  88. scrollTop.value = event;
  89. };
  90. return (_ctx, _cache) => {
  91. return {
  92. a: common_vendor.unref(common_assets.qing),
  93. b: common_vendor.p({
  94. ["custom-prefix"]: "iconfont",
  95. name: "icon-icon_aifilter",
  96. size: "30"
  97. }),
  98. c: common_vendor.p({
  99. ["custom-prefix"]: "iconfont",
  100. name: "icon-icon_picture",
  101. size: "30"
  102. }),
  103. d: common_vendor.p({
  104. ["custom-prefix"]: "iconfont",
  105. name: "icon-icon_next",
  106. size: "50rpx"
  107. }),
  108. e: common_vendor.p({
  109. ["custom-prefix"]: "iconfont",
  110. name: "icon-icon_cutout",
  111. color: "red",
  112. size: "30"
  113. }),
  114. f: common_vendor.p({
  115. ["custom-prefix"]: "iconfont",
  116. name: "icon-icon_next",
  117. size: "50rpx"
  118. }),
  119. g: common_vendor.p({
  120. list: tabs.value
  121. }),
  122. h: common_vendor.p({
  123. ["custom-prefix"]: "iconfont",
  124. name: "icon-huoyan",
  125. size: "34rpx",
  126. color: "rgba(237, 100, 100, 1)"
  127. }),
  128. i: common_vendor.p({
  129. name: "arrow-right",
  130. size: "24rpx"
  131. }),
  132. j: common_vendor.o(onFortune),
  133. k: common_vendor.p({
  134. ["offset-top"]: "0",
  135. ["customNav-height"]: "0",
  136. ["bg-color"]: scrollTop.value > 170 ? common_vendor.unref(bgColor) : ""
  137. }),
  138. l: common_vendor.f(dataList.value, (item, index, i0) => {
  139. return {
  140. a: index
  141. };
  142. }),
  143. m: common_vendor.sr(layout, "1cf27b2a-0", {
  144. "k": "layout"
  145. }),
  146. n: common_vendor.o(onQueryList),
  147. o: common_vendor.o(onScroll),
  148. p: common_vendor.o(($event) => dataList.value = $event),
  149. q: common_vendor.p({
  150. showBottom: true,
  151. back: {
  152. show: false,
  153. logoShow: true
  154. },
  155. modelValue: dataList.value
  156. })
  157. };
  158. };
  159. }
  160. };
  161. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-1cf27b2a"]]);
  162. wx.createPage(MiniProgramPage);