tdRecord.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <view class="content">
  3. <!-- 筛选弹框 -->
  4. <search-modal v-if="openScreen" :visible="openScreen" :defaultParams="searchForm" @refresh="refresh" @close="openScreen=false"></search-modal>
  5. <view class="page-head" @click="openScreen=true">
  6. <text>筛选</text>
  7. <image class="filter-icon" src="@/static/filter.png"></image>
  8. </view>
  9. <scroll-view class="list" scroll-y :scroll-top="scrollTop" @scrolltolower="onreachBottom">
  10. <view class="list-box" v-for="item in listdata" :key="item.id">
  11. <view class="list-time">{{item.deliveryTime}}</view>
  12. <view class="list-cons">
  13. <view class="list-imgs">
  14. <u-image width="80rpx" height="80rpx" src="/static/GLASS.png"></u-image>
  15. <view class="cls-names">废旧金属/塑料</view>
  16. </view>
  17. <view class="list-md">
  18. <view>
  19. <text class="red">{{item.rubbishWeight}}</text> 克
  20. </view>
  21. <view>{{item.customerMobile}}</view>
  22. </view>
  23. <view class="list-end">
  24. <text class="red">{{item.goldNum}}</text>
  25. <u-image width="40rpx" height="40rpx" src="/static/ledou.png"></u-image>
  26. </view>
  27. </view>
  28. </view>
  29. <u-empty class="nodata" :text="noDataText" v-if="listdata.length==0 && status!='loading'" mode="list"></u-empty>
  30. <view class="loadmore">
  31. <u-loadmore v-if="total>pageSize || status=='loading'" :status="status" />
  32. </view>
  33. </scroll-view>
  34. </view>
  35. </template>
  36. <script>
  37. import searchModal from './searchModal.vue'
  38. import {getDeliveryLog} from '@/api/delivery.js'
  39. export default {
  40. components: { searchModal },
  41. data() {
  42. return {
  43. openScreen: false,
  44. searchForm: { // 查询条件
  45. beginDate: '', // 创建时间默认筛选近7天
  46. endDate: '', // 创建时间默认筛选近7天
  47. customerMobile: '' // 手机号
  48. },
  49. scrollTop:0,
  50. pageNo: 1, // 当前页码
  51. pageSize: 10, // 每页条数
  52. total: 0,
  53. listdata: [],
  54. noDataText: '暂无数据', // 列表请求状态提示语
  55. status: 'loadmore', // 加载中状态
  56. }
  57. },
  58. methods: {
  59. // 获取查询参数 刷新列表
  60. refresh(params){
  61. this.searchForm = params
  62. this.listdata = []
  63. this.total = 0
  64. this.searchHandle(1)
  65. },
  66. // 搜索查询
  67. searchHandle (pageNo) {
  68. this.status = "loading"
  69. pageNo ? this.pageNo = pageNo : null
  70. getDeliveryLog({
  71. pageNo: this.pageNo,
  72. pageSize: this.pageSize,
  73. beginDate: this.searchForm.beginDate,
  74. endDate: this.searchForm.endDate,
  75. customerMobile: this.searchForm.customerMobile
  76. }).then(res => {
  77. if (res.status == 200) {
  78. if(this.pageNo>1){
  79. this.listdata = this.listdata.concat(res.data.list || [])
  80. }else{
  81. this.listdata = res.data.list || []
  82. this.scrollTop = 0
  83. }
  84. this.total = res.data.count || 0
  85. this.noDataText = '暂无数据'
  86. } else {
  87. this.noDataText = res.message
  88. this.listdata = []
  89. this.total = 0
  90. }
  91. this.status = "loadmore"
  92. })
  93. },
  94. // scroll-view到底部加载更多
  95. onreachBottom() {
  96. if(this.listdata.length < this.total){
  97. this.pageNo += 1
  98. this.searchHandle()
  99. }else{
  100. uni.showToast({ title: '已经到底了', icon: 'none' })
  101. this.status = "nomore"
  102. }
  103. }
  104. }
  105. }
  106. </script>
  107. <style lang="less">
  108. .content{
  109. width: 100%;
  110. padding: 0 20rpx;
  111. display: flex;
  112. flex-direction: column;
  113. height: 100vh;
  114. .page-head{
  115. padding: 20rpx;
  116. display: flex;
  117. align-items: center;
  118. justify-content: flex-end;
  119. .filter-icon{
  120. flex-shrink: 0;
  121. width: 36rpx;
  122. height: 36rpx;
  123. padding-left: 20rpx;
  124. }
  125. }
  126. .list{
  127. flex-grow: 1;
  128. }
  129. .list-box{
  130. background: #FFFFFF;
  131. border-radius: 10rpx;
  132. padding: 20rpx;
  133. box-shadow: 2rpx 2rpx 6rpx #eee;
  134. margin-bottom: 20rpx;
  135. .list-time{
  136. font-size: 28rpx;
  137. color: #666666;
  138. }
  139. .list-cons{
  140. display: flex;
  141. align-items: center;
  142. }
  143. .list-imgs{
  144. padding:20rpx 0 0;
  145. width: 180rpx;
  146. display: flex;
  147. align-items: center;
  148. flex-direction: column;
  149. justify-content: center;
  150. .cls-names{
  151. padding:10rpx 0;
  152. font-size: 24rpx;
  153. }
  154. }
  155. .list-md{
  156. flex-grow: 1;
  157. padding:0 20rpx;
  158. > view{
  159. padding:6rpx 0;
  160. display: flex;
  161. align-items: center;
  162. font-size: 30rpx;
  163. }
  164. }
  165. .list-end{
  166. padding:20rpx;
  167. font-size: 30rpx;
  168. display: flex;
  169. align-items: center;
  170. .red{
  171. font-size: 50rpx;
  172. color: #ff5500;
  173. }
  174. }
  175. .red{
  176. font-weight: bold;
  177. color: red;
  178. font-size: 36rpx;
  179. margin-right: 8rpx;
  180. }
  181. }
  182. }
  183. </style>