45 lines
932 B
JavaScript
45 lines
932 B
JavaScript
import { apiArr } from '../../../api/user';
|
|
import { postUrl } from '../../../utils/util';
|
|
|
|
Page({
|
|
data: {
|
|
count: 0,
|
|
records: [],
|
|
pointsNum: 0,
|
|
},
|
|
|
|
onLoad(options) {
|
|
this.init();
|
|
},
|
|
async init () {
|
|
wx.showLoading({
|
|
title: '加载中',
|
|
})
|
|
postUrl(apiArr.signIntegral,{}, res => {
|
|
this.setData({
|
|
pointsNum: res.integral
|
|
})
|
|
});
|
|
await this.getSignCycle();
|
|
},
|
|
|
|
getSignCycle () {
|
|
postUrl(apiArr.signCycle, {}, async res => {
|
|
const { start_time, end_time, day_num } = res;
|
|
this.getSignList(start_time, end_time, day_num);
|
|
})
|
|
},
|
|
getSignList(startTime, endTime, dayNum) {
|
|
postUrl(apiArr.signList, {
|
|
page_num: 1,
|
|
page_size: dayNum,
|
|
sign_date: [startTime, endTime]
|
|
}, res => {
|
|
wx.hideLoading();
|
|
this.setData({
|
|
records: res.rows
|
|
})
|
|
})
|
|
},
|
|
});
|