lex-xin 5 anni fa
parent
commit
121b5fddea
41 ha cambiato i file con 161 aggiunte e 51 eliminazioni
  1. 0 1
      dist/css/PeriodAdjust.44b41ae7.css
  2. 1 0
      dist/css/PeriodAdjust.6621016f.css
  3. 0 0
      dist/css/PeriodAdjust~PeriodChange.c57beb2b.css
  4. 1 0
      dist/css/PeriodChange.a91ed740.css
  5. 0 1
      dist/css/PeriodChange.d09c7553.css
  6. 0 1
      dist/css/VIPApply.6080d9bb.css
  7. 1 0
      dist/css/VIPApply.e672a445.css
  8. 0 0
      dist/index.html
  9. 0 0
      dist/js/Approval.69425322.js
  10. 0 0
      dist/js/Approval.69425322.js.map
  11. 0 0
      dist/js/Approval~Attendance~IStarted~Leave~PeriodAdjust~PeriodChange~VIPApply.8c56d61c.js.map
  12. 0 0
      dist/js/Approval~Attendance~IStarted~Leave~PeriodAdjust~PeriodChange~VIPApply.e1b5a518.js
  13. 0 0
      dist/js/Approval~Attendance~IStarted~Leave~PeriodAdjust~PeriodChange~VIPApply.e1b5a518.js.map
  14. 0 0
      dist/js/Attendance.d1114a18.js
  15. 0 0
      dist/js/Attendance.d1114a18.js.map
  16. 0 0
      dist/js/IStarted.e247a849.js
  17. 0 0
      dist/js/IStarted.e247a849.js.map
  18. 0 0
      dist/js/Leave.b88bea49.js
  19. 0 0
      dist/js/Leave.b88bea49.js.map
  20. 0 0
      dist/js/PeriodAdjust.51875e88.js
  21. 0 0
      dist/js/PeriodAdjust.51875e88.js.map
  22. 0 0
      dist/js/PeriodAdjust.8ebb2ef4.js
  23. 0 0
      dist/js/PeriodAdjust.8ebb2ef4.js.map
  24. 0 0
      dist/js/PeriodAdjust~PeriodChange.2ae65cf1.js
  25. 0 0
      dist/js/PeriodAdjust~PeriodChange.2ae65cf1.js.map
  26. 0 0
      dist/js/PeriodAdjust~PeriodChange.997c5b7f.js
  27. 0 0
      dist/js/PeriodAdjust~PeriodChange.997c5b7f.js.map
  28. 0 0
      dist/js/PeriodChange.34314ada.js
  29. 0 0
      dist/js/PeriodChange.34314ada.js.map
  30. 0 2
      dist/js/PeriodChange.b21f744c.js
  31. 0 0
      dist/js/PeriodChange.b21f744c.js.map
  32. 0 0
      dist/js/VIPApply.15d0c543.js.map
  33. 0 0
      dist/js/VIPApply.d2f1f3ca.js
  34. 0 0
      dist/js/VIPApply.d2f1f3ca.js.map
  35. 0 0
      dist/js/app.c0b005de.js
  36. 0 0
      dist/js/app.c0b005de.js.map
  37. 3 2
      src/common/axios.js
  38. 8 8
      src/components/MCalendar.vue
  39. 29 14
      src/views/teacher/PeriodAdjust.vue
  40. 109 18
      src/views/teacher/PeriodChange.vue
  41. 9 4
      src/views/teacher/VIPApply.vue

+ 0 - 1
dist/css/PeriodAdjust.44b41ae7.css

@@ -1 +0,0 @@
-.periodadjust[data-v-696cd78c]{min-height:100vh;position:relative}.periodadjust .container[data-v-696cd78c]{min-height:calc(100vh - 60px)}.periodadjust .button-group[data-v-696cd78c]{width:100%;position:absolute;bottom:0;left:0}.periodadjust .button-group .van-button[data-v-696cd78c]{font-size:.16rem;width:50%}.periodadjust .button-group .van-button--primary[data-v-696cd78c]{background:#14928a}[data-v-696cd78c] .van-cell__title{font-size:.16rem;color:#444}[data-v-696cd78c] .van-cell-group{margin-top:.05rem}.title-content[data-v-696cd78c]{-webkit-box-flex:1;-ms-flex:1 auto;flex:1 auto;font-weight:700}.title-content .van-cell__label[data-v-696cd78c]{font-weight:400;margin-top:.06rem;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.title-content .van-icon-location[data-v-696cd78c]{margin-right:.05rem}[data-v-696cd78c] .van-cell__label,[data-v-696cd78c] .van-cell__value{color:#777;font-size:.14rem}[data-v-696cd78c] .van-cell__label span,[data-v-696cd78c] .van-cell__value span{padding-right:.1rem}.input-cell[data-v-696cd78c]{padding:.12rem .16rem .2rem}.input-cell .van-radio[data-v-696cd78c]{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}[data-v-696cd78c] .van-radio__icon .van-icon{border-color:#aaa}[data-v-696cd78c] .van-radio__icon--checked .van-icon{background:#f97215;border-color:#f97215}[data-v-696cd78c] .icon{margin-top:.2rem}

+ 1 - 0
dist/css/PeriodAdjust.6621016f.css

@@ -0,0 +1 @@
+.periodadjust[data-v-7805fa1e]{min-height:100vh;position:relative}.periodadjust .container[data-v-7805fa1e]{height:calc(100vh - 50px);overflow-y:auto;overflow-x:hidden}.periodadjust .button-group[data-v-7805fa1e]{width:100%;position:absolute;bottom:0;left:0}.periodadjust .button-group .van-button[data-v-7805fa1e]{font-size:.16rem;width:50%}.periodadjust .button-group .van-button--primary[data-v-7805fa1e]{background:#14928a}[data-v-7805fa1e] .van-cell__title{font-size:.16rem;color:#444}[data-v-7805fa1e] .van-cell-group{margin-top:.05rem}.title-content[data-v-7805fa1e]{-webkit-box-flex:1;-ms-flex:1 auto;flex:1 auto;font-weight:700}.title-content .van-cell__label[data-v-7805fa1e]{font-weight:400;margin-top:.06rem;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.title-content .van-icon-location[data-v-7805fa1e]{margin-right:.05rem}[data-v-7805fa1e] .van-cell__label,[data-v-7805fa1e] .van-cell__value{color:#777;font-size:.14rem}[data-v-7805fa1e] .van-cell__label span,[data-v-7805fa1e] .van-cell__value span{padding-right:.1rem}.input-cell[data-v-7805fa1e]{padding:.12rem .16rem .2rem}.input-cell .van-radio[data-v-7805fa1e]{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}[data-v-7805fa1e] .van-radio__icon .van-icon{border-color:#aaa}[data-v-7805fa1e] .van-radio__icon--checked .van-icon{background:#f97215;border-color:#f97215}[data-v-7805fa1e] .icon{margin-top:.2rem}

File diff suppressed because it is too large
+ 0 - 0
dist/css/PeriodAdjust~PeriodChange.c57beb2b.css


+ 1 - 0
dist/css/PeriodChange.a91ed740.css

@@ -0,0 +1 @@
+.periodchange[data-v-3f666941]{min-height:100vh;position:relative}.periodchange .container[data-v-3f666941]{height:calc(100vh - 50px);overflow-y:auto;overflow-x:hidden}.periodchange .button-group[data-v-3f666941]{width:100%;position:absolute;bottom:0;left:0}.periodchange .button-group .van-button--primary[data-v-3f666941]{background:#14928a}[data-v-3f666941] .van-cell__title{font-size:.16rem;color:#444}[data-v-3f666941] .van-cell-group{margin-top:.05rem}.title-content[data-v-3f666941]{font-weight:700}.title-content .van-cell__label[data-v-3f666941]{font-weight:400;margin-top:.06rem;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.title-content .van-icon-location[data-v-3f666941]{margin-right:.05rem}[data-v-3f666941] .van-cell__label,[data-v-3f666941] .van-cell__value{color:#777}[data-v-3f666941] .van-cell__label span,[data-v-3f666941] .van-cell__value span{padding-right:.1rem}.input-cell[data-v-3f666941]{padding:.12rem .16rem .2rem}.input-cell .van-radio[data-v-3f666941]{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}[data-v-3f666941] .van-radio__icon .van-icon{border-color:#aaa}[data-v-3f666941] .van-radio__icon--checked .van-icon{background:#f97215;border-color:#f97215}[data-v-3f666941] .icon{margin-top:.2rem}

+ 0 - 1
dist/css/PeriodChange.d09c7553.css

@@ -1 +0,0 @@
-[data-v-39898267] .van-cell__title{font-size:.16rem;color:#444}[data-v-39898267] .van-cell-group{margin-top:.05rem}.title-content[data-v-39898267]{font-weight:700}.title-content .van-cell__label[data-v-39898267]{font-weight:400;margin-top:.06rem;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.title-content .van-icon-location[data-v-39898267]{margin-right:.05rem}[data-v-39898267] .van-cell__label,[data-v-39898267] .van-cell__value{color:#777}[data-v-39898267] .van-cell__label span,[data-v-39898267] .van-cell__value span{padding-right:.1rem}

+ 0 - 1
dist/css/VIPApply.6080d9bb.css

@@ -1 +0,0 @@
-.vip-title[data-v-54c8f25b]{padding:.06rem 0 .04rem;font-size:.12rem;color:#444;text-align:center}.add-plan[data-v-54c8f25b]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;padding:.2rem 0;font-size:.16rem;color:#777}.add-plan .van-icon[data-v-54c8f25b]{margin-right:.05rem;font-size:.2rem}.title-time[data-v-54c8f25b]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-flex:1;-ms-flex:1 auto;flex:1 auto;color:#4a4a4a}.title-time .online[data-v-54c8f25b]{color:#777}.title-time .week[data-v-54c8f25b]{padding-left:.4rem;padding-right:.15rem}[data-v-54c8f25b] .van-cell__value,[data-v-54c8f25b] .van-field__label{-webkit-box-flex:1;-ms-flex:1 auto;flex:1 auto}[data-v-54c8f25b] .van-field__control:disabled{color:#6a6969}.button-group[data-v-54c8f25b]{margin:.3rem .26rem .2rem}.button-group .van-button--primary[data-v-54c8f25b]{background:#14928a;font-size:.18rem}.van-row[data-v-54c8f25b]{line-height:.4rem;border-top:1px solid #edeef0;text-align:center;font-size:.14rem}.van-row[data-v-54c8f25b]:first-child{border-top:0;background:#edeef0;color:#444;font-size:.15rem}.tableContainer[data-v-54c8f25b]{max-height:2.44rem;overflow:auto}.tableContainer .van-row[data-v-54c8f25b]{color:#444}.tableContainer .van-row[data-v-54c8f25b]:first-child{border-top:0;background:#fff;font-size:.14rem}

+ 1 - 0
dist/css/VIPApply.e672a445.css

@@ -0,0 +1 @@
+.vip-title[data-v-20315a8d]{padding:.06rem 0 .04rem;font-size:.12rem;color:#444;text-align:center}.add-plan[data-v-20315a8d]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;padding:.2rem 0;font-size:.16rem;color:#777}.add-plan .van-icon[data-v-20315a8d]{margin-right:.05rem;font-size:.2rem}.title-time[data-v-20315a8d]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-flex:1;-ms-flex:1 auto;flex:1 auto;color:#4a4a4a}.title-time .online[data-v-20315a8d]{color:#777}.title-time .week[data-v-20315a8d]{padding-left:.4rem;padding-right:.15rem}[data-v-20315a8d] .van-cell__value,[data-v-20315a8d] .van-field__label{-webkit-box-flex:1;-ms-flex:1 auto;flex:1 auto}[data-v-20315a8d] .van-field__control:disabled{color:#6a6969}.button-group[data-v-20315a8d]{margin:.3rem .26rem .2rem}.button-group .van-button--primary[data-v-20315a8d]{background:#14928a;font-size:.18rem}.van-row[data-v-20315a8d]{line-height:.4rem;border-top:1px solid #edeef0;text-align:center;font-size:.14rem}.van-row[data-v-20315a8d]:first-child{border-top:0;background:#edeef0;color:#444;font-size:.15rem}.tableContainer[data-v-20315a8d]{max-height:2.44rem;overflow:auto}.tableContainer .van-row[data-v-20315a8d]{color:#444}.tableContainer .van-row[data-v-20315a8d]:first-child{border-top:0;background:#fff;font-size:.14rem}

File diff suppressed because it is too large
+ 0 - 0
dist/index.html


File diff suppressed because it is too large
+ 0 - 0
dist/js/Approval.69425322.js


File diff suppressed because it is too large
+ 0 - 0
dist/js/Approval.69425322.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/js/Approval~Attendance~IStarted~Leave~PeriodAdjust~PeriodChange~VIPApply.8c56d61c.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/js/Approval~Attendance~IStarted~Leave~PeriodAdjust~PeriodChange~VIPApply.e1b5a518.js


File diff suppressed because it is too large
+ 0 - 0
dist/js/Approval~Attendance~IStarted~Leave~PeriodAdjust~PeriodChange~VIPApply.e1b5a518.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/js/Attendance.d1114a18.js


File diff suppressed because it is too large
+ 0 - 0
dist/js/Attendance.d1114a18.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/js/IStarted.e247a849.js


File diff suppressed because it is too large
+ 0 - 0
dist/js/IStarted.e247a849.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/js/Leave.b88bea49.js


File diff suppressed because it is too large
+ 0 - 0
dist/js/Leave.b88bea49.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/js/PeriodAdjust.51875e88.js


File diff suppressed because it is too large
+ 0 - 0
dist/js/PeriodAdjust.51875e88.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/js/PeriodAdjust.8ebb2ef4.js


File diff suppressed because it is too large
+ 0 - 0
dist/js/PeriodAdjust.8ebb2ef4.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/js/PeriodAdjust~PeriodChange.2ae65cf1.js


File diff suppressed because it is too large
+ 0 - 0
dist/js/PeriodAdjust~PeriodChange.2ae65cf1.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/js/PeriodAdjust~PeriodChange.997c5b7f.js


File diff suppressed because it is too large
+ 0 - 0
dist/js/PeriodAdjust~PeriodChange.997c5b7f.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/js/PeriodChange.34314ada.js


File diff suppressed because it is too large
+ 0 - 0
dist/js/PeriodChange.34314ada.js.map


+ 0 - 2
dist/js/PeriodChange.b21f744c.js

@@ -1,2 +0,0 @@
-(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["PeriodChange"],{2781:function(t,e,a){"use strict";var n=a("6c91"),o=a.n(n);o.a},"6c91":function(t,e,a){},e9f9:function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"periodchange"},[a("m-header"),t.isCalendar?a("m-calendar",{attrs:{dataList:t.getMonthDay},on:{onSelectDay:t.onSelectDay}}):t._e(),t._l(5,function(e){return a("van-cell-group",{key:e},[a("van-cell",{attrs:{icon:"underway-o",center:!0}},[a("template",{slot:"default"},[t._v("未签到")]),a("template",{slot:"title"},[t._v("15:00-15:45")])],2),a("van-cell",{attrs:{"title-class":"title-content",center:!0}},[a("template",{slot:"title"},[t._v("【乐团课】乐理知识(一)")]),a("template",{slot:"label"},[a("van-icon",{attrs:{name:"location"}}),t._v("\n                武汉市武昌区哈吃几口茶")],1)],2)],1)})],2)},o=[],r=(a("ac6a"),a("6e6e")),c=a("47ad"),s=a("d678"),i=a("9afb"),l={name:"periodchange",components:{MHeader:r["a"],MCalendar:c["a"],MEmpty:s["a"]},data:function(){return{getMonthDay:[],isCalendar:!1}},mounted:function(){var t=this.getFormartDate(new Date);this.getCourseDate(t),this.getCourseMonth(t)},methods:{onSelectDay:function(t){this.getCourseDate(this.getFormartDate(t))},getCourseDate:function(t){var e=this;Object(i["h"])({date:t,type:"VIP"}).then(function(t){var a=t.data;200==a.code&&a.data&&(e.dataList=a.data.rows,e.dataShow=a.data.rows.length>0)})},getCourseMonth:function(t){var e=this;Object(i["g"])({month:t,type:"VIP"}).then(function(t){var a=t.data;200==a.code&&(a.data.forEach(function(t){var a=new Date(t);e.getMonthDay.push(a.getDate())}),e.isCalendar=!0)})},getFormartDate:function(t){var e=new Date(t),a=e.getFullYear()+"-"+(e.getMonth()+1)+"-"+e.getDate();return a}}},u=l,d=(a("2781"),a("2877")),h=Object(d["a"])(u,n,o,!1,null,"39898267",null);e["default"]=h.exports}}]);
-//# sourceMappingURL=PeriodChange.b21f744c.js.map

File diff suppressed because it is too large
+ 0 - 0
dist/js/PeriodChange.b21f744c.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/js/VIPApply.15d0c543.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/js/VIPApply.d2f1f3ca.js


File diff suppressed because it is too large
+ 0 - 0
dist/js/VIPApply.d2f1f3ca.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/js/app.c0b005de.js


File diff suppressed because it is too large
+ 0 - 0
dist/js/app.c0b005de.js.map


+ 3 - 2
src/common/axios.js

@@ -56,11 +56,12 @@ _axios.interceptors.response.use(
     // Do something with response data
     if(response.data.code == 403 || response.data.code == 403) {
       window.localStorage.removeItem('userInfo') // 删除用户信息
+      window.localStorage.removeItem('Authorization') // 删除用户信息
       // android ios 注册方法
       if(browser().android) {
-          DAYA.postMessage(JSON.stringify({api: 'back'}))
+          DAYA.postMessage(JSON.stringify({api: 'login'}))
       } else if(browser().iPhone) {
-          window.webkit.messageHandlers.DAYA.postMessage(JSON.stringify({api: 'back'}))
+          window.webkit.messageHandlers.DAYA.postMessage(JSON.stringify({api: 'login'}))
       }
     }
     return response;

+ 8 - 8
src/components/MCalendar.vue

@@ -156,14 +156,14 @@ export default {
                     tDisabled = 1
                 }
             }
-            let noCheck = true // 是否可以选中
-            if(this.dataList.length > 0) {
-                this.dataList.forEach(item => {
-                    if(item == d) {
-                        noCheck = false
-                    }
-                })
-            }
+            let noCheck = false // 是否可以选中
+            // if(this.dataList.length > 0) {
+            //     this.dataList.forEach(item => {
+            //         if(item == d) {
+            //             noCheck = false
+            //         }
+            //     })
+            // }
             return {
                 dayNum: d,
                 monthType: f,

+ 29 - 14
src/views/teacher/PeriodAdjust.vue

@@ -1,15 +1,16 @@
 <template>
     <div class="periodadjust">
-        <div class="container">
+        <div :class="[dataShow ? 'container' : '']">
             <m-header />
-            <m-calendar v-if="isCalendar" :dataList="getMonthDay" @onSelectDay="onSelectDay" />
+            <m-calendar @onSelectDay="onSelectDay" />
             <van-radio-group v-if="dataShow" key="data" v-model="radioSelect">
                 <van-cell-group v-for="(item, index) in dataList" :key="index">
-                    <van-cell icon="underway-o" :center="true" @click="onCheckRadio(item.id)">
-                        <template slot="default"><span>到课:{{item.studentNum}}/{{item.totalStudentNum}}</span><span>请假:{{item.leaveStudentNum}}</span></template>
+                    <van-cell icon="underway-o" :center="true" @click="onCheckRadio(item)">
+                        <!-- <template slot="default"><span>到课:{{item.studentNum}}/{{item.totalStudentNum}}</span><span>请假:{{item.leaveStudentNum}}</span></template> -->
+                        <template slot="default">{{ item.signInStatus ? '已签到' : '未签到' }}</template>
                         <template slot="title">{{item.startClassTime | formatDate}}-{{item.endClassTime | formatDate}}</template>
                     </van-cell>
-                    <van-cell class="input-cell" title-class="title-content" :center="true" @click="onCheckRadio(item.id)">
+                    <van-cell class="input-cell" title-class="title-content" :center="true" @click="onCheckRadio(item)">
                         <template slot="default">
                             <van-radio ref="radioes" :disabled="radioDisabled" :name="item.id"></van-radio>
                         </template>
@@ -53,30 +54,30 @@ export default {
                 currentDate: new Date()
             },
             radioSelect: null,
+            radioSelectList: [], // 选中的列表
             dataList: [],
             dataShow: true, // 是否有数据
-            getMonthDay: [], // 当月有课的日期
-            isCalendar: false,
             radioDisabled: true, // 今天或今天之前的数据禁用
         }
     },
     mounted() {
         let toDay = this.getFormartDate(new Date())
         this.getCourseDate(toDay)
-        this.getCourseMonth(toDay)
+        // this.getCourseMonth(toDay)
     },
     methods: {
         onSelectDay(value) {
-            if(new Date(this.getFormartDate(new Date()) >= new Date(this.getFormartDate(value)))) {
+            if(new Date(this.getFormartDate(new Date())) >= new Date(this.getFormartDate(value))) {
                 this.radioDisabled = true
             } else {
                 this.radioDisabled = false
-                this.getCourseDate(this.getFormartDate(value))
             }
+            this.getCourseDate(this.getFormartDate(value))
         },
-        onCheckRadio(id) { // 单选按钮选中
+        onCheckRadio(item) { // 单选按钮选中
             if(this.radioDisabled) return
-            this.radioSelect = id
+            this.radioSelect = item.id
+            this.radioSelectList = item
         },
         getCourseMonth(month) {
             getCourseScheduleDateByMonth({ month: month, type: 'VIP' }).then(res => {
@@ -104,9 +105,19 @@ export default {
                 this.$toast('请选择需要交换的课程')
                 return
             }
+            let dataInfo = this.radioSelectList
+            let classDate = dataInfo.classDate.split(' ')[0]
+            let startTime = dataInfo.startClassTime.split(' ')[1]
+
             // 确认选择
             this.$router.push({
-                path: '/PeriodChange'
+                path: '/PeriodChange',
+                query: {
+                    checkId: this.radioSelect,
+                    classDate: classDate,
+                    startTime: startTime,
+                    name: dataInfo.name
+                }
             })
         },
         getFormartDate(date) {
@@ -149,6 +160,8 @@ export default {
                     this.$toast('调整成功')
                     if(browser().iPhone) {
                         window.webkit.messageHandlers.DAYA.postMessage(JSON.stringify({api: 'back'}))
+                    } else if(browser().android) {
+                        DAYA.postMessage(JSON.stringify({api: 'back'}))
                     } else {
                         this.$router.push('/business')
                     }
@@ -186,7 +199,9 @@ export default {
     min-height: 100vh;
     position: relative;
     .container {
-        min-height: calc(100vh - 60px);
+        height: calc(100vh - 50px);
+        overflow-y: auto;
+        overflow-x: hidden;
     }
     .button-group {
         width: 100%;

+ 109 - 18
src/views/teacher/PeriodChange.vue

@@ -1,46 +1,70 @@
 <template>
     <div class="periodchange">
-        <m-header />
-        <m-calendar v-if="isCalendar" :dataList="getMonthDay" @onSelectDay="onSelectDay" />
+        <div :class="[dataShow ? 'container' : '']">
+            <m-header />
+            <m-calendar @onSelectDay="onSelectDay" />
+            
+            <van-radio-group v-if="dataShow" key="data" v-model="radioSelect">
+                <van-cell-group v-for="(item, index) in dataList" :key="index">
+                    <van-cell icon="underway-o" :center="true" @click="onCheckRadio(item)">
+                        <template slot="default">{{ item.signInStatus ? '已签到' : '未签到' }}</template>
+                        <template slot="title">{{item.startClassTime | formatDate}}-{{item.endClassTime | formatDate}}</template>
+                    </van-cell>
+                    <van-cell class="input-cell" title-class="title-content" :center="true" @click="onCheckRadio(item)">
+                        <template slot="default">
+                            <van-radio ref="radioes" :disabled="radioDisabled" :name="item.id"></van-radio>
+                        </template>
+                        <template slot="title">{{ item.name }}</template>
+                        <template slot="label">主讲老师:{{ item.teacherName }}</template>
+                    </van-cell>
+                </van-cell-group>
+            </van-radio-group>
+            <m-empty v-else key="data" />
 
-        <van-cell-group v-for="i in 5" :key="i">
-            <van-cell icon="underway-o" :center="true">
-                <template slot="default">未签到</template>
-                <template slot="title">15:00-15:45</template>
-            </van-cell>
-            <van-cell title-class="title-content" :center="true">
-                <template slot="title">【乐团课】乐理知识(一)</template>
-                <template slot="label">
-                    <van-icon name="location" />
-                    武汉市武昌区哈吃几口茶</template>
-            </van-cell>
-        </van-cell-group>
+            <div class="button-group" v-if="dataShow">
+                <van-button type="primary" @click="onChangeClass" size="large">确认交换</van-button>
+            </div>
+        </div>
     </div>
 </template>
 <script>
 import MHeader from '@/components/MHeader'
 import MCalendar from '@/components/MCalendar'
 import MEmpty from '@/components/MEmpty'
+import { browser }  from '@/common/common'
 import { getCourseSchedulesWithDate, 
-    getCourseScheduleDateByMonth } from '@/api/teacher'
+    getCourseScheduleDateByMonth, courseSwap } from '@/api/teacher'
 export default {
     name: 'periodchange',
     components: { MHeader, MCalendar, MEmpty },
     data() {
         return {
-            getMonthDay: [], // 当月有课的日期
-            isCalendar: false,
+            dataShow: true,
+            dataList: [],
+            radioSelect: null,
+            radioSelectList: [], // 选中的列表
+            radioDisabled: true, // 今天或今天之前的数据禁用
         }
     },
     mounted() {
         let toDay = this.getFormartDate(new Date())
         this.getCourseDate(toDay)
-        this.getCourseMonth(toDay)
+        // this.getCourseMonth(toDay)
     },
     methods: {
         onSelectDay(value) {
+            if(new Date(this.getFormartDate(new Date())) >= new Date(this.getFormartDate(value))) {
+                this.radioDisabled = true
+            } else {
+                this.radioDisabled = false
+            }
             this.getCourseDate(this.getFormartDate(value))
         },
+        onCheckRadio(item) { // 单选按钮选中
+            if(this.radioDisabled) return
+            this.radioSelect = item.id
+            this.radioSelectList = item
+        },
         getCourseDate(date) {
             getCourseSchedulesWithDate({ date: date, type: 'VIP' }).then(res => {
                 let result = res.data
@@ -67,11 +91,62 @@ export default {
             let checkDay = checkDate.getFullYear() + '-' + (checkDate.getMonth() + 1) + '-' + checkDate.getDate()
             return checkDay
         },
+        onChangeClass() {
+            let item = this.radioSelectList,
+                params = this.$route.query,
+                classTime = item.classDate.split(' ')[0],
+                startTime = item.startClassTime.split(' ')[1]
+            let firstClass = params.classDate + ' ' + params.name + ' ' + startTime + '<br/>与'
+            let lastClass = classTime + ' ' + item.name + ' ' + startTime + '<br/>上课时间互换'
+            this.$dialog.confirm({
+                message:  firstClass + lastClass
+            }).then(() => {
+                courseSwap({
+                    courseScheduleId1: params.checkId,
+                    courseScheduleId2: item.id
+                }).then(res => {
+                    let result = res.data
+                    if(result.code == 200) {
+                        this.$toast('交换成功')
+                        if(browser().iPhone) {
+                            window.webkit.messageHandlers.DAYA.postMessage(JSON.stringify({api: 'back'}))
+                        } else if(browser().android) {
+                            DAYA.postMessage(JSON.stringify({api: 'back'}))
+                        } else {
+                            this.$router.push('/business')
+                        }
+                    } else {
+                        this.$toast(result.msg)
+                    }
+                })
+            }).catch(() => {
+                // on cancel
+            });
+        },
     }
 }
 </script>
 <style lang='less' scoped>
 @import url("../../assets/commonLess/variable.less");
+.periodchange {
+    min-height: 100vh;
+    position: relative;
+    .container {
+        height: calc(100vh - 50px);
+        overflow-y: auto;
+        overflow-x: hidden;
+    }
+
+    .button-group {
+        width: 100%;
+        position: absolute;
+        bottom: 0;
+        left: 0;
+        .van-button--primary {
+            background: @mColor;
+        }
+    }
+}
 /deep/.van-cell__title {
     font-size: .16rem;
     color: @mFontColor;
@@ -101,4 +176,20 @@ export default {
     }
 }
 
+.input-cell {
+    padding: .12rem .16rem .2rem;
+    .van-radio {
+        justify-content: flex-end;
+    }
+}
+/deep/.van-radio__icon .van-icon {
+    border-color: @sFontColor;
+}
+/deep/.van-radio__icon--checked .van-icon {
+    background: @orangeColor;
+    border-color: @orangeColor;
+}
+/deep/.icon {
+    margin-top: .2rem;
+}
 </style>

+ 9 - 4
src/views/teacher/VIPApply.vue

@@ -540,7 +540,6 @@ export default {
             }
             let totalCount = Number(online) + Number(offline)
             let dateOperation  = new Date(form.courseStart)
-            let tempI = 0
             while(totalCount && totalCount > 0) {
                 for(let i = 0; i < scheduleList.length; i++) {
                     if (online == 0 && offline == 0) break
@@ -590,8 +589,8 @@ export default {
                 vcs = loadData.vipGroupCategorySelect, // 课程形式
                 tc = loadData.teacherCategory, // 老师基本信息
                 oncn = form.onlineClassesNums ? form.onlineClassesNums : 0, // 线上课次数
-                offcn = form.offlineClassesNums ? form.offlineClassesNums : 0, // 线下课次数
-                giveTeachMode = form.giveTeachMode // 线下或线下
+                offcn = form.offlineClassesNums ? form.offlineClassesNums : 0 // 线下课次数
+                // giveTeachMode = form.giveTeachMode // 线下或线下
             // 优惠活动
             // ...
             if(vas.salarySettlementJson) {
@@ -793,7 +792,13 @@ export default {
                     if(browser().iPhone) {
                         window.webkit.messageHandlers.DAYA.postMessage(JSON.stringify({api: 'back'}))
                     } else {
-                        this.$router.push('/business')
+                        if(browser().iPhone) {
+                            window.webkit.messageHandlers.DAYA.postMessage(JSON.stringify({api: 'back'}))
+                        } else if(browser().android) {
+                            DAYA.postMessage(JSON.stringify({api: 'back'}))
+                        } else {
+                            this.$router.push('/business')
+                        }
                     }
                 } else {
                     this.$toast(result.msg)

Some files were not shown because too many files changed in this diff