//index.js //获取应用实例 const app = getApp() Page({ data: { showMore: false, //更多 show: false, notice: "通知通知我是通知通知通知我是通知通知通知我是通知通知通知我是通知", kcArr: [], // "spxxArr": [{ // "isfinish": "/images/unfinish.png", // "spfm": "/images/spfm.jpg", // "iszburl": "/images/zb.png", // "name": "一期素质教育培训", // "startdate": "6月9日", // "starttime": "19:30", // "isstartstudy": "/images/startstudy.png", // "isdtxs": "/images/dtxs.png", // "ispjkc": "/images/pjkc.png" // }, { // "isfinish": "/images/finish.png", // "spfm": "/images/spfm.jpg", // "iszburl": "/images/db.png", // "name": "一期素质教育培训", // "startdate": "6月9日", // "starttime": "19:30", // "isstartstudy": "/images/startstudy.png", // "isdtxs": "/images/dtxs.png", // "ispjkc": "/images/pjkc.png" // }, { // "isfinish": "/images/unstart.png", // "spfm": "/images/spfm.jpg", // "iszburl": "/images/db.png", // "name": "一期素质教育培训", // "startdate": "6月9日", // "starttime": "19:30", // "isstartstudy": "/images/startstudy.png", // "isdtxs": "/images/dtxs.png", // "ispjkc": "/images/pjkc.png", // }, // { // "isfinish": "/images/unstart.png", // "spfm": "/images/spfm.jpg", // "iszburl": "/images/db.png", // "name": "一期素质教育培训", // "startdate": "6月9日", // "starttime": "19:30", // "isstartstudy": "/images/startstudy.png", // "isdtxs": "/images/dtxs.png", // "ispjkc": "/images/pjkc.png" // }, // { // "isfinish": "/images/unstart.png", // "spfm": "/images/spfm.jpg", // "iszburl": "/images/db.png", // "name": "一期素质教育培训", // "startdate": "6月9日", // "starttime": "19:30", // "isstartstudy": "/images/startstudy.png", // "isdtxs": "/images/dtxs.png", // "ispjkc": "/images/pjkc.png" // }, // { // "isfinish": "/images/unstart.png", // "spfm": "/images/spfm.jpg", // "iszburl": "/images/db.png", // "name": "一期素质教育培训", // "startdate": "6月9日", // "starttime": "19:30", // "isstartstudy": "/images/startstudy.png", // "isdtxs": "/images/dtxs.png", // "ispjkc": "/images/pjkc.png" // } // ], "myactiveArr": [{ "name": "现场体验:长山花园社区", "cysj": "2020/06/20 07:09", "cyry": "全体人员", }, { "name": "实战演练:党建工作实务", "cysj": "2020/06/21 07:09", "cyry": "全体人员", }, { "name": "现场体验:青岛路社区", "cysj": "2020/06/22 07:09", "cyry": "全体人员", } ] }, // showPopup() { // }, // 更多 listToggle: function () { this.setData({ showMore: !this.data.showMore }) }, hidePopup() { this.setData({ show: false }); var sessionKey = ""; // var _this = this; wx.checkSession({ success: () => { console.log("我有缓存") sessionKey = wx.getStorageSync('sessionKey'); console.log(sessionKey) wx.request({ url: app.globalData.publicUrl2 + '/education/student/wx/verification?sessionKey=' + sessionKey, method: "post", // data: success: function (res) { console.log(res, "我成功了") } }) }, fail() { console.log("我没有缓存并去登录请求") wx.login({ success(res) { console.log(res); var code = res.code wx.request({ url: app.globalData.publicUrl2 + '/wx/user/wx7e7a46e129d6cd0f/login', method: "get", data: { code }, success: function (res) { sessionKey = res.data.sessionKey; wx.setStorageSync('sessionKey', res.data.sessionKey); } }) } }) } }) }, myactiveMore() { wx.navigateTo({ url: '../myActive/myActive' }) }, gokhAnswer() { wx.navigateTo({ url: '../answerAfterclass/answerAfterclass' }) }, gopjClass() { wx.navigateTo({ url: '../evaluationCourse/evaluationCourse' }) }, goMyPoints() { wx.navigateTo({ url: '../myPoints/myPoints' }) }, goactiveDetails() { wx.navigateTo({ url: '../myactiveDetails/myactiveDetails' }) }, lq() { wx.showToast({ title: '领取成功' }) }, goWrite() { wx.navigateTo({ url: '../studentRegistration/studentRegistration' }) }, goWrite2() { wx.navigateTo({ url: '../feedBack/feedBack' }) }, onReady: function () {}, onLoad: function () { var sessionKey = ""; var _this = this; wx.checkSession({ success: () => { console.log("我有缓存") sessionKey = wx.getStorageSync('sessionKey'); console.log(sessionKey) var enSessionKey = encodeURIComponent(sessionKey) console.log(enSessionKey,"woshi zhuanyi") wx.request({ url: app.globalData.publicUrl2 + '/education/student/wx/selStudentSessionKey?sessionKey=' + enSessionKey, method: "post", success: function (res) { console.log(res, "333") if (res.data.data.isAgree == 0) { _this.setData({ show: true }); } else { _this.setData({ show: false }); } } }), wx.request({ url: app.globalData.publicUrl + '/wx/course/selectBySessionKey/' + sessionKey, method: "get", success: function (res) { console.log(res) _this.setData({ kcArr: res.data.list }) } }) }, fail() { console.log("我没有缓存并去登录请求") wx.login({ success(res) { console.log(res); var code = res.code wx.request({ url: app.globalData.publicUrl2 + '/wx/user/wx7e7a46e129d6cd0f/login', method: "get", data: { code }, success: function (res) { sessionKey = res.data.sessionKey; wx.setStorageSync('sessionKey', res.data.sessionKey); } }) } }) } }) }, // onShow: function () { // this.setData({ // show: true // }); // } })