index.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <template>
  2. <view class="content">
  3. <view class="header">
  4. <view>
  5. <text>2021-03-15至2021-06-02</text>
  6. </view>
  7. <text>总计:其它垃圾2000,厨余垃圾1000,建筑垃圾0。</text>
  8. </view>
  9. <scroll-view class="scroll-con" scroll-y @scrolltolower="onreachBottom">
  10. <!-- 列表数据 -->
  11. <view class="cell-item" v-for="item in listdata">
  12. <view class="cell-item-title" >
  13. <view>
  14. <text>2020-02-23 15:12:30</text>
  15. </view>
  16. <view>
  17. <span>查看详情</span>
  18. <u-icon name="arrow-right" size="28"></u-icon>
  19. </view>
  20. </view>
  21. <view class="cell-item-cont">
  22. <view class="cont-item">
  23. <text>其它垃圾</text>
  24. <text>1000kg</text>
  25. </view>
  26. <view class="cont-item">
  27. <text>厨余垃圾</text>
  28. <text>1000kg</text>
  29. </view>
  30. <view class="cont-item">
  31. <text>建筑垃圾</text>
  32. <text>1000kg</text>
  33. </view>
  34. </view>
  35. </view>
  36. <view class="nodata" v-if="listdata.length==0 && status!='loading'">
  37. <u-empty :text="noDataText" mode="list"></u-empty>
  38. </view>
  39. <view class="loadmore">
  40. <u-loadmore v-if="total>pageSize || status=='loading'" :status="status" />
  41. </view>
  42. </scroll-view>
  43. <view class="footer">
  44. <u-icon name="edit-pen" size="30"></u-icon>
  45. <text>垃圾数据录入</text>
  46. </view>
  47. </view>
  48. </template>
  49. <script>
  50. export default {
  51. data() {
  52. return {
  53. listdata: [{},{},{},{}],
  54. pageNo: 1, // 当前页码
  55. pageSize: 10, // 每页条数
  56. total: 0, // 数据总条数
  57. noDataText: '暂无数据', // 列表请求状态提示语
  58. status: 'loadmore', // 加载中状态
  59. }
  60. },
  61. onLoad() {
  62. },
  63. onUnload() {
  64. },
  65. onShareAppMessage(res) {
  66. },
  67. onShareTimeline(res) {
  68. },
  69. onShow() {
  70. },
  71. methods: {
  72. // scroll-view到底部加载更多
  73. onreachBottom() {
  74. console.log(111111)
  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="scss" scoped>
  87. page{
  88. }
  89. .content {
  90. width: 100%;
  91. height: 100%;
  92. display: flex;
  93. flex-direction: column;
  94. justify-content: center;
  95. align-items: center;
  96. .header{
  97. background-color: #FFFFFF;
  98. display: flex;
  99. flex-direction: column;
  100. border-radius: 15upx;
  101. padding: 20upx;
  102. box-shadow: 0upx 3upx 6upx #eee;
  103. margin-bottom: 20upx;
  104. > text {
  105. line-height: 50upx;
  106. }
  107. }
  108. .scroll-con{
  109. flex: 1;
  110. width: 100%;
  111. .cell-item{
  112. width: 100%;
  113. background-color: #fff;
  114. border-radius: 15upx;
  115. // padding: 20upx;
  116. box-shadow: 0upx 3upx 6upx #eee;
  117. .cell-item-title{
  118. padding: 20upx 20upx 10upx;
  119. width: 100%;
  120. display: flex;
  121. justify-content: space-between;
  122. border-bottom: 1px solid #e6e6e6;
  123. }
  124. .cell-item-cont{
  125. width: 100%;
  126. display: flex;
  127. justify-content: space-between;
  128. padding: 20upx;
  129. margin-bottom: 20upx;
  130. .cont-item{
  131. display: flex;
  132. flex-direction: column;
  133. align-items: center;
  134. width: 33%;
  135. border-right: 1px solid #e6e6e6;
  136. :first-child {
  137. padding: 26upx;
  138. width: 100upx;
  139. height: 100upx;
  140. background-color: red;
  141. border-radius: 50%;
  142. font-size: 24upx;
  143. display: flex;
  144. align-items: center;
  145. justify-content: center;
  146. color: #fff;
  147. }
  148. }
  149. :last-child {
  150. border: none;
  151. }
  152. }
  153. }
  154. }
  155. .footer{
  156. z-index: 9999;
  157. position: fixed;
  158. bottom: 80upx;
  159. width: 80%;
  160. height: 80upx;
  161. background-color: red;
  162. opacity: 0.8;
  163. border-radius: 40upx;
  164. color: #fff;
  165. display: flex;
  166. align-items: center;
  167. justify-content: center;
  168. }
  169. }
  170. </style>