yukangzhe 4 年之前
父節點
當前提交
39068835a8

+ 1 - 0
app.js

@@ -68,6 +68,7 @@ App({
   },
 
   globalData: {
+    ver:'1.0.0',
     userInfo: null,
     openId: '',
     imageUrl: 'https://app.schoolwisdoms.com/static/wx/images/',

+ 3 - 3
pages/Components/calendar/calendar.wxss

@@ -170,8 +170,8 @@
   text-align: center;
   color: #fff;
   /* background: linear-gradient(-60deg, #0FDAC5, #1BC7B0); */
-  background: #cc6031;
-  box-shadow: 0px 2px 15px 0px #cc6031;
+  background: #005033;
+  box-shadow: 0px 2px 15px 0px #005033;
   margin: 0 auto;
 }
 
@@ -182,7 +182,7 @@
 .calendar .calendar-main .day .spot {
   width: 8rpx;
   height: 8rpx;
-  background-color: #cc6031;
+  background-color: #005033;
   border-radius: 50%;
   margin: 6rpx auto 0;
 }

+ 13 - 8
pages/Components/classList/classList.wxss

@@ -1,6 +1,7 @@
 /* 课表列表 */
 .class-list{
-  padding-bottom: 50rpx
+  padding-bottom: 50rpx;
+  margin-top:50rpx;
 }
 .class-box{
   display: flex;
@@ -8,14 +9,14 @@
   align-content: space-between;
   width: 646rpx;
   background: #FFF;
-  border-left: 4rpx solid #cc6031;
+  border-left: 4rpx solid #005033;
   padding: 25rpx;
   border-radius: 15rpx;
   margin: 0 auto 40rpx;
   box-shadow: 0 15rpx 20rpx #eee;
 }
 .class-box view{
-  height: 60rpx;
+  /* height: 60rpx; */
   line-height: 60rpx;
 }
 .class-name,.class-time{
@@ -41,7 +42,7 @@
 }
 .class-type{
   color: #FFF;
-  background: #cc6031;
+  background: #005033;
   line-height: 30rpx;
   height: 30rpx;
   margin-top: 20rpx;
@@ -62,11 +63,15 @@
 .class-btn-box{
   margin-left: auto;
 }
+.class-btn-box{
+  color: #005033;
+  border-color: #005033;
+}
 
 .class-btn{
   width: 178rpx;
-    border: 2rpx solid #cc6031;
-    color: #cc6031;
+    border: 2rpx solid #005033;
+    color: #005033;
     text-align: center;
     font-size: 28rpx;
     border-radius: 50rpx;
@@ -106,7 +111,7 @@
   }
   .choose-box{
     width: 646rpx;
-    border-left: 4rpx solid #cc6031;
+    border-left: 4rpx solid #005033;
     padding: 25rpx;
     margin: 20rpx 0;
     border-radius: 15rpx;
@@ -144,7 +149,7 @@
     left: 50%;
     margin-left: -200rpx;
     text-align: center;
-    background: #cc6031;
+    background: #005033;
     line-height: 80rpx;
     color: #FFF;
     border-radius: 50rpx;

+ 7 - 5
pages/Components/lessonsList/lessonsList.wxss

@@ -3,15 +3,17 @@
   flex-wrap: wrap;
   justify-content: space-between;
   width: 646rpx;
-  border-left: 4rpx solid #cc6031;
+  border-left: 4rpx solid #005033;
   border-radius: 15rpx;
   margin: 40rpx auto;
   padding: 25rpx;
   box-shadow: 0 15rpx 20rpx #eee;
+  background: #FFF;
 }
+
 .lessons-type{
   color: #FFF;
-  background: #cc6031;
+  background: #005033;
   line-height: 30rpx;
   height: 30rpx;
   margin-top: 20rpx;
@@ -31,7 +33,7 @@
   margin-right: auto;
 }
 .lessons-flag{
-  color: #cc6031;
+  color: #005033;
 }
 .lessons-flag-ed{
   color: #999;
@@ -49,9 +51,9 @@
   width: 180rpx;
   margin-left: auto;
   text-align: center;
-  border: 1px solid #cc6031;
+  border: 1px solid #005033;
   border-radius: 100rpx;
-  color: #cc6031;
+  color: #005033;
   font-size: 28rpx;
 }
 .more-btn{

+ 2 - 2
pages/Components/selectDate/selectDate.wxss

@@ -1,7 +1,7 @@
 .select-view {
   height: 60rpx;
   line-height: 60rpx;
-  background: #cc6031;
+  background: #005033;
   color: #FFF;
   text-align: center;
   font-size: 36rpx;
@@ -61,7 +61,7 @@
   line-height: 60rpx;
   width: 150rpx;
   border-radius: 10rpx;
-  background: #cc6031;
+  background: #005033;
   text-align: center;
   color: #FFF;
 }

+ 1 - 1
pages/Components/switchTab/switchTab.wxss

@@ -5,7 +5,7 @@
 }
 .switch-view view{
   margin: 0 auto;
-  color: #999;
+  color: #005033;
   height: 80rpx;
   line-height: 80rpx;
   font-size: 36rpx;

+ 1 - 1
pages/addClass/addClass.wxss

@@ -11,7 +11,7 @@ page{
   line-height: 60rpx;
   width: 750rpx;
   color: #FFF;
-  background: #cc6031;
+  background: #005033;
   text-align: center;
   font-size: 36rpx;
 }

+ 3 - 3
pages/growUp/growUp.wxss

@@ -18,7 +18,7 @@
 .line-index{
     width: 20rpx;
     height: 20rpx;
-    background: #cc6031;
+    background: #005033;
     border-radius: 20rpx;
     position: relative;
     top: 20rpx;
@@ -115,7 +115,7 @@
 }
 
 .curAudioStyle {
-  box-shadow: 0 0 20rpx #cc6031 !important;
+  box-shadow: 0 0 20rpx #005033 !important;
   border: none;
 }
 
@@ -125,7 +125,7 @@
   text-align: center;
   line-height: 80rpx;
   color: #FFF;
-  background: #cc6031;
+  background: #005033;
   border-radius: 50rpx;
   font-size: 36rpx;
   position: fixed;

+ 1 - 0
pages/index/index.js

@@ -8,6 +8,7 @@ Page({
    * 页面的初始数据
    */
   data: {
+    isShow: wx.getStorageSync('isShow'),
     array: ['艾克斯郎校区1', '艾克斯郎校区2', '艾克斯郎校区3', '艾克斯郎校区4'],
     index: 0,
     curStu: {},

+ 3 - 3
pages/index/index.wxml

@@ -23,7 +23,7 @@
 			<swiper class="banner" autoplay circular interval="3000">
 				<block wx:for="{{bannerList}}" wx:key="index">
 					<swiper-item class="banner-box" >
-						<image lazy-load mode="aspectFill" class="bb-image" src="{{item.imageUrl}}"></image>
+						<image lazy-load mode="widthFix" class="bb-image" src="{{item.imageUrl}}"></image>
 					</swiper-item>
 				</block>
 			</swiper>
@@ -62,7 +62,7 @@
   <!-- end -->
 
   <!-- 学生秀 -->
-  <view class="show-view">
+  <view class="show-view" wx:if="{{isShow}}">
     <view class="title-view">
       <view class="title">学生秀</view>
       <view class="more" bindtap="getMoreShow" data-type="0">更多</view>
@@ -73,7 +73,7 @@
   <!-- end -->
 
    <!-- 老师秀 -->
-   <view class="show-view">
+   <view class="show-view"  wx:if="{{isShow}}">
     <view class="title-view">
       <view class="title">老师秀</view>
       <view class="more" bindtap="getMoreShow" data-type="1">更多</view>

+ 4 - 3
pages/index/index.wxss

@@ -117,7 +117,7 @@
 
 /* 标题 */
 .title {
-  font-size: 36rpx;
+  font-size: 32rpx;
   font-weight: 600;
 }
 
@@ -142,8 +142,8 @@
 }
 
 .app-img {
-  height: 80rpx;
-  width: 80rpx;
+  height: 60rpx;
+  width: 60rpx;
   margin: 0 auto;
 }
 
@@ -171,6 +171,7 @@
   .more{
     margin-left: auto;
     color: #999;
+    font-size: 24rpx;
   }
   .reset-btn{
     width: 120rpx;

+ 59 - 19
pages/leave/leave.js

@@ -28,40 +28,61 @@ Page({
   onLoad: function (options) {
     let date = options.beginDate;
     if (date) {
-      this.setData({ bd: date })
+      this.setData({
+        bd: date
+      })
     }
     const urls = urlDef.urls;
     let stu = wx.getStorageSync('student');
     if (stu) {
-      this.setData({ 'curStu': stu });
+      this.setData({
+        'curStu': stu
+      });
 
       util.apiPost(urls.get_sys_params + '&q.orgId=' + stu.orgId + '&q.id=1000_2').then((rs) => {
         if (rs && rs.length > 0) {
-          this.setData({ leaveTime: parseInt(rs[0].sysVal, 10) })
+          this.setData({
+            leaveTime: parseInt(rs[0].sysVal, 10)
+          })
         }
       });
       // this.leaveDay = 14; // 允许提前()天请假
       util.apiPost(urls.get_sys_params + '&q.orgId=' + stu.orgId + '&q.id=1000_1').then((rs) => {
         if (rs && rs.length > 0) {
-          this.setData({ leaveDay: parseInt(rs[0].sysVal, 10) })
+          this.setData({
+            leaveDay: parseInt(rs[0].sysVal, 10)
+          })
         }
       });
 
 
-      util.apiPost(urls.get_sys_params, { 'q.orgId': stu.orgId, 'q.id': 'f8158acabeeb44ec9ff651aade6b295f' }).then((rs) => {
+      util.apiPost(urls.get_sys_params, {
+        'q.orgId': stu.orgId,
+        'q.id': 'f8158acabeeb44ec9ff651aade6b295f'
+      }).then((rs) => {
         if (rs && rs.length > 0) {
           // 将分钟转为毫秒
-          this.setData({ 'aheadTime': parseInt(rs[0].sysVal, 10) * 60 * 1000 })
+          this.setData({
+            'aheadTime': parseInt(rs[0].sysVal, 10) * 60 * 1000
+          })
         }
       });
-      util.apiPost(urls.leave_get_classes_info, { 'q.studentId': stu.studentId }).then((rs) => {
+      util.apiPost(urls.leave_get_classes_info, {
+        'q.studentId': stu.studentId
+      }).then((rs) => {
         if (rs && rs.length > 0) {
-          this.setData({ 'eventList': rs })
+          this.setData({
+            'eventList': rs
+          })
         }
       });
-      util.apiPost(urls.get_holidays, { 'q.companyId': stu.orgId }).then((rs) => {
+      util.apiPost(urls.get_holidays, {
+        'q.companyId': stu.orgId
+      }).then((rs) => {
         if (rs && rs.length > 0) {
-          this.setData({ 'holidayList': rs })
+          this.setData({
+            'holidayList': rs
+          })
         }
       });
     }
@@ -81,8 +102,11 @@ Page({
     let date = this.data.bd
     if (date) {
       let t = this;
-      setTimeout(() => { t.selectDate(date) }, 500)
+      setTimeout(() => {
+        t.selectDate(date)
+      }, 500)
     }
+    
   },
 
   /**
@@ -120,37 +144,53 @@ Page({
 
   },
   selectDate: function (v) {
-    this.setData({ curDate: v })
+    this.setData({ 
+      curDate: v
+    })
     let vd = new Date(v);
     let week = this.data.weekMap[vd.getDay()];
     let list = this.data.eventList.filter(o => {
       return o.attenceDate == v;
     });
+    if(list.length<=0){
+      setTimeout(() => {
+        this.selectDate(v)
+      }, 1000);
+    }
     list.map(o => {
       o.bt = o.beginTime.substring(0, 5);
       o.et = o.endTime.substring(0, 5);
       o.leaveFlag = this.canLeave(o)
     })
-    this.setData({ 'date': v, 'week': week, 'dateList': [{ items: list, date: v, week: week }] });
+    this.setData({
+      'date': v,
+      'week': week,
+      'dateList': [{
+        items: list,
+        date: v,
+        week: week
+      }]
+    });
   },
   callSelectDate: function (d) {
     let v = d.detail.dateString;
     this.selectDate(v);
   },
   canLeave(item) {
-    let timeCheck = (item.attenceDate > this.data.curDate); // 默认要大于当前时间,就是不能请当天的假
-    let dateCheck = (item.attenceDate > this.data.curDate); // 默认要大于当前时间,就是不能请当天的假
+    let timeCheck = (item.attenceDate.replace(/-/g, '/') > this.data.curDate.replace(/-/g, '/')); // 默认要大于当前时间,就是不能请当天的假
+    let dateCheck = (item.attenceDate.replace(/-/g, '/') > this.data.curDate.replace(/-/g, '/')); // 默认要大于当前时间,就是不能请当天的假
     if (this.data.leaveTime > 0) { // 允许上课前()分钟请假
       // 判断当前时间是否跟上课时间相差  leaveTime 分钟
-      let attenceTime = new Date(item.attenceDate + ' ' + item.beginTime)
+      let attenceTime = new Date(item.attenceDate.replace(/-/g, '/') + ' ' + item.beginTime)
       timeCheck = Math.floor((attenceTime.getTime() - new Date().getTime()) / 60000) >= this.data.leaveTime;
     }
     if (this.data.leaveDay > 0) { // 允许提前()天请假
-      let attenceTime = new Date(item.attenceDate + ' 00:00:00')
+      let attenceTime = item.attenceDate + ' 00:00:00'
       const temDate = new Date();
       temDate.setDate(temDate.getDate() + this.data.leaveDay);
-      dateCheck = (temDate >= attenceTime);
+      const curTemDate = temDate.getFullYear()+ "-" + (temDate.getMonth() + 1) + "-" + temDate.getDate() + ' 00:00:00';
+      dateCheck = (curTemDate.replace(/-/g, '/') >= attenceTime.replace(/-/g, '/'));
     }
     return (item.isAttend === 0 && item.leaveCount > 0 && timeCheck && dateCheck && (item.status === 0 || item.status === 4));
-  }
+  },
 })

+ 20 - 17
pages/leaveDetail/leaveDetail.js

@@ -15,7 +15,9 @@ Page({
   },
 
   getText: function (e) {
-    this.setData({ content: e.detail.value })
+    this.setData({
+      content: e.detail.value
+    })
   },
 
   bindPickerChange: function (e) {
@@ -32,8 +34,9 @@ Page({
     let o = JSON.parse(options.data)
     let s = o.source
     s.bt = s.beginTime.substring(0, 5)
-    this.setData({ item: s })
-
+    this.setData({
+      item: s
+    })
   },
 
   /**
@@ -98,12 +101,14 @@ Page({
       if (rs && rs.length > 0) {
         timeoutDay = parseInt(rs[0].sysVal, 10);
       }
-      if (timeoutDay > 0) {// 计算本课程上课时间,跟当前时间相隔多少天,这个天不能超过 timeoutDay
+      if (timeoutDay > 0) { // 计算本课程上课时间,跟当前时间相隔多少天,这个天不能超过 timeoutDay
         let courseDate = new Date(this.data.item.attenceDate)
         let now = new Date();
         let day = Math.ceil((courseDate.getTime() - now.getTime()) / (1000 * 60 * 60 * 24));
         if (day > timeoutDay) { // 超过请假范围了
-          wx.showToast({ title: '只能请' + timeoutDay + '天内的假' });
+          wx.showToast({
+            title: '只能请' + timeoutDay + '天内的假'
+          });
           return;
         }
       }
@@ -115,7 +120,7 @@ Page({
         cancelText: "否",
         confirmText: "是",
         success: function (res) {
-          if (res.cancel) { } else {
+          if (res.cancel) {} else {
             that.doRealSave()
           }
         }
@@ -125,7 +130,7 @@ Page({
 
   },
   doRealSave: function () {
-
+    const that = this
     const urls = urlDef.urls;
     let stu = wx.getStorageSync('student')
     let today = util.curTime().substring(0, 10).replace(/\//g, '-')
@@ -141,16 +146,14 @@ Page({
       orgId: stu.orgId,
       leaveDate: today,
       leaveReason: leaveReason,
-      goodList: [
-        {
-          beginTime: this.data.item.beginTime,
-          attenceStudentId: this.data.item.id,
-          attenceTeacherId: this.data.item.attenceTeacherId,
-          kindId: this.data.item.kindId,
-          status: this.data.item.status,
-          switchingId: this.data.item.switchingId
-        }
-      ]
+      goodList: [{
+        beginTime: this.data.item.beginTime,
+        attenceStudentId: this.data.item.id,
+        attenceTeacherId: this.data.item.attenceTeacherId,
+        kindId: this.data.item.kindId,
+        status: this.data.item.status,
+        switchingId: this.data.item.switchingId
+      }]
     };
 
     util.apiPost(urls.student_leave, attenceData, 'application/json').then(rs => {

+ 2 - 2
pages/leaveDetail/leaveDetail.wxss

@@ -34,7 +34,7 @@
     border-radius: 20rpx;
 }
 .red-view{
-  color: #cc6031;
+  color: #005033;
 }
 
 .submit-view{
@@ -43,7 +43,7 @@
   width: 400rpx;
   height: 100rpx;
   line-height: 100rpx;
-  background: #cc6031;
+  background: #005033;
   color: #FFF;
   text-align: center;
   left: 50%;

+ 1 - 1
pages/lessons/lessons.js

@@ -42,7 +42,7 @@ Page({
       cancelText: "否",//默认是“取消”
       cancelColor: '#999999',//取消文字的颜色
       confirmText: "我知道了",//默认是“确定”
-      confirmColor: 'skyblue',//确定文字的颜色
+      // confirmColor: 'skyblue',//确定文字的颜色
     })
   },
 

+ 1 - 1
pages/lessons/lessons.wxss

@@ -11,7 +11,7 @@
   line-height: 60rpx;
   width: 750rpx;
   color: #FFF;
-  background: #cc6031;
+  background: #005033;
   text-align: center;
   font-size: 36rpx;
 }

+ 22 - 1
pages/login/login.js

@@ -18,7 +18,27 @@ Page({
       title: '加载中',
       mask: true
     })
-    this.getOpenId()
+    this.getVersion()
+  },
+
+  //判断版本号
+  getVersion: function () {
+    util.doPost(
+      'getVersion', {
+        appId: app.globalData.appId
+      }
+    ).then(res => {
+      if (res.version != app.globalData.ver) {
+        wx.setStorageSync('isShow', false)
+        wx.switchTab({
+          url: '/pages/index/index',
+        })
+      } else {
+        wx.setStorageSync('isShow', true)
+        this.getOpenId()
+      }
+      
+    })
   },
 
   // 登录
@@ -69,6 +89,7 @@ Page({
       ).then(rs => {
         if (rs.success > 0) {
           wx.setStorageSync('phone', rs.data.phoneNumber);
+          // wx.setStorageSync('phone', '13871019618')
           this.autoLogin();
         } else {
           wx.showToast({

+ 1 - 1
pages/login/login.wxml

@@ -1,7 +1,7 @@
 <!--pages/Components/campusBinding/campusBinding.wxml-->
 <view class="main">
 	<image lazy-load class="logo" mode="aspectFill" src="/images/logo.png"></image>
-	<text class="name">艾克斯朗学生端</text>
+	<!-- <text class="name">艾克斯朗学生端</text> -->
 	<button class="button" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" hidden="{{btnShow}}">
 		登陆
 	</button>

+ 3 - 3
pages/login/login.wxss

@@ -37,9 +37,9 @@
   line-height: 82rpx;
   text-align: center;
   background: rgba(255, 255, 255, 1);
-  border: 2rpx solid #cc6031;
-  box-shadow: 0rpx 4rpx 12rpx #cc6031;
+  border: 2rpx solid #005033;
+  box-shadow: 0rpx 4rpx 12rpx #005033;
   border-radius: 42rpx;
   font-size: 32rpx;
-  color: #cc6031;
+  color: #005033;
 }

+ 3 - 3
pages/piano/piano.wxss

@@ -42,7 +42,7 @@ page{
 .select-view {
   height: 60rpx;
   line-height: 60rpx;
-  background: #cc6031;
+  background: #005033;
   color: #FFF;
   text-align: center;
   font-size: 36rpx;
@@ -102,7 +102,7 @@ page{
   line-height: 60rpx;
   width: 150rpx;
   border-radius: 10rpx;
-  background: #cc6031;
+  background: #005033;
   text-align: center;
   color: #FFF;
 }
@@ -127,7 +127,7 @@ page{
 .getPiano{
   height: 48rpx;
   line-height: 48rpx;
-  background: #cc6031;
+  background: #005033;
   color: #FFF;
   text-align: center;
   padding: 15rpx;

+ 1 - 1
pages/student/student.wxss

@@ -161,7 +161,7 @@ image{
   width: 700rpx;
   height: 900rpx;
   position: fixed;
-  top:100rpx;
+  top:50rpx;
   left: 25rpx;
   z-index: 3;
 }

+ 16 - 0
pages/targetList/targetList.js

@@ -221,6 +221,22 @@ Page({
           this.setData({ list: classItem })
 
           wx.hideLoading()
+          if(classItem.length <= 0){
+            wx.showModal({
+              title: '提示',
+              content: '暂无目标课程',
+              showCancel: false, //是否显示取消按钮
+              cancelText: "否", //默认是“取消”
+              cancelColor: '#999999', //取消文字的颜色
+              confirmText: "确定", //默认是“确定”
+              // confirmColor: 'skyblue', //确定文字的颜色
+              success(){
+                wx.navigateBack({
+                  delta: 1,
+                })
+              }
+            })
+          }
         }
 
       })

+ 1 - 1
pages/targetList/targetList.wxss

@@ -8,7 +8,7 @@
   position: fixed;
   bottom: 40rpx;
   left: 50%;
-  background: #cc6031;
+  background: #005033;
   margin-left: -200rpx;
   border-radius: 50rpx;
 }

+ 1 - 1
pages/theClasses/theClasses.wxss

@@ -12,7 +12,7 @@ page{
   line-height: 60rpx;
   width: 750rpx;
   color: #FFF;
-  background: #cc6031;
+  background: #005033;
   text-align: center;
   font-size: 36rpx;
 }

+ 2 - 2
utils/urls.js

@@ -1,7 +1,7 @@
-// const baseUrl = 'https://demo.schoolwisdoms.com';
+const baseUrl = 'https://demo.schoolwisdoms.com';
 // const baseUrl = 'https://app.schoolwisdoms.com';
 
-const baseUrl = 'http://192.168.2.103';
+// const baseUrl = 'http://192.168.2.103';
 
 const ssoBase = baseUrl + '/sso';
 const platformBase = baseUrl + '/admin';