settlementRecord.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <view class="settlementrecord-pages">
  3. <view class="jsList">
  4. <view v-for="item in list" :key="item.id" class="flex align_center justify_between" @click="viewDetail(item)">
  5. <view>
  6. <view>{{item.payDate}}</view>
  7. <view class="payType">{{ filterpayType(item.payWay) }}</view>
  8. </view>
  9. <view>
  10. <text>¥{{item.settleAmount}}</text>
  11. <uni-font-icons color="#999" size="12" type="icon-xiangyoujiantou"></uni-font-icons>
  12. </view>
  13. </view>
  14. <view style="padding-top: 50%;border:0" v-if="list.length==0 && status!='loading'">
  15. <u-empty :src="`/static/nodata.png`" icon-size="180" :text="noDataText" img-width="120" mode="list"></u-empty>
  16. </view>
  17. <view style="padding: 20upx;border:0" v-if="(total>=list.length&&list.length)||status=='loading'">
  18. <u-loadmore :status="status" />
  19. </view>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. import {getShelfSettleBillList} from "@/api/shelf.js"
  25. export default {
  26. data() {
  27. return {
  28. list: [],
  29. pageNo: 1,
  30. pageSize: 20,
  31. total: 0,
  32. noDataText: '暂无数据',
  33. status: 'loadimg'
  34. }
  35. },
  36. onLoad() {
  37. this.getSettleBillList()
  38. },
  39. methods: {
  40. filterpayType(val) {
  41. let dataList = this.$store.state.vuex_paymentTypeList;
  42. let _value = '';
  43. for (let i = 0; i < dataList.length; i++) {
  44. if (val == dataList[i].code) {
  45. _value = dataList[i].dispName;
  46. break;
  47. }
  48. }
  49. return _value;
  50. },
  51. getSettleBillList(){
  52. let params = {
  53. pageNo: this.pageNo,
  54. pageSize: this.pageSize
  55. }
  56. const _this = this
  57. this.status = "loading"
  58. getShelfSettleBillList(params).then(res => {
  59. console.log(res)
  60. if (res.status == 200) {
  61. if(_this.pageNo>1){
  62. _this.list = _this.list.concat(res.data.list || [])
  63. }else{
  64. _this.list = res.data.list || []
  65. }
  66. _this.total = res.data.count || 0
  67. } else {
  68. _this.list = []
  69. _this.total = 0
  70. _this.noDataText = res.message
  71. }
  72. _this.status = _this.total>=_this.list.length ? "nomore" : 'loadmore'
  73. })
  74. },
  75. viewDetail(item){
  76. item.payTypeVal = this.filterpayType(item.payWay)
  77. this.$u.vuex('vuex_settleRecordDetail', item)
  78. uni.navigateTo({
  79. url: "/pages/digitalShelf/settlementRecord/settlementDetail"
  80. })
  81. }
  82. },
  83. onReachBottom() {
  84. if(this.list.length < this.total){
  85. this.pageNo += 1
  86. this.getSettleBillList()
  87. }else{
  88. this.status = "nomore"
  89. }
  90. }
  91. }
  92. </script>
  93. <style lang="less">
  94. .settlementrecord-pages{
  95. background-color: #fff;
  96. padding: 10rpx 30rpx;
  97. min-height: 100vh;
  98. .jsList{
  99. > view{
  100. border-bottom: 2rpx solid #eee;
  101. padding: 30rpx 10rpx;
  102. color: #666;
  103. text{
  104. margin-left: 10rpx;
  105. color: #222;
  106. }
  107. .payType{
  108. color: #999;
  109. margin-top: 10rpx;
  110. }
  111. }
  112. }
  113. }
  114. </style>