1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["PeriodChange"],{5609:function(t,e,a){},"74f9":function(t,e,a){"use strict";var s=a("5609"),n=a.n(s);n.a},e9f9:function(t,e,a){"use strict";a.r(e);var s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"periodchange"},[a("div",{class:[t.dataShow?"container":""]},[a("m-calendar",{attrs:{dayList:t.getMonthDay},on:{onSelectDay:t.onSelectDay,onChangeMonth:t.onChangeMonth}}),t.dataShow?a("van-radio-group",{key:"data",staticClass:"cellList",model:{value:t.radioSelect,callback:function(e){t.radioSelect=e},expression:"radioSelect"}},t._l(t.dataList,function(e,s){return a("van-cell-group",{key:s},[a("van-cell",{staticClass:"titleCell",on:{click:function(a){return t.onCheckRadio(e)}}},[a("template",{slot:"default"},[a("div",{staticClass:"signImgBox"},[a("img",{staticClass:"signImg",attrs:{src:t.getSignInIcon(e.isSignIn),alt:""}})])]),a("template",{slot:"title"},[a("div",{staticClass:"classTitleWrap",staticStyle:{"word-break":"break-all"}},[a("img",{staticClass:"teacherModelImg",attrs:{src:t.getTeacherImg(e.teachMode),alt:""}}),a("img",{staticClass:"courseImg",attrs:{src:t.squrtList.squrt2,alt:""}}),t._v("\n "+t._s(e.name)+"\n ")])])],2),a("van-cell",[a("template",{slot:"title"},[e.schoolName?a("p",{staticClass:"studentTitle",staticStyle:{"word-break":"break-all"}},[t._v("\n 上课地点 : "+t._s(e.schoolName)+"\n ")]):t._e(),a("p",{staticClass:"studentTitle",staticStyle:{"word-break":"break-all"}},[t._v("\n 上课学生 : "+t._s(e.studentNames)+"\n ")])])],2),a("van-cell",{staticClass:"input-cell",attrs:{"title-class":"title-content","value-class":"value-content",center:!0},on:{click:function(a){return t.onCheckRadio(e)}}},[a("template",{slot:"title"},[a("div",{staticClass:"chioseWrap"},[a("img",{staticClass:"clockIcon",attrs:{src:t.squrtList.squrt8,alt:""}}),a("p",{staticClass:"timer"},[t._v("\n "+t._s(t._f("formatDate")(e.startClassTime))+"-"+t._s(t._f("formatDate")(e.endClassTime))+"\n ")])])]),a("template",{slot:"default"},[a("van-radio",{ref:"radioes",refInFor:!0,attrs:{disabled:t.radioDisabled,name:e.id}})],1)],2)],1)}),1):a("m-empty",{key:"data"})],1),t.dataShow?a("van-sticky",[a("div",{staticClass:"button-group"},[a("van-button",{attrs:{type:"primary",size:"large"},on:{click:t.onChangeClass}},[t._v("确认交换")])],1)]):t._e()],1)},n=[],r=a("a34a"),i=a.n(r),o=a("47ad"),c=a("d678"),l=a("5a0c"),u=a.n(l),d=a("ff51"),h=a("9afb"),f=a("3908");function g(t,e,a,s,n,r,i){try{var o=t[r](i),c=o.value}catch(l){return void a(l)}o.done?e(c):Promise.resolve(c).then(s,n)}function m(t){return function(){var e=this,a=arguments;return new Promise(function(s,n){var r=t.apply(e,a);function i(t){g(r,s,n,i,o,"next",t)}function o(t){g(r,s,n,i,o,"throw",t)}i(void 0)})}}var p={name:"periodchange",components:{MCalendar:o["a"],MEmpty:c["a"]},data:function(){return{dataShow:!0,dataList:[],radioSelect:null,radioSelectList:[],radioDisabled:!0,getMonthDay:[],squrtList:{squrt2:a("8b84"),squrt3:a("c040"),squrt4:a("5fcb"),squrt5:a("261c"),squrt6:a("5dc1"),squrt7:a("1367"),squrt8:a("430b")}}},created:function(){},mounted:function(){var t=this.$route.query;t.Authorization&&(localStorage.setItem("Authorization",decodeURI(t.Authorization)),localStorage.setItem("userInfo",decodeURI(t.Authorization))),document.title="课程交换";var e=this.getFormartDate(new Date);this.getCourseMonth(e),this.getCourseDate(e)},methods:{onSelectDay:function(t){new Date(this.getFormartDate(new Date))>=new Date(this.getFormartDate(t))?this.radioDisabled=!0:this.radioDisabled=!1,this.getCourseDate(this.getFormartDate(t))},onChangeMonth:function(t){this.getCourseMonth(u()(t).format("YYYY-MM-DD"))},getCourseMonth:function(){var t=m(i.a.mark(function t(e){var a=this;return i.a.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return Object(f["a"])(!0),t.prev=1,t.next=4,Object(h["p"])({month:e,type:"VIP"}).then(function(t){var e=t.data;200==e.code&&(a.getMonthDay=[],e.data.forEach(function(t){a.getMonthDay.push(u()(t).format("DD"))}),a.isCalendar=!0)});case 4:Object(f["a"])(!1),t.next=10;break;case 7:t.prev=7,t.t0=t["catch"](1),Object(f["a"])(!1);case 10:case"end":return t.stop()}},t,null,[[1,7]])}));function e(e){return t.apply(this,arguments)}return e}(),onCheckRadio:function(t){this.radioDisabled||(this.radioSelect=t.id,this.radioSelectList=t)},getCourseDate:function(){var t=m(i.a.mark(function t(e){var a=this;return i.a.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return Object(f["a"])(!0),t.prev=1,t.next=4,Object(h["q"])({date:e,type:"VIP"}).then(function(t){var e=t.data;200==e.code&&e.data&&(a.dataList=e.data.rows,a.dataShow=e.data.rows.length>0)});case 4:Object(f["a"])(!1),t.next=10;break;case 7:t.prev=7,t.t0=t["catch"](1),Object(f["a"])(!1);case 10:case"end":return t.stop()}},t,null,[[1,7]])}));function e(e){return t.apply(this,arguments)}return e}(),getFormartDate:function(t){var e=new Date(t),a=e.getFullYear()+"-"+(e.getMonth()+1)+"-"+e.getDate();return a},onChangeClass:function(){var t=this,e=this.radioSelectList,a=this.$route.query,s=e.classDate.split(" ")[0],n=e.startClassTime.split(" ")[1],r=a.classDate+" "+a.name+" "+a.startTime+"<br/>与",i=s+" "+e.name+" "+n+"<br/>上课时间互换";this.$dialog.confirm({message:r+i}).then(function(){Object(h["g"])({courseScheduleId1:a.checkId,courseScheduleId2:e.id}).then(function(e){var a=e.data;200==a.code?(t.$toast("交换成功"),setTimeout(function(){Object(d["b"])().iPhone?window.webkit.messageHandlers.DAYA.postMessage(JSON.stringify({api:"back"})):Object(d["b"])().android?DAYA.postMessage(JSON.stringify({api:"back"})):t.$router.push("/business")},500)):t.$toast(a.msg)})}).catch(function(){})},getSignInIcon:function(t){return 1==t?this.squrtList.squrt3:0==t?this.squrtList.squrt5:this.squrtList.squrt4},getTeacherImg:function(t){return"ONLINE"==t?this.squrtList.squrt6:this.squrtList.squrt7}}},v=p,b=(a("74f9"),a("2877")),C=Object(b["a"])(v,s,n,!1,null,"60bf45e8",null);e["default"]=C.exports}}]);
|