index.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <template>
  2. <view class="cleared-container">
  3. <scroll-view class="scroll-con" scroll-y :scroll-top="scrollTop" @scrolltolower="onreachBottom">
  4. <!-- 列表数据 -->
  5. <view class="cell-item-con">
  6. <view class="cell-item" v-for="(item, index) in listdata" :key="index">
  7. <view class="cell-item-c">
  8. <view class="cell-item-date">{{item.createDate}}</view>
  9. <view class="cell-item-orderNum">
  10. {{item.createDate}}
  11. <u-icon name="arrow-right" :size="28" color="#999"></u-icon>
  12. </view>
  13. </view>
  14. <u-grid :col="3" :hover-class="none">
  15. <u-grid-item>
  16. <view class="cell-item-main">
  17. <text class="cell-item-number blue">26</text>
  18. <text class="cell-item-unit">个</text>
  19. </view>
  20. <view class="cell-item-exp">清运网点数</view>
  21. </u-grid-item>
  22. <u-grid-item>
  23. <view class="cell-item-main">
  24. <text class="cell-item-number green">26</text>
  25. <text class="cell-item-unit">个</text>
  26. </view>
  27. <view class="cell-item-exp">清运箱体数</view>
  28. </u-grid-item>
  29. <u-grid-item>
  30. <view class="cell-item-main">
  31. <text class="cell-item-number red">26</text>
  32. <text class="cell-item-unit">kg</text>
  33. </view>
  34. <view class="cell-item-exp">清运总重量</view>
  35. </u-grid-item>
  36. </u-grid>
  37. </view>
  38. </view>
  39. <u-empty class="nodata" :text="noDataText" v-if="listdata.length==0 && status!='loading'" mode="list"></u-empty>
  40. <view class="loadmore">
  41. <u-loadmore v-if="total>pageSize || status=='loading'" :status="status" />
  42. </view>
  43. </scroll-view>
  44. </view>
  45. </template>
  46. <script>
  47. // import { getGoldLogList, GoldLogCancel } from '@/api/officialPartnerGoldLog.js'
  48. export default {
  49. data() {
  50. return {
  51. listdata: [],
  52. pageNo: 1, // 当前页码
  53. pageSize: 10, // 每页条数
  54. total: 0, // 数据总条数
  55. noDataText: '暂无数据', // 列表请求状态提示语
  56. status: 'loadmore', // 加载中状态
  57. customBtnStyle: { // 撤销单据 自定义按钮样式
  58. borderColor: '#2ab4e5',
  59. backgroundColor: '#2ab4e5',
  60. color: '#fff'
  61. },
  62. scrollTop: 0, // 滚动条位置
  63. }
  64. },
  65. onLoad() {
  66. this.refresh({})
  67. },
  68. methods:{
  69. // 获取查询参数 刷新列表
  70. refresh(){
  71. this.listdata = []
  72. this.total = 0
  73. this.searchHandle(1)
  74. },
  75. // 撤销单据
  76. revokeFun(row){
  77. const _this = this
  78. uni.showModal({
  79. title: '提示',
  80. content: '撤销单据后乐豆将全部退回给原支付账号,确认撤销吗?',
  81. success(res) {
  82. if (res.confirm) {
  83. // GoldLogCancel({ id: row.id }).then(ret => {
  84. // if(ret.status == 200){
  85. // uni.showToast({ title: ret.message, icon: 'none' })
  86. // _this.searchHandle(1)
  87. // }
  88. // })
  89. }
  90. }
  91. })
  92. },
  93. // 搜索查询
  94. searchHandle (pageNo) {
  95. // this.status = "loading"
  96. pageNo ? this.pageNo = pageNo : null
  97. // getGoldLogList({
  98. // pageNo: this.pageNo,
  99. // pageSize: this.pageSize,
  100. // customerMobile: ''
  101. // }).then(res => {
  102. // if (res.status == 200) {
  103. // if(this.pageNo>1){
  104. // this.listdata = this.listdata.concat(res.data.list || [])
  105. // }else{
  106. // this.listdata = res.data.list || []
  107. // this.scrollTop = 0
  108. // }
  109. // this.total = res.data.count || 0
  110. // this.noDataText = '暂无数据'
  111. // } else {
  112. // this.noDataText = res.message
  113. // this.listdata = []
  114. // this.total = 0
  115. // }
  116. // this.status = "loadmore"
  117. // })
  118. },
  119. // scroll-view到底部加载更多
  120. onreachBottom() {
  121. if(this.listdata.length < this.total){
  122. this.pageNo += 1
  123. this.searchHandle()
  124. }else{
  125. uni.showToast({ title: '已经到底了', icon: 'none' })
  126. this.status = "nomore"
  127. }
  128. }
  129. }
  130. }
  131. </script>
  132. <style lang="scss">
  133. page{
  134. height: 100%;
  135. }
  136. .cleared-container {
  137. width: 100%;
  138. height: 100%;
  139. display: flex;
  140. flex-direction: column;
  141. // 列表
  142. .scroll-con{
  143. flex: 1;
  144. overflow: auto;
  145. }
  146. // 列表样式
  147. .cell-item-con{
  148. .cell-item{
  149. margin: $uni-spacing-col-base $uni-spacing-row-base;
  150. background-color: #fff;
  151. border-radius: $uni-border-radius-base;
  152. color: $uni-text-color;
  153. font-size: $uni-font-size-base;
  154. box-shadow: 3rpx 3rpx 5rpx #eee;
  155. .cell-item-c{
  156. display: flex;
  157. justify-content: space-between;
  158. padding: $uni-spacing-col-base $uni-spacing-row-base;
  159. .cell-item-date{
  160. color: $uni-text-color-grey;
  161. }
  162. }
  163. .cell-item-main{
  164. display: inline-block;
  165. margin-bottom: 10rpx;
  166. .cell-item-number{
  167. margin-right: 5rpx;
  168. }
  169. .cell-item-unit{
  170. font-size: 26rpx;
  171. }
  172. .blue {
  173. color: #1890FF;
  174. }
  175. .green {
  176. color: #16b50e;
  177. }
  178. .red {
  179. color: red;
  180. }
  181. }
  182. }
  183. }
  184. }
  185. </style>