2 Achegas 9e036b6e7a ... d6352b628a

Autor SHA1 Mensaxe Data
  tiedan d6352b628a Merge branch 'hou' of http://git.cc-lotus.info/ssfg/OnlineTraining0622 into hou %!s(int64=4) %!d(string=hai) anos
  tiedan 8398c25b50 feature 加入版本号和首页公告,修复部分bug %!s(int64=4) %!d(string=hai) anos

+ 5 - 2
app.json

@@ -1,7 +1,9 @@
 {
   "pages": [
-    "pages/myClass/myClass",
+    "pages/index/index",
     "pages/welcome/welcome",
+    
+    "pages/myClass/myClass",
     "pages/groupsList/groupsList",
     "pages/answerAfterclass/answerAfterclass",
     "pages/zbDetails/zbDetails",
@@ -20,7 +22,7 @@
     "pages/userGuide/userGuide",
     "pages/schoolIntrouce/schoolIntrouce",
     "pages/last/last",
-    "pages/index/index",
+    
     "pages/personInfo/personInfo",
     "pages/lastdetail/lastdetail",
     "pages/lastdetailDetail/lastdetailDetail",
@@ -31,6 +33,7 @@
     "pages/historyClass/historyClass",
     "pages/onlineClass/onlineClass",
     "pages/myNotice/myNotice",
+    "pages/myNoticen/myNotice",
     "pages/exhibitionList/exhibitionList",
     "pages/startClass/startClass",
     "pages/myInteractionsDetais/myInteractionsDetais",

+ 60 - 0
pages/index/index.js

@@ -2,6 +2,7 @@ const app = require('../../utils/util.js');
 const tools = require('../../utils/tools.js');
 Page({
   data: {
+    
     wqdataArr: 0,
     jjdataArr: 0,
     isNeedlogin: false,
@@ -35,6 +36,9 @@ Page({
     ],
     active: 0,
     xcpArr: [],
+    wdArr:[],
+    notice:"",
+    noticeVis:false,
     vType:["理论阵地","我的学院","特色课程","特色管理"]
   },
   // 轮播点击去上课跳转到我的班级
@@ -253,6 +257,59 @@ Page({
       }
     })
   },
+  toNotice(){
+    var that=this;
+      wx.setStorage({
+        data: that.data.noticeArr,
+        key: 'noticeArr',
+        success:()=>{
+          wx.navigateTo({
+            url: '../myNoticen/myNotice'
+          })
+        }
+      })
+  },
+  getNotice(sessionKey){
+    wx.request({
+       
+      url: app.globalData.publicUrl + '/wx/eduNoticeSee/afficheLists',
+      method: "post",
+      data: {
+        sessionKey: sessionKey,
+        //isSee: 1
+        // isNotice: 0
+      },
+      success: (res) => {
+        console.log(res);
+     
+        if (res.data.code == 0) {
+          if (res.data.data.notReadAfficheList.length !== 0) {
+            this.setData({
+              noticeVis: true,
+              noticeArr: res.data,
+              notice: res.data.data.notReadAfficheList[0].noticeContent
+            
+            })
+          } else {
+            this.setData({
+              noticeArr: res.data.data,
+              noticeVis: false,
+              
+            })
+          }
+        } else {
+          this.setData({
+            noticeVis: false
+          })
+        }
+      },
+      fail: () => {
+        this.setData({
+          noticeVis: false
+        })
+      }
+    })
+  },
   async onShow() {
     const sessionKey = await tools.checkSessionAndLogin();
     this.getBanner(sessionKey);
@@ -260,10 +317,13 @@ Page({
     this.getwqLength(sessionKey);
     this.getRedPoint1(sessionKey);
     this.getRedPoint4(sessionKey);
+    this.getNotice(sessionKey);
+    
    // this.getfour1();
   },
   async onLoad() {
     //this.getfour();
+    
     this.getVedioList(this.data.active+1);
   },
 })

+ 4 - 1
pages/index/index.wxml

@@ -1,5 +1,8 @@
 <view class="container">
-    <!-- <van-notice-bar left-icon="volume-o" mode="link" text="技术是开发它的人的共同灵魂。" tapclick="toNotice" /> -->
+    <van-notice-bar wx:if="{{noticeVis}}" left-icon="volume-o" mode="link" text="{{notice}}" bindtap="toNotice" style="padding-bottom:10rpx;" />
+		<van-button style="{{ buttonStyle }}">
+  默认按钮
+</van-button>
 	<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">

+ 5 - 4
pages/myNotice/myNotice.js

@@ -14,10 +14,11 @@ Page({
       method: "post",
       data: {
         sessionKey: sessionKey,
-        isSee: 1
-        // isNotice: 0
+        isSee: 1,
+         isNotice: 0
       },
       success: (res) => {
+        console.log(res);
         if (res.data.code == 0) {
           if (res.data.list.length !== 0) {
             this.setData({
@@ -49,8 +50,8 @@ Page({
       method: "post",
       data: {
         sessionKey: sessionKey,
-        isSee: 0
-        // isNotice: 0
+        isSee: 0,
+        isNotice: 0
       },
       success: (res) => {
         if (res.data.code == 0) {

+ 229 - 0
pages/myNoticen/myNotice.js

@@ -0,0 +1,229 @@
+const app = require('../../utils/util.js');
+const tools = require('../../utils/tools.js');
+Page({
+  data: {
+    active: 0,
+    wdArr: [],
+    ydArr: [],
+    showNull: false,
+    showNull1: false
+  },
+  getNotice(){
+    wx.showLoading();
+    wx.getStorage({
+      key: 'noticeArr',
+      success:(res)=>{
+        console.log(res);
+        wx.hideLoading();
+        this.setData({
+          wdArr:res.data.data.notReadAfficheList,
+          ydArr:res.data.data.readAfficheList,
+          showNull:res.data.data.notReadAfficheList.length>0?false:true,
+          showNull1:res.data.data.readAfficheList.length>0?false:true,
+        })
+       
+      },
+      fail:()=>{
+        wx.hideLoading();
+      }
+    })
+  },
+  getNoticeArr(sessionKey,active){
+    console.log("getNoticeArr");
+    wx.showLoading();
+    wx.request({
+      url: app.globalData.publicUrl + '/wx/eduNoticeSee/afficheLists',
+      method: "post",
+      data: {
+        sessionKey: sessionKey,
+        // isSee: 1
+        // // isNotice: 0
+      },
+      success: (res) => {
+        console.log(res);
+        wx.hideLoading();
+        if (res.data.code == 0) {
+          
+          
+          if(active){
+            console.log("1");
+            if(active==0){
+              
+              this.setData({
+                wdArr:res.data.data.notReadAfficheList,
+                ydArr:res.data.data.readAfficheList,
+       
+                showNull1:res.data.data.readAfficheList.length>0?false:true,
+              })
+            }else{
+              this.setData({
+                wdArr:res.data.data.notReadAfficheList,
+                ydArr:res.data.data.readAfficheList,
+                showNull:res.data.data.notReadAfficheList.length>0?false:true,
+                
+              })
+            }
+          }else{
+            console.log("2");
+            this.setData({
+              wdArr:res.data.data.notReadAfficheList,
+              ydArr:res.data.data.readAfficheList,
+              showNull:res.data.data.notReadAfficheList.length>0?false:true,
+              showNull1:res.data.data.readAfficheList.length>0?false:true,
+            })
+          }
+        } else {
+          if(active){
+            if(active==0){
+              this.setData({
+                wdArr:res.data.data.notReadAfficheList,
+                ydArr:res.data.data.readAfficheList,
+       
+                showNull1:res.data.data.readAfficheList.length>0?false:true,
+              })
+            }else{
+              this.setData({
+                wdArr:res.data.data.notReadAfficheList,
+                ydArr:res.data.data.readAfficheList,
+                showNull:res.data.data.notReadAfficheList.length>0?false:true,
+                
+              })
+            }
+          }
+          
+
+
+        }
+      },
+      fail: () => {
+        console.log("fal");
+        console.log("active",typeof active);
+        wx.hideLoading();
+        wx.showModal({
+          showCancel: false,
+          content: "网络错误"
+        })
+        // if(typeof active=="number"){
+            
+        //     if(active==0){
+              
+        //       console.log("weidu");
+        //       this.setData({
+        //         wdArr:[],
+        //         showNull:true,
+        //       })
+        //     }else{
+        //       this.setData({
+        //         ydArr:[],
+        //         showNull1:true,
+                
+        //       })
+        //     }
+        //   }
+      }
+    })
+  },
+  getArr(sessionKey) {
+    wx.request({
+      url: app.globalData.publicUrl + '/wx/eduNoticeSee/list',
+      method: "post",
+      data: {
+        sessionKey: sessionKey,
+        isSee: 1
+        // isNotice: 0
+      },
+      success: (res) => {
+        if (res.data.code == 0) {
+          if (res.data.list.length !== 0) {
+            this.setData({
+              showNull: false,
+              wdArr: res.data.list
+            })
+          } else {
+            this.setData({
+              wdArr: res.data.list,
+              showNull: true
+            })
+          }
+        } else {
+          this.setData({
+            showNull: true
+          })
+        }
+      },
+      fail: () => {
+        this.setData({
+          showNull: true
+        })
+      }
+    })
+  },
+  getArr1(sessionKey) {
+    wx.request({
+      url: app.globalData.publicUrl + '/wx/eduNoticeSee/list',
+      method: "post",
+      data: {
+        sessionKey: sessionKey,
+        isSee: 0
+        // isNotice: 0
+      },
+      success: (res) => {
+        if (res.data.code == 0) {
+          if (res.data.list.length !== 0) {
+            this.setData({
+              showNull1: false,
+              ydArr: res.data.list
+            })
+          } else {
+            this.setData({
+              ydArr: res.data.list,
+              showNull1: true
+            })
+          }
+        } else {
+          this.setData({
+            showNull1: true
+          })
+        }
+      },
+      fail: () => {
+        this.setData({
+          showNull1: true
+        })
+      }
+    })
+  },
+  async onChange(event) {
+ console.log("onCHange");
+
+      const sessionKey = await tools.checkSessionAndLogin();
+      this.getNoticeArr(sessionKey,event.detail.index);
+    
+  },
+  meRead(sessionKey, noticeId) {
+    wx.request({
+      url: app.globalData.publicUrl + '/wx/eduNoticeSee/edit',
+      method: "post",
+      data: {
+        sessionKey: sessionKey,
+        isSee: 0,
+        noticeId: noticeId
+      },
+      success: () => {
+        console.log("meRead",noticeId);
+        this.getNoticeArr(sessionKey)
+      }
+    })
+  },
+  async btn(e) {
+    console.log(e.currentTarget.dataset.item.id);
+    let noticeId = e.currentTarget.dataset.item.id;
+    const sessionKey = await tools.checkSessionAndLogin();
+    this.meRead(sessionKey, noticeId);
+  },
+  async onLoad() {
+    const sessionKey = await tools.checkSessionAndLogin();
+    this.getNotice();
+    //this.getArr(sessionKey);
+  }
+})

+ 4 - 0
pages/myNoticen/myNotice.json

@@ -0,0 +1,4 @@
+{
+  "navigationBarTitleText":"公告列表",
+  "usingComponents": {}
+}

+ 39 - 0
pages/myNoticen/myNotice.wxml

@@ -0,0 +1,39 @@
+<van-tabs active="{{ active }}" bind:change="onChange">
+	<van-tab title="未读">
+		<view class="box">
+			<view wx:for="{{wdArr}}">
+				<view class="box1">
+					<van-row>
+						<van-col span="2">
+							<image src="/images/wdtz.png" style="height: 32rpx; width: 32rpx;" mode="aspectFit"></image>
+						</van-col>
+						<van-col span="22">{{item.noticeContent}}</van-col>
+					</van-row>
+					<view class="btn" data-item="{{item}}" bindtap="btn">我知道了</view>
+				</view>
+			</view>
+			<view wx:if="{{showNull}}">
+				<image src='/images/nodata.png' mode='aspectFill' class="nodata"></image>
+				<view class="nodata_text">暂无数据</view>
+			</view>
+		</view>
+	</van-tab>
+	<van-tab title="已读">
+		<view class="box">
+			<view wx:for="{{ydArr}}">
+				<view class="box2">
+					<van-row>
+						<van-col span="2">
+							<image src="/images/ydtz.png" style="height: 32rpx; width: 32rpx;" mode="aspectFit"></image>
+						</van-col>
+						<van-col span="22">{{item.noticeContent}}</van-col>
+					</van-row>
+				</view>
+			</view>
+			<view wx:if="{{showNull1}}">
+				<image src='/images/nodata.png' mode='aspectFill' class="nodata"></image>
+				<view class="nodata_text">暂无数据</view>
+			</view>
+		</view>
+	</van-tab>
+</van-tabs>

+ 61 - 0
pages/myNoticen/myNotice.wxss

@@ -0,0 +1,61 @@
+.box {
+  width: 88%;
+  margin: 0 auto;
+  position: relative;
+}
+.box1 {
+  /* display: flex; */
+  border-radius: 20rpx;
+  margin-top: 20rpx;
+  background: #FBF3E3;
+  padding: 30rpx;
+  color: #E55800;
+  font-size: 25rpx;
+}
+.box2 {
+  border-radius: 20rpx;
+  margin-top: 20rpx;
+  background: rgba(244,244,244);
+  padding: 30rpx;
+  color: rgba(102,102,102);
+  font-size: 25rpx;
+}
+/* .box2 {
+  background: #FBF3E3;
+} */
+/* .content {
+  margin-left: 30rpx;
+  font-size: 25rpx;
+}
+.content1 {
+  color: #E55800;
+} */
+.btn {
+  /* padding: 10rpx 10rpx; */
+  background: white;
+  width: 160rpx;
+  height: 50rpx;
+  line-height: 50rpx;
+  border-radius: 50rpx;
+  margin-top: 20rpx;
+  margin-left: 200rpx;
+  text-align: center;
+}
+.van-tab--active .van-ellipsis {
+  color: #EE0A24;
+  font-weight: bold;
+}
+.nodata {
+  /* position: absolute; */
+  margin-top: 285rpx;
+  margin-left: 165rpx;
+  width: 340rpx;
+  height: 262rpx;
+}
+.nodata_text{
+  /* position: absolute; */
+  margin-top: 20rpx;
+  margin-left: 280rpx;
+  font-size: 30rpx;
+  color: #666666;
+}

+ 3 - 0
pages/personInfo/personInfo.js

@@ -2,6 +2,7 @@ const app = require('../../utils/util.js');
 const tools = require('../../utils/tools.js');
 Page({
   data: {
+    version:'',
     isRz: false,
     dataArr: [{
         img: "/images/person1.png",
@@ -132,6 +133,8 @@ Page({
     })
   },
   async onShow() {
+    this.setData({version:app.globalData.version});
+    
     const sessionKey = await tools.checkSessionAndLogin();
     this.getInformation(sessionKey);
   }

+ 1 - 0
pages/personInfo/personInfo.wxml

@@ -16,5 +16,6 @@
 				<view class="small-title">{{item.subname}}</view>
 			</view>
 		</view>
+		<view class="version">版本 {{version}}</view>
 	</view>
 </view>

+ 5 - 0
pages/personInfo/personInfo.wxss

@@ -59,4 +59,9 @@ page {
   margin-left: 100rpx;
   color: #eb3f33;
   font-weight: 900;
+}
+.version{
+  text-align: center;
+  color:#666666;
+  padding-bottom:10rpx;
 }

+ 4 - 1
pages/welcome/welcome.js

@@ -1,8 +1,11 @@
+const app = require('../../utils/util.js');
 Page({
   data: {
-    kjShow: true
+    kjShow: true,
+    version:''
   },
   onLoad: function () {
+    this.setData({version:app.globalData.version});
     setTimeout(function () {
       wx.switchTab({
         url: '/pages/index/index'

+ 2 - 1
pages/welcome/welcome.wxml

@@ -1,3 +1,4 @@
-<view>
+<view class="container">
 	<image src='https://bucketnj1-1254259530.cos.ap-nanjing.myqcloud.com/20200704143337.gif' mode='aspectFill' style="width:750rpx;height:100vh" wx:if="{{kjShow}}"></image>
+	<view class="version">V {{version}}</view>
 </view>

+ 3 - 1
pages/welcome/welcome.wxss

@@ -1 +1,3 @@
-/* pages/welcome/welcome.wxss */
+/* pages/welcome/welcome.wxss */
+.container{position: relative;}
+.version{position: absolute; bottom: 40rpx; font-size: 24rpx; text-align: center; color: #666; width: 100%; display:block;}

+ 2 - 0
pages/zbDetails/zbDetails.js

@@ -485,6 +485,7 @@ Page({
     })
   },
   async onShow() {
+
     const sessionKey = await tools.checkSessionAndLogin();
     const information = await tools.request('/wx/student/selStudentSessionKeyEcho', {
       sessionKey
@@ -497,6 +498,7 @@ Page({
     this.setData({
       ['rtcConfig.userSig']: sig.userSig
     })
+    //保持页面常亮
     wx.setKeepScreenOn({
       keepScreenOn: true,
     })

+ 6 - 3
utils/util.js

@@ -1,10 +1,13 @@
 const globalData = {
-  publicUrl: 'https://sqdx.jiaxintech.com'//测试地址
-  // publicUrl: 'https://sqpx.jiaxintech.com'//正式地址
+  version:'3.0.17',
+ publicUrl: 'https://sqdx.jiaxintech.com'//测试地址
+ //  publicUrl: 'https://sqpx.jiaxintech.com'//正式地址
   // publicUrl:'http://10.16.10.139'//ly
   // publicUrl:'http://10.16.4.19:80'//hyb
   // publicUrl:'http://10.16.4.26:80'//zxq
-  //publicUrl:'http://10.20.1.207:80'//dailin
+  // publicUrl:'http://10.20.1.207:80'//dailin
+
+  
 };
 const formatTime = date => {
   const year = date.getFullYear()