ssfg 5 년 전
부모
커밋
ade7791b3e
37개의 변경된 파일1100개의 추가작업 그리고 381개의 파일을 삭제
  1. 36 3
      app.js
  2. 4 1
      app.json
  3. 49 4
      pages/Identity/Identity.js
  4. 5 5
      pages/Identity/Identity.wxml
  5. 2 2
      pages/Identity/Identity.wxss
  6. 44 23
      pages/agoClass/agoClass.js
  7. 4 4
      pages/agoClass/agoClass.wxml
  8. 39 0
      pages/dbDetails/dbDetails.js
  9. 4 0
      pages/dbDetails/dbDetails.json
  10. 11 0
      pages/dbDetails/dbDetails.wxml
  11. 27 0
      pages/dbDetails/dbDetails.wxss
  12. 2 2
      pages/dbVideo/dbVideo.js
  13. 58 29
      pages/demandCourses/demandCourses.js
  14. 13 8
      pages/demandCourses/demandCourses.wxml
  15. 39 2
      pages/demandCourses/demandCourses.wxss
  16. 2 2
      pages/exhibitionList/exhibitionList.js
  17. 4 4
      pages/exhibitionList/exhibitionList.wxml
  18. 32 39
      pages/index/index.js
  19. 167 73
      pages/myClass/myClass.js
  20. 5 5
      pages/myClass/myClass.wxml
  21. 204 39
      pages/myMission/myMission.js
  22. 2 2
      pages/myMission/myMission.wxml
  23. 64 26
      pages/myTraining/myTraining.js
  24. 7 4
      pages/myTraining/myTraining.wxml
  25. 48 8
      pages/onlineClass/onlineClass.js
  26. 18 18
      pages/onlineClass/onlineClass.wxml
  27. 3 3
      pages/onlineClass/onlineClass.wxss
  28. 22 39
      pages/personInfo/personInfo.js
  29. 3 3
      pages/personInfo/personInfo.wxml
  30. 64 29
      pages/startClass/startClass.js
  31. 4 4
      pages/startClass/startClass.wxml
  32. 38 0
      pages/zbDetails/zbDetails.js
  33. 4 0
      pages/zbDetails/zbDetails.json
  34. 10 0
      pages/zbDetails/zbDetails.wxml
  35. 27 0
      pages/zbDetails/zbDetails.wxss
  36. 35 0
      utils/util.js
  37. BIN
      wx7e7a46e129d6cd0f.o6zAJs6_LMFAAXLohpL4IEbUQdOY.1QyilC7Bgm1Z20e5c3776a4b93da05406431fcc4e339.png

+ 36 - 3
app.js

@@ -1,8 +1,41 @@
 //app.js
 App({
   globalData: {
-    // publicUrl: 'https://jlxwjr.jljrkg.com/',
-    // imageUrl: 'https://jlxwjr.jljrkg.com',
-    publicUrl: 'https://sqdx.windd.cn'
+    // publicUrl: 'http://10.16.10.139:8090', //luyu
+    publicUrl2: 'http://10.16.4.19:8090', //huyubo
+    publicUrl: 'https://sqdx.windd.cn', //fwq
+    // publicUrl2: 'https://sqdx.windd.cn', //fwq
+  },
+  getSessionkey() {
+    var sessionKey = "";
+    var _this = this;
+    wx.checkSession({
+      success: () => {
+        console.log("我有缓存")
+        var sessionKey = wx.getStorageSync('sessionKey');
+        return sessionKey;
+      },
+      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);
+                return sessionKey;
+              }
+            })
+          }
+        })
+      }
+    })
   }
 })

+ 4 - 1
app.json

@@ -1,9 +1,12 @@
 {
   "pages": [
+    "pages/index/index",
+    "pages/zbDetails/zbDetails",
+   
     "pages/personInfo/personInfo",
     "pages/myMission/myMission",
-    "pages/index/index",
    
+    "pages/dbDetails/dbDetails",
     "pages/myClass/myClass",
     "pages/testAnswer/testAnswer",
     "pages/demandCourses/demandCourses",

+ 49 - 4
pages/Identity/Identity.js

@@ -1,8 +1,53 @@
-
+const app = getApp()
 Page({
   data: {
-   
+    userName: "",
+    phone: "",
+    card: ""
   },
-  onLoad: function () {
-  }
+  formSubmit: function (e) {
+    let {
+      userName,
+      phone,
+      card
+    } = e.detail.value;
+    if (userName=="") {
+      wx.showToast({
+        title: '姓名为空,请重新输入',
+        icon: 'none',
+        duration: 1500
+      })
+      return false
+    } else if (phone=="") {
+      wx.showToast({
+        title: '手机号为空,请重新输入',
+        icon: 'none',
+        duration: 1500
+      })
+      return false
+    } else if (card=="") {
+      wx.showToast({
+        title: '身份证号为空,请重新输入',
+        icon: 'none',
+        duration: 1500
+      })
+      return false
+    }
+    console.log(e.detail.value)
+    var sessionKey = wx.getStorageSync('sessionKey');
+    wx.request({
+      url: app.globalData.publicUrl2 + '/education/student/wx/uthentication',
+      method: "post",
+      data: {
+        studentName: e.detail.value.userName,
+        studentCard: e.detail.value.card,
+        phone: e.detail.value.phone,
+        sessionKey: sessionKey
+      },
+      success: function (res) {
+        wx.showToast(res.msg)
+      }
+    })
+  },
+  onLoad: function () {}
 })

+ 5 - 5
pages/Identity/Identity.wxml

@@ -1,12 +1,12 @@
 <view class='container'>
-	<form catchsubmit="formSubmit">
+	<form bindsubmit="formSubmit">
 		<view class="form_item">
 			<image src='/images/shenfen1.png' mode="aspectFit" class="icon1"></image>
-			<input style='display:inline-block;height:60%;' placeholder-style='font-size:30rpx;' placeholder='请输入姓名' value='{{form.name}}'></input>
+			<input style='display:inline-block;height:60%;' placeholder-style='font-size:30rpx;' placeholder='请输入姓名' name='userName'></input>
 		</view>
 		<view class="form_item">
 			<image src='/images/shenfen2.png' mode="aspectFit" class="icon1"></image>
-			<input style='display:inline-block;height:60%;' placeholder-style='font-size:30rpx;' placeholder='请输入手机号' value='{{form.phone}}' type='number'></input>
+			<input style='display:inline-block;height:60%;' placeholder-style='font-size:30rpx;' placeholder='请输入手机号' name='phone' type='number'></input>
 			<!-- <view class="getyzm">获取验证码</view> -->
 		</view>
 		<!-- <view class="form_item">
@@ -15,8 +15,8 @@
 		</view> -->
 		<view class="form_item">
 			<image src='/images/shenfen4.png' mode="aspectFit" class="icon1"></image>
-			<input style='width:80%;display:inline-block;height:60%;' placeholder-style='font-size:30rpx;' placeholder='请输入身份证号' value='{{form.card}}'></input>
+			<input style='width:80%;display:inline-block;height:60%;' placeholder-style='font-size:30rpx;' placeholder='请输入身份证号' name="card"></input>
 		</view>
-		<view class="qrrz" bindtap="submit">确认验证</view>
+		<button class="qrrz" formType="submit">确认验证</button>
 	</form>
 </view>

+ 2 - 2
pages/Identity/Identity.wxss

@@ -24,9 +24,9 @@
   text-align: center;
 }
 .qrrz{
-  width: 559rpx;
+  /* width: 659rpx; */
   height: 77rpx;
-  line-height: 77rpx;
+  /* line-height: 57rpx; */
   margin-left: 95rpx;
   border-radius: 40rpx;
   font-size: 29rpx;

+ 44 - 23
pages/agoClass/agoClass.js

@@ -1,36 +1,57 @@
 //logs.js
 // const util = require('../../utils/util.js')
-
+const app = getApp()
 Page({
   data: {
     dataArr:[
-      {
-        "url": "/images/sc_img.png",
-        "name": "长春市社区工作者线上培训班",
-        "zbdw": "宽城区委组织部",
-        "time": "2020年06月23日"
-      },{
-        "url": "/images/sc_img.png",
-        "name": "长春市专职党务工作者线上培训班",
-        "zbdw": "长春市委组织部",
-        "time": "2020年06月26日"
-      },{
-        "url": "/images/sc_img.png",
-        "name": "区域党建联盟",
-        "zbdw": "宽城区委组织部",
-        "time": "2020年06月29日"
-      },{
-        "url": "/images/sc_img.png",
-        "name": "小区党组织建设",
-        "zbdw": "宽城区委组织部",
-        "time": "2020年06月30日"
-      }
+     
     ]
   },
   checkboxChange(){
 
   },
   onLoad: function () {
-    
+    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/selClas?sessionKey=' + sessionKey + '&isActive=2',
+          method: "post",
+          // data:{
+          //   isActive:0
+          // },
+          success: function (res) {
+            console.log (res,"我是往期开班的列表")
+            _this.setData({
+              dataArr: res.data.data
+            })
+          }
+        })
+      },
+      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);
+              }
+            })
+          }
+        })
+      }
+    })
   }
 })

+ 4 - 4
pages/agoClass/agoClass.wxml

@@ -1,10 +1,10 @@
 <view class="container">
 <view class="class_box" wx:for="{{dataArr}}" wx:for-index="idx" wx:for-item="item">
-<image src="{{item.url}}" mode='aspectFill' class="scimg"></image>
+<image src="{{item.clasImg}}" mode='aspectFill' class="scimg"></image>
 <view class="sctext">
-<view class="t1">{{item.name}}</view>
-<view class="t2">{{item.zbdw}}</view>
-<view class="t2">{{item.time}}</view>
+<view class="t1">{{item.clasName}}</view>
+<view class="t2">{{item.remark}}</view>
+<view class="t2">{{item.clasBegin}}</view>
 </view>
 </view>
 </view>

+ 39 - 0
pages/dbDetails/dbDetails.js

@@ -0,0 +1,39 @@
+//index.js
+//获取应用实例
+const request = require('../../utils/request.js');
+const app = getApp()
+Page({
+  data: {
+    url: '',
+    title:'',
+    message:'',
+    playTimes:0,
+    id: 0
+  },
+  videoErrorCallback: function (e) {
+    console.log('视频错误信息:')
+    console.log(e.detail.errMsg)
+  },
+  onReady: function () {},
+  onLoad: function (options) {
+    let _this = this
+    _this.setData({
+      id: options.id
+    })
+    wx.request({
+      method: "get",
+      url: app.globalData.publicUrl + '/wx/course/selectRecordByCourseId/S6vZqa6S6Fzyomehw==/' + _this.data.id,
+      success: (e) => {
+        // console.log(e,"11111111111111111")
+        this.setData({
+          url: e.data.url,
+          show: false,
+          title:e.data.course.courseInfo,
+          message: e.data.course.courseName,
+          playTimes: e.data.course.playTimes
+        })
+      }
+    })
+  },
+
+})

+ 4 - 0
pages/dbDetails/dbDetails.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText":"点播详情"
+}

+ 11 - 0
pages/dbDetails/dbDetails.wxml

@@ -0,0 +1,11 @@
+<view class="home">
+	<video id="myVideo" src="{{url}}" binderror="videoErrorCallback" show-play-btn="ture" show-mute-btn="true" controls>
+	</video>
+	<view class="text_box">
+		<view class="title">{{title}}</view>
+		<view class="bfnum">{{playTimes}}次播放</view>
+		<!-- <view class="zj">主讲:授课教师</view> -->
+		<view class="zw">{{message}}
+		</view>
+	</view>
+</view>

+ 27 - 0
pages/dbDetails/dbDetails.wxss

@@ -0,0 +1,27 @@
+#myVideo{
+  width: 100%;
+}
+.text_box{
+width: 90%;
+margin-left: 5%;
+}
+.title{
+  font-size: 32rpx;
+  margin-top: 50rpx;
+}
+.bfnum{
+color: #999999;
+font-size: 25rpx;
+margin-top: 10rpx;
+height: 50rpx;
+border-bottom: 1px solid #dbdbdb;
+}
+.zj{
+  font-size: 32rpx;
+  margin-top: 20rpx;
+}
+.zw{
+  font-size: 25rpx;
+  margin-top: 40rpx;
+  line-height: 40rpx;
+}

+ 2 - 2
pages/dbVideo/dbVideo.js

@@ -22,9 +22,9 @@ Page({
     })
     wx.request({
       method: "POST",
-      url: app.globalData.publicUrl + '/education/course/wx/queryById?id=' + _this.data.id,
+      url: app.globalData.publicUrl + '/wx/course/queryById?id=' + _this.data.id,
       success: (e) => {
-        console.log(e,"11111111111111111")
+        // console.log(e,"11111111111111111")
         this.setData({
           url: e.data.url,
           show: false,

+ 58 - 29
pages/demandCourses/demandCourses.js

@@ -1,35 +1,64 @@
-//logs.js
-// const util = require('../../utils/util.js')
-
+const app = getApp()
 Page({
   data: {
-    xczsArr: [{
-      "url": "/images/show1.jpg",
-      "name": "社区干部综合素质提升培训",
-      "time": "09:10",
-      "people": "1234"
-    }, {
-      "url": "/images/show2.jpg",
-      "name": "社区干部综合素质提升培训",
-      "time": "09:10",
-      "people": "1234"
-    }, {
-      "url": "/images/show3.jpg",
-      "name": "社区干部综合素质提升培训",
-      "time": "09:10",
-      "people": "1234"
-    }, {
-      "url": "/images/show4.jpg",
-      "name": "社区干部综合素质提升培训",
-      "time": "09:10",
-      "people": "1234"
-    }]
+    lbArr: []
+  },
+  goIn(e) {
+    var id = e.currentTarget.dataset.item.id
+    wx.navigateTo({
+      url: '../dbDetails/dbDetails?id=' + id
+    })
   },
   onLoad: function () {
-    this.setData({
-      logs: (wx.getStorageSync('logs') || []).map(log => {
-        return util.formatTime(new Date(log))
-      })
+    var sessionKey = "";
+    var _this = this;
+    wx.checkSession({
+      success: () => {
+        console.log("我有缓存")
+        sessionKey = wx.getStorageSync('sessionKey');
+        console.log(sessionKey)
+        wx.request({
+          url: app.globalData.publicUrl + '/wx/course/selectRecordBySessionKey/'+sessionKey,
+          method: "get",
+          success: function (res) {
+            console.log(res)
+            _this.setData({
+              lbArr: 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);
+              }
+            })
+          }
+        })
+      }
     })
+    // var _this=this;
+    // wx.request({
+    //   url: app.globalData.publicUrl + '/wx/course/selectRecordBySessionKey/S6vZqa6S6Fzyomehw==',
+    //   method: "get",
+    //   success: function (res) {
+    //     console.log(res)
+    //     _this.setData({
+    //       lbArr:res.data.list
+    //     })
+    //   }
+    // })
   }
-})
+})

+ 13 - 8
pages/demandCourses/demandCourses.wxml

@@ -1,13 +1,18 @@
 	<view class="xczs">
-		<view class="zb1" wx:for="{{xczsArr}}" wx:for-index="idx" wx:for-item="item" bindtap="turnDetails" id="{{idx}}" wx:key="idx">
-			<image src='{{item.url}}' mode='aspectFill' class="show1"></image>
-			<view class="grayblock">
-				<view class="show_text">{{item.name}}</view>
-				<view class="viedoxx">
-					<image src='/images/clock.png' mode='aspectFill' class="qb"></image>
-					<view style="color:#e82315;font-size:25rpx;font-weight:500;float:left">{{item.time}}</view>
-					<view style="color:#848585;font-size:22rpx;float:right;margin-right:20rpx">{{item.people}}人看过</view>
+		<view class="zb1" wx:for="{{lbArr}}" wx:for-index="idx" wx:for-item="item" bindtap="turnDetails" id="{{idx}}" wx:key="idx">
+			<view style="position:relative">
+				<image src='{{item.courseImg}}' mode='aspectFill' class="show1"></image>
+				<view class="grayblock">
+					<view class="show_text">{{item.courseName}}</view>
+					<view class="viedoxx">
+						<image src='/images/clock.png' mode='aspectFill' class="qb"></image>
+						<view style="color:#e82315;font-size:25rpx;font-weight:500;float:left">{{item.time}}</view>
+						<view style="color:#848585;font-size:22rpx;float:right;margin-right:20rpx">{{item.playTimes}}人看过</view>
+					</view>
 				</view>
 			</view>
+			<!-- <view class="btn {{item.videoId==null?'getinroom':'nogetinroom'}}">
+			<button bindtap="goIn" data-item="{{item}}" type="primary" plain="true" style="width:128rpx">进入课堂</button>
+			</view> -->
 		</view>
 	</view>

+ 39 - 2
pages/demandCourses/demandCourses.wxss

@@ -11,13 +11,14 @@
 
 .zb1 {
   width: 338rpx;
-  height: 283rpx;
+  height: 403rpx;
   margin-right: 20rpx;
   margin-bottom: 10rpx;
   border-radius: 10rpx;
   overflow: hidden;
   float: left;
   position: relative;
+  /* border: 1px solid red; */
 }
 
 .show1 {
@@ -45,4 +46,40 @@
   margin-left: 10rpx;
   margin-top: 5rpx;
   float: left;
-}
+}
+.btn{
+  width:  128rpx;
+}
+.getinroom {
+  /* margin: 0 auto; */
+  /* width: 10%; */
+  width: 128rpx;
+  height: 40rpx;
+  border: 1px solid red;
+  color: #d72c1a;
+  margin-left: 100rpx;
+  /* border: 1px solid #f2b09d; */
+  /* text-align: center; */
+  /* border-radius: 20rpx; */
+  /* width: 20%; */
+  /* margin-left: 25%; */
+  /* margin-top: 15rpx; */
+  /* height: 50rpx; */
+  /* line-height: 50rpx; */
+  /* font-size: 24rpx; */
+}
+button{
+  margin-top: 30rpx;
+  margin-bottom: 30rpx;
+}
+/* .nogetinroom {
+  color: #999999;
+  border: 1px solid #999999;
+  text-align: center;
+  border-radius: 20rpx;
+  width: 50%;
+  margin-left: 25%;
+  margin-top: 15rpx;
+  height: 50rpx;
+  font-size: 24rpx;
+} */

+ 2 - 2
pages/exhibitionList/exhibitionList.js

@@ -39,7 +39,7 @@ Page({
     console.log(tag)
     wx.request({
       method: "POST",
-      url: app.globalData.publicUrl + '/education/course/wx/listByCourseTag?tag=' + tag,
+      url: app.globalData.publicUrl + '/wx/course/listByCourseTag?tag=' + tag,
       success: (e) => {
         console.log(e, "我是tab点击回来的数据")
         _this.setData({
@@ -61,7 +61,7 @@ Page({
     var _active = that.data.active+1
     wx.request({
       method: "POST",
-      url: app.globalData.publicUrl + '/education/course/wx/listByCourseTag?tag=' + _active,
+      url: app.globalData.publicUrl + '/wx/course/listByCourseTag?tag=' + _active,
       success: (e) => {
         that.data.xcpArr = [];
         console.log(e.data.list)

+ 4 - 4
pages/exhibitionList/exhibitionList.wxml

@@ -3,7 +3,7 @@
 		<van-tab title="宣传片展播" title-style="font-size:25rpx">
 			<view class="xczs">
 				<view class="zb1" wx:for="{{xcpArr}}" wx:for-index="idx" wx:for-item="item" wx:key="idx" bindtap="goSeevideo" data-item="{{item}}">
-					<image src='http://sqdx.windd.cn/files/{{item.courseImg}}' mode='aspectFill' class="show1"></image>
+					<image src='{{item.courseImg}}' mode='aspectFill' class="show1"></image>
 					<view class="grayblock">
 						<view class="show_text">{{item.courseName}}</view>
 						<view class="viedoxx">
@@ -18,7 +18,7 @@
 		<van-tab title="媒体报道链接" title-style="font-size:25rpx">
 			<view class="xczs">
 				<view class="zb1" wx:for="{{xcpArr}}" wx:for-index="idx" wx:for-item="item" wx:key="idx" bindtap="goSeevideo" data-item="{{item}}">
-					<image src='http://sqdx.windd.cn/files/{{item.courseImg}}' mode='aspectFill' class="show1"></image>
+					<image src='{{item.courseImg}}' mode='aspectFill' class="show1"></image>
 					<view class="grayblock">
 						<view class="show_text">{{item.courseName}}</view>
 						<view class="viedoxx">
@@ -33,7 +33,7 @@
 		<van-tab title="主题活动" title-style="font-size:25rpx">
 			<view class="xczs">
 				<view class="zb1" wx:for="{{xcpArr}}" wx:for-index="idx" wx:for-item="item" wx:key="idx" bindtap="goSeevideo" data-item="{{item}}">
-					<image src='http://sqdx.windd.cn/files/{{item.courseImg}}' mode='aspectFill' class="show1"></image>
+					<image src='{{item.courseImg}}' mode='aspectFill' class="show1"></image>
 					<view class="grayblock">
 						<view class="show_text">{{item.courseName}}</view>
 						<view class="viedoxx">
@@ -48,7 +48,7 @@
 		<van-tab title="特色课程" title-style="font-size:25rpx">
 			<view class="xczs">
 				<view class="zb1" wx:for="{{xcpArr}}" wx:for-index="idx" wx:for-item="item" wx:key="idx" bindtap="goSeevideo" data-item="{{item}}">
-					<image src='http://sqdx.windd.cn/files/{{item.courseImg}}' mode='aspectFill' class="show1"></image>
+					<image src='{{item.courseImg}}' mode='aspectFill' class="show1"></image>
 					<view class="grayblock">
 						<view class="show_text">{{item.courseName}}</view>
 						<view class="viedoxx">

+ 32 - 39
pages/index/index.js

@@ -1,18 +1,9 @@
 //index.js
 //获取应用实例
-const request = require('../../utils/request.js');
+const util = require('../../utils/util.js')
 const app = getApp()
 Page({
   data: {
-    // 第一个轮播
-    // ispoint:true,
-    // "bnrUrl": [{
-    //   "url": "../../images/zbfm.png"
-    // }, {
-    //   "url": "../../images/zbfm.png"
-    // }, {
-    //   "url": "../../images/zbfm.png"
-    // }],
     // 课程轮播
     "bnrUrl": [{
       "url": "/images/zbfm.png",
@@ -96,20 +87,20 @@ Page({
   },
   // 首页的四个点击
   goGrid(e) {
-    console.log(e)
-    if(e.currentTarget.dataset.id==0){
+    // console.log(e)
+    if (e.currentTarget.dataset.id == 0) {
       wx.navigateTo({
         url: '/pages/onlineClass/onlineClass',
       })
-    }else if (e.currentTarget.dataset.id==1){
+    } else if (e.currentTarget.dataset.id == 1) {
       wx.navigateTo({
         url: '/pages/demandCourses/demandCourses',
       })
-    }else if (e.currentTarget.dataset.id==2){
+    } else if (e.currentTarget.dataset.id == 2) {
       wx.navigateTo({
         url: '/pages/myInteractions/myInteractions',
       })
-    }else if (e.currentTarget.dataset.id==3){
+    } else if (e.currentTarget.dataset.id == 3) {
       wx.navigateTo({
         url: '/pages/testAnswer/testAnswer',
       })
@@ -117,32 +108,34 @@ Page({
   },
   onReady: function () {},
   onLoad: function () {
-    wx.request({
-      method: "POST",
-      url: app.globalData.publicUrl + '/education/course/wx/listByCourseTag?tag=1',
-      success: (e) => {
-        console.log(e)
+    var sessionKey;
+    wx.checkSession({
+      success: () => {
+        console.log("我有缓存")
+        sessionKey = wx.getStorageSync('sessionKey');
+        console.log(sessionKey)
+      },
+      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);
+              }
+            })
+          }
+        })
       }
     })
-    // var that = this;
-    // wx.login({
-    //   success(res) {
-    //     console.log(res);
-    //     var code = res.code
-    //     // 携带code换取openid
-    //     wx.request({
-    //       url: '',
-    //       method: "post",
-    //       data: {
-    //         code
-    //       },
-    //       success: function (res) {
-    //         //保存data内容 里面包含 openid 和 session_key
-    //         that.setData(res.data);
-    //       }
-    //     })
-    //   }
-    // })
   },
   // getPhoneNumber: function (e) {
   //   var that = this;

+ 167 - 73
pages/myClass/myClass.js

@@ -6,71 +6,72 @@ Page({
     showMore: false, //更多
     show: false,
     notice: "通知通知我是通知通知通知我是通知通知通知我是通知通知通知我是通知",
-    "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"
-      }
-    ],
+    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",
@@ -100,6 +101,43 @@ Page({
     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({
@@ -131,23 +169,79 @@ Page({
       title: '领取成功'
     })
   },
-  goWrite(){
+  goWrite() {
     wx.navigateTo({
       url: '../studentRegistration/studentRegistration'
     })
   },
-  goWrite2(){
+  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
-    });
-  }
+  // onShow: function () {
+  //   this.setData({
+  //     show: true
+  //   });
+  // }
 })

+ 5 - 5
pages/myClass/myClass.wxml

@@ -23,15 +23,15 @@
 		<view class="layout_text2">去填写</view>
 	</view>
 	<view class="{{!showMore? 'hiddenmore' : 'showmore'}}">
-		<view class="sp {{idx>2 ? 'none' : ''}}" wx:for="{{spxxArr}}" wx:for-index="idx" wx:for-item="item">
-			<image src='{{item.spfm}}' mode='aspectFill' class="spfm"></image>
-			<image src='{{item.isfinish}}' mode='aspectFill' class="isfinish"></image>
+		<view class="sp {{idx>2 ? 'none' : ''}}" wx:for="{{kcArr}}" wx:for-index="idx" wx:for-item="item">
+			<image src='{{item.courseImg}}' mode='aspectFill' class="spfm"></image>
+			<!-- <image src='{{item.isfinish}}' mode='aspectFill' class="isfinish"></image> -->
 			<view class="sp_text">
 				<view>
 					<view class="fisrt_set">
-						<image src='{{item.iszburl}}' mode='aspectFill' class="dbimg"></image><text class="name">{{item.name}}</text>
+						<image src='{{item.isLive==1?"/images/zb.png":"/images/db.png"}}' mode='aspectFill' class="dbimg"></image><text class="name">{{item.courseName}}</text>
 					</view>
-					<view class="start_text">开始时间:{{item.startdate}} <text class="time">{{item.starttime}}</text></view>
+					<view class="start_text">开始时间:{{item.courseStart}}</view>
 					<view>
 						<image src='/images/startstudy.png' mode='aspectFill' class="an"></image>
 						<image src='/images/dtxs.png' mode='aspectFill' class="an" bindtap="gokhAnswer"></image>

+ 204 - 39
pages/myMission/myMission.js

@@ -1,4 +1,5 @@
 // pages/learningReport/learningReport.js
+const app = getApp()
 Page({
 
   /**
@@ -74,6 +75,16 @@ Page({
       url: '/pages/answerAfterclass/answerAfterclass',
     })
   },
+  goWrite() {
+    wx.navigateTo({
+      url: '../studentRegistration/studentRegistration'
+    })
+  },
+  goWrite2() {
+    wx.navigateTo({
+      url: '../feedBack/feedBack'
+    })
+  },
   lq() {
     this.setData({
       showzs: true
@@ -89,14 +100,58 @@ Page({
 
   },
   showEwm() {
-    this.setData({
-      showewm: true
-    });
+    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/selClas?sessionKey=' + sessionKey + '&isActive=1',
+            method: "post",
+            success: function (res) {
+              if (res.data.data.isAgree == 0) {
+                _this.setData({
+                  show: true
+                });
+              } else {
+                _this.setData({
+                  show: false
+                });
+              }
+            }
+          })
+        },
+        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);
+                }
+              })
+            }
+          })
+        }
+      })
+      // this.setData({
+      //   showewm: true
+      // });
   },
   // showzs(){
-
   // },
   onClose() {
+    wx.hideLoading()
     this.setData({
       showewm: false
     });
@@ -110,47 +165,157 @@ Page({
    * 生命周期函数--监听页面初次渲染完成
    */
   saveImg() {
-    wx.showLoading({
-      title: '保存中...'
-    })
-    var imgSrc = "https://sqdx.windd.cn/files/21.png"
-    wx.downloadFile({
-      url: imgSrc,
-      success: function (res) {
-        console.log(res);
-        //图片保存到本地
-        wx.saveImageToPhotosAlbum({
-          filePath: res.tempFilePath,
-          success: function (data) {
-            wx.hideLoading()
-            wx.showToast({
-              title: '保存成功',
-              icon: 'success',
-              duration: 2000
-            })
-          },
-          fail: function (err) {
-            console.log(err);
-            if (err.errMsg === "saveImageToPhotosAlbum:fail auth deny") {
-              console.log("当初用户拒绝,再次发起授权")
-              wx.openSetting({
-                success(settingdata) {
-                  console.log(settingdata)
-                  if (settingdata.authSetting['scope.writePhotosAlbum']) {
-                    console.log('获取权限成功,给出再次点击图片保存到相册的提示。')
-                  } else {
-                    console.log('获取权限失败,给出不给权限就无法正常使用的提示')
+    wx.getSetting({
+      success(res) {
+        if (!res.authSetting['scope.writePhotosAlbum']) {
+          wx.authorize({
+            scope: 'scope.writePhotosAlbum',
+            success() {
+              console.log(res, "我点击同意啦")
+              wx.showLoading({
+                title: '保存中...'
+              })
+              var imgSrc = "http://yijiao.oss-cn-qingdao.aliyuncs.com/images/http://tmp/wx1b4e5e756cd48af1.o6zAJsws4grEQvYrWTjBigy-6QaU.0llhudiKSF2V955a1c48350d9328ef064b4d36d12746.jpg"
+              wx.downloadFile({
+                url: imgSrc,
+                success: function (res) {
+                  console.log(res, '我下载完成啦');
+                  //图片保存到本地
+                  wx.saveImageToPhotosAlbum({
+                    filePath: res.tempFilePath,
+                    success: function (data) {
+                      console.log(data, '我保存成功啦')
+                      wx.hideLoading();
+                      wx.showToast({
+                        title: '保存成功',
+                        icon: 'success',
+                        duration: 2000
+                      })
+                    },
+                    fail: function (err) {
+                      console.log(err, '我保存失败啦')
+                      wx.hideLoading();
+                      if (err.errMsg === "saveImageToPhotosAlbum:fail auth deny") {
+                        console.log("当初用户拒绝,再次发起授权")
+                        wx.openSetting({
+                          success(settingdata) {
+                            console.log(settingdata)
+                            if (settingdata.authSetting['scope.writePhotosAlbum']) {
+                              console.log('获取权限成功,给出再次点击图片保存到相册的提示。')
+                            } else {
+                              console.log('获取权限失败,给出不给权限就无法正常使用的提示')
+                            }
+                          }
+                        })
+                      }
+                    },
+                    complete(res) {
+                      console.log(res);
+                    }
+                  })
+                }
+              })
+              console.log('授权成功')
+            }
+          })
+        } else {
+          var imgSrc = "http://yijiao.oss-cn-qingdao.aliyuncs.com/images/http://tmp/wx1b4e5e756cd48af1.o6zAJsws4grEQvYrWTjBigy-6QaU.0llhudiKSF2V955a1c48350d9328ef064b4d36d12746.jpg"
+          wx.downloadFile({
+            url: imgSrc,
+            success: function (res) {
+              console.log(res, '我下载完成啦');
+              wx.hideLoading();
+              //图片保存到本地
+              wx.saveImageToPhotosAlbum({
+                filePath: res.tempFilePath,
+                success: function (data) {
+                  console.log(data, '我保存成功啦')
+                  wx.hideLoading();
+                  wx.showToast({
+                    title: '保存成功',
+                    icon: 'success',
+                    duration: 2000
+                  })
+                },
+                fail: function (err) {
+                  console.log(err, '我保存失败啦')
+                  wx.hideLoading();
+                  if (err.errMsg === "saveImageToPhotosAlbum:fail auth deny") {
+                    console.log("当初用户拒绝,再次发起授权")
+                    wx.openSetting({
+                      success(settingdata) {
+                        console.log(settingdata)
+                        if (settingdata.authSetting['scope.writePhotosAlbum']) {
+                          console.log('获取权限成功,给出再次点击图片保存到相册的提示。')
+                        } else {
+                          console.log('获取权限失败,给出不给权限就无法正常使用的提示')
+                        }
+                      }
+                    })
                   }
+                },
+                complete(res) {
+                  console.log(res);
                 }
               })
             }
-          },
-          complete(res) {
-            console.log(res);
-          }
-        })
+          })
+        }
       }
     })
+    // wx.showLoading({
+    //   title: '保存中...'
+    // })
+    // wx.getSetting({
+    //   success(res) {
+    //     console.log(res)
+    //     if (res.authSetting['scope.writePhotosAlbum']) {
+    //       wx.authorize({
+    //         scope: 'scope.writePhotosAlbum',
+    //         success() {
+    //           var imgSrc = "http://sqdx.windd.cn/files/21.png"
+    //           wx.downloadFile({
+    //             url: imgSrc,
+    //             success: function (res) {
+    //               console.log(res);
+    //               //图片保存到本地
+    //               wx.saveImageToPhotosAlbum({
+    //                 filePath: res.tempFilePath,
+    //                 success: function (data) {
+    //                   wx.hideLoading();
+    //                   wx.showToast({
+    //                     title: '保存成功',
+    //                     icon: 'success',
+    //                     duration: 2000
+    //                   })
+    //                 },
+    //                 fail: function (err) {
+    //                   console.log(err);
+    //                   if (err.errMsg === "saveImageToPhotosAlbum:fail auth deny") {
+    //                     console.log("当初用户拒绝,再次发起授权")
+    //                     wx.openSetting({
+    //                       success(settingdata) {
+    //                         console.log(settingdata)
+    //                         if (settingdata.authSetting['scope.writePhotosAlbum']) {
+    //                           console.log('获取权限成功,给出再次点击图片保存到相册的提示。')
+    //                         } else {
+    //                           console.log('获取权限失败,给出不给权限就无法正常使用的提示')
+    //                         }
+    //                       }
+    //                     })
+    //                   }
+    //                 },
+    //                 complete(res) {
+    //                   console.log(res);
+    //                 }
+    //               })
+    //             }
+    //           })
+    //         }
+    //       })
+    //     }
+    //   }
+    // })
   },
   onReady: function () {
 

+ 2 - 2
pages/myMission/myMission.wxml

@@ -15,7 +15,7 @@
 			<view class="save_btn" bindtap="saveImg">保存二维码</view>
 		</view>
 	</van-popup>
-	<view class="step">
+	<view class="step" bindtap="goWrite">
 		<image src='/images/step_finish.png' mode='aspectFill' class="finish_img"></image>
 		<view class="layout">
 			<image src='/images/xydj_bj.png' mode='aspectFill' class="bgimg1"></image>
@@ -41,7 +41,7 @@
 			</view>
 		</view>
 	</view>
-	<view class="step" style="padding-top:30rpx">
+	<view class="step" style="padding-top:30rpx" bindtap="goWrite2">
 		<image src='/images/step_finish.png' mode='aspectFill' class="finish_img"></image>
 		<view class="layout">
 			<image src='/images/zhfk_bj.png' mode='aspectFill' class="bgimg1"></image>

+ 64 - 26
pages/myTraining/myTraining.js

@@ -1,41 +1,79 @@
 //logs.js
 // const util = require('../../utils/util.js')
-
+const app = getApp()
 Page({
   data: {
     dataArr:[
-      {
-        "url": "/images/sc_img.png",
-        "name": "长春市社区工作者线上培训班",
-        "zbdw": "宽城区委组织部",
-        "status": "已结束"
-      },{
-        "url": "/images/sc_img.png",
-        "name": "长春市专职党务工作者线上培训班",
-        "zbdw": "长春市委组织部",
-        "status": "已结束"
-      },{
-        "url": "/images/sc_img.png",
-        "name": "区域党建联盟",
-        "zbdw": "宽城区委组织部",
-        "status": "已结束"
-      },{
-        "url": "/images/sc_img.png",
-        "name": "小区党组织建设",
-        "zbdw": "宽城区委组织部",
-        "status": "已结束"
-      }
+      // {
+      //   "url": "/images/sc_img.png",
+      //   "name": "长春市社区工作者线上培训班",
+      //   "zbdw": "宽城区委组织部",
+      //   "status": "已结束"
+      // },{
+      //   "url": "/images/sc_img.png",
+      //   "name": "长春市专职党务工作者线上培训班",
+      //   "zbdw": "长春市委组织部",
+      //   "status": "已结束"
+      // },{
+      //   "url": "/images/sc_img.png",
+      //   "name": "区域党建联盟",
+      //   "zbdw": "宽城区委组织部",
+      //   "status": "已结束"
+      // },{
+      //   "url": "/images/sc_img.png",
+      //   "name": "小区党组织建设",
+      //   "zbdw": "宽城区委组织部",
+      //   "status": "已结束"
+      // }
     ]
   },
   gomyClass(){
     wx.switchTab({
       url: '../myClass/myClass'
     })
-  },
-  checkboxChange(){
-
   },
   onLoad: function () {
-    
+    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/selWholeClas?sessionKey=' + sessionKey,
+          method: "post",
+          success: function (res) {
+            console.log(res.data.data,"22222")
+            _this.setData({
+              dataArr: res.data.data
+            })
+            // if(dataArr){
+
+            // }
+          }
+        })
+      },
+      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);
+              }
+            })
+          }
+        })
+      }
+    })
   }
 })

+ 7 - 4
pages/myTraining/myTraining.wxml

@@ -1,10 +1,13 @@
 <view class="container">
 <view class="class_box" wx:for="{{dataArr}}" wx:for-index="idx" wx:for-item="item" bindtap="gomyClass">
-<image src="{{item.url}}" mode='aspectFill' class="scimg"></image>
+<image src="{{item.clasImg}}" mode='aspectFill' class="scimg"></image>
 <view class="sctext">
-<view class="t1">{{item.name}}</view>
-<view class="t2">主办单位:{{item.zbdw}}</view>
-<view class="t2">培训状态:{{item.status}}</view>
+<view class="t1">{{item.clasName}}</view>
+<view class="t2">主办单位:{{item.remark}}</view>
+<!-- <view class="t2" id="isActive">培训状态:{{item.isActive==0?"已结束":"正在开班"}}</view> -->
+<rich-text class='t2' wx:if='{{item.isActive==0}}'>待开始</rich-text>
+<rich-text class='t2' wx:elif='{{item.isActive==1}}'>正在开班</rich-text>
+<rich-text class='t2' wx:else>已结束</rich-text>
 </view>
 </view>
 </view>

+ 48 - 8
pages/onlineClass/onlineClass.js

@@ -1,16 +1,56 @@
 //logs.js
 // const util = require('../../utils/util.js')
-
+const app = getApp()
 Page({
   data: {
-    // logs: [],
     active: 0,
+    zbArr: []
+  },
+  goIn(e) {
+    var id = e.currentTarget.dataset.item.id
+    wx.navigateTo({
+      url: '../zbDetails/zbDetails?id=' + id
+    })
   },
   onLoad: function () {
-    // this.setData({
-    //   logs: (wx.getStorageSync('logs') || []).map(log => {
-    //     return util.formatTime(new Date(log))
-    //   })
-    // })
+    var sessionKey = "";
+    var _this = this;
+    wx.checkSession({
+      success: () => {
+        console.log("我有缓存")
+        sessionKey = wx.getStorageSync('sessionKey');
+        console.log(sessionKey)
+        wx.request({
+          url: app.globalData.publicUrl + '/wx/course/selectLivesBySessionKey/' + sessionKey,
+          method: "get",
+          success: function (res) {
+            console.log(res, "woshi ")
+            _this.setData({
+              zbArr: 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);
+              }
+            })
+          }
+        })
+      }
+    })
   }
-})
+})

+ 18 - 18
pages/onlineClass/onlineClass.wxml

@@ -1,21 +1,21 @@
 <!--logs.wxml-->
 <view class="container">
-<view class="video_box">
-	<view class="video">
-		<view class="zbz">
-			<image src='../../images/online_icon.png' mode='aspectFill' class="onlineimg"></image>
-			<view class="onlinetext">直播中</view>
-			<view class="onlinetext"> 123人</view>
-		</view>
-		<image src='../../images/spfm.jpg' mode='aspectFill' class="spbj"></image>
-		<view class="text1">社区干部综合素质提升培训</view>
-		<view class="text2">
-			<image src='../../images/onlinenum.png' mode='aspectFill' class="onlinenumicon"></image>1234人在线观看
+	<view class="video_box">
+		<view class="video" wx:for="{{zbArr}}" wx:for-index="idx" wx:for-item="item" wx:key="idx">
+			<view class="zbz">
+				<image src='../../images/online_icon.png' mode='aspectFill' class="onlineimg"></image>
+				<view class="onlinetext">{{item.isActive==1?"直播中":"待直播"}}</view>
+				<view class="onlinetext"> {{item.playTimes}}人</view>
+			</view>
+			<image src='{{item.courseImg}}' mode='aspectFill' class="spbj"></image>
+			<view class="text1">{{item.courseName}}</view>
+			<view class="text2">
+				<image src='../../images/onlinenum.png' mode='aspectFill' class="onlinenumicon"></image>{{item.playTimes}}人在线观看
+			</view>
+			<view class="text3">{{item.courseInfo}}</view>
+			<button class="{{item.videoId==null?'getinroom':'nogetinroom'}}" bindtap="goIn" data-item="{{item}}">进入课堂</button>
 		</view>
-		<view class="text3">社区干部综合素质提升培训...</view>
-		<view class="getinroom">进入课堂</view>
-	</view>
-	<view class="video">
+		<!-- <view class="video">
 		<view class="dzb">
 			<image src='../../images/online_icon.png' mode='aspectFill' class="onlineimg"></image>
 			<view class="onlinetext">待直播</view>
@@ -28,8 +28,8 @@
 		</view>
 		<view class="text3">社区干部综合素质提升培训...</view>
 		<view class="nogetinroom">进入课堂</view>
-	</view>
-		<view class="video">
+	</view> -->
+		<!-- <view class="video">
 		<view class="dzb">
 			<image src='../../images/online_icon.png' mode='aspectFill' class="onlineimg"></image>
 			<view class="onlinetext">待直播</view>
@@ -42,7 +42,7 @@
 		</view>
 		<view class="text3">社区干部综合素质提升培训...</view>
 		<view class="nogetinroom">进入课堂</view>
+	</view> -->
 	</view>
-</view>
 
 </view>

+ 3 - 3
pages/onlineClass/onlineClass.wxss

@@ -82,11 +82,11 @@
   border: 1px solid #f2b09d;
   text-align: center;
   border-radius: 20rpx;
-  width: 50%;
+  width: 20%;
   margin-left: 25%;
   margin-top: 15rpx;
   height: 50rpx;
-  line-height: 50rpx;
+  /* line-height: 50rpx; */
   font-size: 24rpx;
 }
 
@@ -99,6 +99,6 @@
   margin-left: 25%;
   margin-top: 15rpx;
   height: 50rpx;
-  line-height: 50rpx;
+  /* line-height: 50rpx; */
   font-size: 24rpx;
 }

+ 22 - 39
pages/personInfo/personInfo.js

@@ -1,6 +1,6 @@
 //logs.js
 // const util = require('../../utils/util.js')
-
+const app = getApp()
 Page({
   data: {
     logs: []
@@ -25,44 +25,27 @@ Page({
       url: '/pages/myInteractions/myInteractions',
     })
   },
-  getPhoneNumber: function (e) {
-    var that = this;
-    console.log(e)
-    console.log(e.detail.errMsg == "getPhoneNumber:ok");
-    if (e.detail.errMsg == "getPhoneNumber:ok") {
-      wx.request({
-        url: 'http://localhost/index/users/decodePhone',
-        data: {
-          encryptedData: e.detail.encryptedData,
-          iv: e.detail.iv,
-          sessionKey: that.data.session_key,
-          uid: "",
-        },
-        method: "post",
-        success: function (res) {
-          console.log(res);
-        }
-      })
-    }
-  },
+  // getPhoneNumber: function (e) {
+  //   var that = this;
+  //   console.log(e)
+  //   console.log(e.detail.errMsg == "getPhoneNumber:ok");
+  //   if (e.detail.errMsg == "getPhoneNumber:ok") {
+  //     wx.request({
+  //       url: 'http://localhost/index/users/decodePhone',
+  //       data: {
+  //         encryptedData: e.detail.encryptedData,
+  //         iv: e.detail.iv,
+  //         sessionKey: that.data.session_key,
+  //         uid: "",
+  //       },
+  //       method: "post",
+  //       success: function (res) {
+  //         console.log(res);
+  //       }
+  //     })
+  //   }
+  // },
   onLoad: function () {
-    var that = this;
-    wx.login({
-      success(res) {
-        console.log(res);
-        var code = res.code
-        wx.request({
-          url: '',
-          method: "post",
-          data: {
-            code
-          },
-          success: function (res) {
-            console.log(res.data.openid);
-            that.setData(res.data);
-          }
-        })
-      }
-    })
+ 
   }
 })

+ 3 - 3
pages/personInfo/personInfo.wxml

@@ -47,9 +47,9 @@
 				<view class='right-bpx'>
 				<!-- <button class='big-title' open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">身份认证
 				</button> -->
-				<view><button class='big-title' open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">身份认证
-				</button></view>
-					<!-- <view class='big-title' bindtap="toIdentity">身份认证</view> -->
+				<!-- <view><button class='big-title' open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">身份认证
+				</button></view> -->
+					<view class='big-title' bindtap="toIdentity">身份认证</view>
 				</view>
 			</view>
 		</view> 

+ 64 - 29
pages/startClass/startClass.js

@@ -1,36 +1,71 @@
 //logs.js
 // const util = require('../../utils/util.js')
-
+const app = getApp()
 Page({
   data: {
-    dataArr:[
-      {
-        "url": "/images/sc_img.png",
-        "name": "长春市社区工作者线上培训班",
-        "zbdw": "宽城区委组织部",
-        "time": "2020年06月23日"
-      },{
-        "url": "/images/sc_img.png",
-        "name": "长春市专职党务工作者线上培训班",
-        "zbdw": "长春市委组织部",
-        "time": "2020年06月26日"
-      },{
-        "url": "/images/sc_img.png",
-        "name": "区域党建联盟",
-        "zbdw": "宽城区委组织部",
-        "time": "2020年06月29日"
-      },{
-        "url": "/images/sc_img.png",
-        "name": "小区党组织建设",
-        "zbdw": "宽城区委组织部",
-        "time": "2020年06月30日"
-      }
-    ]
-  },
-  checkboxChange(){
-
+    dataArr: [
+    //   {
+    //   "url": "/images/sc_img.png",
+    //   "name": "长春市社区工作者线上培训班",
+    //   "zbdw": "宽城区委组织部",
+    //   "time": "2020年06月23日"
+    // }, {
+    //   "url": "/images/sc_img.png",
+    //   "name": "长春市专职党务工作者线上培训班",
+    //   "zbdw": "长春市委组织部",
+    //   "time": "2020年06月26日"
+    // }, {
+    //   "url": "/images/sc_img.png",
+    //   "name": "区域党建联盟",
+    //   "zbdw": "宽城区委组织部",
+    //   "time": "2020年06月29日"
+    // }, {
+    //   "url": "/images/sc_img.png",
+    //   "name": "小区党组织建设",
+    //   "zbdw": "宽城区委组织部",
+    //   "time": "2020年06月30日"
+    // }
+  ]
   },
   onLoad: function () {
-    
+    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/selClas?sessionKey=' + sessionKey + '&isActive=0',
+          method: "post",
+          success: function (res) {
+            console.log (res,"我是即将开班的列表")
+            _this.setData({
+              dataArr: res.data.data
+            })
+          }
+        })
+      },
+      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);
+              }
+            })
+          }
+        })
+      }
+    })
   }
-})
+})

+ 4 - 4
pages/startClass/startClass.wxml

@@ -1,10 +1,10 @@
 <view class="container">
 <view class="class_box" wx:for="{{dataArr}}" wx:for-index="idx" wx:for-item="item">
-<image src="{{item.url}}" mode='aspectFill' class="scimg"></image>
+<image src="{{item.clasImg}}" mode='aspectFill' class="scimg"></image>
 <view class="sctext">
-<view class="t1">{{item.name}}</view>
-<view class="t2">{{item.zbdw}}</view>
-<view class="t2">{{item.time}}</view>
+<view class="t1">{{item.clasName}}</view>
+<view class="t2">{{item.remark}}</view>
+<view class="t2">{{item.clasBegin}}</view>
 </view>
 </view>
 </view>

+ 38 - 0
pages/zbDetails/zbDetails.js

@@ -0,0 +1,38 @@
+//index.js
+//获取应用实例
+const request = require('../../utils/request.js');
+const app = getApp()
+Page({
+  data: {
+    url: '',
+    title:'',
+    message:'',
+    playTimes:0,
+    id: 0
+  },
+  videoErrorCallback: function (e) {
+    console.log('视频错误信息:')
+    console.log(e.detail.errMsg)
+  },
+  onReady: function () {},
+  onLoad: function (options) {
+    let _this = this
+    _this.setData({
+      id: options.id
+    })
+    wx.request({
+      method: "get",
+      url: app.globalData.publicUrl + '/wx/course/selectLiveByCourseId/S6vZqa6S6Fzyomehw==/' + _this.data.id,
+      success: (e) => {
+        console.log(e,"11111111111111111")
+        this.setData({
+          url: e.data.pullUrl.flvUrl,
+          title:e.data.course.courseName,
+          message: e.data.course.courseInfo,
+          playTimes: e.data.course.playTimes
+        })
+      }
+    })
+  },
+
+})

+ 4 - 0
pages/zbDetails/zbDetails.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText":"宣传展示"
+}

+ 10 - 0
pages/zbDetails/zbDetails.wxml

@@ -0,0 +1,10 @@
+<view class="home">
+	<live-player src="{{url}}" mode="live" autoplay bindstatechange="statechange" binderror="error" style="width:100%"/>
+	<view class="text_box">
+		<view class="title">{{title}}</view>
+		<view class="bfnum">{{playTimes}}次播放</view>
+		<!-- <view class="zj">主讲:授课教师</view> -->
+		<view class="zw">{{message}}
+		</view>
+	</view>
+</view>

+ 27 - 0
pages/zbDetails/zbDetails.wxss

@@ -0,0 +1,27 @@
+#myVideo{
+  width: 100%;
+}
+.text_box{
+width: 90%;
+margin-left: 5%;
+}
+.title{
+  font-size: 32rpx;
+  margin-top: 50rpx;
+}
+.bfnum{
+color: #999999;
+font-size: 25rpx;
+margin-top: 10rpx;
+height: 50rpx;
+border-bottom: 1px solid #dbdbdb;
+}
+.zj{
+  font-size: 32rpx;
+  margin-top: 20rpx;
+}
+.zw{
+  font-size: 25rpx;
+  margin-top: 40rpx;
+  line-height: 40rpx;
+}

+ 35 - 0
utils/util.js

@@ -0,0 +1,35 @@
+const app = getApp();
+var filters = {
+  getSessionKey: function () {
+    wx.checkSession({
+      success: (res) => {
+        console.log(res.errMsg);
+        app.globalData.publicUrl = res.errMsg;
+        return res.errMsg;
+      },
+      fail() {
+        wx.login({
+          success(res) {
+            console.log(res);
+            var code = res.code
+            wx.request({
+              url: app.globalData.publicUrl + '/wx/user/wx7e7a46e129d6cd0f/login',
+              method: "get",
+              data: {
+                code
+              },
+              success: function (res) {
+                console.log(res.data.openid);
+                that.setData(res.data);
+                return res.data
+              }
+            })
+          }
+        })
+      }
+    })
+  }
+}
+module.exports = {
+  getSessionKey: filters.getSessionKey
+}

BIN
wx7e7a46e129d6cd0f.o6zAJs6_LMFAAXLohpL4IEbUQdOY.1QyilC7Bgm1Z20e5c3776a4b93da05406431fcc4e339.png