ssfg 5 years ago
parent
commit
5fa013e685

+ 3 - 3
app.json

@@ -1,7 +1,8 @@
 {
   "pages": [
+    "pages/studentRegistration/studentRegistration",
     "pages/welcome/welcome",
-    "pages/zbDetails/zbDetails",
+    "pages/zbDetails/zbDetails", 
      "pages/testAnswer/testAnswer",
     "pages/myClass/myClass",
     "pages/last/last",
@@ -10,7 +11,7 @@
     "pages/lastdetail/lastdetail",
     "pages/lastdetailDetail/lastdetailDetail",
     "pages/answerAfterclasses/answerAfterclasses",
-    "pages/studentRegistration/studentRegistration",
+    
     "pages/evaluationCourse/evaluationCourse",
     "pages/feedBack/feedBack",
     "pages/answerAfterclass/answerAfterclass",
@@ -20,7 +21,6 @@
     "pages/onlineClass/onlineClass",
     "pages/dbDetails/dbDetails",
     "pages/dbVideo/dbVideo",
-    
     "pages/myNotice/myNotice",
     "pages/myInteractions/myInteractions",
     "pages/myMission/myMission",

+ 156 - 111
components/trtc-room/controller/user-controller.js

@@ -1,7 +1,9 @@
 import Event from '../utils/event.js'
 import User from '../model/user.js'
 import Stream from '../model/stream.js'
-import { EVENT } from '../common/constants.js'
+import {
+  EVENT
+} from '../common/constants.js'
 
 const TAG_NAME = 'UserController'
 /**
@@ -103,13 +105,18 @@ class UserController {
         let user = this.getUser(userID)
         if (!user) {
           // 新增用户
-          user = new User({ userID: userID })
+          user = new User({
+            userID: userID
+          })
           this.userList.push({
             userID: userID,
           })
         }
         userMap.set(userID, user)
-        this._emitter.emit(EVENT.REMOTE_USER_JOIN, { userID: userID, userList: this.userList })
+        this._emitter.emit(EVENT.REMOTE_USER_JOIN, {
+          userID: userID,
+          userList: this.userList
+        })
         // console.log(TAG_NAME, 'addUser', item, userMap.get(userID), this.userMap)
       })
     }
@@ -136,7 +143,11 @@ class UserController {
         user.streams['aux'] && user.streams['aux'].reset()
         // 用户退出,释放引用,外部调用该 user 所有stream 的 playerContext.stop() 方法停止播放
         // TODO 触发时机提前了,方便外部用户做出处理,时机仍需进一步验证
-        this._emitter.emit(EVENT.REMOTE_USER_LEAVE, { userID: userID, userList: this.userList, streamList: this.streamList })
+        this._emitter.emit(EVENT.REMOTE_USER_LEAVE, {
+          userID: userID,
+          userList: this.userList,
+          streamList: this.streamList
+        })
         user = undefined
         this.userMap.delete(userID)
         // console.log(TAG_NAME, 'removeUser', this.userMap)
@@ -152,60 +163,75 @@ class UserController {
     const incomingUserList = data.userlist
     if (Array.isArray(incomingUserList) && incomingUserList.length > 0) {
       incomingUserList.forEach((item) => {
-        const userID = item.userid
-        const streamType = item.streamtype
-        const streamID = userID + '_' + streamType
-        const hasVideo = item.hasvideo
-        const src = item.playurl
-        const user = this.getUser(userID)
-        // 更新指定用户的属性
-        if (user) {
-          // 查找对应的 stream
-          let stream = user.streams[streamType]
-          console.log(TAG_NAME, 'updateUserVideo start', user, streamType, stream)
-          // 常规逻辑
-          // 新来的stream,新增到 user.steams 和 streamList,streamList 包含所有用户(有音频或视频)的 stream
-          if (!stream) {
-            // 不在 user streams 里,需要新建
-            user.streams[streamType] = stream = new Stream({ userID, streamID, hasVideo, src, streamType })
-            this._addStream(stream)
-          } else {
-            // 更新 stream 属性
-            stream.setProperty({ hasVideo })
-            if (!hasVideo && !stream.hasAudio) {
-              this._removeStream(stream)
-            }
-            // or
-            // if (hasVideo) {
-            //   stream.setProperty({ hasVideo })
-            // } else if (!stream.hasAudio) {
-            //   // hasVideo == false && hasAudio == false
-            //   this._removeStream(stream)
-            // }
-          }
-          // 特殊逻辑
-          if (streamType === 'aux') {
-            if (hasVideo) {
-              // 辅流需要修改填充模式
-              stream.objectFit = 'contain'
+        console.log(item, "5555555555555555555555555")
+        // if (item.userid == "0" || item.userid == "share-userId") {
+          const userID = item.userid
+          const streamType = item.streamtype
+          const streamID = userID + '_' + streamType
+          const hasVideo = item.hasvideo
+          const src = item.playurl
+          const user = this.getUser(userID)
+          // 更新指定用户的属性
+          if (user) {
+            // 查找对应的 stream
+            let stream = user.streams[streamType]
+            console.log(TAG_NAME, 'updateUserVideo start', user, streamType, stream)
+            // 常规逻辑
+            // 新来的stream,新增到 user.steams 和 streamList,streamList 包含所有用户(有音频或视频)的 stream
+            if (!stream) {
+              // 不在 user streams 里,需要新建
+              user.streams[streamType] = stream = new Stream({
+                userID,
+                streamID,
+                hasVideo,
+                src,
+                streamType
+              })
               this._addStream(stream)
             } else {
-              // 如果是辅流要移除该 stream,否则需要移除 player
-              this._removeStream(stream)
+              // 更新 stream 属性
+              stream.setProperty({
+                hasVideo
+              })
+              if (!hasVideo && !stream.hasAudio) {
+                this._removeStream(stream)
+              }
+              // or
+              // if (hasVideo) {
+              //   stream.setProperty({ hasVideo })
+              // } else if (!stream.hasAudio) {
+              //   // hasVideo == false && hasAudio == false
+              //   this._removeStream(stream)
+              // }
             }
-          }
-          // 更新所属user 的 hasXxx 值
-          this.userList.find((item)=>{
-            if (item.userID === userID) {
-              item[`has${streamType.replace(/^\S/, (s) => s.toUpperCase())}Video`] = hasVideo
-              return true
+            // 特殊逻辑
+            if (streamType === 'aux') {
+              if (hasVideo) {
+                // 辅流需要修改填充模式
+                stream.objectFit = 'contain'
+                this._addStream(stream)
+              } else {
+                // 如果是辅流要移除该 stream,否则需要移除 player
+                this._removeStream(stream)
+              }
             }
-          })
-          console.log(TAG_NAME, 'updateUserVideo end', user, streamType, stream)
-          const eventName = hasVideo ? EVENT.REMOTE_VIDEO_ADD : EVENT.REMOTE_VIDEO_REMOVE
-          this._emitter.emit(eventName, { stream: stream, streamList: this.streamList, userList: this.userList })
-          // console.log(TAG_NAME, 'updateUserVideo', user, stream, this.userMap)
-        }
+            // 更新所属user 的 hasXxx 值
+            this.userList.find((item) => {
+              if (item.userID === userID) {
+                item[`has${streamType.replace(/^\S/, (s) => s.toUpperCase())}Video`] = hasVideo
+                return true
+              }
+            })
+            console.log(TAG_NAME, 'updateUserVideo end', user, streamType, stream)
+            const eventName = hasVideo ? EVENT.REMOTE_VIDEO_ADD : EVENT.REMOTE_VIDEO_REMOVE
+            this._emitter.emit(eventName, {
+              stream: stream,
+              streamList: this.streamList,
+              userList: this.userList
+            })
+            // console.log(TAG_NAME, 'updateUserVideo', user, stream, this.userMap)
+          }
+        // }
       })
     }
   }
@@ -218,56 +244,69 @@ class UserController {
     const incomingUserList = data.userlist
     if (Array.isArray(incomingUserList) && incomingUserList.length > 0) {
       incomingUserList.forEach((item) => {
-        const userID = item.userid
-        // 音频只跟着 stream main ,这里只修改 main
-        const streamType = 'main'
-        const streamID = userID + '_' + streamType
-        const hasAudio = item.hasaudio
-        const src = item.playurl
-        const user = this.getUser(userID)
-        if (user) {
-          let stream = user.streams[streamType]
-          // if (!stream) {
-          //   user.streams[streamType] = stream = new Stream({ streamType: streamType })
-          //   this._addStream(stream)
-          // }
-
-          // 常规逻辑
-          // 新来的stream,新增到 user.steams 和 streamList,streamList 包含所有用户的 stream
-          if (!stream) {
-            // 不在 user streams 里,需要新建
-            user.streams[streamType] = stream = new Stream({ userID, streamID, hasAudio, src, streamType })
-            this._addStream(stream)
-          } else {
-            // 更新 stream 属性
-            stream.setProperty({ hasAudio })
-            if (!hasAudio && !stream.hasVideo) {
-              this._removeStream(stream)
-            }
-            // or
-            // if (hasAudio) {
-            //   stream.setProperty({ hasAudio })
-            // } else if (!stream.hasVideo) {
-            // // hasVideo == false && hasAudio == false
-            //   this._removeStream(stream)
+        // if (item.userid == "0" || item.userid == "share-userId") {
+          const userID = item.userid
+          // 音频只跟着 stream main ,这里只修改 main
+          const streamType = 'main'
+          const streamID = userID + '_' + streamType
+          const hasAudio = item.hasaudio
+          const src = item.playurl
+          const user = this.getUser(userID)
+          if (user) {
+            let stream = user.streams[streamType]
+            // if (!stream) {
+            //   user.streams[streamType] = stream = new Stream({ streamType: streamType })
+            //   this._addStream(stream)
             // }
-          }
 
-          // stream.userID = userID
-          // stream.streamID = userID + '_' + streamType
-          // stream.hasAudio = hasAudio
-          // stream.src = src
-          // 更新所属 user 的 hasXxx 值
-          this.userList.find((item)=>{
-            if (item.userID === userID) {
-              item[`has${streamType.replace(/^\S/, (s) => s.toUpperCase())}Audio`] = hasAudio
-              return true
+            // 常规逻辑
+            // 新来的stream,新增到 user.steams 和 streamList,streamList 包含所有用户的 stream
+            if (!stream) {
+              // 不在 user streams 里,需要新建
+              user.streams[streamType] = stream = new Stream({
+                userID,
+                streamID,
+                hasAudio,
+                src,
+                streamType
+              })
+              this._addStream(stream)
+            } else {
+              // 更新 stream 属性
+              stream.setProperty({
+                hasAudio
+              })
+              if (!hasAudio && !stream.hasVideo) {
+                this._removeStream(stream)
+              }
+              // or
+              // if (hasAudio) {
+              //   stream.setProperty({ hasAudio })
+              // } else if (!stream.hasVideo) {
+              // // hasVideo == false && hasAudio == false
+              //   this._removeStream(stream)
+              // }
             }
-          })
-          const eventName = hasAudio ? EVENT.REMOTE_AUDIO_ADD : EVENT.REMOTE_AUDIO_REMOVE
-          this._emitter.emit(eventName, { stream: stream, streamList: this.streamList, userList: this.userList })
-          // console.log(TAG_NAME, 'updateUserAudio', user, stream, this.userMap)
-        }
+            // stream.userID = userID
+            // stream.streamID = userID + '_' + streamType
+            // stream.hasAudio = hasAudio
+            // stream.src = src
+            // 更新所属 user 的 hasXxx 值
+            this.userList.find((item) => {
+              if (item.userID === userID) {
+                item[`has${streamType.replace(/^\S/, (s) => s.toUpperCase())}Audio`] = hasAudio
+                return true
+              }
+            })
+            const eventName = hasAudio ? EVENT.REMOTE_AUDIO_ADD : EVENT.REMOTE_AUDIO_REMOVE
+            this._emitter.emit(eventName, {
+              stream: stream,
+              streamList: this.streamList,
+              userList: this.userList
+            })
+            // console.log(TAG_NAME, 'updateUserAudio', user, stream, this.userMap)
+          }
+        // }
       })
     }
   }
@@ -279,7 +318,10 @@ class UserController {
   getUser(userID) {
     return this.userMap.get(userID)
   }
-  getStream({ userID, streamType }) {
+  getStream({
+    userID,
+    streamType
+  }) {
     const user = this.userMap.get(userID)
     if (user) {
       return user.streams[streamType]
@@ -297,7 +339,7 @@ class UserController {
    * @returns {Object}
    */
   reset() {
-    this.streamList.forEach((item)=>{
+    this.streamList.forEach((item) => {
       item.reset()
     })
     this.streamList = []
@@ -319,20 +361,24 @@ class UserController {
    * @param {String} userID 用户ID
    */
   _removeUserAndStream(userID) {
-    this.streamList = this.streamList.filter((item)=>{
+    this.streamList = this.streamList.filter((item) => {
       return item.userID !== userID && item.userID !== ''
     })
-    this.userList = this.userList.filter((item)=>{
+    this.userList = this.userList.filter((item) => {
       return item.userID !== userID
     })
   }
   _addStream(stream) {
-    if (!this.streamList.includes(stream)) {
-      this.streamList.push(stream)
-    }
+    console.log(stream, "ioioioooioioioo")
+    // if (stream.userID == "0" || stream.userID == "share-userId") {
+      if (!this.streamList.includes(stream)) {
+        this.streamList.push(stream)
+        console.log(this.streamList, "我是过滤后的推送列表")
+      }
+    // }
   }
   _removeStream(stream) {
-    this.streamList = this.streamList.filter((item)=>{
+    this.streamList = this.streamList.filter((item) => {
       if (item.userID === stream.userID && item.streamType === stream.streamType) {
         return false
       }
@@ -342,5 +388,4 @@ class UserController {
     user.streams[stream.streamType] = undefined
   }
 }
-
-export default UserController
+export default UserController

File diff suppressed because it is too large
+ 21 - 82
components/trtc-room/template/1v1/1v1.wxml


+ 42 - 20
components/trtc-room/template/1v1/1v1.wxss

@@ -1,19 +1,26 @@
 /* 1v1 视频电话模式 */
-.template-1v1{
-  width: 100vw;
-  height: 100vh;
+.template-1v1 {
+  width: 750rpx;
+  height: 500rpx;
   position: relative;
-  /* border: 1px solid red; */
 }
-.template-1v1 .pusher-container{
-  width: 240rpx;
-  height: 320rpx;
+
+.template-1v1 .pusher-container {
+  width: 300rpx;
+  height: 300rpx;
   position: absolute;
   right: 0rpx;
   top: 0rpx;
-  z-index: 20;
-  border: 1px solid red;
+  z-index: 999999999;
 }
+
+.full_btn {
+  position: absolute;
+  right: -300rpx;
+  top: 200rpx;
+  transform: rotate(90deg);
+}
+
 /* .template-1v1 .pusher-container.fullscreen{
   width: 100vw;
   height: 100vh;
@@ -36,29 +43,42 @@
 } */
 .template-1v1 .loading-img {
   height: 200rpx;
-  display:flex;
+  display: flex;
   justify-content: center;
   align-items: center;
   animation: rotate 2s linear infinite;
 }
+
 .template-1v1 .rotate-img {
-  width:160rpx;
+  width: 160rpx;
   height: 160rpx;
 }
+
 .template-1v1 .loading-text {
   width: 100%;
   padding-top: 40rpx;
   text-align: center;
 }
+
 @keyframes rotate {
-  0%{ transform: rotate(0deg);}
-  50%{ transform: rotate(180deg);}
-  100%{ transform: rotate(360deg);}
+  0% {
+    transform: rotate(0deg);
+  }
+
+  50% {
+    transform: rotate(180deg);
+  }
+
+  100% {
+    transform: rotate(360deg);
+  }
 }
-.template-1v1 .player-container:nth-child(1){
-  width: 100vw;
-  height: 100vh;
+
+.template-1v1 .player-container:nth-child(1) {
+  width: 100%;
+  height: 100%;
 }
+
 .template-1v1 .handle-btns {
   position: absolute;
   z-index: 3;
@@ -94,12 +114,14 @@
   align-items: center;
   border-radius: 50%;
 }
+
 .template-1v1 .btn-hangup .btn-image,
-.template-1v1 .btn-normal .btn-image{
+.template-1v1 .btn-normal .btn-image {
   width: 4vh;
   height: 4vh;
 }
-.template-1v1 .btn-hangup  {
+
+.template-1v1 .btn-hangup {
   width: 8vh;
   height: 8vh;
   background: #f75c45;
@@ -108,4 +130,4 @@
   justify-content: center;
   align-items: center;
   border-radius: 50%;
-}
+}

+ 0 - 1
components/trtc-room/template/custom/custom.wxml

@@ -52,7 +52,6 @@
         beauty="{{pusher.beautyLevel}}"
         whiteness="{{pusher.whitenessLevel}}"
         orientation="{{pusher.videoOrientation}}"
-        aspect="{{pusher.videoAspect}}"
         device-position="{{pusher.frontCamera}}"
         remote-mirror="{{pusher.enableRemoteMirror}}"
         local-mirror="{{pusher.localMirror}}"

+ 5 - 5
components/trtc-room/template/grid/grid.wxss

@@ -78,16 +78,16 @@
 }
 
 .pusher-container {
-  width: 300rpx;
-  height: 300rpx;
+  width: 240rpx;
+  height: 320rpx;
   position: absolute;
-  bottom: 0;
+  top: 0;
   right: 0;
 }
 
 .player-container {
-  width: 700rpx;
-  height: 500rpx;
+  width: 720rpx;
+  height: 100vh;
   position: absolute;
   top: 0;
   left: 0;

+ 54 - 4
components/trtc-room/trtc-room.js

@@ -37,11 +37,12 @@ Component({
       },
     },
   },
-
   /**
    * 组件的初始数据
    */
   data: {
+    // orientation:'horizontal',
+    fullScreenFlag: 0,//默认为0不全屏  全屏为1 
     pusher: null,
     debugPanel: true, // 是否打开组件调试面板
     debug: false, // 是否打开player pusher 的调试信息
@@ -192,6 +193,7 @@ Component({
           roomID: this.data.config.roomID
         }).then(() => {
           // 进房后开始推送视频或音频
+
           // setTimeout(()=>{
           //   this.publishLocalVideo()
           //   this.publishLocalAudio()
@@ -252,6 +254,40 @@ Component({
    * 组件的方法列表
    */
   methods: {
+    fullScreen() {
+      for (let i = 0; i < this.data.streamList.length; i++) {
+        console.log(this.data.streamList[i])
+        let params = {
+          userID: this.data.streamList[i].userID,
+          streamType: this.data.streamList[i].streamType,
+          direction: 0
+        }
+        let params1 = {
+          userID: this.data.streamList[i].userID,
+          streamType: this.data.streamList[i].streamType,
+          orientation: 'horizontal'
+        }
+        this.enterFullscreen(params);
+        this.setRemoteOrientation(params1)
+      }
+    },
+    exitFullScreen(){
+      for (let i = 0; i < this.data.streamList.length; i++) {
+        console.log(this.data.streamList[i])
+        let params = {
+          userID: this.data.streamList[i].userID,
+          streamType: this.data.streamList[i].streamType,
+          direction: 0
+        }
+        let params1 = {
+          userID: this.data.streamList[i].userID,
+          streamType: this.data.streamList[i].streamType,
+          orientation: 'vertical'
+        }
+        this.exitFullscreen(params);
+        this.setRemoteOrientation(params1)
+      }
+    },
     /**
      * 初始化各项参数和用户控制模块,在组件实例触发 attached 时调用,此时不建议对View进行变更渲染(调用setData方法)
      */
@@ -296,7 +332,7 @@ Component({
         }
         // 初始化IM
         if (config.enableIM && config.sdkAppID) {
-          this._initIM(config)
+          // this._initIM(config)
         }
         if (config.sdkAppID && data.oldVal.sdkAppID !== config.sdkAppID && MTA) {
           MTA.Event.stat('sdkAppID', {
@@ -517,6 +553,7 @@ Component({
      */
     subscribeRemoteAudio(params) {
       console.log(TAG_NAME, 'subscribeRemoteAudio', params)
+      // if (params.userID == "0" || params.userID == "share-userId") {
       return this._setPlayerConfig({
         userID: params.userID,
         streamType: 'main',
@@ -524,6 +561,7 @@ Component({
           muteAudio: false,
         },
       })
+      // }
     },
     /**
      * 取消订阅远端音频
@@ -810,6 +848,9 @@ Component({
           direction: params.direction || 0,
           success: (event) => {
             console.log(TAG_NAME, 'enterFullscreen success', event)
+            this.setData({
+              fullScreenFlag: 1
+            })
             resolve(event)
           },
           fail: (event) => {
@@ -830,6 +871,9 @@ Component({
         this.userController.getStream(params).playerContext.exitFullScreen({
           success: (event) => {
             console.log(TAG_NAME, 'exitFullScreen success', event)
+            this.setData({
+              fullScreenFlag: 0
+            })
             resolve(event)
           },
           fail: (event) => {
@@ -845,6 +889,7 @@ Component({
      * @returns {Promise}
      */
     setRemoteOrientation(params) {
+      console.log(params)
       return this._setPlayerConfig({
         userID: params.userID,
         streamType: params.streamType,
@@ -1331,6 +1376,8 @@ Component({
       })
       // 视频状态 true
       this.userController.on(EVENT.REMOTE_VIDEO_ADD, (event) => {
+        console.log(event, "22222222222222")
+        // if (event.data.stream.userID == "0" || event.data.stream.userID == "share-userId") {
         console.log(TAG_NAME, '远端视频可用', event, event.data.stream.userID)
         const stream = event.data.stream
         // 如果Android onHide 时,新增的player 无法播放 记录标识位
@@ -1353,6 +1400,7 @@ Component({
           })
         })
         console.log(TAG_NAME, 'REMOTE_VIDEO_ADD', 'streamList:', this.data.streamList, 'userList:', this.data.userList)
+        // }
       })
       // 视频状态 false
       this.userController.on(EVENT.REMOTE_VIDEO_REMOVE, (event) => {
@@ -1375,6 +1423,7 @@ Component({
       // 音频可用
       this.userController.on(EVENT.REMOTE_AUDIO_ADD, (event) => {
         console.log(TAG_NAME, '远端音频可用', event)
+        // if (event.data.stream.userID == "0" || event.data.stream.userID == "share-userId") {
         const stream = event.data.stream
         this._setList({
           userList: event.data.userList,
@@ -1390,6 +1439,7 @@ Component({
           })
         })
         console.log(TAG_NAME, 'REMOTE_AUDIO_ADD', 'streamList:', this.data.streamList, 'userList:', this.data.userList)
+        // }
       })
       // 音频不可用
       this.userController.on(EVENT.REMOTE_AUDIO_REMOVE, (event) => {
@@ -1577,7 +1627,7 @@ Component({
       this._emitter.emit(EVENT.REMOTE_STATE_UPDATE, event)
     },
     _playerFullscreenChange(event) {
-      // console.log(TAG_NAME, '_playerFullscreenChange', event)
+      console.log(event, "ooooooooooooooooooooooooooooo")
       this._emitter.emit(EVENT.REMOTE_FULLSCREEN_UPDATE, event)
       this._emitter.emit(EVENT.VIDEO_FULLSCREEN_UPDATE, event)
     },
@@ -1718,7 +1768,7 @@ Component({
       if (config.debugMode) {
         tim.setLogLevel(1)
       } else {
-        tim.setLogLevel(4)
+        tim.setLogLevel(1)
       }
       // 取消监听
       tim.off(TIM.EVENT.SDK_READY, this._onIMReady)

+ 76 - 41
components/trtc-room/trtc-room.wxss

@@ -1,23 +1,31 @@
-
 @import "./template/1v1/1v1.wxss";
 @import "./template/grid/grid.wxss";
 @import "./template/custom/custom.wxss";
 
 .pusher {
-  width: 240rpx;
-  height: 320rpx;
+  width: 300rpx;
+  height: 300rpx;
+  /* border: 1px solid red; */
 }
 .player {
-  width: 100%;
-  height: 100%;
+  width: 750rpx;
+  height: 500rpx;
+  /* border: 1px solid red; */
+}
+.player1{
+  width: 300rpx;
+  height: 300rpx;
+  position: absolute;
+  top: 0;
+  right: 0;
 }
-.debug-info{
-  max-width: 100vw;
+.debug-info {
+  max-width: 750rpx;
   max-height: 90vh;
   box-sizing: border-box;
   overflow-y: scroll;
   position: absolute;
-  z-index: 9999;
+  z-index: 9;
   background-color: rgba(0, 0, 0, .5);
   color: #fff;
   bottom: 20rpx;
@@ -25,8 +33,9 @@
   padding: 10rpx;
   font-size: 12px;
 }
+
 .debug-info-btn .debug-btn,
-.debug-info .debug-btn{
+.debug-info .debug-btn {
   padding: 0 8px;
   min-height: 18px;
   width: auto;
@@ -36,28 +45,34 @@
   color: #06ae56;
   background-color: #f2f2f2;
 }
-.debug-info .debug-btn.false{
+
+.debug-info .debug-btn.false {
   color: rgb(114, 114, 114);
 }
+
 .debug-info-btn .debug-btn,
 .debug-info .button-hover {
   background-color: rgb(219, 219, 219);
 }
-.debug-info .close-btn{
+
+.debug-info .close-btn {
   position: absolute;
   top: 0;
   right: 0;
   padding: 5px 10px;
 }
-.debug-info .text.true{
+
+.debug-info .text.true {
   color: #1fff8b;
 }
-.debug-info .text.false{
+
+.debug-info .text.false {
   color: #ff2e2e;
 }
-.debug-info-btn{
+
+.debug-info-btn {
   position: absolute;
-  z-index: 9998;
+  z-index: 999;
   bottom: 160rpx;
   left: 0;
 }
@@ -75,15 +90,17 @@
   background-color: #f2f2f2;
   margin: 0 16rpx;
 }
-.trtc-room-container .btn.active{
+
+.trtc-room-container .btn.active {
   color: #f2f2f2;
   background-color: #006eff;
 }
-.trtc-room-container .btn-hover{
+
+.trtc-room-container .btn-hover {
   background-color: #d1d1d1;
 }
 
-.im-panel{
+.im-panel {
   position: absolute;
   z-index: 9;
   display: flex;
@@ -102,6 +119,7 @@
   color: #fff;
   background-color: rgba(0, 0, 0, 0.8);
 }
+
 .im-panel .close-btn {
   position: absolute;
   top: 0;
@@ -109,25 +127,29 @@
   padding: 5px 10px;
   z-index: 99;
 }
-.message-panel-body{
+
+.message-panel-body {
   width: 100%;
   height: 80%;
   overflow-x: hidden;
   overflow-y: scroll;
 }
-.message-scroll-container{
+
+.message-scroll-container {
   height: 100%;
   /* box-sizing: border-box;
   padding: 0 20rpx; */
 }
-.message-list{
+
+.message-list {
   width: 100%;
   box-sizing: border-box;
   padding: 0 20rpx;
   /* display: flex;
   flex-direction: column; */
 }
-.message-item{
+
+.message-item {
   width: 100%;
   /* height: 36rpx; */
   /* padding: 0 20rpx; */
@@ -135,35 +157,41 @@
   display: flex;
   flex-direction: row;
 }
-.message-item .user-name{
+
+.message-item .user-name {
   width: 20%;
   color: #2483ff;
   overflow: hidden;
   text-overflow: ellipsis;
   white-space: nowrap;
 }
-.user-name.mine{
+
+.user-name.mine {
   color: #ff7424;
 }
-.message-item .separate{
-  padding:0 5px;
+
+.message-item .separate {
+  padding: 0 5px;
   color: #fff;
 }
-.message-item .message-content{
-  word-wrap:break-word; 
-  word-break:break-all;
+
+.message-item .message-content {
+  word-wrap: break-word;
+  word-break: break-all;
   padding-left: 20rpx;
   position: relative;
-  max-width: 80%; 
+  max-width: 80%;
   box-sizing: border-box;
 }
-.message-content::after{
+
+.message-content::after {
   content: ':';
   position: absolute;
   left: 0;
   top: 0;
 }
-.message-panel-bottom{
+
+.message-panel-bottom {
   width: 100%;
   height: 50rpx;
   box-sizing: border-box;
@@ -172,24 +200,27 @@
   display: flex;
   flex-direction: row;
 }
+
 .message-input-container {
   flex-grow: 1;
 }
+
 .message-input-container .message-input {
   font-size: 12px;
   padding-left: 20rpx;
   border-radius: 10rpx;
   height: 100%;
-  background-color: rgba(0,0,0,0.1);
+  background-color: rgba(0, 0, 0, 0.1);
 }
-.message-send-btn .btn{
+
+.message-send-btn .btn {
   margin-right: 0;
   height: 50rpx;
   min-height: 50rpx;
   line-height: 50rpx;
 }
 
-.volume-animation{
+.volume-animation {
   position: absolute;
   width: 80rpx;
   height: 80rpx;
@@ -199,20 +230,24 @@
   z-index: 9;
   /* transform: translate(-50%, 0); */
 }
-.volume-animation .image{
+
+.volume-animation .image {
   position: absolute;
   width: 80rpx;
   height: 80rpx;
 }
-.volume-animation .audio-active{
+
+.volume-animation .audio-active {
   animation: viewlinear 1.5s linear infinite;
-} 
+}
+
 @keyframes viewlinear {
-  
+
   /** 第一种写法**/
   0% {
     height: 0;
   }
+
   100% {
     height: 100%;
   }
@@ -221,6 +256,6 @@
 .none,
 .view-container.none,
 .template-grid .view-container.none,
-.template-1v1 .view-container.none{
+.template-1v1 .view-container.none {
   display: none !important;
-}
+}

BIN
images/gift2.jpg


BIN
images/gift4.jpg


BIN
images/redcloud.png


+ 2 - 2
pages/Identity/Identity.js

@@ -30,6 +30,7 @@ Page({
         sessionKey: sessionKey
       },
       success: function (res) {
+        wx.hideLoading()
         if (res.data.code == 0) {
           wx.showModal({
             showCancel: false,
@@ -59,7 +60,7 @@ Page({
     })
     // let _this = this;
     if (this.data.isRz == 0) {
-      wx.hideLoading()
+      // wx.hideLoading()
       const params = e.detail.value
       if (!this.WxValidate.checkForm(params)) {
         const error = this.WxValidate.errorList[0]
@@ -102,7 +103,6 @@ Page({
         } else {
           console.log("报错额")
         }
-        console.log(res)
       }
     })
   },

+ 12 - 10
pages/index/index.js

@@ -25,8 +25,8 @@ Page({
       url: "/images/icon4.png",
       name: "测试答卷",
       isread: true
-    }]
-    // xczsArr: []
+    }],
+    xczsArr: []
   },
   gomyClass(e) {
     console.log(e.currentTarget.dataset.item.isActive, "我是测试跳转的")
@@ -137,7 +137,7 @@ Page({
         sessionKey: sessionKey
       },
       success: (res) => {
-        console.log(this.data.bnrUrl,res.data.data.claList)
+        console.log(this.data.bnrUrl, res.data.data.claList)
         if (this.data.bnrUrl.sort().toString() == res.data.data.claList.sort().toString()) {
           console.log("我和上次一样")
         } else {
@@ -208,13 +208,15 @@ Page({
       url: app.globalData.publicUrl + '/wx/course/listCategory',
       method: "post",
       success: (res) => {
-        if (this.data.xczsArr.sort().toString() == res.data.list.sort().toString()) {
-          console.log("我和上次一样")
-        } else {
-          console.log("我和上次不一样")
-          this.setData({
-            xczsArr: res.data.list
-          })
+        if (this.data.xczsArr.length != 0) {
+          if (this.data.xczsArr.sort().toString() == res.data.list.sort().toString()) {
+            console.log("我和上次一样")
+          } else {
+            console.log("我和上次不一样")
+            this.setData({
+              xczsArr: res.data.list
+            })
+          }
         }
       },
       fail(res) {

+ 84 - 54
pages/myClass/myClass.js

@@ -21,6 +21,33 @@ Page({
     istask3: false, //期末考试是否完成
     istask4: false, //综合反馈是否完成
   },
+  isRz(sessionKey){
+    wx.request({
+      url: app.globalData.publicUrl + '/wx/student/selStudentSessionKey',
+      method: "post",
+      data: {
+        sessionKey: sessionKey
+      },
+      success: (res) => {
+        if (res.data.code == 0 && res.data.data) {
+          if (res.data.data.studentOpenId == "" ||res.data.data.studentOpenId == null) {
+            wx.showModal({
+              content: "您还没有进行身份认证哦",
+              showCancel: false,
+              success(res) {
+                if (res.confirm) {
+                  wx.switchTab({
+                    url: '../index/index'
+                  })
+                }
+              }
+            })
+            return false;
+          }
+        }
+      }
+    })
+  },
   // 查询我是否有班&&班级名字
   isClass(sessionKey) {
     wx.request({
@@ -65,6 +92,7 @@ Page({
         sessionKey: sessionKey
       },
       success: (res) => {
+        console.log(res,"00000000000000000000000000")
         if (res.data.code == 0 && res.data.data) {
           if (res.data.data.agreement == 0) {
             this.setData({
@@ -311,56 +339,56 @@ Page({
       }
     })
   },
-  getMycourse1(sessionKey) {
-    wx.request({
-      url: app.globalData.publicUrl + '/wx/course/selectBySessionKey',
-      method: "post",
-      data: {
-        sessionKey: sessionKey
-      },
-      success: (res) => {
-        if (this.data.kcArr.sort().toString() == res.data.list.sort().toString()) {
-          console.log("我和上次一样")
-        } else {
-          console.log("我和上次不一样")
-          this.setData({
-            kcArr: res.data.list,
-            istask2: res.data.allDone
-          });
-          console.log(this.data.kcArr, "9999999999999999")
-          for (let i = 0; i < res.data.list.length; i++) {
-            if (res.data.list[i].isStudyDone == 0) {
-              this.setData({
-                IngCourseArr: res.data.list[i]
-              })
-            }
-          }
-          let result = [];
-          if (res.data.list)
-            for (let 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
-            })
-          }
-        }
+  // getMycourse1(sessionKey) {
+  //   wx.request({
+  //     url: app.globalData.publicUrl + '/wx/course/selectBySessionKey',
+  //     method: "post",
+  //     data: {
+  //       sessionKey: sessionKey
+  //     },
+  //     success: (res) => {
+  //       if (this.data.kcArr.sort().toString() == res.data.list.sort().toString()) {
+  //         console.log("我和上次一样")
+  //       } else {
+  //         console.log("我和上次不一样")
+  //         this.setData({
+  //           kcArr: res.data.list,
+  //           istask2: res.data.allDone
+  //         });
+  //         console.log(this.data.kcArr, "9999999999999999")
+  //         for (let i = 0; i < res.data.list.length; i++) {
+  //           if (res.data.list[i].isStudyDone == 0) {
+  //             this.setData({
+  //               IngCourseArr: res.data.list[i]
+  //             })
+  //           }
+  //         }
+  //         let result = [];
+  //         if (res.data.list)
+  //           for (let 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
@@ -389,6 +417,7 @@ Page({
   },
   // 去学习
   goStudy(e) {
+    // console.log(this.data.istask)
     if (!this.data.istask) {
       wx.showModal({
         showCancel: false,
@@ -789,7 +818,7 @@ Page({
     //   let a = str.slice(n * i, n * (i + 1));
     //   strArr.push(a);
     // }
-    let a = str.slice(0, 18);
+    let a = str.slice(0, 16);
     let b = str.slice(16, 36);
     let c = str.slice(36, 56);
     strArr.push(a, b, c);
@@ -881,16 +910,17 @@ Page({
     this.setData({
       sessionKey: sessionKey
     })
-    this.getMycourse1(sessionKey);
+    this.isRz(sessionKey)
+    this.isClass(sessionKey);
+    this.getMycourse(sessionKey);
     this.getMynotice(sessionKey);
-    this.checkTaskList1(sessionKey)
+    this.checkTaskList1(sessionKey);
+
   },
   async onLoad() {
     const sessionKey = await tools.checkSessionAndLogin();
     this.setData({
       sessionKey: sessionKey
     })
-    this.getMycourse(sessionKey);
-    this.isClass(sessionKey);
   }
 })

+ 28 - 2
pages/myMission/myMission.js

@@ -220,6 +220,33 @@ Page({
       }
     })
   },
+  isRz(sessionKey){
+    wx.request({
+      url: app.globalData.publicUrl + '/wx/student/selStudentSessionKey',
+      method: "post",
+      data: {
+        sessionKey: sessionKey
+      },
+      success: (res) => {
+        if (res.data.code == 0 && res.data.data) {
+          if (res.data.data.studentOpenId == "" ||res.data.data.studentOpenId == null) {
+            wx.showModal({
+              content: "您还没有进行身份认证哦",
+              showCancel: false,
+              success(res) {
+                if (res.confirm) {
+                  wx.switchTab({
+                    url: '../index/index'
+                  })
+                }
+              }
+            })
+            return false;
+          }
+        }
+      }
+    })
+  },
   // 查询我是否有班&&班级名字
   isClass(sessionKey) {
     wx.request({
@@ -757,12 +784,11 @@ Page({
     this.setData({
       sessionKey
     })
+    this.isRz(sessionKey);
     this.isClass(sessionKey);
     this.getMycourse(sessionKey);
     this.checkTaskList(sessionKey)
     this.checkTaskList2(sessionKey)
-
-
     this.checkTaskList6(sessionKey)
   }
 })

+ 7 - 4
pages/studentRegistration/studentRegistration.wxml

@@ -62,12 +62,15 @@
 					<image src="/images/quan.png" style="width:20rpx;height:20rpx"> </image>
 				</view>
 				<view class="xingbie">文化程度</view>
-				<view class='weui-input'>
+				<!-- <view class='weui-input'>
 					<input class="" name="culture" value="{{culture }}" placeholder="请输入文化程度" placeholder-style="font-size:25rpx"/>
-					<!-- <view class="{{ cultureIsTrue?'error':'noerror'}}">请输入文化程度</view> -->
-				</view>
+				</view> -->
+				<!-- <picker bindchange="kaihuListChange" value="{{kaihuList[kaihuindex]._id}}" range-key="{{'name'}}" range="{{kaihuList}}" disabled="{{flag}}">
+            <view class="picker">
+              {{kaihuList[kaihuindex].name}} <text >{{kaihutext}}</text>
+            </view>
+       </picker> -->
 			</view>
-
 			<view class='fwb'>
 				<view class="red-image">
 					<image src="/images/quan.png" style="width:20rpx;height:20rpx"> </image>

+ 16 - 7
pages/zbDetails/zbDetails.js

@@ -17,7 +17,7 @@ Page({
     inputValue: '',
     bottom: "", //滑到底状态 防止弹出消息不跳到最后一条
     onSdkReady: function (event) {
-      let _this=this;
+      let _this = this;
       console.log(event, "im准备好了")
       let promise = _this.data.tim.getGroupList();
       console.log(promise, "我获取到promise的值了")
@@ -103,7 +103,7 @@ Page({
       });
     },
     onSdkRecived: function (event) {
-      let _this=this;
+      let _this = this;
       console.log(event.data, _this.data.currentGroup.groupID, "我收到消息了")
       if (event.data[0].conversationType == "GROUP" && event.data[0].to == _this.data.currentGroup.groupID) {
         console.log("我找到这个会话了", _this.data.chatContent)
@@ -160,13 +160,19 @@ Page({
     let promise = this.data.tim.sendMessage(message);
     promise.then(function (imResponse) {
       console.log(imResponse);
+      wx.showToast({
+        title: '举手成功',
+        icon: 'success',
+        duration: 2000,
+        mask: true
+      })
     }).catch(function (imError) {
       console.warn('sendMessage error:', imError);
     });
   },
   // 发消息
   sendMessage() {
-    if(this.data.inputValue==null||this.data.inputValue==""){
+    if (this.data.inputValue == null || this.data.inputValue == "") {
       wx.showModal({
         content: "不可以发送空消息哦!",
         showCancel: false
@@ -232,7 +238,7 @@ Page({
     this.data.tim.on(TIM.EVENT.SDK_READY, this.data.onSdkReady, this);
     this.data.tim.on(TIM.EVENT.MESSAGE_RECEIVED, this.data.onSdkRecived, this);
     const sig = await getusersig.genTestUserSig(this.data.rtcConfig.userID, this.data.rtcConfig.sdkAppID, "f1ca85809aed35d82d8bb76612787e38dada5d0a6f233662777b42bdb7eb880b")
-    console.log(sig,"ppppppppppppppppppppp")
+    console.log(sig, "ppppppppppppppppppppp")
     let promise = this.data.tim.login({
       userID: this.data.rtcConfig.userID,
       userSig: sig.userSig
@@ -249,7 +255,7 @@ Page({
   offTim() {
     this.data.tim.off(TIM.EVENT.SDK_READY, this.data.onSdkReady);
     this.data.tim.off(TIM.EVENT.MESSAGE_RECEIVED, this.data.onSdkRecived);
-    console.log(this.data.roomIdandcourseId,"我是退出的群组")
+    console.log(this.data.roomIdandcourseId, "我是退出的群组")
     this.data.tim.quitGroup(this.data.roomIdandcourseId);
     let promise = this.data.tim.logout();
     promise.then(function (imResponse) {
@@ -283,6 +289,7 @@ Page({
       console.log('远端用户退出')
     })
     this.trtcRoomContext.on(TRTC_EVENT.REMOTE_AUDIO_ADD, (event) => {
+      console.log(event, "lalalallalalalalal")
       this.trtcRoomContext.subscribeRemoteAudio({
         userID: event.data.userID
       }).then(() => {
@@ -314,11 +321,13 @@ Page({
       })
     })
   },
-  async onLoad(options) {
-    console.log("我onLoad了")
+  onLoad(options) {
     this.setData({
       roomIdandcourseId: options.id
     })
+  },
+  async onShow() {
+    // console.log("我onShow了")
     const sessionKey = await tools.checkSessionAndLogin();
     const information = await tools.request('/wx/student/selStudentSessionKeyEcho', {
       sessionKey

+ 2 - 2
pages/zbDetails/zbDetails.wxml

@@ -1,6 +1,6 @@
 <view class="home">
 	<view class="big_box">
-		<trtc-room id="trtcroom" config="{{rtcConfig}}" scene="live" videoWidth='360' videoHeight='200'></trtc-room>
+		<trtc-room id="trtcroom" config="{{rtcConfig}}" scene="live"></trtc-room>
 		<view class="area">
 			<view class="chatbox">
 				<scroll-view scroll-y="true" style="height: 280rpx;width:690rpx;" bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" scroll-into-view="{{bottom}}" scroll-top="{{scrollTop}}">
@@ -14,7 +14,7 @@
 				</scroll-view>
 			</view>
 			<view class="puthands_box">
-				<input class="weui-input" bindinput="bindKeyInput" placeholder="请输入您的问题" style="height:60rpx" placeholder-style="color:#ffffff" value="{{inputValue}}" />
+				<input class="weui-input" bindinput="bindKeyInput" placeholder="请输入您的问题" style="height:60rpx" placeholder-style="color:#000" value="{{inputValue}}" />
 				<view class="send" bindtap="sendMessage">发送</view>
 				<view class="send" bindtap="handsup">举手</view>
 			</view>

+ 8 - 62
pages/zbDetails/zbDetails.wxss

@@ -1,95 +1,42 @@
-/* .home {
-  width: 100%;
-} */
 page {
   background-color: #f2f2f2;
 }
-
 .big_box {
   width: 750rpx;
   height: 100vh;
-  /* border: 1px solid red; */
-}
-
-/* 
-.allbig_box {
-  width: 100%;
-  height: 100vh;
-  border: 1px solid yellow;
-} */
-/* .full_btn {
-  position: absolute;
-  right: -100rpx;
-  top: 50%;
-  transform:rotate(90deg);
 }
 
-.text_box {
-  width: 90%;
-  margin-left: 5%;
-  border-bottom: 1px solid #fff;
-} */
-
-/* .title {
-  font-size: 32rpx;
-  margin-top: 50rpx;
-}
-
-.bfnum {
-  color: #999999;
-  font-size: 25rpx;
-  margin-top: 10rpx;
-  height: 50rpx;
-}
-
-/* .zj {
-  font-size: 32rpx;
-  margin-top: 20rpx;
-}
-
-.zw {
-  font-size: 25rpx;
-  margin-top: 40rpx;
-  line-height: 40rpx;
-} */
 .area {
   width: 700rpx;
-  height: 400rpx;
-  background-color: rgba(0,0,0,0.6);
+  height: 600rpx;
+  background-color: rgba(0,0,0,0.1);
   position: absolute;
-  bottom: 30rpx;
+  top: 550rpx;
   left: 25rpx;
   border-radius: 20rpx;
+  z-index: 99;
 }
 .chatbox {
-  /* margin-top: 20rpx; */
   width: 700rpx;
-  height: 300rpx;
-  /* background-color: #fff; */
-  /* border: 1px solid red; */
-  /* margin-left: 35rpx; */
+  height: 500rpx;
   border-radius: 20rpx;
   overflow-y: auto;
   font-size: 25rpx;
-  /* margin-bottom: 20rpx; */
-  /* border: 1px solid red; */
   position: absolute;
   top:0rpx;
-  /* border-bottom: 1px solid #dbdbdb; */
+  /* border: 1px solid red; */
 }
 .puthands_box {
   width: 700rpx;
   height: 80rpx;
-  /* border: 1px solid red; */
   position: absolute;
   bottom: 0rpx;
 }
 
 .chat_text {
-  /* margin-bottom: 10rpx; */
   font-size: 30rpx;
   font-weight: 900;
-  color: #fff;
+  color: #000;
 }
 
 .handimg {
@@ -99,7 +46,6 @@ page {
 }
 
 .weui-input {
-  /* border: 1px solid red; */
   width: 440rpx;
   height: 40rpx;
   margin-top: 10rpx;
@@ -109,7 +55,7 @@ page {
   font-size: 25rpx;
   margin-left: 20rpx;
   float: left;
-  color: #fff;
+  color: #000;
   
 }
 

+ 1 - 1
project.config.json

@@ -24,7 +24,7 @@
 			"disablePlugins": [],
 			"outputPath": ""
 		},
-		"useCompilerModule": true,
+		"useCompilerModule": false,
 		"userConfirmedUseCompilerModuleSwitch": false
 	},
 	"compileType": "miniprogram",

+ 2 - 2
utils/util.js

@@ -1,7 +1,7 @@
 const globalData = {
-  publicUrl: 'https://sqdx.jiaxintech.com',
+  publicUrl: 'https://sqpx.jiaxintech.com',
   // publicUrl:'http://10.16.10.139'
-  // publicSocketUrl: 'wss://sqdx.jiaxintech.com',
+  // publicUrl:'http://10.16.4.19'
 };
 module.exports = {
   globalData: globalData,