list.js 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. "use strict";
  2. const common_vendor = require("../../../common/vendor.js");
  3. const sheep_index = require("../../../sheep/index.js");
  4. const sheep_api_promotion_combination = require("../../../sheep/api/promotion/combination.js");
  5. require("../../../sheep/api/index.js");
  6. require("../../../sheep/api/distri/score.js");
  7. require("../../../sheep/request/index.js");
  8. require("../../../sheep/config/index.js");
  9. require("../../../sheep/store/index.js");
  10. require("../../../sheep/store/app.js");
  11. require("../../../sheep/api/promotion/diy.js");
  12. require("../../../sheep/platform/index.js");
  13. require("../../../sheep/platform/provider/wechat/index.js");
  14. require("../../../sheep/platform/provider/wechat/miniProgram.js");
  15. require("../../../sheep/api/member/auth.js");
  16. require("../../../sheep/api/member/social.js");
  17. require("../../../sheep/api/member/user.js");
  18. require("../../../sheep/platform/provider/apple/index.js");
  19. require("../../../sheep/platform/share.js");
  20. require("../../../sheep/router/index.js");
  21. require("../../../sheep/hooks/useModal.js");
  22. require("../../../sheep/helper/index.js");
  23. require("../../../sheep/helper/test.js");
  24. require("../../../sheep/helper/digit.js");
  25. require("../../../sheep/api/member/signin.js");
  26. require("../../../sheep/helper/throttle.js");
  27. require("../../../sheep/url/index.js");
  28. require("../../../sheep/platform/pay.js");
  29. require("../../../sheep/api/pay/order.js");
  30. require("../../../sheep/store/user.js");
  31. require("../../../sheep/store/cart.js");
  32. require("../../../sheep/api/trade/cart.js");
  33. require("../../../sheep/api/pay/wallet.js");
  34. require("../../../sheep/api/trade/order.js");
  35. require("../../../sheep/api/promotion/coupon.js");
  36. require("../../../sheep/store/sys.js");
  37. require("../../../sheep/store/modal.js");
  38. require("../../../sheep/api/distri/share.js");
  39. require("../../../sheep/api/distri/team.js");
  40. require("../../../sheep/api/infra/file.js");
  41. require("../../../sheep/api/member/address.js");
  42. require("../../../sheep/api/member/point.js");
  43. require("../../../sheep/api/migration/app.js");
  44. require("../../../sheep/api/migration/chat.js");
  45. require("../../../sheep/api/migration/index.js");
  46. require("../../../sheep/api/migration/third.js");
  47. require("../../../sheep/api/pay/channel.js");
  48. require("../../../sheep/api/product/category.js");
  49. require("../../../sheep/api/product/comment.js");
  50. require("../../../sheep/api/product/favorite.js");
  51. require("../../../sheep/api/product/history.js");
  52. require("../../../sheep/api/product/spu.js");
  53. require("../../../sheep/api/promotion/activity.js");
  54. require("../../../sheep/api/promotion/article.js");
  55. require("../../../sheep/api/promotion/bargain.js");
  56. require("../../../sheep/api/promotion/rewardActivity.js");
  57. require("../../../sheep/api/promotion/seckill.js");
  58. require("../../../sheep/api/system/area.js");
  59. require("../../../sheep/api/system/voice.js");
  60. require("../../../sheep/api/trade/afterSale.js");
  61. require("../../../sheep/api/trade/brokerage.js");
  62. require("../../../sheep/api/trade/config.js");
  63. require("../../../sheep/api/trade/delivery.js");
  64. require("../../../sheep/config/zIndex.js");
  65. if (!Array) {
  66. const _easycom_s_goods_column2 = common_vendor.resolveComponent("s-goods-column");
  67. const _easycom_uni_load_more2 = common_vendor.resolveComponent("uni-load-more");
  68. const _easycom_s_layout2 = common_vendor.resolveComponent("s-layout");
  69. (_easycom_s_goods_column2 + _easycom_uni_load_more2 + _easycom_s_layout2)();
  70. }
  71. const _easycom_s_goods_column = () => "../../../sheep/components/s-goods-column/s-goods-column.js";
  72. const _easycom_uni_load_more = () => "../../../uni_modules/uni-load-more/components/uni-load-more/uni-load-more.js";
  73. const _easycom_s_layout = () => "../../../sheep/components/s-layout/s-layout.js";
  74. if (!Math) {
  75. (_easycom_s_goods_column + _easycom_uni_load_more + _easycom_s_layout)();
  76. }
  77. const _sfc_main = {
  78. __name: "list",
  79. setup(__props) {
  80. common_vendor.useCssVars((_ctx) => ({
  81. "958cfdc2": common_vendor.unref(headerBg)
  82. }));
  83. const { safeAreaInsets, safeArea } = sheep_index.sheep.$platform.device;
  84. const sysNavBar = sheep_index.sheep.$platform.navbar;
  85. const statusBarHeight = sheep_index.sheep.$platform.device.statusBarHeight * 2;
  86. const pageHeight = (safeArea.height + safeAreaInsets.bottom) * 2 + statusBarHeight - sysNavBar - 350;
  87. const headerBg = sheep_index.sheep.$url.css("/static/img/shop/goods/groupon-header.png");
  88. const state = common_vendor.reactive({
  89. pagination: {
  90. list: [],
  91. total: 0,
  92. pageNo: 1,
  93. pageSize: 10
  94. },
  95. loadStatus: "",
  96. summaryData: {}
  97. });
  98. const getSummary = async () => {
  99. const { data } = await sheep_api_promotion_combination.CombinationApi.getCombinationRecordSummary();
  100. state.summaryData = data;
  101. };
  102. async function getList() {
  103. state.loadStatus = "loading";
  104. const { data } = await sheep_api_promotion_combination.CombinationApi.getCombinationActivityPage({
  105. pageNo: state.pagination.pageNo,
  106. pageSize: state.pagination.pageSize
  107. });
  108. data.list.forEach((activity) => {
  109. state.pagination.list.push({ ...activity, price: activity.combinationPrice });
  110. });
  111. state.pagination.total = data.total;
  112. state.loadStatus = state.pagination.list.length < state.pagination.total ? "more" : "noMore";
  113. }
  114. function loadMore() {
  115. if (state.loadStatus === "noMore") {
  116. return;
  117. }
  118. state.pagination.pageNo++;
  119. getList();
  120. }
  121. common_vendor.onReachBottom(() => loadMore());
  122. common_vendor.onLoad(() => {
  123. getSummary();
  124. getList();
  125. });
  126. return (_ctx, _cache) => {
  127. return common_vendor.e({
  128. a: common_vendor.s({
  129. marginTop: "-" + Number(statusBarHeight + 88) + "rpx"
  130. }),
  131. b: common_vendor.f(state.summaryData.avatars, (item, index, i0) => {
  132. return common_vendor.e({
  133. a: common_vendor.s(`background-image: url(${item})`),
  134. b: index === 6 && state.summaryData.avatars.length > 3
  135. }, index === 6 && state.summaryData.avatars.length > 3 ? {} : {}, {
  136. c: index,
  137. d: common_vendor.s(index === 6 ? "position: relative" : "position: static")
  138. });
  139. }),
  140. c: common_vendor.t(state.summaryData.userCount || 0),
  141. d: common_vendor.f(state.pagination.list, (item, k0, i0) => {
  142. return {
  143. a: common_vendor.o(($event) => common_vendor.unref(sheep_index.sheep).$router.go("/pages/goods/groupon", {
  144. id: item.id
  145. }), item.id),
  146. b: "628ec892-1-" + i0 + ",628ec892-0",
  147. c: common_vendor.p({
  148. size: "lg",
  149. data: item,
  150. grouponTag: true
  151. }),
  152. d: item.id
  153. };
  154. }),
  155. e: state.pagination.total > 0
  156. }, state.pagination.total > 0 ? {
  157. f: common_vendor.o(loadMore),
  158. g: common_vendor.p({
  159. status: state.loadStatus,
  160. ["content-text"]: {
  161. contentdown: "上拉加载更多"
  162. }
  163. })
  164. } : {}, {
  165. h: pageHeight + "rpx",
  166. i: common_vendor.s(_ctx.__cssVars()),
  167. j: common_vendor.p({
  168. navbar: "inner",
  169. bgStyle: {
  170. color: "#FE832A"
  171. }
  172. })
  173. });
  174. };
  175. }
  176. };
  177. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-628ec892"], ["__file", "D:/zx/mall-front-app/pages/activity/groupon/list.vue"]]);
  178. wx.createPage(MiniProgramPage);