order.js 8.0 KB

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