fxlog.vue 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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}} 【订单ID:{{item.oid}}】</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. contentText: {
  34. contentdown: '上拉加载更多',
  35. contentrefresh: '加载中',
  36. contentnomore: '没有数据了'
  37. }
  38. }
  39. },
  40. onReachBottom() {
  41. this.status = 'more';
  42. this.getList();
  43. },
  44. onLoad() {
  45. this.getList();
  46. },
  47. methods:{
  48. getList() {
  49. let data = {
  50. //column: 'id,post_id,title,author_name,cover,published_at' //需要的字段名
  51. };
  52. var limit=10;
  53. if (this.last_id>0) {
  54. //说明已有数据,目前处于上拉加载
  55. this.status = 'loading';
  56. data.offset = this.last_id*limit;
  57. data._ = new Date().getTime() + '';
  58. }
  59. data.limit=limit
  60. data.token = uni.getStorageSync("userinfo").token;
  61. uni.request({
  62. url: this.configs.webUrl+'/api/user/userfxinfo',
  63. data: data,
  64. success: data => {
  65. console.log(data.data)
  66. if (data.data.total>0) {
  67. let list = data.data.rows;
  68. this.listData = this.reload ? list : this.listData.concat(list);
  69. this.reload = false;
  70. this.last_id = this.last_id+1;
  71. if(data.data.total<this.last_id*limit){
  72. this.status = '';
  73. }
  74. }else{
  75. this.contentText.contentdown='没有数据'
  76. }
  77. },
  78. fail: (data, code) => {
  79. //console.log('fail' + JSON.stringify(data));
  80. }
  81. });
  82. },
  83. }
  84. }
  85. </script>
  86. <style>
  87. </style>