index.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <template>
  2. <view class="px-20">
  3. <view class="flex-between-center mt-10">
  4. <view class="flex-1 h-72 rd-40rpx bg--w111-fff px-32 flex-y-center relative">
  5. <text class="iconfont icon-ic_search fs-28"></text>
  6. <input v-model="params.nickname" class="pl-18 flex-1 line1 fs-28" placeholder="请输入用户昵称/手机号/用户ID"
  7. placeholder-class="text--w111-999" @confirm="searchSubmit" />
  8. <text class="iconfont icon-ic_close1 fs-28 text--w111-999 z-10" v-if="params.nickname" @tap="clearWord"></text>
  9. </view>
  10. <view class="w-72 h-72 rd-50-p111- bg--w111-fff flex-center ml-20" @tap="goPage('/pages/behalf/record/index')">
  11. <text class="iconfont icon-ic_order text--w111-666"></text>
  12. </view>
  13. </view>
  14. <view class="add-box w-full h-176 rd-24rpx mt-32 flex-col flex-center text-primary"
  15. @tap="goPage('/pages/behalf/goods_list/index?uid=0')">
  16. <text class="iconfont icon-ic_picture fs-44"></text>
  17. <text class="fs-24 lh-34rpx pt-12">未注册用户点此下单</text>
  18. </view>
  19. <view v-if="userList.length">
  20. <view class="w-full h-176 rd-24rpx item flex-between-center bg--w111-fff mt-20"
  21. v-for="(item,index) in userList" :key="index">
  22. <view class="flex-y-center">
  23. <easy-loadimage
  24. mode="widthFix"
  25. :image-src="item.avatar"
  26. width="96rpx"
  27. height="96rpx"
  28. borderRadius="50%"></easy-loadimage>
  29. <view class="w-400 ml-24">
  30. <view class="fs-28 fw-500 flex-y-center">
  31. <text>{{item.nickname}}</text>
  32. <view class="svip flex-center" v-if="item.isMember == 1">SVIP</view>
  33. <view class="vip flex-center" v-if="item.level_status == 1 && item.level_grade">
  34. <text class="iconfont icon-huiyuandengji"></text>
  35. {{item.level}}
  36. </view>
  37. </view>
  38. <view class="fs-24 text--w111-999 lh-34rpx pt-4">{{item.phone}}</view>
  39. <view class="flex-y-center fs-24 lh-34rpx">
  40. <view class="flex-y-center">
  41. <text class="text--w111-999 pr-10">积分:</text>
  42. <text>{{item.integral}}</text>
  43. </view>
  44. <view class="flex-y-center pl-30">
  45. <text class="text--w111-999 pr-10">余额:</text>
  46. <text>{{item.now_money}}</text>
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. <view class="w-144 h-56 rd-28rpx flex-center fs-24 text--w111-fff bg-primary" @tap="goPage('/pages/behalf/goods_list/index?uid=' + item.uid)">下单</view>
  52. </view>
  53. <view class="flex-center fs-26 text--w111-999 pt-24" v-if="userList.length > 0">{{loadTit}}...</view>
  54. </view>
  55. <view v-else class="mt-20">
  56. <emptyPage title="暂无用户信息~" src="/statics/images/empty-box.png"></emptyPage>
  57. </view>
  58. </view>
  59. </template>
  60. <script>
  61. import { adminUserList } from "@/api/admin.js";
  62. import emptyPage from '@/components/emptyPage.vue';
  63. export default {
  64. name:'userList',
  65. data(){
  66. return {
  67. params:{
  68. page:1,
  69. limit:10,
  70. nickname:'',
  71. },
  72. userList:[],
  73. status: false,
  74. loadTit:'正在加载'
  75. }
  76. },
  77. components: {
  78. emptyPage,
  79. },
  80. onLoad() {
  81. this.getList();
  82. },
  83. onPageScroll(object) {
  84. uni.$emit('scroll');
  85. },
  86. methods:{
  87. getList(){
  88. let that = this;
  89. if (that.status) return;
  90. that.loadTit = '加载更多';
  91. adminUserList(this.params).then(res => {
  92. let len = res.data.list.length;
  93. this.userList = this.userList.concat(res.data.list)
  94. that.params.page++;
  95. that.status = this.params.limit > len;
  96. that.params.page = that.params.page;
  97. that.loadTit = that.status ? '没有更多内容啦~' : '加载更多';
  98. }).catch(err=>{
  99. that.loadTit = '加载更多';
  100. return this.$util.Tips({
  101. title: err
  102. });
  103. })
  104. },
  105. searchSubmit(){
  106. this.params.page = 1;
  107. this.status = false;
  108. this.userList = [];
  109. this.getList();
  110. },
  111. clearWord(){
  112. this.params.nickname = ''
  113. },
  114. goPage(url){
  115. uni.navigateTo({
  116. url
  117. })
  118. }
  119. },
  120. onReachBottom(e) {
  121. this.getList()
  122. }
  123. }
  124. </script>
  125. <style lang="scss">
  126. .text-primary{
  127. color: $primary-admin;
  128. }
  129. .bg-primary{
  130. background: $primary-admin;
  131. }
  132. .add-box{
  133. border: 2rpx dashed $primary-admin;
  134. background: $light-primary-admin;
  135. color: $primary-admin;
  136. }
  137. .add-icon{
  138. border: 2rpx solid $primary-admin;
  139. }
  140. .item{
  141. padding: 30rpx 24rpx;
  142. }
  143. .icon-ic_close1{
  144. position: absolute;
  145. right: 34rpx;
  146. top: 50%;
  147. transform: translateY(-50%);
  148. }
  149. .svip {
  150. width: 56rpx;
  151. height: 26rpx;
  152. background: linear-gradient(270deg, #484643 0%, #1F1B17 100%);
  153. border-radius: 100rpx;
  154. font-size: 18rpx;
  155. font-weight: 600;
  156. color: #FDDAA4;
  157. margin-left: 10rpx;
  158. }
  159. .vip{
  160. width: 64rpx;
  161. height: 26rpx;
  162. background: #FEF0D9;
  163. border: 1px solid #FACC7D;
  164. border-radius: 50rpx;
  165. font-size: 18rpx;
  166. font-weight: 500;
  167. color: #DFA541;
  168. margin-left: 10rpx;
  169. .iconfont {
  170. font-size: 20rpx;
  171. margin-right: 4rpx;
  172. }
  173. }
  174. </style>