team.js 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const sheep_index = require("../../sheep/index.js");
  4. const sheep_api_trade_brokerage = require("../../sheep/api/trade/brokerage.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/combination.js");
  57. require("../../sheep/api/promotion/rewardActivity.js");
  58. require("../../sheep/api/promotion/seckill.js");
  59. require("../../sheep/api/system/area.js");
  60. require("../../sheep/api/system/voice.js");
  61. require("../../sheep/api/trade/afterSale.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_layout2 = common_vendor.resolveComponent("s-layout");
  67. _easycom_s_layout2();
  68. }
  69. const _easycom_s_layout = () => "../../sheep/components/s-layout/s-layout.js";
  70. if (!Math) {
  71. _easycom_s_layout();
  72. }
  73. const _sfc_main = {
  74. __name: "team",
  75. setup(__props) {
  76. common_vendor.useCssVars((_ctx) => ({
  77. "768616fe": common_vendor.unref(headerBg)
  78. }));
  79. sheep_index.sheep.$platform.device.statusBarHeight * 2;
  80. common_vendor.computed(() => sheep_index.sheep.$store("user").userInfo);
  81. const headerBg = sheep_index.sheep.$url.css("/static/img/shop/user/withdraw_bg.png");
  82. common_vendor.onPageScroll((e) => {
  83. state.scrollTop = e.scrollTop <= 100;
  84. });
  85. let sort = common_vendor.ref();
  86. const state = common_vendor.reactive({
  87. summary: {},
  88. pagination: {
  89. pageNo: 1,
  90. pageSize: 8,
  91. list: [],
  92. total: 0
  93. },
  94. loadStatus: "",
  95. // ↓ 新 ui 逻辑
  96. level: 1,
  97. nickname: common_vendor.ref(""),
  98. sortKey: "",
  99. isAsc: ""
  100. });
  101. function submitForm() {
  102. state.pagination.list = [];
  103. getTeamList();
  104. }
  105. async function getTeamList() {
  106. state.loadStatus = "loading";
  107. let { code, data } = await sheep_api_trade_brokerage.BrokerageApi.getBrokerageUserChildSummaryPage({
  108. pageNo: state.pagination.pageNo,
  109. pageSize: state.pagination.pageSize,
  110. level: state.level,
  111. "sortingField.order": state.isAsc,
  112. "sortingField.field": state.sortKey,
  113. nickname: state.nickname
  114. });
  115. if (code !== 0) {
  116. return;
  117. }
  118. state.pagination.list = common_vendor._.concat(state.pagination.list, data.list);
  119. state.pagination.total = data.total;
  120. state.loadStatus = state.pagination.list.length < state.pagination.total ? "more" : "noMore";
  121. }
  122. function setType(e) {
  123. state.pagination.list = [];
  124. state.level = e + "";
  125. getTeamList();
  126. }
  127. function setSort(sortKey, isAsc) {
  128. state.pagination.list = [];
  129. sort = sortKey + isAsc.toUpperCase();
  130. state.isAsc = isAsc;
  131. state.sortKey = sortKey;
  132. getTeamList();
  133. }
  134. common_vendor.onLoad(async () => {
  135. await getTeamList();
  136. let { data } = await sheep_api_trade_brokerage.BrokerageApi.getBrokerageUserSummary();
  137. state.summary = data;
  138. });
  139. function loadMore() {
  140. if (state.loadStatus === "noMore") {
  141. return;
  142. }
  143. state.pagination.pageNo++;
  144. getTeamList();
  145. }
  146. common_vendor.onReachBottom(() => {
  147. loadMore();
  148. });
  149. return (_ctx, _cache) => {
  150. return common_vendor.e({
  151. a: common_vendor.t(state.summary.firstBrokerageUserCount + state.summary.secondBrokerageUserCount || 0),
  152. b: common_vendor.t(state.summary.firstBrokerageUserCount || 0),
  153. c: common_vendor.n(state.level == 1 ? "item on" : "item"),
  154. d: common_vendor.o(($event) => setType(1)),
  155. e: common_vendor.t(state.summary.secondBrokerageUserCount || 0),
  156. f: common_vendor.n(state.level == 2 ? "item on" : "item"),
  157. g: common_vendor.o(($event) => setType(2)),
  158. h: common_vendor.o(submitForm),
  159. i: state.nickname,
  160. j: common_vendor.o(($event) => state.nickname = $event.detail.value),
  161. k: common_vendor.o(submitForm),
  162. l: common_vendor.unref(sort) === "userCountDESC"
  163. }, common_vendor.unref(sort) === "userCountDESC" ? {
  164. m: common_vendor.o(($event) => setSort("userCount", "asc"))
  165. } : common_vendor.unref(sort) === "userCountASC" ? {
  166. o: common_vendor.o(($event) => setSort("userCount", "desc"))
  167. } : {
  168. p: common_vendor.o(($event) => setSort("userCount", "desc"))
  169. }, {
  170. n: common_vendor.unref(sort) === "userCountASC",
  171. q: common_vendor.unref(sort) === "priceDESC"
  172. }, common_vendor.unref(sort) === "priceDESC" ? {
  173. r: common_vendor.o(($event) => setSort("price", "asc"))
  174. } : common_vendor.unref(sort) === "priceASC" ? {
  175. t: common_vendor.o(($event) => setSort("price", "desc"))
  176. } : {
  177. v: common_vendor.o(($event) => setSort("price", "desc"))
  178. }, {
  179. s: common_vendor.unref(sort) === "priceASC",
  180. w: common_vendor.unref(sort) === "orderCountDESC"
  181. }, common_vendor.unref(sort) === "orderCountDESC" ? {
  182. x: common_vendor.o(($event) => setSort("orderCount", "asc"))
  183. } : common_vendor.unref(sort) === "orderCountASC" ? {
  184. z: common_vendor.o(($event) => setSort("orderCount", "desc"))
  185. } : {
  186. A: common_vendor.o(($event) => setSort("orderCount", "desc"))
  187. }, {
  188. y: common_vendor.unref(sort) === "orderCountASC",
  189. B: common_vendor.f(state.pagination.list, (item, index, i0) => {
  190. return {
  191. a: item.avatar,
  192. b: common_vendor.t(item.nickname),
  193. c: common_vendor.t(common_vendor.unref(sheep_index.sheep).$helper.timeFormat(item.brokerageTime, "yyyy-mm-dd hh:MM:ss")),
  194. d: common_vendor.t(item.brokerageUserCount || 0),
  195. e: common_vendor.t(item.orderCount || 0),
  196. f: common_vendor.t(item.brokeragePrice || 0),
  197. g: index
  198. };
  199. }),
  200. C: state.pagination.list.length === 0
  201. }, state.pagination.list.length === 0 ? {} : {}, {
  202. D: common_vendor.n(state.scrollTop ? "team-wrap" : ""),
  203. E: common_vendor.s(_ctx.__cssVars()),
  204. F: common_vendor.p({
  205. title: "我的团队",
  206. navbar: "inner"
  207. })
  208. });
  209. };
  210. }
  211. };
  212. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-42603af6"], ["__file", "D:/zx/mall-front-app/pages/commission/team.vue"]]);
  213. _sfc_main.__runtimeHooks = 1;
  214. wx.createPage(MiniProgramPage);