index.vue 2.7 KB

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