index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688
  1. <template>
  2. <view class="content">
  3. <view class="content-money">
  4. <view class="status_bar">
  5. <!-- 这里是状态栏 -->
  6. </view>
  7. <view class="body-title">
  8. <view class="goback-box" @click="toBack">
  9. <image class="goback" src="../../../static/icon/fanhui.png" mode=""></image>
  10. </view>
  11. <view class="header">我的推广</view>
  12. </view>
  13. <view class="content-bg">
  14. <image src="http://ygs.hqgjsmc.com/baseimg/zhihuanjuan.png" mode=""></image>
  15. </view>
  16. <view class="money-box">
  17. <view class="">
  18. <view class="money">{{ push_count || '0'}}</view>
  19. <view>直推人数</view>
  20. </view>
  21. <!-- <view class="">
  22. <view class="money">{{ order_count || '0'}}</view>
  23. <view>团队人数</view>
  24. </view>
  25. <view class="">
  26. <view class="money">{{ order_price*1 || '0' }}</view>
  27. <view>团队业绩</view>
  28. </view> -->
  29. </view>
  30. </view>
  31. <!-- <view class="navbar">
  32. <view class="nav-item" :class="{ current: grade === 0 }" @click="setType(0)">一级</view>
  33. <view class="nav-item" :class="{ current: grade == 1 }" @click="setType(1)">二级</view>
  34. </view> -->
  35. <view class="info-box flex">
  36. <view class="info-item">
  37. <view class="info-font">团队人数</view>
  38. <view class="info-num">{{ order_count || 0 }}</view>
  39. </view>
  40. <view class="shu"></view>
  41. <view class="info-item">
  42. <view class="info-font">团队业绩</view>
  43. <view class="info-num">{{ order_price*1 || '0' }}</view>
  44. </view>
  45. </view>
  46. <scroll-view class="list-scroll-content" scroll-y @scrolltolower="userSpreadNewList">
  47. <!-- 空白页 -->
  48. <!-- <empty v-if="recordList.length === 0"></empty> -->
  49. <!-- 订单列表 -->
  50. <view v-for="(item, index) in recordList" :key="index" class="order-item flex">
  51. <view class="title-box flex_item">
  52. <view class="title-avatar">
  53. <image :src="item.avatar|| '../../../static/error/missing-face.png'"
  54. style="width: 100rpx;height: 100rpx;"></image>
  55. </view>
  56. <view class="list_tpl">
  57. <view class="title">
  58. <text>{{ item.nickname || '' }}</text>
  59. </view>
  60. <view class="time">
  61. <text>业绩:{{ item.price }}</text>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. <!-- <uni-load-more :status="tabItem.loadingType"></uni-load-more> -->
  67. <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse">
  68. </authorize>
  69. </scroll-view>
  70. </view>
  71. </template>
  72. <!-- <template>
  73. <view :style="viewColor">
  74. <view class="promoter-list">
  75. <view class='promoterHeader'>
  76. <view class='headerCon acea-row row-between-wrapper'>
  77. <view>
  78. <view class='name'>推广人数</view>
  79. <view><text class='num'>{{userInfo.spread_total}}</text>人</view>
  80. </view>
  81. <view class='iconfont icon-tuandui'></view>
  82. </view>
  83. </view>
  84. <view class='nav acea-row row-around'>
  85. <view :class="grade == 0 ? 'item on' : 'item'" @click='setType(0)'>一级({{userInfo.one_level_count}})</view>
  86. <view :class="grade == 1 ? 'item on' : 'item'" @click='setType(1)'>二级({{userInfo.two_level_count}})</view>
  87. </view>
  88. <view class='search acea-row row-between-wrapper'>
  89. <view class='input'><input placeholder='点击搜索会员名称' placeholder-class='placeholder' v-model="keyword" @confirm="submitForm" confirm-type='search' name="search"></input></view>
  90. <button class='iconfont icon-sousuo2' @click="submitForm"></button>
  91. </view>
  92. <view class='list'>
  93. <view class="sortNav acea-row row-middle">
  94. <view class="sortItem" @click='setSort("spread_count ASC")' v-if="sort == 'spread_count DESC'">团队排序
  95. <image :src="domain+'/static/diy/sort1'+keyColor+'.png'"></image>
  96. </view>
  97. <view class="sortItem" @click='setSort("")' v-else-if="sort == 'spread_count ASC'">团队排序
  98. <image :src="domain+'/static/diy/sort3'+keyColor+'.png'"></image>
  99. </view>
  100. <view class="sortItem" @click='setSort("spread_count DESC")' v-else>团队排序
  101. <image src="/static/images/sort2.png"></image>
  102. </view>
  103. <view class="sortItem" @click='setSort("pay_price ASC")' v-if="sort == 'pay_price DESC'">金额排序
  104. <image :src="domain+'/static/diy/sort1'+keyColor+'.png'"></image>
  105. </view>
  106. <view class="sortItem" @click='setSort("")' v-else-if="sort == 'pay_price ASC'">金额排序
  107. <image :src="domain+'/static/diy/sort3'+keyColor+'.png'"></image>
  108. </view>
  109. <view class="sortItem" @click='setSort("pay_price DESC")' v-else>金额排序
  110. <image src="/static/images/sort2.png"></image>
  111. </view>
  112. <view class="sortItem" @click='setSort("pay_count ASC")' v-if="sort == 'pay_count DESC'">订单排序
  113. <image :src="domain+'/static/diy/sort1'+keyColor+'.png'"></image>
  114. </view>
  115. <view class="sortItem" @click='setSort("")' v-else-if="sort == 'pay_count ASC'">订单排序
  116. <image :src="domain+'/static/diy/sort3'+keyColor+'.png'"></image>
  117. </view>
  118. <view class="sortItem" @click='setSort("pay_count DESC")' v-else>订单排序
  119. <image src="/static/images/sort2.png"></image>
  120. </view>
  121. </view>
  122. <block v-for="(item,index) in recordList" :key="index">
  123. <view class='item acea-row row-between-wrapper'>
  124. <view class="picTxt acea-row row-between-wrapper">
  125. <view class='pictrue'>
  126. <image :src='item.avatar ? item.avatar : "/static/images/f.png"'></image>
  127. </view>
  128. <view class='text'>
  129. <view class='name line1'>{{item.nickname}}</view>
  130. <view>加入时间: {{item.spread_time}}</view>
  131. </view>
  132. </view>
  133. <view class="right">
  134. <view><text class='num t-color'>{{item.spread_count ? item.spread_count : 0}}</text>人</view>
  135. <view><text class="num">{{item.pay_count ? item.pay_count : 0}}</text>单</view>
  136. <view><text class="num">{{item.pay_price ? item.pay_price : 0}}</text>元</view>
  137. </view>
  138. </view>
  139. </block>
  140. </view>
  141. </view>
  142. <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
  143. </view>
  144. </template> -->
  145. <script>
  146. // +----------------------------------------------------------------------
  147. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  148. // +----------------------------------------------------------------------
  149. // | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
  150. // +----------------------------------------------------------------------
  151. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  152. // +----------------------------------------------------------------------
  153. // | Author: CRMEB Team <admin@crmeb.com>
  154. // +----------------------------------------------------------------------
  155. import {
  156. spreadPeople,
  157. spreadPeoples,
  158. getUserInfo,
  159. spreadInfo
  160. } from '@/api/user.js';
  161. import {
  162. mapGetters
  163. } from "vuex";
  164. import authorize from '@/components/Authorize';
  165. import {
  166. HTTP_REQUEST_URL
  167. } from '@/config/app';
  168. export default {
  169. components: {
  170. authorize
  171. },
  172. data() {
  173. return {
  174. push_count: '',
  175. order_count: '',
  176. order_price: '',
  177. domain: HTTP_REQUEST_URL,
  178. total: 0,
  179. totalLevel: 0,
  180. teamCount: 0,
  181. page: 1,
  182. limit: 20,
  183. keyword: '',
  184. sort: '',
  185. grade: 0,
  186. status: false,
  187. recordList: [],
  188. isAuto: false, //没有授权的不会自动授权
  189. isShowAuth: false, //是否隐藏授权
  190. userInfo: {}
  191. };
  192. },
  193. computed: mapGetters(['isLogin', 'viewColor', 'keyColor']),
  194. onLoad() {
  195. if (this.isLogin) {
  196. this.userSpreadNewList();
  197. this.getUserInfo()
  198. } else {
  199. this.isAuto = true;
  200. this.isShowAuth = true
  201. }
  202. },
  203. onShow: function() {
  204. if (this.is_show) {
  205. this.userSpreadNewList();
  206. this.getUserInfo();
  207. }
  208. },
  209. onHide: function() {
  210. this.is_show = true;
  211. },
  212. methods: {
  213. toBack() {
  214. uni.switchTab({
  215. url: '/pages/user/index'
  216. })
  217. },
  218. getUserInfo() {
  219. spreadInfo().then(res => {
  220. this.userInfo = res.data
  221. });
  222. },
  223. onLoadFun: function(e) {
  224. this.isShowAuth = false;
  225. this.userSpreadNewList();
  226. this.getUserInfo()
  227. },
  228. // 授权关闭
  229. authColse: function(e) {
  230. this.isShowAuth = e
  231. },
  232. setSort: function(sort) {
  233. let that = this;
  234. that.sort = sort;
  235. that.page = 1;
  236. that.limit = 20;
  237. that.status = false;
  238. that.$set(that, 'recordList', []);
  239. that.userSpreadNewList();
  240. },
  241. // setKeyword: function(e) {
  242. // this.keyword = e.detail.value;
  243. // },
  244. submitForm: function() {
  245. this.page = 1;
  246. this.limit = 20;
  247. this.status = false;
  248. this.$set(this, 'recordList', []);
  249. this.userSpreadNewList();
  250. },
  251. setType: function(grade) {
  252. if (this.grade != grade) {
  253. this.grade = grade;
  254. this.page = 1;
  255. this.limit = 20;
  256. this.keyword = '';
  257. this.sort = '';
  258. this.status = false;
  259. this.$set(this, 'recordList', []);
  260. this.userSpreadNewList();
  261. }
  262. },
  263. userSpreadNewList: function() {
  264. let that = this;
  265. let page = that.page;
  266. let limit = that.limit;
  267. let status = that.status;
  268. let keyword = that.keyword;
  269. let sort = that.sort;
  270. let grade = that.grade;
  271. let recordList = that.recordList;
  272. let recordListNew = [];
  273. if (status == true) return;
  274. spreadPeoples({
  275. page: page,
  276. limit: limit,
  277. // keyword: keyword,
  278. // level: grade + 1,
  279. // sort: sort,
  280. }).then(res => {
  281. that.push_count = res.data.push_count
  282. that.order_count = res.data.order_count
  283. that.order_price = res.data.order_price
  284. let len = res.data.user.length;
  285. let recordListData = res.data.user;
  286. recordListNew = recordList.concat(recordListData);
  287. that.total = res.data.total;
  288. that.totalLevel = res.data.totalLevel;
  289. that.teamCount = that.$util.$h.Add(Number(res.data.total), Number(res.data.totalLevel));
  290. that.status = limit > len;
  291. that.page = page + 1;
  292. that.$set(that, 'recordList', recordListNew);
  293. });
  294. }
  295. },
  296. // onReachBottom: function() {
  297. // this.userSpreadNewList();
  298. // }
  299. }
  300. </script>
  301. <!-- <style scoped lang="scss">
  302. .promoterHeader {
  303. background-image: linear-gradient(to right, var(--view-bntColor21) 0%, var(--view-bntColor22) 100%);
  304. }
  305. .t-color {
  306. color: var(--view-theme);
  307. }
  308. .promoter-list .nav {
  309. background-color: #fff;
  310. height: 86rpx;
  311. line-height: 86rpx;
  312. font-size: 28rpx;
  313. color: #282828;
  314. border-bottom: 1rpx solid #eee;
  315. }
  316. .promoter-list .nav .item.on {
  317. border-bottom: 5rpx solid var(--view-theme);
  318. color: var(--view-theme);
  319. }
  320. .promoter-list .search {
  321. width: 100%;
  322. background-color: #fff;
  323. height: 86rpx;
  324. padding-left: 30rpx;
  325. box-sizing: border-box;
  326. }
  327. .promoter-list .search .input {
  328. width: 610rpx;
  329. height: 60rpx;
  330. border-radius: 50rpx;
  331. background-color: #f5f5f5;
  332. text-align: center;
  333. position: relative;
  334. }
  335. .promoter-list .search .input input {
  336. height: 100%;
  337. font-size: 26rpx;
  338. width: 610rpx;
  339. text-align: center;
  340. }
  341. .promoter-list .search .input .placeholder {
  342. color: #bbb;
  343. }
  344. .promoter-list .search .input .iconfont {
  345. position: absolute;
  346. right: 28rpx;
  347. color: #999;
  348. font-size: 28rpx;
  349. top: 50%;
  350. transform: translateY(-50%);
  351. }
  352. .promoter-list .search .iconfont {
  353. font-size: 45rpx;
  354. color: #515151;
  355. width: 110rpx;
  356. height: 60rpx;
  357. line-height: 60rpx;
  358. }
  359. .promoter-list .list {
  360. margin-top: 12rpx;
  361. }
  362. .promoter-list .list .sortNav {
  363. background-color: #fff;
  364. height: 76rpx;
  365. border-bottom: 1rpx solid #eee;
  366. color: #333;
  367. font-size: 28rpx;
  368. }
  369. .promoter-list .list .sortNav .sortItem {
  370. text-align: center;
  371. flex: 1;
  372. }
  373. .promoter-list .list .sortNav .sortItem image {
  374. width: 24rpx;
  375. height: 24rpx;
  376. margin-left: 6rpx;
  377. vertical-align: -3rpx;
  378. }
  379. .promoter-list .list .item {
  380. background-color: #fff;
  381. border-bottom: 1rpx solid #eee;
  382. height: 152rpx;
  383. padding: 0 30rpx 0 20rpx;
  384. font-size: 24rpx;
  385. color: #666;
  386. }
  387. .promoter-list .list .item .picTxt {
  388. width: 440rpx;
  389. }
  390. .promoter-list .list .item .picTxt .pictrue {
  391. width: 106rpx;
  392. height: 106rpx;
  393. border-radius: 50%;
  394. }
  395. .promoter-list .list .item .picTxt .pictrue image {
  396. width: 100%;
  397. height: 100%;
  398. border-radius: 50%;
  399. border: 3rpx solid #fff;
  400. box-shadow: 0 0 10rpx #aaa;
  401. box-sizing: border-box;
  402. }
  403. .promoter-list .list .item .picTxt .text {
  404. width: 304rpx;
  405. font-size: 24rpx;
  406. color: #666;
  407. }
  408. .promoter-list .list .item .picTxt .text .name {
  409. font-size: 28rpx;
  410. color: #333;
  411. margin-bottom: 13rpx;
  412. }
  413. .promoter-list .list .item .right {
  414. width: 240rpx;
  415. text-align: right;
  416. font-size: 22rpx;
  417. color: #333;
  418. }
  419. .promoter-list .list .item .right .num{
  420. margin-right: 7rpx;
  421. }
  422. </style>
  423. -->
  424. <style lang="scss">
  425. page {
  426. // background: #ffffff;
  427. height: 100%;
  428. }
  429. .status_bar {
  430. height: var(--status-bar-height);
  431. width: 100%;
  432. }
  433. .content-money {
  434. position: relative;
  435. height: 480rpx;
  436. .content-bg {
  437. position: absolute;
  438. top: 0;
  439. left: 0;
  440. right: 0;
  441. width: 750rpx;
  442. height: 480rpx;
  443. image {
  444. width: 100%;
  445. height: 100%;
  446. }
  447. }
  448. .body-title {
  449. height: 80rpx;
  450. text-align: center;
  451. font-size: 35rpx;
  452. position: relative;
  453. .header {
  454. position: absolute;
  455. left: 0;
  456. top: 0;
  457. width: 100%;
  458. font-size: 36rpx;
  459. font-family: PingFang SC;
  460. font-weight: bold;
  461. color: #fffeff;
  462. height: 80rpx;
  463. font-size: 36rpx;
  464. font-weight: 700;
  465. z-index: 9;
  466. display: flex;
  467. justify-content: center;
  468. align-items: center;
  469. }
  470. .goback-box {
  471. position: absolute;
  472. left: 18rpx;
  473. top: 0;
  474. height: 80rpx;
  475. display: flex;
  476. align-items: center;
  477. }
  478. .goback {
  479. z-index: 100;
  480. width: 34rpx;
  481. height: 34rpx;
  482. }
  483. }
  484. }
  485. .money-box {
  486. position: relative;
  487. z-index: 2;
  488. /* #ifdef H5 */
  489. padding-top: 80rpx;
  490. /* #endif */
  491. color: #ffffff;
  492. text-align: center;
  493. /* #ifdef APP-PLUS */
  494. height: 250rpx;
  495. display: flex;
  496. flex-direction: column;
  497. justify-content: center;
  498. /* #endif */
  499. display: flex;
  500. justify-content: center;
  501. view {
  502. flex-grow: 1;
  503. }
  504. .money {
  505. font-size: 72rpx;
  506. font-family: PingFang SC;
  507. font-weight: bold;
  508. color: #ffffff;
  509. }
  510. .text {
  511. font-size: 30rpx;
  512. }
  513. }
  514. // 列表
  515. .swiper-box {
  516. padding-top: 10rpx;
  517. }
  518. .order-item {
  519. margin-top: 20rpx;
  520. padding: 20rpx 30rpx;
  521. line-height: 1.5;
  522. background-color: #fff;
  523. .title-box {
  524. width: 100%;
  525. .title-avatar {
  526. width: 100rpx;
  527. height: 100rpx;
  528. margin-right: 25rpx;
  529. // image {
  530. // width: 100rpx;
  531. // height: 100rpx;
  532. // border-radius: 50%;
  533. // }
  534. }
  535. .list_tpl {
  536. width: 85%;
  537. .title {
  538. font-size: $font-lg;
  539. color: $font-color-base;
  540. overflow: hidden; //超出的文本隐藏
  541. text-overflow: ellipsis; //溢出用省略号显示
  542. white-space: nowrap;
  543. }
  544. .time {
  545. margin-top: 15rpx;
  546. font-size: 22rpx;
  547. color: $font-color-light;
  548. }
  549. }
  550. }
  551. .money {
  552. color: #DB1935;
  553. font-size: $font-lg;
  554. }
  555. }
  556. .list-scroll-content {
  557. height: 100%;
  558. }
  559. .content {
  560. height: 100%;
  561. .empty-content {
  562. background-color: #ffffff;
  563. }
  564. }
  565. .navbar {
  566. margin-top: 20rpx;
  567. display: flex;
  568. height: 88rpx;
  569. padding: 0 5px;
  570. background: #fff;
  571. box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
  572. position: relative;
  573. z-index: 10;
  574. .nav-item {
  575. flex: 1;
  576. display: flex;
  577. justify-content: center;
  578. align-items: center;
  579. height: 100%;
  580. font-size: 15px;
  581. color: #999999;
  582. position: relative;
  583. &.current {
  584. color: #000;
  585. &:after {
  586. content: '';
  587. position: absolute;
  588. left: 50%;
  589. bottom: 0;
  590. transform: translateX(-50%);
  591. width: 44px;
  592. height: 0;
  593. border-bottom: 2px solid #fe5b38;
  594. }
  595. }
  596. }
  597. }
  598. .info-box {
  599. width: 670rpx;
  600. height: 186rpx;
  601. background: #ffffff;
  602. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  603. border-radius: 20rpx;
  604. margin: -100rpx auto 0;
  605. position: relative;
  606. z-index: 2;
  607. .info-item {
  608. width: 50%;
  609. display: flex;
  610. flex-direction: column;
  611. align-items: center;
  612. line-height: 1;
  613. .info-font {
  614. font-size: 30rpx;
  615. font-family: PingFang SC;
  616. font-weight: bold;
  617. color: #999999;
  618. }
  619. .info-num {
  620. margin-top: 30rpx;
  621. font-size: 30rpx;
  622. font-family: PingFang SC;
  623. font-weight: bold;
  624. color: #181818;
  625. }
  626. }
  627. .shu {
  628. width: 2rpx;
  629. height: 74rpx;
  630. background: #dcdfe6;
  631. }
  632. }
  633. </style>