ssfg vor 5 Jahren
Ursprung
Commit
9c0797c105

+ 1 - 3
app.json

@@ -1,21 +1,19 @@
 {
   "pages": [
     "pages/index/index",
+    "pages/zbDetails/zbDetails",
     "pages/myInteractions/myInteractions",
     "pages/myMission/myMission",
-    
     "pages/exhibitionList/exhibitionList",
     "pages/startClass/startClass",
     "pages/demandCourses/demandCourses",
     "pages/onlineClass/onlineClass",
-    "pages/zbDetails/zbDetails",
     "pages/personInfo/personInfo",
     "pages/dbDetails/dbDetails",
     "pages/myClass/myClass",
     "pages/testAnswer/testAnswer",
     "pages/dbVideo/dbVideo",
     "pages/myInteractionsDetais/myInteractionsDetais",
-    
     "pages/myPoints/myPoints",
     "pages/evaluationCourse/evaluationCourse",
     "pages/Identity/Identity",

+ 23 - 2
pages/dbDetails/dbDetails.js

@@ -10,7 +10,8 @@ Page({
     playTimes: 0,
     id: 0,
     studyLog: {},
-    currentTime: 0
+    currentTime: 0,
+    startPlayTime: 0
   },
   videoErrorCallback: function (e) {
     console.log('视频错误信息:')
@@ -34,6 +35,7 @@ Page({
           title: e.data.course.courseInfo,
           message: e.data.course.courseName,
           playTimes: e.data.course.playTimes
+          
         })
       }
     })
@@ -50,7 +52,8 @@ Page({
       success: (e) => {
         console.log(e, "22222222222222")
         _this.setData({
-          studyLog: e.data.studyLog
+          studyLog: e.data.studyLog,
+          startPlayTime:e.data.studyLog.studyTime
         })
       }
     })
@@ -64,6 +67,24 @@ Page({
       [studyTime]: currentTime
     })
   },
+  chechEndStatus: function () {
+    let _this = this;
+    // let currentTime = parseInt(e.detail.currentTime)
+    let isDone = 'studyLog.isDone'
+    this.setData({
+      [isDone]: 1
+    })
+    wx.request({
+      method: "post",
+      url: app.globalData.publicUrl + '/wx/course/updateStudyLog',
+      data: {
+        studyLog: _this.data.studyLog
+      },
+      success: (e) => {
+        console.log(e, "我修改进度成功了aaaa")
+      }
+    })
+  },
   onUnload() {
     var _this = this;
     console.log(_this.data.studyLog)

+ 1 - 1
pages/dbDetails/dbDetails.wxml

@@ -1,5 +1,5 @@
 <view class="home">
-	<video id="myVideo" src="{{url}}" binderror="videoErrorCallback" bindtimeupdate="timeUpdate" show-play-btn="ture" show-mute-btn="true" controls>
+	<video id="myVideo" src="{{url}}" initial-time="{{startPlayTime}}" binderror="videoErrorCallback" bindtimeupdate="timeUpdate" show-play-btn="ture" show-mute-btn="true" controls bindended="chechEndStatus">
 	</video>
 	<view class="text_box">
 		<view class="title">{{title}}</view>

+ 50 - 2
pages/demandCourses/demandCourses.js

@@ -2,7 +2,8 @@ const app = require('../../utils/util.js');
 Page({
   data: {
     lbArr: [],
-    showNull: false
+    showNull: false,
+    sfmArr:[]
   },
   goIn(e) {
     var id = e.currentTarget.dataset.item.id
@@ -19,10 +20,38 @@ Page({
         sessionKey: sessionKey
       },
       success: function (res) {
+        console.log(res)
         _this.setData({
           lbArr: res.data.list
         })
-        if (res.data.list.length == 0) {
+        let result = [];
+        for (var i = 0; i < res.data.list.length; i++) {
+          result.push({
+            courseTime: res.data.list[i].courseTime
+          });
+        }
+        const timesArr = result.map((item) => {
+          return item.courseTime;
+        });
+        let sfmArr = [];
+        for (let i = 0; i < timesArr.length; i++) {
+          let value = timesArr[i];
+          const resultValue = _this.handler(value);
+          sfmArr.push({
+            courseTime: resultValue
+          })
+          _this.setData({
+            sfmArr: sfmArr
+          })
+        }
+        if (_this.data.lbArr.length == 0) {
+          _this.setData({
+            showNull: true
+          })
+        }
+      },
+      fail: function () {
+        if (_this.data.lbArr.length == 0) {
           _this.setData({
             showNull: true
           })
@@ -30,6 +59,25 @@ Page({
       }
     })
   },
+  handler(value) {
+    //换算为秒 进制1000
+    const second = Math.floor(value / 1000); //判断是否够1秒
+    if (second < 1) {
+      return "0秒";
+    }
+    const secondValue = second % 60; // 秒
+    const minutes = Math.floor(second / 60); //判断是否够1分钟
+    if (minutes < 1) {
+      return `${secondValue}秒`;
+    }
+    const minutesValue = minutes % 60; //分
+    const hours = Math.floor(minutes / 60); //判断是否够1小时
+    if (hours < 1) {
+      return `${minutesValue}分${secondValue}秒`;
+    }
+    const hoursValue = hours % 60; //小时
+    return `${hoursValue}时${minutesValue}分${secondValue}秒`;
+  },
   onLoad: function () {
     var sessionKey = "";
     var _this = this;

+ 1 - 1
pages/demandCourses/demandCourses.wxml

@@ -16,7 +16,7 @@
 			<view class="grayblock">
 				<view class="show_text">{{item.courseName}}</view>
 				<image src='/images/clock.png' mode='aspectFill' class="qb"></image>
-				<view style="color:#e82315;font-size:25rpx;font-weight:500;float:left">{{item.courseTime/1000/60}}分钟</view>
+				<view style="color:#e82315;font-size:25rpx;font-weight:500;float:left">{{sfmArr[idx].courseTime}}</view>
 				<view style="color:#848585;font-size:22rpx;float:right;margin-right:20rpx">{{item.playTimes}}人看过</view>
 			</view>
 		</view>

+ 14 - 0
pages/demandCourses/demandCourses.wxss

@@ -45,4 +45,18 @@ page {
   margin-left: 10rpx;
   margin-top: 5rpx;
   float: left;
+}
+.nodata {
+  position: absolute;
+  top: 285rpx;
+  left: 205rpx;
+  width: 340rpx;
+  height: 262rpx;
+}
+.nodata_text{
+  position: absolute;
+  top: 550rpx;
+  left: 310rpx;
+  font-size: 30rpx;
+  color: #666666;
 }

+ 1 - 1
pages/exhibitionList/exhibitionList.json

@@ -1,4 +1,4 @@
 {
-  "navigationBarTitleText":"宣传展示",
+  "navigationBarTitleText":"我们的学院",
   "usingComponents": {}
 }

+ 6 - 6
pages/exhibitionList/exhibitionList.wxml

@@ -15,7 +15,7 @@
 				</view>
 			</view>
 		</van-tab>
-		<van-tab title="特色课程" title-style="font-size:25rpx">
+		<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='{{item.courseImg}}' mode='aspectFill' class="show1"></image>
@@ -23,14 +23,14 @@
 						<view class="show_text">{{item.courseName}}</view>
 						<view class="viedoxx">
 							<image src='/images/qb.png' mode='aspectFill' class="qb"></image>
-							<view style="color:#e82315;font-size:25rpx;font-weight:500;float:left">特色课程</view>
+							<view style="color:#e82315;font-size:25rpx;font-weight:500;float:left">学院宣传</view>
 							<view style="color:#848585;font-size:22rpx;float:right;margin-right:20rpx">{{item.playTimes}}人看过</view>
 						</view>
 					</view>
 				</view>
 			</view>
 		</van-tab>
-		<van-tab title="班级风采" title-style="font-size:25rpx">
+		<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='{{item.courseImg}}' mode='aspectFill' class="show1"></image>
@@ -38,14 +38,14 @@
 						<view class="show_text">{{item.courseName}}</view>
 						<view class="viedoxx">
 							<image src='/images/qb.png' mode='aspectFill' class="qb"></image>
-							<view style="color:#e82315;font-size:25rpx;font-weight:500;float:left">班级风采</view>
+							<view style="color:#e82315;font-size:25rpx;font-weight:500;float:left">特色课程</view>
 							<view style="color:#848585;font-size:22rpx;float:right;margin-right:20rpx">{{item.playTimes}}人看过</view>
 						</view>
 					</view>
 				</view>
 			</view>
 		</van-tab>
-		<van-tab title="我的学院" title-style="font-size:25rpx">
+		<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='{{item.courseImg}}' mode='aspectFill' class="show1"></image>
@@ -53,7 +53,7 @@
 						<view class="show_text">{{item.courseName}}</view>
 						<view class="viedoxx">
 							<image src='/images/qb.png' mode='aspectFill' class="qb"></image>
-							<view style="color:#e82315;font-size:25rpx;font-weight:500;float:left">我的学院</view>
+							<view style="color:#e82315;font-size:25rpx;font-weight:500;float:left">精细管理</view>
 							<view style="color:#848585;font-size:22rpx;float:right;margin-right:20rpx">{{item.playTimes}}人看过</view>
 						</view>
 					</view>

+ 1 - 1
pages/index/index.wxml

@@ -35,7 +35,7 @@
 	</van-grid>
 		<view style="height:15rpx;width:750rpx;background-color:#F2F2F2"></view>
 	<view class="qy_title">
-		<view class="redk"></view>宣传展示
+		<view class="redk"></view>我们的学院
 		<view class="more" bindtap="xczsMore">查看全部></view>
 	</view>
 	<view class="xczs">

+ 42 - 17
pages/myClass/myClass.js

@@ -7,21 +7,7 @@ Page({
     notice: "",
     className: '',
     kcArr: [],
-    "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": "全体人员",
-      }
-    ]
+    sfmArr:[]
   },
   // 更多
   listToggle: function () {
@@ -195,12 +181,12 @@ Page({
             content: '跳转至身份认证',
             success: function (res) {
               if (res.confirm) {
-                wx.redirectTo({
+                wx.navigateTo({
                   url: '../Identity/Identity'
                 })
               } else {
                 wx.switchTab({
-                  url: '../index/index'
+                  url: '../myClass/myClass'
                 })
               }
             }
@@ -272,9 +258,48 @@ Page({
         _this.setData({
           kcArr: res.data.list
         });
+        let result = [];
+        for (var i = 0; i < res.data.list.length; i++) {
+          result.push({
+            courseTime: res.data.list[i].courseTime
+          });
+        }
+        const timesArr = result.map((item) => {
+          return item.courseTime;
+        });
+        let sfmArr = [];
+        for (let i = 0; i < timesArr.length; i++) {
+          let value = timesArr[i];
+          const resultValue = _this.handler(value);
+          sfmArr.push({
+            courseTime: resultValue
+          })
+          _this.setData({
+            sfmArr: sfmArr
+          })
+        }
       }
     })
   },
+  handler(value) {
+    //换算为秒 进制1000
+    const second = Math.floor(value / 1000); //判断是否够1秒
+    if (second < 1) {
+      return "0秒";
+    }
+    const secondValue = second % 60; // 秒
+    const minutes = Math.floor(second / 60); //判断是否够1分钟
+    if (minutes < 1) {
+      return `${secondValue}秒`;
+    }
+    const minutesValue = minutes % 60; //分
+    const hours = Math.floor(minutes / 60); //判断是否够1小时
+    if (hours < 1) {
+      return `${minutesValue}分${secondValue}秒`;
+    }
+    const hoursValue = hours % 60; //小时
+    return `${hoursValue}时${minutesValue}分${secondValue}秒`;
+  },
   onShow() {
     var _this = this;
     wx.checkSession({

+ 2 - 2
pages/myClass/myClass.wxml

@@ -22,7 +22,7 @@
 	<view class="{{!showMore? 'hiddenmore' : 'showmore'}}">
 		<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.isDone==0?"/images/unfinish.png":"/images/finish.png"}}' mode='aspectFill' class="isfinish"></image>
+			<image src='{{item.isDone==0||item.isDone==null?"/images/unfinish.png":"/images/finish.png"}}' mode='aspectFill' class="isfinish"></image>
 			<view class="sp_text">
 					<view class="fisrt_set">
 						<image src='/images/db.png' mode='aspectFill' class="dbimg" wx:if='{{item.isLive==-1}}'></image>
@@ -32,7 +32,7 @@
 						<text class="name">{{item.courseName}}</text>
 					</view>
 					<view class="start_text" wx:if='{{item.isLive==1}}'>开始时间:{{item.courseStart}}</view>
-					<view class="start_text" wx:if='{{item.isLive==-1}}'>视频时长: {{item.courseTime/1000/60}}分钟</view>
+					<view class="start_text" wx:if='{{item.isLive==-1}}'>视频时长: {{sfmArr[idx].courseTime}}</view>
 					<view>
 						<image src='/images/startstudy.png' mode='aspectFill' class="an" data-item="{{item}}" bindtap="goStudy"></image>
 						<image src='/images/dtxs.png' mode='aspectFill' class="an" bindtap="gokhAnswer"></image>

+ 1 - 0
pages/myInteractionsDetais/myInteractionsDetais.wxss

@@ -6,6 +6,7 @@
 .mytw_nr {
   width: 100%;
   position: relative;
+  background-color: #f2f2f2;
 }
 
 .myimg {

+ 45 - 4
pages/myMission/myMission.js

@@ -9,6 +9,7 @@ Page({
     showzs: false,
     kcArr: [],
     ewmurl: '',
+    sfmArr:[],
     istask1: false,
     istask2: false,
     istask3: false,
@@ -91,13 +92,53 @@ Page({
         sessionKey: sessionKey
       },
       success: function (res) {
-        console.log(res)
+        console.log(res,"11111111111111")
         _this.setData({
-          kcArr: res.data.list
+          kcArr: res.data.list,
+          istask3:res.data.allDone
+        });
+        let result = [];
+        for (var i = 0; i < res.data.list.length; i++) {
+          result.push({
+            courseTime: res.data.list[i].courseTime
+          });
+        }
+        const timesArr = result.map((item) => {
+          return item.courseTime;
         });
+        let sfmArr = [];
+        for (let i = 0; i < timesArr.length; i++) {
+          let value = timesArr[i];
+          const resultValue = _this.handler(value);
+          sfmArr.push({
+            courseTime: resultValue
+          })
+          _this.setData({
+            sfmArr: sfmArr
+          })
+        }
       }
     })
   },
+  handler(value) {
+    //换算为秒 进制1000
+    const second = Math.floor(value / 1000); //判断是否够1秒
+    if (second < 1) {
+      return "0秒";
+    }
+    const secondValue = second % 60; // 秒
+    const minutes = Math.floor(second / 60); //判断是否够1分钟
+    if (minutes < 1) {
+      return `${secondValue}秒`;
+    }
+    const minutesValue = minutes % 60; //分
+    const hours = Math.floor(minutes / 60); //判断是否够1小时
+    if (hours < 1) {
+      return `${minutesValue}分${secondValue}秒`;
+    }
+    const hoursValue = hours % 60; //小时
+    return `${hoursValue}时${minutesValue}分${secondValue}秒`;
+  },
   // 学员身份认证
   checkTaskList(sessionKey) {
     var _this = this;
@@ -136,12 +177,12 @@ Page({
             content: '跳转至身份认证',
             success: function (res) {
               if (res.confirm) {
-                wx.redirectTo({
+                wx.navigateTo({
                   url: '../Identity/Identity'
                 })
               } else {
                 wx.switchTab({
-                  url: '../index/index'
+                  url: '../myMission/myMission'
                 })
               }
             }

+ 2 - 2
pages/myMission/myMission.wxml

@@ -30,7 +30,7 @@
 		<image src='{{istask3==false?"/images/step_unfinish.png":"/images/step_finish.png"}}' mode='aspectFill' class="finish_img"></image>
 		<view class="sp_bigbox">
 			<view class="sp" wx:for="{{kcArr}}" wx:for-index="idx" wx:for-item="item">
-				<image src='{{item.isDone==0?"/images/unfinish.png":"/images/finish.png"}}' mode='aspectFill' class="isfinish"></image>
+				<image src='{{item.isDone==0||item.isDone==null?"/images/unfinish.png":"/images/finish.png"}}' mode='aspectFill' class="isfinish"></image>
 				<view class="sp_text">
 					<view class="fisrt_set">
 						<!-- <image src='{{item.isLive==1?"/images/zb.png":"/images/db.png"}}' mode='aspectFill' class="dbimg"></image> -->
@@ -42,7 +42,7 @@
 					</view>
 					<!-- <view class="start_text">开始时间:{{item.courseStart}}</view> -->
 					<view class="start_text" wx:if='{{item.isLive==1}}'>开始时间:{{item.courseStart}}</view>
-					<view class="start_text" wx:if='{{item.isLive==-1}}'>视频时长: {{item.courseTime/1000/60}}分钟</view>
+					<view class="start_text" wx:if='{{item.isLive==-1}}'>视频时长: {{sfmArr[idx].courseTime}}</view>
 					<view>
 						<image src='/images/startstudy.png' mode='aspectFill' class="an" data-item="{{item}}" bindtap="goStudy"></image>
 						<image src='/images/dtxs.png' mode='aspectFill' class="an" bindtap="gokhAnswer"></image>

+ 7 - 0
pages/onlineClass/onlineClass.js

@@ -45,6 +45,13 @@ Page({
             showNull: true
           })
         }
+      },
+      fail: function () {
+        if (_this.data.zbArr.length == 0) {
+          _this.setData({
+            showNull: true
+          })
+        }
       }
     })
   },

+ 1 - 3
pages/onlineClass/onlineClass.wxml

@@ -9,13 +9,11 @@
 			</view>
 			<image src='{{item.courseImg}}' mode='aspectFill' class="spbj"></image>
 			<view class="text1">{{item.courseName}}</view>
-			<!-- <view class="text2">开始时间:{{item.courseStart}}</view> -->
 			<view class="text2">
 				<image src='../../images/onlinenum.png' mode='aspectFill' class="onlinenumicon"></image>{{item.playTimes}}人在线观看
 			</view>
-			<view class="text3">{{item.courseInfo}}</view>
+			<!-- <view class="text3">{{item.courseInfo}}</view> -->
 			<view class="{{item.isActive==1?'getinroom':'nogetinroom'}}"  bindtap="goIn" data-item="{{item}}">进入课堂
-			<!-- <button bindtap="goIn" data-item="{{item}}" style="width:100%;" plain="true">进入课堂</button> -->
 			</view>
 
 		</view>

+ 7 - 0
pages/testAnswer/testAnswer.js

@@ -29,6 +29,13 @@ Page({
   },
   checkboxChange(){
 
+  },
+  startAnswer(){
+    wx.showModal({
+      showCancel: false,
+      content: "此功能暂时还未开放哦",
+      success(res) {}
+    })
   },
   onLoad: function () {
     

+ 1 - 1
pages/testAnswer/testAnswer.wxml

@@ -4,7 +4,7 @@
 		<view class="sctext">
 			<view class="t1">{{item.name}}</view>
 			<view class="t2">主讲人: {{item.zbdw}} <text style="margin-left:20rpx">{{item.time}}</text></view>
-			<view class="t3">开始答题</view>
+			<view class="t3" bindtap="startAnswer">开始答题</view>
 		</view>
     <view class="isanswertag">未答题</view>
 	</view>

+ 11 - 5
pages/zbDetails/zbDetails.js

@@ -10,12 +10,18 @@ Page({
     id: 0,
     socketOpen: false,
     chatContent: [],
-    inputValue: ''
+    inputValue: '',
+    bottom: ""
   },
   // videoErrorCallback: function (e) {
   //   console.log('视频错误信息:')
   //   console.log(e.detail.errMsg)
   // },
+  scrollToTop() {
+    this.setAction({
+      scrollTop: 0
+    })
+  },
   onReady: function () {},
   bindKeyInput: function (e) {
     this.setData({
@@ -80,7 +86,8 @@ Page({
       let res = JSON.parse(data.data);
       console.log(res)
       _this.setData({
-        chatContent: _this.data.chatContent.concat(res.msg)
+        chatContent: _this.data.chatContent.concat(res.msg),
+        bottom: 'scrollBottom'
       })
       if (res.messageType == "system" && res.mag == "socketLiveEnd") {
         this.setData({
@@ -105,11 +112,10 @@ Page({
       wx.sendSocketMessage({
         data: msg
       })
-    } else {
-    }
+    } else {}
   },
   onShow() {
-    let _this=this;
+    let _this = this;
     wx.checkSession({
       success: () => {
         console.log("我有缓存")

+ 9 - 8
pages/zbDetails/zbDetails.wxml

@@ -7,10 +7,18 @@
 		<view class="zw">{{message}}
 		</view>
 	</view>
-	<view class="chatbox">
+	<!-- <view class="chatbox">
 		<view wx:for="{{chatContent}}" wx:for-index="idx" wx:for-item="item" wx:key="idx" class="chat_text">
 			{{item}}
 		</view>
+	</view> -->
+	<view class="chatbox">
+		<scroll-view scroll-y="true" style="height: 400rpx;" bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" scroll-into-view="{{bottom}}" scroll-top="{{scrollTop}}">
+			<view wx:for="{{chatContent}}" wx:for-index="idx" wx:for-item="item" wx:key="idx" class="chat_text">
+				{{item}}
+			</view>
+			<view id="scrollBottom" style="height:50rpx"></view>
+		</scroll-view>
 	</view>
 	<view class="puthands_box">
 		<image src='/images/puthands.png' mode='aspectFill' class="handimg"></image>
@@ -18,11 +26,4 @@
 		<input class="weui-input" bindinput="bindKeyInput" placeholder="请输入你的问题" />
 		<view class="send" bindtap="submit">发送</view>
 	</view>
-	<!-- <button bindtap="hands">发送</button> -->
-	<!-- <form bindsubmit="bindFormSubmit">
-			<textarea value="{{mytip}}" name="textarea" placeholder="我要说话啦!!!" auto-focus maxlength="-1" style="height:700rpx" />
-			<button form-type="submit" type="button" class="submit_btn"> 提交 </button>
-    </form>
-	<view style="border:1px solid red;color:#000" wx:for="{{chatContent}}" wx:for-index="idx" wx:for-item="item" wx:key="idx">
-		{{item}}</view> -->
 </view>

+ 3 - 1
pages/zbDetails/zbDetails.wxss

@@ -45,7 +45,9 @@
   margin-bottom: 20rpx;
   /* border-bottom: 1px solid #dbdbdb; */
 }
-
+.chat_text{
+  padding:30rpx 30rpx 10rpx 30rpx;
+}
 .puthands_box {
   margin-top: 20rpx;
   margin-left: 35rpx;

+ 1 - 1
utils/util.js

@@ -9,5 +9,5 @@ const globalData = {
   // publicUrl3: 'http://10.16.4.22:8090', //zxq
 };
 module.exports = {
-  globalData: globalData
+  globalData: globalData,
 }