deliveryRecord.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <template>
  2. <view class="deliveryRecord-container">
  3. <scroll-view class="scroll-con" scroll-y @scrolltolower="onreachBottom">
  4. <!-- 列表数据 -->
  5. <view class="cell-item-con">
  6. <view class="cell-item" v-for="(item, index) in listdata" :key="index">
  7. <text class="cell-item-date">{{item.time}}</text>
  8. <view class="cell-item-main">
  9. <u-image width="150rpx" height="150rpx" :src="item.pic" class="cell-item-pic"></u-image>
  10. <view class="cell-item-r">
  11. <view class="cell-item-head">
  12. <view class="cell-item-val"><text class="cell-item-num">{{item.tit}}</text>克</view>
  13. <u-tag :text="item.price + '乐豆'" mode="light" type="warning" size="mini" class="cell-item-price" />
  14. </view>
  15. <text class="cell-item-des">{{item.label}}</text>
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. <u-empty class="nodata" :text="noDataText" v-if="listdata.length==0 && status!='loading'" mode="list"></u-empty>
  21. <view class="loadmore">
  22. <u-loadmore v-if="total>pageSize || status=='loading'" :status="status" />
  23. </view>
  24. </scroll-view>
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. data() {
  30. return {
  31. listdata: [
  32. { tit: '255', time: '2020-11-4 10:11', pic: '', price: '38', label: '撒健康的国家啥都给交撒旦教撒健康的国家啥都给交撒旦撒健给交撒旦教' },
  33. { tit: '255', time: '2020-11-4 10:11', pic: '', price: '38', label: '撒健康的国家啥旦教' },
  34. ],
  35. pageNo: 1, // 当前页码
  36. pageSize: 10, // 每页条数
  37. total: 0, // 数据总条数
  38. noDataText: '暂无数据', // 列表请求状态提示语
  39. status: 'loadmore', // 加载中状态
  40. }
  41. },
  42. onShow() {
  43. this.searchHandle(1)
  44. },
  45. onLoad() {
  46. },
  47. methods:{
  48. // 搜索查询
  49. searchHandle (pageNo,suppName) {
  50. this.status = "loading"
  51. pageNo ? this.pageNo = pageNo : null
  52. // searchSuppliers({
  53. // pageNo: this.pageNo,
  54. // pageSize: this.pageSize,
  55. // queryWord: this.queryValue
  56. // }).then(res => {
  57. // if (res.status == 200) {
  58. // if(this.pageNo>1){
  59. // this.listdata = this.listdata.concat(res.data.list || [])
  60. // }else{
  61. // this.listdata = res.data.list || []
  62. // }
  63. // this.total = res.data.count || 0
  64. // this.listdata.length == 0 && this.queryValue != '' ? this.noDataText = '没有搜索到相关结果' : this.noDataText = '暂无数据'
  65. // } else {
  66. // this.noDataText = res.message
  67. // this.listdata = []
  68. // this.total = 0
  69. // }
  70. this.status = "loadmore"
  71. // })
  72. },
  73. // scroll-view到底部加载更多
  74. onreachBottom() {
  75. if(this.listdata.length < this.total){
  76. this.pageNo += 1
  77. this.searchHandle()
  78. }else{
  79. uni.showToast({ title: '已经到底了', icon: 'none' })
  80. this.status = "nomore"
  81. }
  82. }
  83. }
  84. }
  85. </script>
  86. <style lang="less">
  87. .deliveryRecord-container{
  88. width: 100%;
  89. // 列表
  90. .scroll-con{
  91. height: 100%;
  92. overflow: auto;
  93. }
  94. // 列表样式
  95. .cell-item-con{
  96. .cell-item{
  97. background-color: #fff;
  98. color: #606266;
  99. padding: 16rpx 32rpx 22rpx;
  100. border-bottom: 1rpx solid #e6e6e6;
  101. .cell-item-date{
  102. display: block;
  103. color: #909399;
  104. font-size: 26rpx;
  105. }
  106. .cell-item-main{
  107. display: flex;
  108. justify-content: space-around;
  109. align-items: center;
  110. padding-top: 14rpx;
  111. .cell-item-pic{
  112. flex-shrink: 0;
  113. margin-right: 20rpx;
  114. }
  115. .cell-item-r{
  116. flex-grow: 1;
  117. .cell-item-head{
  118. display: flex;
  119. justify-content: space-between;
  120. align-items: center;
  121. padding: 5rpx 0 15rpx;
  122. .cell-item-val{
  123. font-size: 32rpx;
  124. .cell-item-num{
  125. display: inline-block;
  126. margin-right: 6rpx;
  127. }
  128. }
  129. }
  130. .cell-item-des{
  131. color: #909399;
  132. font-size: 26rpx;
  133. }
  134. }
  135. }
  136. }
  137. }
  138. }
  139. </style>