index.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <template>
  2. <view>
  3. <view class='sign-record'>
  4. <view class='list' v-for="(item,index) in growthList" :key="index">
  5. <view class='item'>
  6. <view class='data'>{{item.month}}</view>
  7. <view class='listn'>
  8. <view class='itemn acea-row row-between-wrapper' v-for="(itemn,indexn) in item.list" :key="indexn">
  9. <view>
  10. <view class='name line1'>{{itemn.title}}</view>
  11. <view>{{itemn.create_time}}</view>
  12. </view>
  13. <view v-if="itemn.pm>0" class='num font-color'>+{{itemn.number}}</view>
  14. <view v-else class='num'>-{{itemn.number}}</view>
  15. </view>
  16. </view>
  17. </view>
  18. </view>
  19. <view class='loadingicon acea-row row-center-wrapper'>
  20. <text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadtitle}}
  21. </view>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. // +----------------------------------------------------------------------
  27. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  28. // +----------------------------------------------------------------------
  29. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  30. // +----------------------------------------------------------------------
  31. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  32. // +----------------------------------------------------------------------
  33. // | Author: CRMEB Team <admin@crmeb.com>
  34. // +----------------------------------------------------------------------
  35. import { growthValueRecord } from '@/api/user.js';
  36. import { mapGetters } from "vuex";
  37. import { toLogin } from '@/libs/login.js';
  38. export default {
  39. components: {},
  40. data() {
  41. return {
  42. loading:false,
  43. loadend:false,
  44. loadtitle:'加载更多',
  45. page:1,
  46. limit:8,
  47. growthList:[],
  48. };
  49. },
  50. computed: mapGetters(['isLogin']),
  51. onLoad(){
  52. if(this.isLogin){
  53. this.getGrowthListList();
  54. }else{
  55. toLogin()
  56. }
  57. },
  58. onReachBottom: function () {
  59. this.getGrowthListList();
  60. },
  61. methods: {
  62. /**
  63. * 获取签到记录列表
  64. */
  65. getGrowthListList:function(){
  66. let that=this;
  67. if(that.loading) return;
  68. if(that.loadend) return;
  69. that.loading = true;
  70. that.loadtitle = "";
  71. growthValueRecord({ page: that.page, limit: that.limit }).then(res=>{
  72. let list = res.data;
  73. let loadend = list.length < that.limit;
  74. that.growthList = that.$util.SplitArray(list, that.growthList);
  75. that.$set(that,'growthList',that.growthList);
  76. that.loadend = loadend;
  77. that.loading = false;
  78. that.loadtitle = loadend ? "哼😕~我也是有底线的~" : "加载更多"
  79. }).catch(err=>{
  80. that.loading = false;
  81. that.loadtitle = '加载更多';
  82. });
  83. },
  84. }
  85. }
  86. </script>
  87. <style>
  88. </style>