ssfg 5 years ago
parent
commit
16b2b2436c

+ 1 - 0
app.json

@@ -2,6 +2,7 @@
   "pages": [
     "pages/index/index",
     "pages/zbDetails/zbDetails",
+    
     "pages/personInfo/personInfo",
     "pages/myMission/myMission",
     "pages/dbDetails/dbDetails",

BIN
images/banjihz.png


BIN
images/bjewm.png


BIN
images/db.png


BIN
images/dtxs.png


BIN
images/dzb.png


BIN
images/goclass.png


BIN
images/pjkc.png


BIN
images/puthands.png


BIN
images/startstudy.png


BIN
images/step_unfinish.png


BIN
images/zb.png


BIN
images/zbjs.png


+ 8 - 8
pages/exhibitionList/exhibitionList.wxml

@@ -1,6 +1,6 @@
 <view>
 	<van-tabs active="{{ active }}" bind:change="onChange">
-		<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>
@@ -8,14 +8,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>
@@ -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>

+ 9 - 0
pages/index/index.js

@@ -4,6 +4,7 @@ Page({
   data: {
     wqdataArr: 0,
     jjdataArr: 0,
+    kjShow: true,
     // 课程轮播
     "bnrUrl": [],
     gridArr: [{
@@ -175,6 +176,14 @@ Page({
     })
   },
   onReady: function () {},
+  onLoad() {
+    let _this = this;
+    setTimeout(function () {
+      _this.setData({
+        kjShow: false
+      })
+    }, 4000)
+  },
   onShow: function () {
     var _this = this;
     wx.checkSession({

+ 3 - 2
pages/index/index.wxml

@@ -1,13 +1,14 @@
 <view class="container">
+	<image src='https://bkthnsz2.oss-cn-shenzhen.aliyuncs.com/20200629134722.gif' mode='aspectFill' style="width:750rpx;height:1334rpx" wx:if="{{kjShow}}"></image>
 	<view class="banner">
 		<swiper class='u-wrp-bnr' indicator-dots="true" interval='5000' duration='1000'>
 			<block wx:for="{{bnrUrl}}" wx:for-index="index" wx:key="idx">
-				<swiper-item  bindtap="gomyClass" data-item="{{item}}">
+				<swiper-item bindtap="gomyClass" data-item="{{item}}">
 					<image src='{{item.clasImg}}' class='u-img-slide' mode='aspectFill'></image>
 					<view class="text text1">{{item.clasName}}</view>
 					<view class="text text2">主办方:{{item.remark}}</view>
 					<view class="text text3">开班时间:{{item.clasBegin}}</view>
-					<image src='/images/goclass.png' mode='aspectFill' class="text gozbbtn" wx:if='{{item.isActive==5}}'></image>
+					<image src='/images/goclass.png' mode='aspectFill' class="gozbbtn" wx:if='{{item.isActive==5}}'></image>
 				</swiper-item>
 			</block>
 		</swiper>

+ 5 - 3
pages/index/index.wxss

@@ -42,9 +42,11 @@
 }
 
 .gozbbtn {
-  width: 157rpx;
-  height: 37rpx;
-  top: 185rpx;
+  position: absolute;
+  width: 258rpx;
+  height: 61rpx;
+  top: 165rpx;
+  right: 20rpx;
 }
 
 .sec {

+ 29 - 9
pages/myClass/myClass.js

@@ -97,9 +97,14 @@ Page({
     })
   },
   goMyPoints() {
-    wx.navigateTo({
-      url: '../myPoints/myPoints'
+    wx.showModal({
+      showCancel: false,
+      content: "敬请期待",
+      success(res) {}
     })
+    // wx.navigateTo({
+    //   url: '../myPoints/myPoints'
+    // })
   },
   goactiveDetails() {
     wx.navigateTo({
@@ -107,19 +112,34 @@ Page({
     })
   },
   lq() {
-    wx.showToast({
-      title: '领取成功'
+    wx.showModal({
+      showCancel: false,
+      content: "敬请期待",
+      success(res) {}
     })
+    // wx.showToast({
+    //   title: '领取成功'
+    // })
   },
   goWrite() {
-    wx.navigateTo({
-      url: '../studentRegistration/studentRegistration'
+    wx.showModal({
+      showCancel: false,
+      content: "敬请期待",
+      success(res) {}
     })
+    // wx.navigateTo({
+    //   url: '../studentRegistration/studentRegistration'
+    // })
   },
   goWrite2() {
-    wx.navigateTo({
-      url: '../feedBack/feedBack'
+    wx.showModal({
+      showCancel: false,
+      content: "敬请期待",
+      success(res) {}
     })
+    // wx.navigateTo({
+    //   url: '../feedBack/feedBack'
+    // })
   },
   // 跳转直播点播页面
   goStudy(e) {
@@ -248,7 +268,7 @@ Page({
         sessionKey: sessionKey
       },
       success: function (res) {
-        console.log(res)
+        console.log(res, "kckckc")
         _this.setData({
           kcArr: res.data.list
         });

+ 10 - 5
pages/myClass/myClass.wxml

@@ -10,11 +10,11 @@
 		<!-- <image src='/images/cloud.png' mode='aspectFill' class="cloudimg"></image> -->
 	</van-popup>
 	<view class="layout">
-		<van-notice-bar left-icon="/images/tzicon.png" text="{{notice}}" speed="30" />
+		<van-notice-bar left-icon="/images/tzicon.png" text="{{notice}}" wrapable scrollable="false" />
 	</view>
 	<van-divider contentPosition="center" customStyle="color: #eb3f33; border-color: #eb3f33; font-size: 30rpx;font-weight:900;position:relative">
 		<!-- <view style="height:30rpx;width:8rpx;background-color:#eb3f33;position:absolute;left:0"></view> -->
-		<text>{{className}}</text>
+		<image src='/images/banjihz.png' mode='aspectFill' class="banjihz"></image><text>{{className}}</text>
 		<!-- <view style="height:30rpx;width:8rpx;background-color:#eb3f33"></view> -->
 	</van-divider>
 	<view class="layout" bindtap="goWrite">
@@ -29,9 +29,14 @@
 			<view class="sp_text">
 				<view>
 					<view class="fisrt_set">
-						<image src='{{item.isLive==1?"/images/zb.png":"/images/db.png"}}' mode='aspectFill' class="dbimg"></image><text class="name">{{item.courseName}}</text>
+						<image src='/images/db.png' mode='aspectFill' class="dbimg" wx:if='{{item.isLive==-1}}'></image>
+						<image src='/images/zb.png' mode='aspectFill' class="dbimg" wx:if='{{item.isLive == 1 && item.isActive==1}}'></image>
+						<image src='/images/dzb.png' mode='aspectFill' class="dbimg" wx:if='{{item.isLive==1 && item.isActive==null}}'></image>
+						<image src='/images/zbjs.png' mode='aspectFill' class="dbimg" wx:if='{{item.isLive==1 && item.isActive==-1}}'></image>
+						<text class="name">{{item.courseName}}</text>
 					</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>
 						<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>
@@ -58,7 +63,7 @@
 		<view class="layout_text3">去填写</view>
 	</view>
 	<view class="qy_title" bindtap="goMyPoints">
-		<view class="redk"></view>我的积分:7655积分
+		<view class="redk"></view>我的积分:0积分
 		<view class="more">></view>
 	</view>
 	<view class="lq">

+ 6 - 3
pages/myClass/myClass.wxss

@@ -17,7 +17,11 @@
   margin-bottom: 80rpx;
 
 }
-
+.banjihz{
+  width: 57rpx;
+  height: 57rpx;
+  margin-right: 30rpx;
+}
 .zw {
   padding-left: 50rpx;
   padding-right: 50rpx;
@@ -131,7 +135,7 @@
 }
 
 .dbimg {
-  width: 84rpx;
+  width: 144rpx;
   height: 35rpx;
   /* margin-top: 10rpx; */
   margin-right: 20rpx;
@@ -154,7 +158,6 @@
 .name {
   font-size: 25rpx;
 }
-
 .start_text {
   font-size: 25rpx;
   color: #999999;

+ 79 - 39
pages/myMission/myMission.js

@@ -7,7 +7,8 @@ Page({
   data: {
     showewm: false,
     showzs: false,
-    kcArr: []
+    kcArr: [],
+    ewmurl:''
   },
   selectBtn0() {
     this.setData({
@@ -35,22 +36,34 @@ Page({
     })
   },
   goWrite() {
-    wx.navigateTo({
-      url: '../studentRegistration/studentRegistration'
+    wx.showModal({
+      showCancel: false,
+      content: "敬请期待",
+      success(res) {}
     })
+    // wx.navigateTo({
+    //   url: '../studentRegistration/studentRegistration'
+    // })
   },
   goWrite2() {
-    wx.navigateTo({
-      url: '../feedBack/feedBack'
+    wx.showModal({
+      showCancel: false,
+      content: "敬请期待",
+      success(res) {}
     })
+    // wx.navigateTo({
+    //   url: '../feedBack/feedBack'
+    // })
   },
   lq() {
-    this.setData({
-      showzs: true
-    });
-    // wx.showToast({
-    //   title: '领取成功'
-    // })
+    wx.showModal({
+      showCancel: false,
+      content: "敬请期待",
+      success(res) {}
+    })
+    // this.setData({
+    //   showzs: true
+    // });
   },
   /**
    * 生命周期函数--监听页面加载
@@ -156,6 +169,43 @@ Page({
   //     }
   //   })
   // },
+  // 记录二维码已经点击
+  ewmClick(sessionKey){
+    let _this=this;
+    wx.request({
+      url: app.globalData.publicUrl2 + '/wx/student/wxGroup',
+      method: "post",
+      data: {
+        sessionKey: sessionKey
+      },
+      success: function (res) {
+        console.log(res)
+        _this.setData({
+          showewm: true
+        })
+      }
+    })
+  },
+  ewmGet(sessionKey){
+    let _this = this;
+    wx.request({
+      url: app.globalData.publicUrl2 + '/wx/student/selAllClas',
+      method: "post",
+      data: {
+        sessionKey: sessionKey
+      },
+      success: function (res) {
+        console.log(res.data.data, "22222222")
+        var filterArr = res.data.data.claList.filter(o => o.isActive == 5)
+        console.log(filterArr,"111111111111")
+        if (filterArr.length !== 0) {
+          _this.setData({
+            ewmurl: filterArr[0].codeImg
+          })
+        }
+      }
+    })
+  },
   showEwm() {
     var sessionKey = "";
     var _this = this;
@@ -163,20 +213,9 @@ Page({
       success: () => {
         console.log("我有缓存")
         sessionKey = wx.getStorageSync('sessionKey');
-        console.log(sessionKey)
-        wx.request({
-          url: app.globalData.publicUrl2 + '/wx/student/wxGroup',
-          method: "post",
-          data: {
-            sessionKey: sessionKey
-          },
-          success: function (res) {
-            console.log(res)
-            _this.setData({
-              showewm: true
-            })
-          }
-        })
+        // console.log(sessionKey)
+        _this.ewmClick(sessionKey)
+        _this.ewmGet(sessionKey)
       },
       fail() {
         console.log("我没有缓存并去登录请求")
@@ -193,19 +232,21 @@ Page({
               success: function (res) {
                 sessionKey = res.data.sessionKey;
                 wx.setStorageSync('sessionKey', res.data.sessionKey);
-                wx.request({
-                  url: app.globalData.publicUrl2 + '/wx/student/wxGroup',
-                  method: "post",
-                  data: {
-                    sessionKey: sessionKey
-                  },
-                  success: function (res) {
-                    console.log(res)
-                    _this.setData({
-                      showewm: true
-                    })
-                  }
-                })
+                _this.ewmClick(sessionKey)
+                _this.ewmGet(sessionKey)
+                // wx.request({
+                //   url: app.globalData.publicUrl2 + '/wx/student/wxGroup',
+                //   method: "post",
+                //   data: {
+                //     sessionKey: sessionKey
+                //   },
+                //   success: function (res) {
+                //     console.log(res)
+                //     _this.setData({
+                //       showewm: true
+                //     })
+                //   }
+                // })
               }
             })
           }
@@ -225,7 +266,6 @@ Page({
         console.log("我有缓存")
         var sessionKey = wx.getStorageSync('sessionKey');
         console.log(sessionKey, "我有缓存")
-
         if (sessionKey == "") {
           wx.login({
             success(res) {

+ 12 - 7
pages/myMission/myMission.wxml

@@ -11,12 +11,12 @@
 			<image src='/images/ewmbj.png' mode='aspectFill' class="ewmbj"></image>
 			<view class="bjq_text">城市社区培训班班级群</view>
 			<view class="sm_text">扫码进群与老师沟通</view>
-			<image src='/images/bjewm.png' mode='aspectFill' class="bjewm"></image>
+			<image src='{{ewmurl}}' mode='aspectFill' class="bjewm"></image>
 			<view class="save_btn" bindtap="saveImg">保存二维码</view>
 		</view>
 	</van-popup>
 	<view class="step" bindtap="goWrite">
-		<image src='/images/step_finish.png' mode='aspectFill' class="finish_img"></image>
+		<image src='/images/step_unfinish.png' mode='aspectFill' class="finish_img"></image>
 		<view class="layout">
 			<image src='/images/xydj_bj.png' mode='aspectFill' class="bgimg1"></image>
 			<view class="layout_text1">学员登记表</view>
@@ -27,15 +27,20 @@
 		<image src='/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.spfm}}' mode='aspectFill' class="spfm"></image> -->
-						<!-- <image src='{{item.courseImg}}' mode='aspectFill' class="spfm"></image> -->
-			<!-- <image src='{{item.isfinish}}' mode='aspectFill' class="isfinish"></image> -->
+			<image src='{{item.isDone==0?"/images/unfinish.png":"/images/finish.png"}}' mode='aspectFill' class="isfinish"></image>
 			<view class="sp_text">
 				<view>
 					<view class="fisrt_set">
-						<image src='{{item.isLive==1?"/images/zb.png":"/images/db.png"}}' mode='aspectFill' class="dbimg"></image><text class="name">{{item.courseName}}</text>
+						<!-- <image src='{{item.isLive==1?"/images/zb.png":"/images/db.png"}}' mode='aspectFill' class="dbimg"></image> -->
+						<image src='/images/db.png' mode='aspectFill' class="dbimg" wx:if='{{item.isLive==-1}}'></image>
+						<image src='/images/zb.png' mode='aspectFill' class="dbimg" wx:if='{{item.isLive == 1 && item.isActive==1}}'></image>
+						<image src='/images/dzb.png' mode='aspectFill' class="dbimg" wx:if='{{item.isLive==1 && item.isActive==null}}'></image>
+						<image src='/images/zbjs.png' mode='aspectFill' class="dbimg" wx:if='{{item.isLive==1 && item.isActive==-1}}'></image>
+						<text class="name">{{item.courseName}}</text>
 					</view>
-					<view class="start_text">开始时间:{{item.courseStart}}</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>
 						<image src='/images/startstudy.png' mode='aspectFill' class="an"></image>
 						<image src='/images/dtxs.png' mode='aspectFill' class="an" bindtap="gokhAnswer"></image>

+ 57 - 29
pages/myMission/myMission.wxss

@@ -5,43 +5,50 @@
   border-left: 3px solid #eb3f33;
   padding-bottom: 50rpx;
 }
-.finish_img{
+
+.finish_img {
   width: 53rpx;
   height: 53rpx;
   position: absolute;
   top: 0;
   left: -25rpx;
 }
-.ewm_icon{
+
+.ewm_icon {
   width: 33rpx;
   height: 32rpx;
 }
-.ewmbj{
+
+.ewmbj {
   width: 641rpx;
   height: 931rpx;
 }
-.ewm_close{
+
+.ewm_close {
   width: 30rpx;
   height: 30rpx;
   position: absolute;
   top: 30rpx;
   right: 30rpx;
 }
-.bjewm{
+
+.bjewm {
   width: 363rpx;
   height: 360rpx;
   position: absolute;
   top: 340rpx;
   left: 140rpx;
 }
-.bjq_text{
+
+.bjq_text {
   font-size: 30rpx;
   font-weight: 900;
   position: absolute;
   top: 90rpx;
   left: 200rpx;
 }
-.sm_text{
+
+.sm_text {
   font-size: 28rpx;
   color: #999999;
   /* font-weight: 900; */
@@ -49,7 +56,8 @@
   top: 140rpx;
   left: 200rpx;
 }
-.save_btn{
+
+.save_btn {
   width: 400rpx;
   height: 80rpx;
   font-size: 28rpx;
@@ -63,28 +71,32 @@
   line-height: 80rpx;
   border-radius: 50rpx;
 }
-.join_btn{
+
+.join_btn {
   border: 1px solid #da2c15;
   border-radius: 20rpx;
   height: 45rpx;
   color: #da2c15;
-  padding:0 10rpx 0 10rpx;
+  padding: 0 10rpx 0 10rpx;
   float: right;
   font-size: 28rpx;
   font-weight: 900;
   line-height: 45rpx;
   margin-right: 30rpx;
 }
-.join_classtext{
+
+.join_classtext {
   font-size: 28rpx;
   margin-left: 50rpx;
   font-weight: 900;
   float: left;
 }
-.ewm_icon{
+
+.ewm_icon {
   margin-left: 20rpx;
   float: left;
 }
+
 /* .bgimg1 {
   width: 291rpx;
   height: 124rpx;
@@ -97,32 +109,36 @@
   height: 124rpx;
   float: right;
 } */
-.sp_bigbox{
-  width:620rpx;
+.sp_bigbox {
+  width: 620rpx;
   height: 550rpx;
   /* border: 1px solid red; */
   margin-left: 50rpx;
   overflow-y: auto;
   overflow-x: hidden;
 }
+
 .sp_bigbox::-webkit-scrollbar {
   background-color: #e5e5e5;
   width: 8rpx;
 }
+
 .sp_bigbox::-webkit-scrollbar-track {
   opacity: 0;
   transition: opacity 0.12s ease-out;
-  -webkit-border-radius:  10rpx;
-  -moz-border-radius:  10rpx;
-  border-radius:  10rpx;
+  -webkit-border-radius: 10rpx;
+  -moz-border-radius: 10rpx;
+  border-radius: 10rpx;
 }
+
 .sp_bigbox::-webkit-scrollbar-thumb {
   background-color: #eb3f33;
   transition: background-color 0.3s;
   -webkit-border-radius: 10rpx;
-  -moz-border-radius:  10rpx;
-  border-radius:  10rpx;
+  -moz-border-radius: 10rpx;
+  border-radius: 10rpx;
 }
+
 .sp {
   width: 620rpx;
   height: 128rpx;
@@ -138,6 +154,7 @@
   top: 0;
   right: 20rpx;
 }
+
 .iszb {
   width: 30rpx;
   height: 10rpx;
@@ -150,8 +167,9 @@
 }
 
 .dbimg {
-  width: 84rpx;
+  width: 144rpx;
   height: 35rpx;
+  /* margin-top: 10rpx; */
   margin-right: 20rpx;
 }
 
@@ -182,6 +200,7 @@
 .time {
   color: #eb3f33;
 }
+
 .lq_btn {
   width: 500rpx;
   height: 77rpx;
@@ -191,11 +210,12 @@
   font-size: 29rpx;
   font-weight: 600;
   color: #fff;
-  background: -webkit-linear-gradient(left,#d7301d,#f99c30);
-  box-shadow: 5px 5px 5px #eea390; 
+  background: -webkit-linear-gradient(left, #d7301d, #f99c30);
+  box-shadow: 5px 5px 5px #eea390;
   margin-bottom: 0rpx;
   text-align: center;
 }
+
 .layout {
   width: 610rpx;
   margin-left: 50rpx;
@@ -204,12 +224,14 @@
   /* border: 1px solid red; */
   height: 74rpx;
 }
+
 .bgimg1 {
   width: 610rpx;
   height: 74rpx;
   /* float: left; */
 }
-.layout_text1{
+
+.layout_text1 {
   position: absolute;
   color: #fff;
   font-size: 30rpx;
@@ -217,7 +239,8 @@
   top: 20rpx;
   left: 50rpx;
 }
-.layout_text2{
+
+.layout_text2 {
   position: absolute;
   color: #df7e33;
   font-size: 25rpx;
@@ -231,7 +254,8 @@
   border-radius: 20rpx;
   height: 40rpx;
 }
-.layout_text3{
+
+.layout_text3 {
   position: absolute;
   color: #3a7dcd;
   font-size: 25rpx;
@@ -245,11 +269,13 @@
   border-radius: 20rpx;
   height: 40rpx;
 }
-.zsbj{
+
+.zsbj {
   width: 657rpx;
   height: 891rpx;
 }
-.byzc{
+
+.byzc {
   width: 400rpx;
   /* border: 1px solid red; */
   font-size: 30rpx;
@@ -262,7 +288,8 @@
   letter-spacing: 5rpx;
   line-height: 70rpx;
 }
-.zsdw_text{
+
+.zsdw_text {
   width: 500rpx;
   /* border: 1px solid red; */
   font-size: 30rpx;
@@ -275,7 +302,8 @@
   /* letter-spacing: 5rpx; */
   /* line-height: 70rpx; */
 }
-.zscloseimg{
+
+.zscloseimg {
   position: absolute;
   top: 900rpx;
   left: 300rpx;

+ 3 - 2
pages/onlineClass/onlineClass.wxml

@@ -4,7 +4,8 @@
 			<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 class="onlinetext" wx:if='{{item.isActive==1}}'> {{item.playTimes}}人</view>
+				<view class="onlinetext" wx:if='{{item.isActive==-1}}'> 开始时间:{{item.courseStart}}</view>
 			</view>
 			<image src='{{item.courseImg}}' mode='aspectFill' class="spbj"></image>
 			<view class="text1">{{item.courseName}}</view>
@@ -17,7 +18,7 @@
 		</view>
 	</view>
 	<view wx:if="{{showNull}}">
-		<image src='/images/nodata.png' mode='aspectFill' class="nodata" ></image>
+		<image src='/images/nodata.png' mode='aspectFill' class="nodata"></image>
 		<view class="nodata_text">暂无数据</view>
 	</view>
 </view>

+ 74 - 26
pages/zbDetails/zbDetails.js

@@ -10,22 +10,27 @@ Page({
     id: 0,
     socketOpen: false,
     chatContent: [],
-    myWrite: ''
+    inputValue: ''
   },
   // videoErrorCallback: function (e) {
   //   console.log('视频错误信息:')
   //   console.log(e.detail.errMsg)
   // },
   onReady: function () {},
+  bindKeyInput: function (e) {
+    this.setData({
+      inputValue: e.detail.value
+    })
+  },
   hands() {
     this.sendSocketMessage("put up hands")
   },
   // console.log(this.data.myWrite)
   // this.sendSocketMessage(this.data.myWrite)
   // this.sendSocketMessage(this.data.myWrite)
-  bindFormSubmit: function (e) {
-    var _this = this;
-    var input_val = e.detail.value.textarea;
+  submit: function () {
+    let _this = this;
+    let input_val = _this.data.inputValue;
     _this.sendSocketMessage(input_val)
   },
   getZbArr(sessionKey) {
@@ -68,6 +73,9 @@ Page({
     wx.onSocketError(function () {
       console.log("我连接出错了")
     })
+    wx.onSocketClose(function () {
+      console.log("我关了")
+    })
     wx.onSocketMessage(function (data) {
       let res = JSON.parse(data.data);
       console.log(res)
@@ -90,13 +98,6 @@ Page({
           }
         })
       }
-      // _this.setData({
-      //   chatContent: res.msg
-      // })
-      // if (res.messageType == "system") {
-
-      //   // this.data.chatContent = data.data.msg
-      // }
     })
   },
   sendSocketMessage(msg) {
@@ -105,23 +106,70 @@ Page({
         data: msg
       })
     } else {
-      // socketMsgQueue.push(msg)
     }
   },
-  // onclose() {
-  //   wx.onSocketClose(function () {
-  //     console.log("我关了")
-  //   })
-  // },
-  onHide() {
-    wx.onSocketClose(function () {
-      console.log("我关了")
+  onShow() {
+    let _this=this;
+    wx.checkSession({
+      success: () => {
+        console.log("我有缓存")
+        var sessionKey = wx.getStorageSync('sessionKey');
+        console.log(sessionKey)
+        if (sessionKey == "") {
+          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.socketConnect(sessionKey);
+                }
+              })
+            }
+          })
+        } else {
+          _this.socketConnect(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) {
+                wx.setStorageSync('sessionKey', res.data.sessionKey);
+                var sessionKey = res.data.sessionKey;
+                _this.socketConnect(sessionKey);
+              }
+            })
+          }
+        })
+      }
     })
   },
+  onHide() {
+    if (this.data.socketOpen) {
+      wx.closeSocket()
+    }
+  },
   onUnload() {
-    wx.onSocketClose(function () {
-      console.log("我关了")
-    })
+    if (this.data.socketOpen) {
+      wx.closeSocket()
+    }
   },
   onLoad: function (options) {
     var _this = this;
@@ -148,14 +196,14 @@ Page({
                   sessionKey = res.data.sessionKey;
                   wx.setStorageSync('sessionKey', res.data.sessionKey);
                   _this.getZbArr(sessionKey);
-                  _this.socketConnect(sessionKey);
+                  // _this.socketConnect(sessionKey);
                 }
               })
             }
           })
         } else {
           _this.getZbArr(sessionKey);
-          _this.socketConnect(sessionKey);
+          // _this.socketConnect(sessionKey);
         }
 
       },
@@ -175,7 +223,7 @@ Page({
                 wx.setStorageSync('sessionKey', res.data.sessionKey);
                 var sessionKey = res.data.sessionKey;
                 _this.getZbArr(sessionKey);
-                _this.socketConnect(sessionKey);
+                // _this.socketConnect(sessionKey);
               }
             })
           }

+ 14 - 5
pages/zbDetails/zbDetails.wxml

@@ -7,13 +7,22 @@
 		<view class="zw">{{message}}
 		</view>
 	</view>
-	<button bindtap="hands">举手</button>
-	<!-- <button bindtap="mySend">发送</button>
-	<textarea style="width:400rpx;height:200rpx;border:1px solid red" value="{{myWrite}}" name="textarea" placeholder="XXX" auto-focus maxlength="-1"></textarea> -->
-	<form bindsubmit="bindFormSubmit">
+	<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="puthands_box">
+		<image src='/images/puthands.png' mode='aspectFill' class="handimg"></image>
+		<view style="font-size:30rpx;color:#eb3f33;float:left;line-height:60rpx;margin-right:20rpx" bindtap="hands">举手</view>
+		<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>
+		{{item}}</view> -->
 </view>

+ 74 - 13
pages/zbDetails/zbDetails.wxss

@@ -1,27 +1,88 @@
-#myVideo{
+#myVideo {
   width: 100%;
 }
-.text_box{
-width: 90%;
-margin-left: 5%;
+
+.text_box {
+  width: 90%;
+  margin-left: 5%;
+  border-bottom: 1px solid #dbdbdb;
 }
-.title{
+
+.title {
   font-size: 32rpx;
   margin-top: 50rpx;
 }
-.bfnum{
-color: #999999;
-font-size: 25rpx;
-margin-top: 10rpx;
-height: 50rpx;
-border-bottom: 1px solid #dbdbdb;
+
+.bfnum {
+  color: #999999;
+  font-size: 25rpx;
+  margin-top: 10rpx;
+  height: 50rpx;
+  border-bottom: 1px solid #dbdbdb;
 }
-.zj{
+
+.zj {
   font-size: 32rpx;
   margin-top: 20rpx;
 }
-.zw{
+
+.zw {
   font-size: 25rpx;
   margin-top: 40rpx;
   line-height: 40rpx;
+}
+
+.chatbox {
+  margin-top: 20rpx;
+  width: 680rpx;
+  height: 400rpx;
+  background-color: #f4f4f4;
+  /* border: 1px solid red; */
+  margin-left: 35rpx;
+  border-radius: 20rpx;
+  overflow-y: auto;
+  font-size: 25rpx;
+  margin-bottom: 20rpx;
+  /* border-bottom: 1px solid #dbdbdb; */
+}
+
+.puthands_box {
+  margin-top: 20rpx;
+  margin-left: 35rpx;
+  width: 680rpx;
+  height: 60rpx;
+  /* border: 1px solid red; */
+}
+
+.handimg {
+  width: 60rpx;
+  height: 60rpx;
+  float: left;
+}
+
+.weui-input {
+  /* border: 1px solid red; */
+  width: 400rpx;
+  height: 40rpx;
+  margin-top: 10rpx;
+  background-color: #f4f4f4;
+  border-radius: 20rpx;
+  text-indent: 20rpx;
+  font-size: 25rpx;
+  margin-left: 20rpx;
+  float: left;
+}
+
+.send {
+  width: 90rpx;
+  height: 40rpx;
+  margin-top: 10rpx;
+  background-color: #eb3f33;
+  border-radius: 20rpx;
+  float: left;
+  font-size: 25rpx;
+  color: #fff;
+  text-align: center;
+  line-height: 40rpx;
+  margin-left: 20rpx;
 }

+ 6 - 6
utils/util.js

@@ -1,11 +1,11 @@
 const globalData = {
-  // publicUrl: 'https://sqdx.windd.cn',
-  // publicUrl2: 'https://sqdx.windd.cn',
+  publicUrl: 'https://sqdx.windd.cn',
+  publicUrl2: 'https://sqdx.windd.cn',
   publicUrl3: 'https://sqdx.windd.cn',
-  // publicSocketUrl: 'wss://sqdx.windd.cn',
-  publicSocketUrl: 'ws://10.16.10.139:8090',
-  publicUrl: 'http://10.16.10.139:8090', //luyu
-  publicUrl2: 'http://10.16.4.19:8090', //huyubo
+  publicSocketUrl: 'wss://sqdx.windd.cn',
+  // publicSocketUrl: 'ws://10.16.10.139:8090',
+  // publicUrl: 'http://10.16.10.139:8090', //luyu
+  // publicUrl2: 'http://10.16.4.19:8090', //huyubo
   // publicUrl3: 'http://10.16.9.28:8090', //zxq
 };
 module.exports = {