index.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. <template>
  2. <view :style="colorStyle">
  3. <view class="promoter-list">
  4. <!-- <pageHeader title="推广人列表"></pageHeader> -->
  5. <view class='search acea-row row-between-wrapper'>
  6. <view class='input'><input placeholder='点击搜索会员名称' placeholder-class='placeholder' v-model="keyword"
  7. @confirm="submitForm" confirm-type='search' name="search"></input></view>
  8. <!-- <button class='iconfont icon-sousuo2' @click="submitForm"></button> -->
  9. </view>
  10. <view class='nav acea-row row-around' v-if="brokerageLevel == 2">
  11. <view :class="grade == 0 ? 'item on' : 'item'" @click='setType(0)'>一级({{total}})</view>
  12. <view :class="grade == 1 ? 'item on' : 'item'" @click='setType(1)'>二级({{totalLevel}})</view>
  13. </view>
  14. <timeSlot @changeTime="changeTime"></timeSlot>
  15. <view class='list' v-if="recordList.length">
  16. <view class="top_num">
  17. 共 <text class="main_color">{{count}}</text> 位推广人,获得佣金<text class="main_color">¥{{price}}</text>
  18. </view>
  19. <block v-for="(item,index) in recordList" :key="index">
  20. <view class='item acea-row row-between-wrapper' :class="index == 0 ? 'radius15' : ''">
  21. <view class="picTxt acea-row row-between-wrapper">
  22. <view class='pictrue'>
  23. <image :src='item.avatar'></image>
  24. </view>
  25. <view class='text'>
  26. <view class='name line1'>{{item.nickname}}</view>
  27. <view>加入时间: {{item.time}}</view>
  28. </view>
  29. </view>
  30. <view class="right">
  31. <view><text class='num font-num'>{{item.childCount ? item.childCount : 0}}</text>人</view>
  32. <view><text class="num">{{item.orderCount ? item.orderCount : 0}}</text>单</view>
  33. <view><text class="num">{{item.numberCount ? item.numberCount : 0}}</text>元</view>
  34. </view>
  35. </view>
  36. </block>
  37. </view>
  38. <view v-if="recordList.length == 0">
  39. <emptyPage title="暂无数据~"></emptyPage>
  40. </view>
  41. </view>
  42. <home v-if="navigation"></home>
  43. </view>
  44. </template>
  45. <script>
  46. import {
  47. spreadPeople
  48. } from '@/api/user.js';
  49. import {
  50. toLogin
  51. } from '@/libs/login.js';
  52. import {
  53. mapGetters
  54. } from "vuex";
  55. import emptyPage from '@/components/emptyPage.vue'
  56. import home from '@/components/home';
  57. import timeSlot from '../components/timeSlot/index.vue'
  58. import pageHeader from '../components/pageHeader/index.vue'
  59. import colors from '@/mixins/color.js';
  60. export default {
  61. components: {
  62. home,
  63. timeSlot,
  64. pageHeader,
  65. emptyPage
  66. },
  67. mixins: [colors],
  68. data() {
  69. return {
  70. total: 0,
  71. totalLevel: 0,
  72. teamCount: 0,
  73. page: 1,
  74. limit: 20,
  75. keyword: '',
  76. sort: '',
  77. grade: 0,
  78. status: false,
  79. recordList: [],
  80. isAuto: false, //没有授权的不会自动授权
  81. isShowAuth: false, //是否隐藏授权
  82. start: 0,
  83. stop: 0,
  84. count:0,
  85. price:0,
  86. brokerageLevel:0
  87. };
  88. },
  89. computed: mapGetters(['isLogin']),
  90. onLoad() {
  91. if (this.isLogin) {
  92. this.userSpreadNewList();
  93. } else {
  94. toLogin();
  95. }
  96. },
  97. onShow: function() {
  98. uni.removeStorageSync('form_type_cart');
  99. if (this.is_show) this.userSpreadNewList();
  100. },
  101. onHide: function() {
  102. this.is_show = true;
  103. },
  104. methods: {
  105. changeTime(time) {
  106. console.log(time)
  107. this.start = time.start
  108. this.stop = time.stop
  109. this.submitForm()
  110. },
  111. onLoadFun(e) {
  112. this.userSpreadNewList();
  113. },
  114. // 授权关闭
  115. authColse: function(e) {
  116. this.isShowAuth = e
  117. },
  118. setSort(sort) {
  119. let that = this;
  120. that.sort = sort;
  121. that.page = 1;
  122. that.limit = 20;
  123. that.status = false;
  124. that.$set(that, 'recordList', []);
  125. that.userSpreadNewList();
  126. },
  127. // setKeyword: function(e) {
  128. // this.keyword = e.detail.value;
  129. // },
  130. submitForm: function() {
  131. this.page = 1;
  132. this.limit = 20;
  133. this.status = false;
  134. this.$set(this, 'recordList', []);
  135. this.userSpreadNewList();
  136. },
  137. setType: function(grade) {
  138. if (this.grade != grade) {
  139. this.grade = grade;
  140. this.page = 1;
  141. this.limit = 20;
  142. this.keyword = '';
  143. this.sort = '';
  144. this.status = false;
  145. this.$set(this, 'recordList', []);
  146. this.userSpreadNewList();
  147. }
  148. },
  149. userSpreadNewList: function() {
  150. let that = this;
  151. let page = that.page;
  152. let limit = that.limit;
  153. let status = that.status;
  154. let keyword = that.keyword;
  155. let sort = that.sort;
  156. let grade = that.grade;
  157. let recordList = that.recordList;
  158. let recordListNew = [];
  159. if (status == true) return;
  160. spreadPeople({
  161. start: this.start,
  162. stop: this.stop,
  163. page: page,
  164. limit: limit,
  165. keyword: keyword,
  166. grade: grade,
  167. sort: sort,
  168. }).then(res => {
  169. let len = res.data.list.length;
  170. let recordListData = res.data.list;
  171. recordListNew = recordList.concat(recordListData);
  172. that.total = res.data.total;
  173. that.totalLevel = res.data.totalLevel;
  174. that.teamCount = res.data.count;
  175. that.brokerageLevel = res.data.brokerage_level;
  176. that.status = limit > len;
  177. that.page = page + 1;
  178. that.$set(that, 'recordList', recordListNew);
  179. that.count = res.data.count;
  180. that.price = res.data.price;
  181. });
  182. }
  183. },
  184. onReachBottom: function() {
  185. this.userSpreadNewList();
  186. }
  187. }
  188. </script>
  189. <style scoped lang="scss">
  190. .promoter-list .nav {
  191. background-color: #fff;
  192. height: 86rpx;
  193. line-height: 86rpx;
  194. font-size: 28rpx;
  195. color: #282828;
  196. border-bottom: 1rpx solid #eee;
  197. }
  198. .promoter-list .nav .item.on {
  199. border-bottom: 5rpx solid var(--view-theme);
  200. color: var(--view-theme);
  201. }
  202. .promoter-list .search {
  203. width: 100%;
  204. background-color: var(--view-theme);
  205. border-bottom: 1px solid #f2f2f2;
  206. height: 86rpx;
  207. padding: 0 30rpx;
  208. box-sizing: border-box;
  209. }
  210. .promoter-list .search .input {
  211. width: 100%;
  212. height: 60rpx;
  213. border-radius: 50rpx;
  214. background-color: #f5f5f5;
  215. position: relative;
  216. }
  217. .promoter-list .search .input input {
  218. height: 100%;
  219. font-size: 26rpx;
  220. width: 100%;
  221. padding-left: 30rpx;
  222. }
  223. .promoter-list .search .input .placeholder {
  224. color: #bbb;
  225. }
  226. .promoter-list .search .input .iconfont {
  227. position: absolute;
  228. right: 28rpx;
  229. color: #999;
  230. font-size: 28rpx;
  231. top: 50%;
  232. transform: translateY(-50%);
  233. }
  234. .promoter-list .search .iconfont {
  235. font-size: 45rpx;
  236. color: #515151;
  237. background-color: var(--view-theme);
  238. width: 110rpx;
  239. height: 60rpx;
  240. line-height: 60rpx;
  241. }
  242. .promoter-list .list {
  243. margin-top: 12rpx;
  244. }
  245. .promoter-list .list .sortNav {
  246. background-color: #fff;
  247. height: 76rpx;
  248. border-bottom: 1rpx solid #eee;
  249. color: #333;
  250. font-size: 28rpx;
  251. }
  252. .promoter-list .list .sortNav .sortItem {
  253. text-align: center;
  254. flex: 1;
  255. }
  256. .promoter-list .list .sortNav .sortItem image {
  257. width: 24rpx;
  258. height: 24rpx;
  259. margin-left: 6rpx;
  260. vertical-align: -3rpx;
  261. }
  262. .promoter-list .list .item {
  263. background-color: #fff;
  264. border-bottom: 1rpx solid #eee;
  265. height: 152rpx;
  266. padding: 0 30rpx 0 20rpx;
  267. font-size: 24rpx;
  268. color: #666;
  269. margin: 0 30rpx;
  270. }
  271. .promoter-list .list .item .picTxt {
  272. width: 440rpx;
  273. }
  274. .promoter-list .list .item .picTxt .pictrue {
  275. width: 106rpx;
  276. height: 106rpx;
  277. border-radius: 50%;
  278. }
  279. .promoter-list .list .item .picTxt .pictrue image {
  280. width: 100%;
  281. height: 100%;
  282. border-radius: 50%;
  283. border: 3rpx solid #fff;
  284. box-shadow: 0 0 10rpx #aaa;
  285. box-sizing: border-box;
  286. }
  287. .promoter-list .list .item .picTxt .text {
  288. width: 304rpx;
  289. font-size: 24rpx;
  290. color: #666;
  291. }
  292. .promoter-list .list .item .picTxt .text .name {
  293. font-size: 28rpx;
  294. color: #333;
  295. margin-bottom: 13rpx;
  296. }
  297. .promoter-list .list .item .right {
  298. width: 190rpx;
  299. text-align: right;
  300. font-size: 22rpx;
  301. color: #333;
  302. }
  303. .promoter-list .list .item .right .num {
  304. margin-right: 7rpx;
  305. }
  306. .top_num{
  307. padding: 30rpx;
  308. font-size: 26rpx;
  309. color: #666;
  310. }
  311. .main_color{
  312. color: #E93323;
  313. }
  314. .radius15{
  315. border-radius: 14rpx 14rpx 0 0;
  316. }
  317. </style>