team.js 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. "use strict";
  2. const common_vendor = require("../../../common/vendor.js");
  3. const sheep_index = require("../../../sheep/index.js");
  4. const sheep_api_distri_team = require("../../../sheep/api/distri/team.js");
  5. const sheep_hooks_useGoods = require("../../../sheep/hooks/useGoods.js");
  6. require("../../../sheep/url/index.js");
  7. require("../../../sheep/store/index.js");
  8. require("../../../sheep/store/app.js");
  9. require("../../../sheep/api/promotion/diy.js");
  10. require("../../../sheep/request/index.js");
  11. require("../../../sheep/config/index.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/platform/pay.js");
  28. require("../../../sheep/api/pay/order.js");
  29. require("../../../sheep/store/user.js");
  30. require("../../../sheep/store/cart.js");
  31. require("../../../sheep/api/trade/cart.js");
  32. require("../../../sheep/api/pay/wallet.js");
  33. require("../../../sheep/api/trade/order.js");
  34. require("../../../sheep/api/promotion/coupon.js");
  35. require("../../../sheep/store/sys.js");
  36. require("../../../sheep/store/modal.js");
  37. require("../../../sheep/config/zIndex.js");
  38. require("../../../sheep/util/index.js");
  39. if (!Array) {
  40. const _easycom_s_empty2 = common_vendor.resolveComponent("s-empty");
  41. const _easycom_uni_load_more2 = common_vendor.resolveComponent("uni-load-more");
  42. const _easycom_s_layout2 = common_vendor.resolveComponent("s-layout");
  43. (_easycom_s_empty2 + _easycom_uni_load_more2 + _easycom_s_layout2)();
  44. }
  45. const _easycom_s_empty = () => "../../../sheep/components/s-empty/s-empty.js";
  46. const _easycom_uni_load_more = () => "../../../uni_modules/uni-load-more/components/uni-load-more/uni-load-more.js";
  47. const _easycom_s_layout = () => "../../../sheep/components/s-layout/s-layout.js";
  48. if (!Math) {
  49. (_easycom_s_empty + _easycom_uni_load_more + _easycom_s_layout)();
  50. }
  51. const _sfc_main = {
  52. __name: "team",
  53. setup(__props) {
  54. sheep_index.sheep.$platform.device.statusBarHeight * 2;
  55. common_vendor.computed(() => sheep_index.sheep.$store("user").userInfo);
  56. sheep_index.sheep.$platform.navbar;
  57. const state = common_vendor.reactive({
  58. currentTab: 0,
  59. pagination: {
  60. list: 0,
  61. total: 0,
  62. pageSize: 11,
  63. pageNo: 1
  64. },
  65. loadStatus: "",
  66. descendants: {
  67. total: 0,
  68. list: []
  69. },
  70. teamCount: 0,
  71. ancestor: {}
  72. });
  73. common_vendor.computed(() => {
  74. if (state.date[0] === state.date[1]) {
  75. return state.date[0];
  76. } else {
  77. return state.date.join("~");
  78. }
  79. });
  80. async function getTeam() {
  81. state.loadStatus = "loading";
  82. let {
  83. code,
  84. data
  85. } = await sheep_api_distri_team.TeamApi.getTeam({
  86. pageNo: state.pagination.pageNo,
  87. pageSize: state.pagination.pageSize
  88. });
  89. if (code !== 0) {
  90. return;
  91. }
  92. state.teamCount = data.teamCount;
  93. state.ancestor = data.ancestor;
  94. let descendantsList = common_vendor._.concat(state.descendants.list, data.descendants.list);
  95. state.descendants.list = descendantsList;
  96. state.descendants.total = data.descendants.total;
  97. state.pagination.total = data.descendants.total;
  98. state.loadStatus = state.descendants.list.length < state.descendants.total ? "more" : "noMore";
  99. }
  100. common_vendor.onLoad(() => {
  101. state.today = common_vendor.dayjs().format("YYYY-MM-DD");
  102. state.date = [state.today, state.today];
  103. getTeam();
  104. });
  105. function loadMore() {
  106. if (state.loadStatus === "noMore") {
  107. return;
  108. }
  109. state.pagination.pageNo++;
  110. getTeam();
  111. }
  112. common_vendor.onReachBottom(() => {
  113. loadMore();
  114. });
  115. return (_ctx, _cache) => {
  116. return common_vendor.e({
  117. a: common_vendor.t(state.teamCount),
  118. b: state.ancestor.avatar,
  119. c: common_vendor.t(state.ancestor.username || "昵称:" + state.ancestor.descNickName),
  120. d: common_vendor.t(common_vendor.unref(sheep_hooks_useGoods.points2point)(state.ancestor.residueSocial)),
  121. e: common_vendor.t(state.ancestor.socialStatusLevel || "等级1"),
  122. f: common_vendor.t(state.ancestor.descendantsCount),
  123. g: state.descendants.total > 0
  124. }, state.descendants.total > 0 ? {
  125. h: common_vendor.f(state.descendants.list, (item, index, i0) => {
  126. return {
  127. a: common_vendor.t(item.sort),
  128. b: item.avatar || common_vendor.unref(sheep_index.sheep).$url.static("/static/images/default_avatar.png"),
  129. c: common_vendor.t(item.username || "昵称:" + item.descNickName),
  130. d: common_vendor.t(common_vendor.unref(sheep_hooks_useGoods.points2point)(item.residueSocial)),
  131. e: common_vendor.t(item.socialStatusLevel),
  132. f: common_vendor.t(item.depth == 1 ? "直推人" : ""),
  133. g: common_vendor.t(item.descendantsCount),
  134. h: item.id
  135. };
  136. })
  137. } : {
  138. i: common_vendor.p({
  139. text: "暂无团队成员",
  140. icon: "/static/data-empty.png"
  141. })
  142. }, {
  143. j: common_vendor.o(() => {
  144. }),
  145. k: state.descendants.total > 0
  146. }, state.descendants.total > 0 ? {
  147. l: common_vendor.o(loadMore),
  148. m: common_vendor.p({
  149. status: state.loadStatus,
  150. ["content-text"]: {
  151. contentdown: "点击加载更多"
  152. }
  153. })
  154. } : {}, {
  155. n: common_vendor.p({
  156. bgStyle: {
  157. "backgroundColor": "#ffffff"
  158. },
  159. title: "",
  160. navbar: "normal"
  161. })
  162. });
  163. };
  164. }
  165. };
  166. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-f08f8293"], ["__file", "D:/zx/mall-front-app/pages/user/wallet/team.vue"]]);
  167. wx.createPage(MiniProgramPage);