order.js 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const sheep_index = require("../../sheep/index.js");
  4. const sheep_util_index = require("../../sheep/util/index.js");
  5. const sheep_api_trade_brokerage = require("../../sheep/api/trade/brokerage.js");
  6. const sheep_hooks_useGoods = require("../../sheep/hooks/useGoods.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_uni_load_more2 = common_vendor.resolveComponent("uni-load-more");
  44. const _easycom_s_layout2 = common_vendor.resolveComponent("s-layout");
  45. (_easycom_su_tabs2 + _easycom_su_sticky2 + _easycom_s_empty2 + _easycom_uni_load_more2 + _easycom_s_layout2)();
  46. }
  47. const _easycom_su_tabs = () => "../../sheep/ui/su-tabs/su-tabs.js";
  48. const _easycom_su_sticky = () => "../../sheep/ui/su-sticky/su-sticky.js";
  49. const _easycom_s_empty = () => "../../sheep/components/s-empty/s-empty.js";
  50. const _easycom_uni_load_more = () => "../../uni_modules/uni-load-more/components/uni-load-more/uni-load-more.js";
  51. const _easycom_s_layout = () => "../../sheep/components/s-layout/s-layout.js";
  52. if (!Math) {
  53. (_easycom_su_tabs + _easycom_su_sticky + _easycom_s_empty + _easycom_uni_load_more + _easycom_s_layout)();
  54. }
  55. const _sfc_main = {
  56. __name: "order",
  57. setup(__props) {
  58. common_vendor.useCssVars((_ctx) => ({
  59. "83224c2e": common_vendor.unref(headerBg)
  60. }));
  61. const statusBarHeight = sheep_index.sheep.$platform.device.statusBarHeight * 2;
  62. const headerBg = sheep_index.sheep.$url.css("/static/img/shop/user/withdraw_bg.png");
  63. common_vendor.onPageScroll((e) => {
  64. state.scrollTop = e.scrollTop <= 100;
  65. });
  66. const state = common_vendor.reactive({
  67. totals: 0,
  68. // 累计推广订单(单)
  69. scrollTop: false,
  70. currentTab: 0,
  71. loadStatus: "",
  72. pagination: {
  73. list: [],
  74. total: 0,
  75. pageNo: 1,
  76. pageSize: 1
  77. }
  78. });
  79. const tabMaps = [
  80. {
  81. name: "全部",
  82. value: "all"
  83. },
  84. {
  85. name: "待结算",
  86. value: "0"
  87. // 待结算
  88. },
  89. {
  90. name: "已结算",
  91. value: "1"
  92. // 已结算
  93. }
  94. ];
  95. function onTabsChange(e) {
  96. sheep_util_index.resetPagination(state.pagination);
  97. state.currentTab = e.index;
  98. getOrderList();
  99. }
  100. async function getOrderList() {
  101. state.loadStatus = "loading";
  102. let { code, data } = await sheep_api_trade_brokerage.BrokerageApi.getBrokerageRecordPage({
  103. pageSize: state.pagination.pageSize,
  104. pageNo: state.pagination.pageSize,
  105. bizType: 1,
  106. // 获得推广佣金
  107. status: state.currentTab > 0 ? state.currentTab : void 0
  108. });
  109. if (code !== 0) {
  110. return;
  111. }
  112. state.pagination.list = common_vendor._.concat(state.pagination.list, data.list);
  113. state.pagination.total = data.total;
  114. state.loadStatus = state.pagination.list.length < state.pagination.total ? "more" : "noMore";
  115. if (state.currentTab === 0) {
  116. state.totals = data.total;
  117. }
  118. }
  119. common_vendor.onLoad(() => {
  120. getOrderList();
  121. });
  122. function loadMore() {
  123. if (state.loadStatus === "noMore") {
  124. return;
  125. }
  126. state.pagination.pageNo++;
  127. getOrderList();
  128. }
  129. common_vendor.onReachBottom(() => {
  130. loadMore();
  131. });
  132. return (_ctx, _cache) => {
  133. return common_vendor.e({
  134. a: common_vendor.t(state.totals),
  135. b: common_vendor.s({
  136. marginTop: "-" + Number(statusBarHeight + 88) + "rpx",
  137. paddingTop: Number(statusBarHeight + 108) + "rpx"
  138. }),
  139. c: common_vendor.o(onTabsChange),
  140. d: common_vendor.p({
  141. list: tabMaps,
  142. scrollable: false,
  143. current: state.currentTab
  144. }),
  145. e: common_vendor.p({
  146. bgColor: "#fff"
  147. }),
  148. f: common_vendor.f(state.pagination.list, (item, k0, i0) => {
  149. return {
  150. a: common_vendor.t(item.bizId),
  151. b: common_vendor.t(item.status === 0 ? "待结算" : item.status === 1 ? "已结算" : "已取消"),
  152. c: common_vendor.t(common_vendor.unref(sheep_hooks_useGoods.fen2yuan)(item.price)),
  153. d: common_vendor.t(item.title),
  154. e: common_vendor.t(common_vendor.unref(sheep_index.sheep).$helper.timeFormat(item.createTime, "yyyy-mm-dd hh:MM:ss")),
  155. f: item
  156. };
  157. }),
  158. g: state.pagination.total === 0
  159. }, state.pagination.total === 0 ? {
  160. h: common_vendor.p({
  161. icon: "/static/order-empty.png",
  162. text: "暂无订单"
  163. })
  164. } : {}, {
  165. i: state.pagination.total > 0
  166. }, state.pagination.total > 0 ? {
  167. j: common_vendor.o(loadMore),
  168. k: common_vendor.p({
  169. status: state.loadStatus,
  170. ["content-text"]: {
  171. contentdown: "上拉加载更多"
  172. }
  173. })
  174. } : {}, {
  175. l: common_vendor.n(state.scrollTop ? "order-warp" : ""),
  176. m: common_vendor.s(_ctx.__cssVars()),
  177. n: common_vendor.p({
  178. title: "分销订单",
  179. navbar: "inner"
  180. })
  181. });
  182. };
  183. }
  184. };
  185. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-3971f30d"], ["__file", "D:/zx/mall-front-app/pages/commission/order.vue"]]);
  186. _sfc_main.__runtimeHooks = 1;
  187. wx.createPage(MiniProgramPage);