order.js 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. "use strict";
  2. const common_vendor = require("../../../common/vendor.js");
  3. const sheep_index = require("../../../sheep/index.js");
  4. const sheep_hooks_useGoods = require("../../../sheep/hooks/useGoods.js");
  5. const sheep_util_index = require("../../../sheep/util/index.js");
  6. const sheep_api_promotion_combination = require("../../../sheep/api/promotion/combination.js");
  7. require("../../../sheep/api/index.js");
  8. require("../../../sheep/api/distri/score.js");
  9. require("../../../sheep/request/index.js");
  10. require("../../../sheep/config/index.js");
  11. require("../../../sheep/store/index.js");
  12. require("../../../sheep/store/app.js");
  13. require("../../../sheep/api/promotion/diy.js");
  14. require("../../../sheep/platform/index.js");
  15. require("../../../sheep/platform/provider/wechat/index.js");
  16. require("../../../sheep/platform/provider/wechat/miniProgram.js");
  17. require("../../../sheep/api/member/auth.js");
  18. require("../../../sheep/api/member/social.js");
  19. require("../../../sheep/api/member/user.js");
  20. require("../../../sheep/platform/provider/apple/index.js");
  21. require("../../../sheep/platform/share.js");
  22. require("../../../sheep/router/index.js");
  23. require("../../../sheep/hooks/useModal.js");
  24. require("../../../sheep/helper/index.js");
  25. require("../../../sheep/helper/test.js");
  26. require("../../../sheep/helper/digit.js");
  27. require("../../../sheep/api/member/signin.js");
  28. require("../../../sheep/helper/throttle.js");
  29. require("../../../sheep/url/index.js");
  30. require("../../../sheep/platform/pay.js");
  31. require("../../../sheep/api/pay/order.js");
  32. require("../../../sheep/store/user.js");
  33. require("../../../sheep/store/cart.js");
  34. require("../../../sheep/api/trade/cart.js");
  35. require("../../../sheep/api/pay/wallet.js");
  36. require("../../../sheep/api/trade/order.js");
  37. require("../../../sheep/api/promotion/coupon.js");
  38. require("../../../sheep/store/sys.js");
  39. require("../../../sheep/store/modal.js");
  40. require("../../../sheep/api/distri/share.js");
  41. require("../../../sheep/api/distri/team.js");
  42. require("../../../sheep/api/infra/file.js");
  43. require("../../../sheep/api/member/address.js");
  44. require("../../../sheep/api/member/point.js");
  45. require("../../../sheep/api/migration/app.js");
  46. require("../../../sheep/api/migration/chat.js");
  47. require("../../../sheep/api/migration/index.js");
  48. require("../../../sheep/api/migration/third.js");
  49. require("../../../sheep/api/pay/channel.js");
  50. require("../../../sheep/api/product/category.js");
  51. require("../../../sheep/api/product/comment.js");
  52. require("../../../sheep/api/product/favorite.js");
  53. require("../../../sheep/api/product/history.js");
  54. require("../../../sheep/api/product/spu.js");
  55. require("../../../sheep/api/promotion/activity.js");
  56. require("../../../sheep/api/promotion/article.js");
  57. require("../../../sheep/api/promotion/bargain.js");
  58. require("../../../sheep/api/promotion/rewardActivity.js");
  59. require("../../../sheep/api/promotion/seckill.js");
  60. require("../../../sheep/api/system/area.js");
  61. require("../../../sheep/api/system/voice.js");
  62. require("../../../sheep/api/trade/afterSale.js");
  63. require("../../../sheep/api/trade/brokerage.js");
  64. require("../../../sheep/api/trade/config.js");
  65. require("../../../sheep/api/trade/delivery.js");
  66. require("../../../sheep/config/zIndex.js");
  67. if (!Array) {
  68. const _easycom_su_tabs2 = common_vendor.resolveComponent("su-tabs");
  69. const _easycom_su_sticky2 = common_vendor.resolveComponent("su-sticky");
  70. const _easycom_s_empty2 = common_vendor.resolveComponent("s-empty");
  71. const _easycom_s_goods_item2 = common_vendor.resolveComponent("s-goods-item");
  72. const _easycom_uni_load_more2 = common_vendor.resolveComponent("uni-load-more");
  73. const _easycom_s_layout2 = common_vendor.resolveComponent("s-layout");
  74. (_easycom_su_tabs2 + _easycom_su_sticky2 + _easycom_s_empty2 + _easycom_s_goods_item2 + _easycom_uni_load_more2 + _easycom_s_layout2)();
  75. }
  76. const _easycom_su_tabs = () => "../../../sheep/ui/su-tabs/su-tabs.js";
  77. const _easycom_su_sticky = () => "../../../sheep/ui/su-sticky/su-sticky.js";
  78. const _easycom_s_empty = () => "../../../sheep/components/s-empty/s-empty.js";
  79. const _easycom_s_goods_item = () => "../../../sheep/components/s-goods-item/s-goods-item.js";
  80. const _easycom_uni_load_more = () => "../../../uni_modules/uni-load-more/components/uni-load-more/uni-load-more.js";
  81. const _easycom_s_layout = () => "../../../sheep/components/s-layout/s-layout.js";
  82. if (!Math) {
  83. (_easycom_su_tabs + _easycom_su_sticky + _easycom_s_empty + _easycom_s_goods_item + _easycom_uni_load_more + _easycom_s_layout)();
  84. }
  85. const _sfc_main = {
  86. __name: "order",
  87. setup(__props) {
  88. const state = common_vendor.reactive({
  89. currentTab: 0,
  90. pagination: {
  91. list: [],
  92. total: 0,
  93. pageNo: 1,
  94. pageSize: 5
  95. },
  96. loadStatus: "",
  97. deleteOrderId: 0
  98. });
  99. const tabMaps = [
  100. {
  101. name: "全部"
  102. },
  103. {
  104. name: "进行中",
  105. value: 0
  106. },
  107. {
  108. name: "拼团成功",
  109. value: 1
  110. },
  111. {
  112. name: "拼团失败",
  113. value: 2
  114. }
  115. ];
  116. function onTabsChange(e) {
  117. sheep_util_index.resetPagination(state.pagination);
  118. state.currentTab = e.index;
  119. getGrouponList();
  120. }
  121. async function getGrouponList() {
  122. state.loadStatus = "loading";
  123. const { code, data } = await sheep_api_promotion_combination.CombinationApi.getCombinationRecordPage({
  124. pageNo: state.pagination.pageNo,
  125. pageSize: state.pagination.pageSize,
  126. status: tabMaps[state.currentTab].value
  127. });
  128. if (code !== 0) {
  129. return;
  130. }
  131. state.pagination.list = common_vendor._.concat(state.pagination.list, data.list);
  132. state.pagination.total = data.total;
  133. state.loadStatus = state.pagination.list.length < state.pagination.total ? "more" : "noMore";
  134. }
  135. common_vendor.onLoad((options) => {
  136. if (options.type) {
  137. state.currentTab = options.type;
  138. }
  139. getGrouponList();
  140. });
  141. function loadMore() {
  142. if (state.loadStatus === "noMore") {
  143. return;
  144. }
  145. state.pagination.pageNo++;
  146. getGrouponList();
  147. }
  148. common_vendor.onReachBottom(() => {
  149. loadMore();
  150. });
  151. common_vendor.onPullDownRefresh(() => {
  152. getGrouponList();
  153. setTimeout(function() {
  154. common_vendor.index.stopPullDownRefresh();
  155. }, 800);
  156. });
  157. return (_ctx, _cache) => {
  158. return common_vendor.e({
  159. a: common_vendor.o(onTabsChange),
  160. b: common_vendor.p({
  161. list: tabMaps,
  162. scrollable: false,
  163. current: state.currentTab
  164. }),
  165. c: common_vendor.p({
  166. bgColor: "#fff"
  167. }),
  168. d: state.pagination.total === 0
  169. }, state.pagination.total === 0 ? {
  170. e: common_vendor.p({
  171. icon: "/static/goods-empty.png"
  172. })
  173. } : {}, {
  174. f: state.pagination.total > 0
  175. }, state.pagination.total > 0 ? {
  176. g: common_vendor.f(state.pagination.list, (record, k0, i0) => {
  177. return {
  178. a: common_vendor.t(record.id),
  179. b: common_vendor.t(tabMaps.find((item) => item.value === record.status).name),
  180. c: common_vendor.n(common_vendor.unref(sheep_hooks_useGoods.formatOrderColor)(record)),
  181. d: common_vendor.t(record.userSize),
  182. e: "5be50f68-4-" + i0 + ",5be50f68-0",
  183. f: common_vendor.p({
  184. img: record.picUrl,
  185. title: record.spuName,
  186. price: record.combinationPrice
  187. }),
  188. g: common_vendor.o(($event) => common_vendor.unref(sheep_index.sheep).$router.go("/pages/order/detail", {
  189. id: record.orderId
  190. }), record.id),
  191. h: common_vendor.t(record.status === 0 ? "邀请拼团" : "拼团详情"),
  192. i: record.status === 0 ? 1 : "",
  193. j: common_vendor.o(($event) => common_vendor.unref(sheep_index.sheep).$router.go("/pages/activity/groupon/detail", {
  194. id: record.id
  195. }), record.id),
  196. k: record.id
  197. };
  198. })
  199. } : {}, {
  200. h: state.pagination.total > 0
  201. }, state.pagination.total > 0 ? {
  202. i: common_vendor.o(loadMore),
  203. j: common_vendor.p({
  204. status: state.loadStatus,
  205. ["content-text"]: {
  206. contentdown: "上拉加载更多"
  207. }
  208. })
  209. } : {}, {
  210. k: common_vendor.p({
  211. title: "我的拼团"
  212. })
  213. });
  214. };
  215. }
  216. };
  217. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-5be50f68"], ["__file", "D:/zx/mall-front-app/pages/activity/groupon/order.vue"]]);
  218. wx.createPage(MiniProgramPage);