transactionDetail.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <template>
  2. <view class="container">
  3. <navbar :config="config" backColor="#999999"></navbar>
  4. <view class="list" v-if="billRefillCardList.length>0">
  5. <view class="item" v-for="(item,index) in billRefillCardList" :key="index">
  6. <view class="u-flex-center-sb u-1A1A1A">
  7. <view class="u-font28">{{item.mode}}</view>
  8. <view class="u-font26">{{item.billType==0?'-':'+'}} {{item.entryValue}}元</view>
  9. </view>
  10. <view class="u-999 u-font24 u-mt10">{{item.formatCreateTimeMillis}}</view>
  11. </view>
  12. </view>
  13. <!-- 没有数据 -->
  14. <loadMore v-if="billRefillCardList.length>0" :status="status"></loadMore>
  15. <nodata v-else :config="{top:5,content:'暂无交易明细~'}"></nodata>
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. export default {
  21. data() {
  22. return {
  23. config: {
  24. back: true, //false是tolbar页面 是则不写
  25. title: '交易明细',
  26. color: '#1A1A1A',
  27. //背景颜色;参数一:透明度(0-1);参数二:背景颜色(array则为线性渐变,string为单色背景)
  28. backgroundColor: [1, "#FFFFFF"],
  29. statusBarFontColor: '#1A1A1A'
  30. },
  31. billRefillCardList: [],
  32. params: {
  33. page: 1,
  34. limit: 20,
  35. },
  36. status: "more",
  37. totalPage: null,
  38. currPage: null
  39. }
  40. },
  41. onLoad() {
  42. this.getList()
  43. },
  44. //下拉刷新
  45. onPullDownRefresh() {
  46. this.params.page = 1
  47. this.billRefillCardList = []
  48. this.getList()
  49. },
  50. //上拉加载
  51. onReachBottom(e) {
  52. if (this.totalPage <= this.currPage) {
  53. this.status = "noMore"
  54. } else {
  55. this.status = "more"
  56. this.params.page++
  57. this.getList()
  58. }
  59. },
  60. methods: {
  61. getList() {
  62. this.$http.get('/bill/refillCard/page', this.params).then(res => {
  63. if (res && res.code == 200) {
  64. console.log(res.page.list)
  65. uni.stopPullDownRefresh()
  66. this.billRefillCardList = this.billRefillCardList.concat(res.page.list)
  67. this.totalPage = res.page.totalPage
  68. this.currPage = res.page.currPage
  69. if (this.totalPage <= this.currPage) {
  70. this.status = "noMore";
  71. } else {
  72. this.status = "more"
  73. }
  74. // if(this.billRefillCardList.length==0){
  75. // this.noData = true
  76. // }else{
  77. // this.noData = false
  78. // }
  79. }
  80. })
  81. }
  82. }
  83. }
  84. </script>
  85. <style lang="scss">
  86. .item {
  87. padding: 20rpx 30rpx 24rpx;
  88. border-bottom: 2rpx solid #eee;
  89. }
  90. </style>