index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614
  1. <template>
  2. <view :style="colorStyle">
  3. <view class="acea-row nav">
  4. <view
  5. class="acea-row row-center-wrapper"
  6. :class="{ on: nav === 1 }"
  7. @click="navTab(1)"
  8. >团队人数
  9. </view>
  10. <view
  11. class="acea-row row-center-wrapper"
  12. :class="{ on: nav === 2 }"
  13. @click="navTab(2)"
  14. >直荐人数
  15. </view>
  16. <view
  17. class="acea-row row-center-wrapper"
  18. :class="{ on: nav === 3 }"
  19. @click="navTab(3)"
  20. >创客人数
  21. </view>
  22. </view>
  23. <view class="main-body">
  24. <view class="number_of_members" v-show="nav === 1">
  25. <!-- <view class="members_top">
  26. <text class="integral">0.0积分</text>
  27. <text class="explain">团队收益</text>
  28. </view> -->
  29. <view class="members_list">
  30. <view
  31. class="item acea-row row-between-wrapper"
  32. v-for="(item, index) in orderList"
  33. :key="index"
  34. >
  35. <view class="text-info">
  36. {{ item.createTime }}
  37. </view>
  38. <view class="left">
  39. <view class="state">
  40. <view class="order">{{ index + 1 }}</view>
  41. <img :src="item.avatar" alt="" />
  42. <view class="s-r">
  43. <text>
  44. {{ item.name }}
  45. </text>
  46. </view>
  47. <view class="op-area">
  48. <u-button type="primary" shape="circle"> 联系他 </u-button>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. <view class="direct_of_push" v-show="nav === 2">
  56. <!-- <view class="push_top">
  57. <text class="integral">0.0积分</text>
  58. <text class="explain">直推收益</text>
  59. </view> -->
  60. <view class="pus_list">
  61. <view
  62. class="item acea-row row-between-wrapper"
  63. v-for="(item, index) in integralList"
  64. :key="index"
  65. >
  66. <view class="text-info">
  67. {{ item.createTime }}
  68. </view>
  69. <view class="left">
  70. <view class="state">
  71. <view class="order">{{ index + 1 }}</view>
  72. <img :src="item.avatar" alt="" />
  73. <view class="s-r">
  74. <text>
  75. {{ item.name }}
  76. </text>
  77. </view>
  78. <view class="op-area">
  79. <u-button type="primary" shape="circle"> 联系他 </u-button>
  80. </view>
  81. </view>
  82. </view>
  83. </view>
  84. </view>
  85. </view>
  86. <view class="mark_of_members" v-show="nav === 3">
  87. <!-- <view class="mark_top">
  88. <text class="integral">0.0积分</text>
  89. <text class="explain">直推收益</text>
  90. </view> -->
  91. <view class="mark_list">
  92. <view
  93. class="item acea-row row-between-wrapper"
  94. v-for="(item, index) in makerList"
  95. :key="index"
  96. >
  97. <view class="text-info">
  98. {{ item.createTime }}
  99. </view>
  100. <view class="left">
  101. <view class="state">
  102. <view class="order">{{ index + 1 }}</view>
  103. <img :src="item.avatar" alt="" />
  104. <view class="s-r">
  105. <text>
  106. {{ item.name }}
  107. </text>
  108. </view>
  109. <view class="op-area">
  110. <u-button type="primary" shape="circle"> 联系他 </u-button>
  111. </view>
  112. </view>
  113. </view>
  114. </view>
  115. </view>
  116. </view>
  117. </view>
  118. </view>
  119. </template>
  120. <script>
  121. import {
  122. userRecomPage,
  123. makerPage
  124. } from '@/api/home.js';
  125. import dayjs from '@/plugin/dayjs/dayjs.min.js';
  126. import {
  127. toLogin
  128. } from '@/libs/login.js';
  129. import {
  130. mapGetters
  131. } from "vuex";
  132. // #ifdef MP
  133. import authorize from '@/components/Authorize';
  134. // #endif
  135. import emptyPage from '@/components/emptyPage.vue';
  136. import colors from '@/mixins/color'
  137. export default {
  138. components: {
  139. // #ifdef MP
  140. authorize,
  141. // #endif
  142. emptyPage
  143. },
  144. filters: {
  145. dateFormat: function (value) {
  146. return dayjs(value * 1000).format('YYYY-MM-DD');
  147. }
  148. },
  149. mixins: [colors],
  150. data () {
  151. return {
  152. nav: 1, // 1:发票记录 2:抬头管理
  153. current: 0,
  154. page: 1,
  155. limit: 10,
  156. integralList: [],
  157. userInfo: {},
  158. loadend: false,
  159. loading: false,
  160. loadTitle: this.$t(`加载更多`),
  161. isAuto: false, //没有授权的不会自动授权
  162. isShowAuth: false, //是否隐藏授权
  163. orderList: [],
  164. makerList: [],
  165. invoiceList: [],
  166. isTime: 0
  167. };
  168. },
  169. computed: mapGetters(['isLogin']),
  170. watch: {
  171. nav: {
  172. immediate: true,
  173. handler (value) {
  174. this.page = 1;
  175. switch (value) {
  176. case 1:
  177. this.orderList = [];
  178. this.getOrderList();
  179. break;
  180. case 2:
  181. this.invoiceList = [];
  182. this.getIntegralList();
  183. break;
  184. case 3:
  185. this.makerList = [];
  186. this.getMakerPage();
  187. break;
  188. }
  189. }
  190. },
  191. isLogin: {
  192. handler: function (newV, oldV) {
  193. if (newV) {
  194. // this.getUserInfo();
  195. // this.userRecomPage();
  196. }
  197. },
  198. deep: true
  199. }
  200. },
  201. onLoad () {
  202. if (this.isLogin) {
  203. // this.getUserInfo();
  204. // this.getIntegralList();
  205. } else {
  206. toLogin();
  207. }
  208. },
  209. /**
  210. * 页面上拉触底事件的处理函数
  211. */
  212. onReachBottom: function () {
  213. },
  214. methods: {
  215. // 菜单切换
  216. navTab (nav) {
  217. if (this.nav !== nav) {
  218. this.nav = nav;
  219. }
  220. },
  221. /**
  222. * 授权回调
  223. */
  224. onLoadFun: function () {
  225. this.getUserInfo();
  226. },
  227. // 授权关闭
  228. authColse: function (e) {
  229. this.isShowAuth = e
  230. },
  231. /**
  232. * 获取积分明细
  233. */
  234. getOrderList: function () {
  235. let that = this;
  236. if (that.loading) return;
  237. // if (that.loadend) return;
  238. that.loading = true;
  239. that.loadTitle = '';
  240. userRecomPage({
  241. type: 1,
  242. userId: this.$store.state.app.uid,
  243. current: that.page,
  244. size: that.limit
  245. }).then(function (res) {
  246. let list = res.data,
  247. loadend = list.length < that.limit;
  248. that.$set(that, 'orderList', list);
  249. that.page = that.page + 1;
  250. that.loading = false;
  251. that.loadend = loadend;
  252. that.loadTitle = loadend ? that.$t(`我也是有底线的`) : that.$t(`加载更多`);
  253. }, function (res) {
  254. this.loading = false;
  255. that.loadTitle = that.$t(`加载更多`);
  256. });
  257. },
  258. getIntegralList: function () {
  259. let that = this;
  260. if (that.loading) return;
  261. // if (that.loadend) return;
  262. that.loading = true;
  263. that.loadTitle = '';
  264. userRecomPage({
  265. type: 2,
  266. userId: this.$store.state.app.uid,
  267. current: that.page,
  268. size: that.limit
  269. }).then(function (res) {
  270. let list = res.data,
  271. loadend = list.length < that.limit;
  272. // that.integralList = that.$util.SplitArray(list, that.integralList);
  273. that.$set(that, 'integralList', list);
  274. that.page = that.page + 1;
  275. that.loading = false;
  276. that.loadend = loadend;
  277. that.loadTitle = loadend ? that.$t(`我也是有底线的`) : that.$t(`加载更多`);
  278. }, function (res) {
  279. this.loading = false;
  280. that.loadTitle = that.$t(`加载更多`);
  281. });
  282. },
  283. getMakerPage: function () {
  284. let that = this;
  285. console.log(that.loading,that.loadend);
  286. if (that.loading) return;
  287. // if (that.loadend) return;
  288. that.loading = true;
  289. that.loadTitle = '';
  290. makerPage({
  291. userId: this.$store.state.app.uid,
  292. current: that.page,
  293. size: that.limit
  294. }).then(function (res) {
  295. let list = res.data,
  296. loadend = list.length < that.limit;
  297. // that.makerList = that.$util.SplitArray(list, that.makerList);
  298. that.$set(that, 'makerList', list);
  299. that.page = that.page + 1;
  300. that.loading = false;
  301. that.loadend = loadend;
  302. that.loadTitle = loadend ? that.$t(`我也是有底线的`) : that.$t(`加载更多`);
  303. }, function (res) {
  304. this.loading = false;
  305. that.loadTitle = that.$t(`加载更多`);
  306. });
  307. },
  308. nav: function (current) {
  309. this.current = current;
  310. }
  311. }
  312. }
  313. </script>
  314. <style lang="scss" scoped>
  315. .nav {
  316. position: fixed;
  317. top: 0;
  318. left: 0;
  319. z-index: 9;
  320. width: 100%;
  321. height: 90rpx;
  322. background-color: #ffffff;
  323. }
  324. .nav .acea-row {
  325. flex: 1;
  326. border-top: 3rpx solid transparent;
  327. border-bottom: 3rpx solid transparent;
  328. font-size: 30rpx;
  329. color: #282828;
  330. }
  331. .nav .on {
  332. border-bottom-color: var(--view-theme);
  333. color: var(--view-theme);
  334. }
  335. .main-body {
  336. margin-top: 90rpx;
  337. .number_of_members {
  338. .members_top {
  339. height: 150rpx;
  340. background: white;
  341. display: flex;
  342. text-align: center;
  343. flex-direction: column;
  344. .integral {
  345. flex: 1;
  346. color: #ff4b4b;
  347. font-size: 38rpx;
  348. padding-top: 30rpx;
  349. }
  350. .explain {
  351. flex: 2;
  352. }
  353. }
  354. .members_list {
  355. .item {
  356. line-height: 50rpx;
  357. padding: 30rpx;
  358. background: white;
  359. margin-bottom: 10rpx;
  360. .text-info {
  361. color: #999999;
  362. margin-bottom: 10rpx;
  363. }
  364. .left {
  365. width: 100%;
  366. .state {
  367. height: 100rpx;
  368. .order {
  369. margin: auto 0;
  370. text-align: center;
  371. width: 50rpx;
  372. height: 50rpx;
  373. line-height: 50rpx;
  374. background: rgb(200, 153, 75);
  375. color: white;
  376. border-radius: 50%;
  377. }
  378. display: flex;
  379. image {
  380. margin-left: 30rpx;
  381. margin-right: 30rpx;
  382. width: 100rpx;
  383. height: 100rpx;
  384. border-radius: 50%;
  385. overflow: hidden;
  386. }
  387. .s-r {
  388. font-size: 34rpx;
  389. display: flex;
  390. flex-direction: column;
  391. }
  392. .op-area {
  393. display: flex;
  394. justify-content: flex-end;
  395. flex-grow: 1;
  396. /deep/ .u-button {
  397. height: 60rpx;
  398. width: 200rpx !important;
  399. margin: auto 0;
  400. font-size: 26rpx;
  401. }
  402. }
  403. }
  404. }
  405. .right {
  406. .num {
  407. height: 100rpx;
  408. }
  409. }
  410. }
  411. }
  412. }
  413. .direct_of_push {
  414. .push_top {
  415. margin-bottom: 10rpx;
  416. height: 150rpx;
  417. background: white;
  418. display: flex;
  419. text-align: center;
  420. flex-direction: column;
  421. .integral {
  422. flex: 1;
  423. color: #ff4b4b;
  424. font-size: 38rpx;
  425. padding-top: 30rpx;
  426. }
  427. .explain {
  428. flex: 2;
  429. }
  430. }
  431. .pus_list {
  432. .item {
  433. line-height: 50rpx;
  434. padding: 30rpx;
  435. background: white;
  436. margin-bottom: 10rpx;
  437. .text-info {
  438. color: #999999;
  439. margin-bottom: 10rpx;
  440. }
  441. .left {
  442. width: 100%;
  443. .state {
  444. height: 100rpx;
  445. .order {
  446. margin: auto 0;
  447. text-align: center;
  448. width: 50rpx;
  449. height: 50rpx;
  450. line-height: 50rpx;
  451. background: rgb(200, 153, 75);
  452. color: white;
  453. border-radius: 50%;
  454. }
  455. display: flex;
  456. image {
  457. margin-left: 30rpx;
  458. margin-right: 30rpx;
  459. width: 100rpx;
  460. height: 100rpx;
  461. border-radius: 50%;
  462. overflow: hidden;
  463. }
  464. .s-r {
  465. font-size: 34rpx;
  466. display: flex;
  467. flex-direction: column;
  468. }
  469. .op-area {
  470. display: flex;
  471. justify-content: flex-end;
  472. flex-grow: 1;
  473. /deep/ .u-button {
  474. height: 60rpx;
  475. width: 200rpx !important;
  476. margin: auto 0;
  477. font-size: 26rpx;
  478. }
  479. }
  480. }
  481. }
  482. .right {
  483. .num {
  484. height: 100rpx;
  485. }
  486. }
  487. }
  488. }
  489. }
  490. .mark_of_members {
  491. .mark_top {
  492. margin-bottom: 10rpx;
  493. height: 150rpx;
  494. background: white;
  495. display: flex;
  496. text-align: center;
  497. flex-direction: column;
  498. .integral {
  499. flex: 1;
  500. color: #ff4b4b;
  501. font-size: 38rpx;
  502. padding-top: 30rpx;
  503. }
  504. .explain {
  505. flex: 2;
  506. }
  507. }
  508. .mark_list {
  509. .item {
  510. line-height: 50rpx;
  511. padding: 30rpx;
  512. background: white;
  513. margin-bottom: 10rpx;
  514. .text-info {
  515. color: #999999;
  516. margin-bottom: 10rpx;
  517. }
  518. .left {
  519. width: 100%;
  520. .state {
  521. height: 100rpx;
  522. .order {
  523. margin: auto 0;
  524. text-align: center;
  525. width: 50rpx;
  526. height: 50rpx;
  527. line-height: 50rpx;
  528. background: rgb(200, 153, 75);
  529. color: white;
  530. border-radius: 50%;
  531. }
  532. display: flex;
  533. image {
  534. margin-left: 30rpx;
  535. margin-right: 30rpx;
  536. width: 100rpx;
  537. height: 100rpx;
  538. border-radius: 50%;
  539. overflow: hidden;
  540. }
  541. .s-r {
  542. font-size: 34rpx;
  543. display: flex;
  544. flex-direction: column;
  545. }
  546. .op-area {
  547. display: flex;
  548. justify-content: flex-end;
  549. flex-grow: 1;
  550. /deep/ .u-button {
  551. height: 60rpx;
  552. width: 200rpx !important;
  553. margin: auto 0;
  554. font-size: 26rpx;
  555. }
  556. }
  557. }
  558. }
  559. .right {
  560. .num {
  561. height: 100rpx;
  562. }
  563. }
  564. }
  565. }
  566. }
  567. }
  568. </style>