| xqd
@@ -53,16 +53,30 @@ Page({
|
|
|
totalLearnTime: 0,
|
|
|
checkCardDays: 0
|
|
|
},
|
|
|
+ prevDate: function(e) {
|
|
|
+ this.getMyLearnInfo(e.detail.currentYear, e.detail.currentMonth)
|
|
|
+ },
|
|
|
+ nextDate: function (e) {
|
|
|
+ this.getMyLearnInfo(e.detail.currentYear, e.detail.currentMonth)
|
|
|
+ },
|
|
|
dateChange: function(e) {
|
|
|
- console.log(e);
|
|
|
+ this.getMyLearnInfo(e.detail.currentYear, e.detail.currentMonth)
|
|
|
},
|
|
|
onLoad: function () {
|
|
|
+ this.getMyLearnInfo()
|
|
|
+ },
|
|
|
+ getMyLearnInfo: function(year, month) {
|
|
|
+ var date = new Date(),
|
|
|
+ year = year || date.getFullYear(),
|
|
|
+ month = month || date.getMonth() + 1
|
|
|
var pt_student = wx.getStorageSync('pt_student')
|
|
|
wx.request({
|
|
|
url: api.getMyLearnInfoUrl,
|
|
|
method: 'GET',
|
|
|
data: {
|
|
|
- 'student_id': pt_student.id
|
|
|
+ 'student_id': pt_student.id,
|
|
|
+ 'year': year,
|
|
|
+ 'month': month
|
|
|
},
|
|
|
success: res => {
|
|
|
if (res.data.status == 'success') {
|