selPayment.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <view>
  3. <view class="customer-ul">
  4. <view class="customer-li" v-for="(item, index) in staff_list" :key="index" @click="changeSupplier(item)">
  5. <view class="customer-name clearfix">
  6. <text class="float_left">{{ item.title }}</text>
  7. <view class="float_right">
  8. <u-tag style="margin-left: 10rpx;" v-if="item.defaultStatus === 5" size="mini" text="默认" mode="plain" type="success" />
  9. </view>
  10. </view>
  11. </view>
  12. </view>
  13. <u-loadmore :status="load_status" />
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. data() {
  19. return {
  20. keyword: '',
  21. load_status: 'nomore',
  22. page: 1,
  23. pageSize: 10,
  24. total: 0,
  25. staff_list: []
  26. };
  27. },
  28. onLoad() {
  29. this.getAllPayment();
  30. },
  31. onPullDownRefresh() {
  32. this.getAllPayment();
  33. },
  34. // 上拉加载
  35. onReachBottom() {
  36. if (this.total / this.pageSize > this.page) {
  37. this.page += 1;
  38. this.getAllPayment();
  39. }
  40. },
  41. methods: {
  42. changeSupplier(item) {
  43. // 选择返回上一页
  44. this._prePage().paymentData = item;
  45. uni.navigateBack();
  46. },
  47. search() {
  48. this.page = 1;
  49. this.getAllPayment();
  50. },
  51. getAllPayment() {
  52. this.loading_status = 'loading';
  53. this.$u.api
  54. .getAllPayment({
  55. page: this.page,
  56. pageSize: this.pageSize
  57. })
  58. .then(res => {
  59. uni.stopPullDownRefresh();
  60. if (this.page === 1) {
  61. this.staff_list = res.data;
  62. } else {
  63. this.staff_list = this.staff_list.concat(res.data);
  64. }
  65. this.total = res.pageTotal;
  66. this.load_status = this.$utils.loadStatus(this.page,this.pageSize,this.total);
  67. })
  68. .catch(err => {
  69. uni.stopPullDownRefresh();
  70. });
  71. }
  72. }
  73. };
  74. </script>
  75. <style lang="scss" scoped>
  76. .search-view {
  77. position: fixed;
  78. z-index: 99;
  79. top: 0;
  80. left: 0;
  81. width: 100%;
  82. background-color: #ffffff;
  83. border-bottom: 1px solid #f5f5f5;
  84. padding: 20rpx 0;
  85. .input-view {
  86. padding: 0 24rpx;
  87. input {
  88. height: 60rpx;
  89. line-height: 60rpx;
  90. padding: 0 24rpx;
  91. display: inline-block;
  92. width: 580rpx;
  93. border: 1px solid #f5f5f5;
  94. vertical-align: middle;
  95. border-radius: 8rpx;
  96. background-color: #f7f8fa;
  97. }
  98. .add-icon {
  99. margin-left: 14rpx;
  100. display: inline-block;
  101. vertical-align: middle;
  102. }
  103. }
  104. }
  105. .customer-ul {
  106. padding-bottom: 20rpx;
  107. .customer-li {
  108. border-bottom: 1px solid #eeeeee;
  109. background-color: #ffffff;
  110. border-radius: 10rpx;
  111. &:last-child{
  112. border-bottom: 0 none;
  113. }
  114. .customer-name {
  115. padding: 0 20rpx;
  116. line-height: 100rpx;
  117. }
  118. }
  119. }
  120. </style>