itemuser.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. <template>
  2. <view :style="colorStyle">
  3. <view class="promoter-list">
  4. <view class='list' v-if="recordList.length">
  5. <block v-for="(item,index) in recordList" :key="index">
  6. <view class='item acea-row row-between-wrapper' :class="index == 0 ? 'radius15' : ''">
  7. <view class="picTxt acea-row row-between-wrapper">
  8. <view class='pictrue'>
  9. <image :src='item.avatar'></image>
  10. </view>
  11. <view class='text'>
  12. <view class='name line1'>{{item.nickname}}</view>
  13. <view>手机号: {{item.phone}}</view>
  14. </view>
  15. </view>
  16. <view class="right">
  17. <view><text class="num">{{item.green_integral|| 0}}</text></view>
  18. </view>
  19. </view>
  20. </block>
  21. </view>
  22. <view v-if="recordList.length == 0">
  23. <emptyPage title="暂无数据~"></emptyPage>
  24. </view>
  25. </view>
  26. <home v-if="navigation"></home>
  27. <!-- #ifdef MP -->
  28. <authorize v-if="isShowAuth" @authColse="authColse" @onLoadFun="onLoadFun"></authorize>
  29. <!-- #endif -->
  30. </view>
  31. </template>
  32. <script>
  33. import {
  34. getGreedUserList
  35. } from '@/api/user.js';
  36. import {
  37. toLogin
  38. } from '@/libs/login.js';
  39. import {
  40. mapGetters
  41. } from "vuex";
  42. import emptyPage from '@/components/emptyPage.vue'
  43. import home from '@/components/home';
  44. import colors from '@/mixins/color.js';
  45. export default {
  46. components: {
  47. home,
  48. emptyPage
  49. },
  50. mixins: [colors],
  51. data() {
  52. return {
  53. page: 1,
  54. limit: 20,
  55. recordList: [],
  56. isAuto: false, //没有授权的不会自动授权
  57. isShowAuth: false, //是否隐藏授权
  58. count:0,
  59. status:false
  60. };
  61. },
  62. computed: mapGetters(['isLogin']),
  63. onLoad() {
  64. if (this.isLogin) {
  65. this.userSpreadNewList();
  66. } else {
  67. //#ifndef MP
  68. toLogin();
  69. //#endif
  70. //#ifdef MP
  71. this.isShowAuth = true;
  72. //#endif
  73. }
  74. },
  75. onShow: function() {
  76. if (this.is_show) this.userSpreadNewList();
  77. },
  78. onHide: function() {
  79. this.is_show = true;
  80. },
  81. methods: {
  82. onLoadFun(e) {
  83. this.userSpreadNewList();
  84. this.isShowAuth = false;
  85. },
  86. // 授权关闭
  87. authColse: function(e) {
  88. this.isShowAuth = e
  89. },
  90. userSpreadNewList: function() {
  91. let that = this;
  92. if (that.status == true) return;
  93. let page = that.page;
  94. let limit = that.limit;
  95. let recordList = that.recordList;
  96. let recordListNew = [];
  97. getGreedUserList({
  98. page: page,
  99. limit: limit,
  100. }).then(res => {
  101. let len = res.data.list.length;
  102. let recordListData = res.data.list;
  103. recordListNew = recordList.concat(recordListData);
  104. that.status = limit > len;
  105. that.page = page + 1;
  106. that.$set(that, 'recordList', recordListNew);
  107. that.count = res.data.count;
  108. });
  109. }
  110. },
  111. onReachBottom: function() {
  112. this.userSpreadNewList();
  113. }
  114. }
  115. </script>
  116. <style scoped lang="scss">
  117. .promoter-list .nav {
  118. background-color: #fff;
  119. height: 86rpx;
  120. line-height: 86rpx;
  121. font-size: 28rpx;
  122. color: #282828;
  123. border-bottom: 1rpx solid #eee;
  124. }
  125. .promoter-list .nav .item.on {
  126. border-bottom: 5rpx solid var(--view-theme);
  127. color: var(--view-theme);
  128. }
  129. .promoter-list .search {
  130. width: 100%;
  131. background-color: var(--view-theme);
  132. border-bottom: 1px solid #f2f2f2;
  133. height: 86rpx;
  134. padding: 0 30rpx;
  135. box-sizing: border-box;
  136. }
  137. .promoter-list .search .input {
  138. width: 100%;
  139. height: 60rpx;
  140. border-radius: 50rpx;
  141. background-color: #f5f5f5;
  142. position: relative;
  143. }
  144. .promoter-list .search .input input {
  145. height: 100%;
  146. font-size: 26rpx;
  147. width: 100%;
  148. padding-left: 30rpx;
  149. }
  150. .promoter-list .search .input .placeholder {
  151. color: #bbb;
  152. }
  153. .promoter-list .search .input .iconfont {
  154. position: absolute;
  155. right: 28rpx;
  156. color: #999;
  157. font-size: 28rpx;
  158. top: 50%;
  159. transform: translateY(-50%);
  160. }
  161. .promoter-list .search .iconfont {
  162. font-size: 45rpx;
  163. color: #515151;
  164. background-color: var(--view-theme);
  165. width: 110rpx;
  166. height: 60rpx;
  167. line-height: 60rpx;
  168. }
  169. .promoter-list .list {
  170. margin-top: 12rpx;
  171. }
  172. .promoter-list .list .sortNav {
  173. background-color: #fff;
  174. height: 76rpx;
  175. border-bottom: 1rpx solid #eee;
  176. color: #333;
  177. font-size: 28rpx;
  178. }
  179. .promoter-list .list .sortNav .sortItem {
  180. text-align: center;
  181. flex: 1;
  182. }
  183. .promoter-list .list .sortNav .sortItem image {
  184. width: 24rpx;
  185. height: 24rpx;
  186. margin-left: 6rpx;
  187. vertical-align: -3rpx;
  188. }
  189. .promoter-list .list .item {
  190. background-color: #fff;
  191. border-bottom: 1rpx solid #eee;
  192. height: 152rpx;
  193. padding: 0 30rpx 0 20rpx;
  194. font-size: 24rpx;
  195. color: #666;
  196. margin: 0 30rpx;
  197. }
  198. .promoter-list .list .item .picTxt {
  199. width: 440rpx;
  200. }
  201. .promoter-list .list .item .picTxt .pictrue {
  202. width: 106rpx;
  203. height: 106rpx;
  204. border-radius: 50%;
  205. }
  206. .promoter-list .list .item .picTxt .pictrue image {
  207. width: 100%;
  208. height: 100%;
  209. border-radius: 50%;
  210. border: 3rpx solid #fff;
  211. box-shadow: 0 0 10rpx #aaa;
  212. box-sizing: border-box;
  213. }
  214. .promoter-list .list .item .picTxt .text {
  215. width: 304rpx;
  216. font-size: 24rpx;
  217. color: #666;
  218. }
  219. .promoter-list .list .item .picTxt .text .name {
  220. font-size: 28rpx;
  221. color: #333;
  222. margin-bottom: 13rpx;
  223. }
  224. .promoter-list .list .item .right {
  225. width: 190rpx;
  226. text-align: right;
  227. font-size: 22rpx;
  228. color: #333;
  229. }
  230. .promoter-list .list .item .right .num {
  231. margin-right: 7rpx;
  232. }
  233. .top_num{
  234. padding: 30rpx;
  235. font-size: 26rpx;
  236. color: #666;
  237. }
  238. .main_color{
  239. color: #E93323;
  240. }
  241. .radius15{
  242. border-radius: 14rpx 14rpx 0 0;
  243. }
  244. </style>