itemuser.vue 5.7 KB

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