123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247 |
- //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
- // });
- // }
- })
|