index.vue 7.8 KB

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