ktadmin.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <template>
  2. <view class="content">
  3. <view class="user-item flex">
  4. <image src="" mode="" class="item-logo"></image>
  5. <view class="item-info flex">
  6. <view class="info-name">
  7. 李丹丹 13523025369
  8. </view>
  9. <view class="info-address">
  10. 椒江区东海大道400号
  11. </view>
  12. <view class="info-t">
  13. 空桶型号:小瓶330ML
  14. </view>
  15. <view class="info-info flex">
  16. <view class="">
  17. 押桶:<text>0</text>
  18. </view>
  19. <view class="">
  20. 押金:<text>0</text>元
  21. </view>
  22. <view class="">
  23. 借桶:<text>0</text>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. import {
  32. getUserList
  33. } from "@/api/user.js"
  34. export default {
  35. data() {
  36. return {
  37. keyword: '', //搜索关键字
  38. searchData: {
  39. page: 1,
  40. limit: 10,
  41. list: [],
  42. loadingType: 'more',
  43. loaded:false,
  44. }
  45. };
  46. },
  47. onLoad(opt) {
  48. this.getlist()
  49. },
  50. onShow() {
  51. },
  52. // #ifndef MP
  53. //点击导航栏 buttons 时触发
  54. onNavigationBarButtonTap(e) {
  55. const index = e.index;
  56. if (index === 0) {
  57. this.reLoadSearch();
  58. }
  59. },
  60. // 点击键盘搜索事件
  61. onNavigationBarSearchInputConfirmed(e) {
  62. this.reLoadSearch();
  63. },
  64. // 搜索栏内容变化事件
  65. onNavigationBarSearchInputChanged(e) {
  66. this.keyword = e.text;
  67. },
  68. // #endif
  69. onReady(res) {
  70. var that = this;
  71. },
  72. onReachBottom() {
  73. this.getlist();
  74. },
  75. methods: {
  76. // 搜索
  77. reLoadSearch() {
  78. this.searchData={
  79. page: 1,
  80. limit: 10,
  81. list: [],
  82. loadingType: 'more',
  83. loaded:false
  84. };
  85. this.getlist()
  86. },
  87. // 载入数据
  88. getlist() {
  89. //这里是将订单挂载到tab列表下
  90. let navItem = this.searchData;
  91. if (navItem.loadingType === 'loading') {
  92. //防止重复加载
  93. return;
  94. }
  95. if (navItem.loadingType === 'noMore') {
  96. //防止重复加载
  97. return;
  98. }
  99. // 修改当前对象状态为加载中
  100. navItem.loadingType = 'loading';
  101. GetAdminOrderList({
  102. page: navItem.page,
  103. limit: navItem.limit,
  104. keyword: this.keyword
  105. })
  106. .then(({
  107. data
  108. }) => {
  109. let arr = data.map(e => {
  110. return e;
  111. });
  112. navItem.list = navItem.list.concat(arr);
  113. // console.log(navItem.orderList);
  114. navItem.page++;
  115. if (navItem.limit == data.length) {
  116. //判断是否还有数据, 有改为 more, 没有改为noMore
  117. navItem.loadingType = 'more';
  118. return;
  119. } else {
  120. //判断是否还有数据, 有改为 more, 没有改为noMore
  121. navItem.loadingType = 'noMore';
  122. }
  123. uni.hideLoading();
  124. navItem.loaded = true;
  125. })
  126. .catch(e => {
  127. console.log(e);
  128. });
  129. }
  130. }
  131. };
  132. </script>
  133. <style lang="scss" scoped>
  134. .user-item {
  135. width: 750rpx;
  136. height: 277rpx;
  137. align-items: flex-start;
  138. padding: 42rpx 35rpx;
  139. background-color: #fff;
  140. margin-bottom: 15rpx;
  141. .item-logo {
  142. width: 115rpx;
  143. height: 115rpx;
  144. border-radius: 50%;
  145. background-color: #eee;
  146. flex-shrink: 0;
  147. margin-right: 24rpx;
  148. }
  149. .item-info {
  150. flex-grow: 1;
  151. height: 100%;
  152. flex-direction: column;
  153. align-items: flex-start;
  154. justify-content: space-between;
  155. .info-name {
  156. font-size: 34rpx;
  157. font-weight: bold;
  158. color: #333333;
  159. }
  160. .info-address {
  161. font-size: 28rpx;
  162. font-weight: 500;
  163. color: #333333;
  164. }
  165. .info-t {
  166. font-size: 26rpx;
  167. font-weight: 500;
  168. color: #333333;
  169. }
  170. .info-info {
  171. width: 100%;
  172. font-size: 30rpx;
  173. font-weight: bold;
  174. color: #333333;
  175. text {
  176. color: #FF4C4C;
  177. }
  178. }
  179. }
  180. }
  181. </style>