import common from '../../utils/util'; import main from '../../utils/main'; const app = getApp(); Page({ data: { List: [], }, onLoad: function (options) { var that = this; that.setData({ Containnerheight: main.getWindowHeight(), NickName: app.globalData.userInfo.NickName, AvatarUrl: app.globalData.userInfo.AvatarUrl, }); var userid = app.globalData.userInfo.UserID; if (options.UserID) userid=options.UserID; main.getData("GetMiaoguoCheckList?UserID=" + userid, function (data) { if (data) { common.getStorageValue(that, "HomeworkListClick", [0,0,0], function () { if (that.data.HomeworkListClick[1] == 0) { data.List[1].Finished = 0; data.FinishedCount -= 10; } if (that.data.HomeworkListClick[2] == 0) { data.List[2].Finished = 0; data.FinishedCount -= 10; } that.setData({ FinishedCount: data.FinishedCount, List: data.List, NickName: data.NickName, AvatarUrl: data.AvatarUrl, }); }); } }); app.globalData.Homework=0; }, clickOK:function(e){ var that = this; var index=e.currentTarget.dataset.index; common.getStorageValue(that, "HomeworkListClick", [0, 0, 0], function () { that.data.List[index].Finished = 1; that.data.FinishedCount += 10; that.setData({ FinishedCount: that.data.FinishedCount, List: that.data.List, }); that.data.HomeworkListClick[index]=1; wx.setStorageSync("HomeworkListClick", that.data.HomeworkListClick); }); }, gotoLessonList:function(){ wx.navigateTo({ url: '../other/lessonlist', }); }, onShareAppMessage: function () { return { title: "作业清单", path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID +'&Homework=1', imageUrl: "../images/program_screenshot_checklist.png", } }, })