team.js 7.6 KB

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