Jacob
2026-10-13 d88fc8684091cda49121af8d5b3940064f3db136
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<template>
   <view>
       <view class='sign-record'>
          <view class='list pad30' v-for="(item,index) in signList" :key="index">
             <view class='item'>
                <view class='data'>{{item.month}}</view>
                <view class='listn borRadius14'>
                   <view class='itemn acea-row row-between-wrapper' v-for="(itemn,indexn) in item.list" :key="indexn">
                      <view>
                         <view class='name line1'>{{itemn.title}}</view>
                         <view>{{itemn.createDay}}</view>
                      </view>
                      <view class='num font-color'>+{{itemn.number}}</view>
                   </view>
                </view>
             </view>
          </view>
           <view class='loadingicon acea-row row-center-wrapper'>
               <text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadtitle}}
            </view>
       </view>
       <!-- #ifdef MP -->
       <!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
       <!-- #endif -->
   </view>
</template>
 
<script>
   import { getSignMonthList } from '@/api/user.js';
   import { toLogin } from '@/libs/login.js';
    import { mapGetters } from "vuex";
   export default {
       components: {
       },
       data() {
           return {
               loading:false,
                   loadend:false,
                   loadtitle:'加载更多',
                   page:1,
                   limit:8,
                   signList:[],
                   isAuto: false, //没有授权的不会自动授权
                   isShowAuth: false //是否隐藏授权
           };
       },
       computed: mapGetters(['isLogin']),
       watch:{
           isLogin:{
               handler:function(newV,oldV){
                   if(newV){
                       this.getSignMoneList();
                   }
               },
               deep:true
           }
       },
       onLoad(){
           if(this.isLogin){
               this.getSignMoneList();
           }else{
               toLogin(this);
           }
       },
       onReachBottom: function () {
           this.getSignMoneList();
         },
       methods: {
             /**
              * 
              * 授权回调
             */
             onLoadFun:function(){
               this.getSignMoneList();
             },
             // 授权关闭
             authColse:function(e){
                 this.isShowAuth = e
             },
             /**
                * 获取签到记录列表
               */
               getSignMoneList:function(){
                 let that=this;
                 if(that.loading) return;
                 if(that.loadend) return;
                 that.loading = true;
                 that.loadtitle = "";
                 getSignMonthList({ page: that.page, limit: that.limit }).then(res=>{
                   let list = res.data.list;
                   let loadend = list.length < that.limit;
                   that.signList = that.$util.SplitArray(list, that.signList);
                   that.$set(that,'signList',that.signList);
                   that.loadend = loadend;
                   that.loading = false;
                   that.loadtitle = loadend ? "哼😕~我也是有底线的~" : "加载更多"
                 }).catch(err=>{
                   that.loading = false;
                   that.loadtitle = '加载更多';
                 });
               },
       }
   }
</script>
 
<style>
</style>