order.js 7.1 KB

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