useradmin.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. <template>
  2. <view class="content padding-t-30">
  3. <!-- 空白页 -->
  4. <!-- #ifdef H5 -->
  5. <empty src="../../../static/error/emptyOrder.png"
  6. v-if="searchData.loaded === true && searchData.list.length === 0"></empty>
  7. <!-- #endif -->
  8. <!-- #ifndef H5 -->
  9. <empty src="../../static/error/emptyOrder.png"
  10. v-if="searchData.loaded === true && searchData.list.length === 0"></empty>
  11. <!-- #endif -->
  12. <view class="user-item " v-for="(item,index) in searchData.list">
  13. <view class="user-info flex">
  14. <view class="flex-start flex-grow-true">
  15. <image class="image" :src="item.avatar" mode="scaleToFill"></image>
  16. <view class="clamp flex-grow-true padding-r-10">
  17. {{item.nickname}}
  18. </view>
  19. </view>
  20. <image @click="phone(item.phone)" class="phone" src="../../../static/icon/adminUserPhone.png"
  21. mode="scaleToFill"></image>
  22. </view>
  23. <view class="user-base font-size-sm padding-b-10">
  24. <view class="padding-b-10 padding-t-20">
  25. 电话:{{item.phone}}
  26. </view>
  27. <view class="padding-b-10">
  28. 地址:{{item.address.locate_address}}
  29. </view>
  30. <view class="padding-b-10">
  31. 详细:{{item.address.detail}}
  32. </view>
  33. </view>
  34. <view class="btn-list flex font-size-sm clamp">
  35. <view class="btn flex-shrink-false">
  36. 水票:{{item.certificate_num}}
  37. </view>
  38. <view class="btn flex-shrink-false clamp">
  39. 持桶:{{item.hold_num}}
  40. </view>
  41. <view class="btn clamp">
  42. 押金:{{+item.pledge_money}}
  43. </view>
  44. </view>
  45. </view>
  46. <uni-load-more :status="searchData.loadingType"></uni-load-more>
  47. </view>
  48. </template>
  49. <script>
  50. import {
  51. storeMember
  52. } from "@/api/water.js"
  53. export default {
  54. data() {
  55. return {
  56. keyword: '', //搜索关键字
  57. searchData: {
  58. page: 1,
  59. limit: 10,
  60. list: [],
  61. loadingType: 'more',
  62. loaded: false
  63. }
  64. };
  65. },
  66. onLoad(opt) {
  67. this.getlist()
  68. },
  69. onShow() {
  70. },
  71. onReady(res) {
  72. var that = this;
  73. },
  74. // #ifndef MP
  75. //点击导航栏 buttons 时触发
  76. onNavigationBarButtonTap(e) {
  77. const index = e.index;
  78. if (index === 0) {
  79. this.reLoadSearch();
  80. }
  81. },
  82. // 点击键盘搜索事件
  83. onNavigationBarSearchInputConfirmed(e) {
  84. this.reLoadSearch();
  85. },
  86. // 搜索栏内容变化事件
  87. onNavigationBarSearchInputChanged(e) {
  88. this.keyword = e.text;
  89. },
  90. // #endif
  91. onReachBottom() {
  92. this.getlist();
  93. },
  94. methods: {
  95. // 拨打电话
  96. phone(phone) {
  97. uni.makePhoneCall({
  98. phoneNumber: phone
  99. })
  100. },
  101. // 搜索
  102. reLoadSearch() {
  103. this.searchData = {
  104. page: 1,
  105. limit: 10,
  106. list: [],
  107. loadingType: 'more',
  108. loaded: false
  109. };
  110. this.getlist()
  111. },
  112. // 获取数据
  113. getlist() {
  114. //这里是将订单挂载到tab列表下
  115. let navItem = this.searchData;
  116. if (navItem.loadingType === 'loading') {
  117. //防止重复加载
  118. return;
  119. }
  120. if (navItem.loadingType === 'noMore') {
  121. //防止重复加载
  122. return;
  123. }
  124. // 修改当前对象状态为加载中
  125. navItem.loadingType = 'loading';
  126. storeMember({
  127. page: navItem.page,
  128. limit: navItem.limit,
  129. key: this.keyword
  130. })
  131. .then(({
  132. data
  133. }) => {
  134. let arr = data.data.map(
  135. (e) => {
  136. return e
  137. }
  138. );
  139. navItem.list = navItem.list.concat(arr);
  140. // console.log(navItem.orderList);
  141. navItem.page++;
  142. if (navItem.limit == data.length) {
  143. //判断是否还有数据, 有改为 more, 没有改为noMore
  144. navItem.loadingType = 'more';
  145. return;
  146. } else {
  147. //判断是否还有数据, 有改为 more, 没有改为noMore
  148. navItem.loadingType = 'noMore';
  149. }
  150. uni.hideLoading();
  151. navItem.loaded = true;
  152. })
  153. .catch(e => {
  154. console.log(e);
  155. });
  156. }
  157. }
  158. };
  159. </script>
  160. <style lang="scss" scoped>
  161. .user-item {
  162. align-items: flex-start;
  163. padding: 30rpx;
  164. background-color: #fff;
  165. margin: 0 30rpx;
  166. border-radius: 30rpx;
  167. margin-bottom: 15rpx;
  168. color: $font-color-light;
  169. .user-info {
  170. height: 72rpx;
  171. font-size: 36rpx;
  172. font-weight: bold;
  173. color: $font-color-base;
  174. .image {
  175. height: 72rpx;
  176. width: 72rpx;
  177. margin-right: 20rpx;
  178. background-color: #eee;
  179. border-radius: 50%;
  180. }
  181. .phone {
  182. width: 40rpx;
  183. height: 40rpx;
  184. }
  185. }
  186. .btn-list {
  187. color: $font-color-light;
  188. text-align: center;
  189. line-height: 1;
  190. .btn {
  191. width: 34%;
  192. padding: 20rpx 0;
  193. font-weight: 500;
  194. }
  195. .btn:nth-child(2) {
  196. border-right: 1px solid $border-color-base;
  197. border-left: 1px solid $border-color-base;
  198. }
  199. }
  200. }
  201. </style>