moneylog.vue 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <view class="pd16_15">
  3. <block v-for="(item,index) in listData" :key="index">
  4. <view class="box pd16_15 flex alcenter space" style="margin-bottom: 30upx;">
  5. <view>
  6. <view class="ft14 cl-main">{{item.memo}}</view>
  7. <view class="mt8 ft12 cl-notice">{{item.createtime}}</view>
  8. <!-- <view class="mt8">
  9. <text class="ft12 cl-notice">备注:</text>
  10. <text class="ft12 cl-main">暂无</text>
  11. </view> -->
  12. </view>
  13. <view class="cl-main ft18 ftw600">
  14. {{item.jzt}}{{item.money}}
  15. </view>
  16. </view>
  17. </block>
  18. <uni-load-more :status="status" :content-text="contentText" />
  19. </view>
  20. </template>
  21. <script>
  22. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  23. export default {
  24. components: {
  25. uniLoadMore
  26. },
  27. data(){
  28. return {
  29. listData: [],
  30. last_id: 0,
  31. reload: true,
  32. status: 'more',
  33. userinfo:[],
  34. contentText: {
  35. contentdown: '上拉加载更多',
  36. contentrefresh: '加载中',
  37. contentnomore: '没有数据了'
  38. }
  39. }
  40. },
  41. onReachBottom() {
  42. this.status = 'more';
  43. this.getList();
  44. },
  45. onLoad() {
  46. this.getList();
  47. },
  48. methods:{
  49. getList() {
  50. let data = {
  51. //column: 'id,post_id,title,author_name,cover,published_at' //需要的字段名
  52. };
  53. var limit=10;
  54. if (this.last_id>0) {
  55. //说明已有数据,目前处于上拉加载
  56. this.status = 'loading';
  57. data.offset = this.last_id*limit;
  58. data._ = new Date().getTime() + '';
  59. }
  60. data.limit=limit
  61. data.token = uni.getStorageSync("userinfo").token;
  62. uni.request({
  63. url: this.configs.webUrl+'/api/user/usermoneyinfo',
  64. data: data,
  65. success: data => {
  66. console.log(data.data)
  67. if (data.data.total>0) {
  68. let list = data.data.rows;
  69. this.listData = this.reload ? list : this.listData.concat(list);
  70. this.reload = false;
  71. this.last_id = this.last_id+1;
  72. if(data.data.total<this.last_id*limit){
  73. this.status = '';
  74. }
  75. }else{
  76. this.contentText.contentdown='没有数据'
  77. }
  78. },
  79. fail: (data, code) => {
  80. //console.log('fail' + JSON.stringify(data));
  81. }
  82. });
  83. },
  84. }
  85. }
  86. </script>
  87. <style>
  88. </style>