tdRecord.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  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/${item.rubbishType}.png`"></u-image>
  15. <view class="cls-names">{{item.rubbishTypeDictValue}}</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. rubbishType: []
  57. }
  58. },
  59. onLoad() {
  60. this.rubbishType = this.$store.state.vuex_rubbishType
  61. },
  62. onShow() {
  63. this.openScreen = false // 关闭筛选框
  64. this.refresh({})
  65. },
  66. methods: {
  67. // 获取查询参数 刷新列表
  68. refresh(params){
  69. this.searchForm = params
  70. this.listdata = []
  71. this.total = 0
  72. this.searchHandle(1)
  73. },
  74. // 搜索查询
  75. searchHandle (pageNo) {
  76. this.status = "loading"
  77. pageNo ? this.pageNo = pageNo : null
  78. getDeliveryLog({
  79. pageNo: this.pageNo,
  80. pageSize: this.pageSize,
  81. beginDate: this.searchForm.beginDate,
  82. endDate: this.searchForm.endDate,
  83. customerMobile: this.searchForm.customerMobile,
  84. operatorNo : this.$store.state.vuex_userData.id
  85. }).then(res => {
  86. if (res.status == 200) {
  87. if(this.pageNo>1){
  88. this.listdata = this.listdata.concat(res.data.list || [])
  89. }else{
  90. this.listdata = res.data.list || []
  91. this.scrollTop = 0
  92. }
  93. this.total = res.data.count || 0
  94. this.noDataText = '暂无数据'
  95. } else {
  96. this.noDataText = res.message
  97. this.listdata = []
  98. this.total = 0
  99. }
  100. this.status = "loadmore"
  101. })
  102. },
  103. // scroll-view到底部加载更多
  104. onreachBottom() {
  105. if(this.listdata.length < this.total){
  106. this.pageNo += 1
  107. this.searchHandle()
  108. }else{
  109. uni.showToast({ title: '已经到底了', icon: 'none' })
  110. this.status = "nomore"
  111. }
  112. }
  113. }
  114. }
  115. </script>
  116. <style lang="less">
  117. .content{
  118. width: 100%;
  119. padding: 0 20rpx;
  120. display: flex;
  121. flex-direction: column;
  122. height: 100vh;
  123. .page-head{
  124. padding: 20rpx;
  125. display: flex;
  126. align-items: center;
  127. justify-content: flex-end;
  128. .filter-icon{
  129. flex-shrink: 0;
  130. width: 36rpx;
  131. height: 36rpx;
  132. padding-left: 20rpx;
  133. }
  134. }
  135. .list{
  136. flex-grow: 1;
  137. height: calc(100vh - 76rpx);
  138. overflow: auto;
  139. }
  140. .list-box{
  141. background: #FFFFFF;
  142. border-radius: 10rpx;
  143. padding: 20rpx;
  144. box-shadow: 2rpx 2rpx 6rpx #eee;
  145. margin-bottom: 20rpx;
  146. .list-time{
  147. font-size: 28rpx;
  148. color: #666666;
  149. }
  150. .list-cons{
  151. display: flex;
  152. align-items: center;
  153. }
  154. .list-imgs{
  155. padding:20rpx 0 0;
  156. width: 180rpx;
  157. display: flex;
  158. align-items: center;
  159. flex-direction: column;
  160. justify-content: center;
  161. .cls-names{
  162. padding:10rpx 0;
  163. font-size: 24rpx;
  164. }
  165. }
  166. .list-md{
  167. flex-grow: 1;
  168. padding:0 20rpx;
  169. > view{
  170. padding:6rpx 0;
  171. display: flex;
  172. align-items: center;
  173. font-size: 30rpx;
  174. }
  175. }
  176. .list-end{
  177. padding:20rpx;
  178. font-size: 30rpx;
  179. display: flex;
  180. align-items: center;
  181. .red{
  182. font-size: 50rpx;
  183. color: #ff5500;
  184. }
  185. }
  186. .red{
  187. font-weight: bold;
  188. color: red;
  189. font-size: 36rpx;
  190. margin-right: 8rpx;
  191. }
  192. }
  193. }
  194. </style>