userTuiList.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. <template>
  2. <view class="promoter-list" >
  3. <view class="header">
  4. <view class="promoterHeader">
  5. <image class="bg" src="/static/images/transparent.png" />
  6. <view class="headerCon acea-row row-between-wrapper">
  7. <view>
  8. <view class="name">推广人数</view>
  9. <view>
  10. <text class="num">{{total}}</text>
  11. <text>人</text>
  12. </view>
  13. </view>
  14. </view>
  15. </view>
  16. <!-- <view class="search acea-row row-between-wrapper">
  17. <form @submit.prevent="submitForm">
  18. <view class="input">
  19. <input placeholder="搜索会员名称" v-model="screen.keyword" />
  20. <text class="iconfont icon-guanbi" @click="screen.keyword=''"></text>
  21. </view>
  22. </form>
  23. <view class="iconfont icon-sousuo2"></view>
  24. </view> -->
  25. </view>
  26. <view class="list">
  27. <view>
  28. <view class="item acea-row row-between-wrapper" v-for="(item, index) in list"
  29. :key="index">
  30. <view class="picTxt acea-row row-between-wrapper">
  31. <view class="pictrue">
  32. <image :src="item.avatar==null?'/static/images/detault_head.jpg':item.avatar" />
  33. </view>
  34. <view class="text">
  35. <view class="name line1">{{item.nickname}}</view>
  36. <view>注册时间: {{item.createTime}}</view>
  37. <view>创收: {{item.tuiMoney.toFixed(2)}}</view>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. <Loading :loaded="loaded" :loading="loading"></Loading>
  44. </view>
  45. </template>
  46. <script>
  47. import {getMyTuiList} from "@/api/user.js";
  48. import Loading from "@/components/Loading";
  49. export default {
  50. name: "tuiList",
  51. components: {
  52. Loading
  53. },
  54. props: {},
  55. data: function () {
  56. return {
  57. total:0,
  58. page: {
  59. page: 1,
  60. pageSize: 10
  61. },
  62. list: [],
  63. loaded: false,
  64. loading: false
  65. };
  66. },
  67. mounted: function () {
  68. this.getMyTuiList();
  69. },
  70. onReachBottom() {
  71. !this.loading && this.getMyTuiList();
  72. },
  73. methods: {
  74. submitForm: function () {
  75. this.page.pageNum = 1;
  76. this.loaded = false;
  77. this.loading = false;
  78. this.list = [];
  79. this.getMyTuiList();
  80. },
  81. getMyTuiList: function () {
  82. let that = this;
  83. if (that.loaded || that.loading) return;
  84. that.loading = true;
  85. getMyTuiList(this.page).then(
  86. res => {
  87. that.total=res.data.total;
  88. that.list.push.apply(that.list, res.data.list);
  89. that.loading = false;
  90. that.loaded = !res.data.hasNextPage;
  91. that.page.page = that.page.page + 1;
  92. uni.hideLoading()
  93. },
  94. err => {
  95. uni.showToast({
  96. title: err.msg || err.response.data.msg || err.response.data.message,
  97. icon: "none",
  98. duration: 2000
  99. });
  100. },
  101. 300
  102. );
  103. },
  104. }
  105. };
  106. </script>
  107. <style lang="less">
  108. /*所有推广头部样式*/
  109. .promoterHeader {
  110. width: 100%;
  111. height: 2.2 * 100rpx;
  112. background-color: #018C39;
  113. position: relative;
  114. .bg{
  115. width: 100%;
  116. height: 100%;
  117. position: absolute;
  118. top: 0;
  119. left: 0;
  120. }
  121. }
  122. .promoterHeader .headerCon {
  123. height: 100%;
  124. padding: 0 0.88 * 100rpx 0 0.55 * 100rpx;
  125. font-size: 0.28 * 100rpx;
  126. color: #fff;
  127. background-repeat: no-repeat;
  128. background-size: 100% 100%;
  129. }
  130. .promoterHeader .headerCon .name {
  131. margin-bottom: 0.02 * 100rpx;
  132. }
  133. .promoterHeader .headerCon .num {
  134. font-size: 0.5 * 100rpx;
  135. }
  136. .promoterHeader .headerCon .iconfont {
  137. font-size: 1.25 * 100rpx;
  138. }
  139. .promoter-list{
  140. width: 100%;
  141. }
  142. /*推广人列表*/
  143. .promoter-list .header {
  144. padding-bottom: 0.12 * 100rpx;
  145. }
  146. .promoter-list .nav {
  147. background-color: #fff;
  148. height: 0.86 * 100rpx;
  149. line-height: 0.86 * 100rpx;
  150. font-size: 0.28 * 100rpx;
  151. color: #282828;
  152. border-bottom: 1px solid #eee;
  153. }
  154. .promoter-list .nav .item {
  155. height: 100%;
  156. }
  157. .promoter-list .nav .item.on {
  158. color: #eb3729;
  159. border-bottom: 0.05 * 100rpx solid #eb3729;
  160. }
  161. .promoter-list .search {
  162. margin-top: 0.12 * 100rpx;
  163. box-sizing: border-box;
  164. width: 100%;
  165. background-color: #fff;
  166. height: 0.86 * 100rpx;
  167. padding: 0 0.3 * 100rpx;
  168. }
  169. .promoter-list .search .input {
  170. width: 6.3 * 100rpx;
  171. height: 0.6 * 100rpx;
  172. border-radius: 0.5 * 100rpx;
  173. background-color: #f5f5f5;
  174. text-align: center;
  175. position: relative;
  176. }
  177. .promoter-list .search .input input {
  178. height: 100%;
  179. font-size: 0.26 * 100rpx;
  180. width: 6.2 * 100rpx;
  181. text-align: left;
  182. }
  183. .promoter-list .search .input input::placeholder {
  184. color: #bbb;
  185. }
  186. .promoter-list .search .input .iconfont {
  187. position: absolute;
  188. right: 0.28 * 100rpx;
  189. color: #999;
  190. font-size: 0.28 * 100rpx;
  191. top: 50%;
  192. transform: translateY(-50%);
  193. }
  194. .promoter-list .search .iconfont {
  195. font-size: 0.4 * 100rpx;
  196. color: #515151;
  197. }
  198. .promoter-list .list .sortNav {
  199. background-color: #fff;
  200. height: 0.76 * 100rpx;
  201. border-bottom: 1px solid #eee;
  202. color: #333;
  203. font-size: 0.28 * 100rpx;
  204. }
  205. .promoter-list .list .sortNav.on {
  206. position: fixed;
  207. top: 0;
  208. left: 0;
  209. width: 100%;
  210. z-index: 5;
  211. }
  212. .promoter-list .list .sortNav .sortItem {
  213. text-align: center;
  214. flex: 1;
  215. -o-flex: 1;
  216. -ms-flex: 1;
  217. }
  218. .promoter-list .list .sortNav .sortItem image {
  219. width: 0.24 * 100rpx;
  220. height: 0.24 * 100rpx;
  221. margin-left: 0.06 * 100rpx;
  222. vertical-align: -0.03 * 100rpx;
  223. }
  224. .promoter-list .list .sortList {
  225. margin-top: 0.76 * 100rpx;
  226. }
  227. .promoter-list .list .item {
  228. background-color: #fff;
  229. border-bottom: 1px solid #eee;
  230. height: 1.52 * 100rpx;
  231. padding: 0 0.3 * 100rpx 0 0.2 * 100rpx;
  232. font-size: 0.24 * 100rpx;
  233. color: #666;
  234. }
  235. .promoter-list .list .item .picTxt {
  236. display: flex;
  237. align-items: center;
  238. justify-content: flex-start;
  239. }
  240. .promoter-list .list .item .picTxt .pictrue {
  241. width: 100rpx;
  242. height:100rpx;
  243. border-radius: 50%;
  244. }
  245. .promoter-list .list .item .picTxt .pictrue image {
  246. width: 100%;
  247. height: 100%;
  248. border-radius: 50%;
  249. border: 0.03 * 100rpx solid #fff;
  250. box-shadow: 0 0 0.07 * 100rpx #aaa;
  251. -moz-box-shadow: 0 0 0.07 * 100rpx #aaa;
  252. -o-box-shadow: 0 0 0.07 * 100rpx #aaa;
  253. -moz-box-sizing: border-box;
  254. box-sizing: border-box;
  255. }
  256. .promoter-list .list .item .picTxt .text {
  257. margin-left: 30rpx;
  258. font-size: 0.24 * 100rpx;
  259. color: #666;
  260. }
  261. .promoter-list .list .item .picTxt .text .name {
  262. font-size: 0.28 * 100rpx;
  263. color: #333;
  264. margin-bottom: 0.13 * 100rpx;
  265. }
  266. .promoter-list .list .item .right {
  267. width: 2.4 * 100rpx;
  268. text-align: right;
  269. font-size: 0.22 * 100rpx;
  270. color: #333;
  271. }
  272. </style>