PeriodAdjust.7af7bdf0.js 13 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["PeriodAdjust"],{"39c3":function(t,e,r){},"87d4":function(t,e,r){"use strict";r.r(e);var n=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"periodadjust"},[r("div",{class:[t.dataShow?"container":""]},[r("m-calendar",{attrs:{dayList:t.getMonthDay},on:{onSelectDay:t.onSelectDay,onChangeMonth:t.onChangeMonth}}),t.dataShow?r("van-radio-group",{key:"data",model:{value:t.radioSelect,callback:function(e){t.radioSelect=e},expression:"radioSelect"}},t._l(t.dataList,function(e,n){return r("van-cell-group",{key:n},[r("van-cell",{attrs:{icon:"underway-o",center:!0},on:{click:function(r){return t.onCheckRadio(e)}}},[r("template",{slot:"default"},[t._v(t._s(e.signInStatus?"已签到":"未签到"))]),r("template",{slot:"title"},[t._v(t._s(t._f("formatDate")(e.startClassTime))+"-"+t._s(t._f("formatDate")(e.endClassTime)))])],2),r("van-cell",{staticClass:"input-cell",attrs:{"title-class":"title-content","value-class":"value-content",center:!0},on:{click:function(r){return t.onCheckRadio(e)}}},[r("template",{slot:"default"},[r("van-radio",{ref:"radioes",refInFor:!0,attrs:{disabled:t.radioDisabled,name:e.id}})],1),r("template",{slot:"title"},[t._v(t._s(e.name))]),r("template",{slot:"label"},[t._v(t._s(t._f("teachModeStatus")(e.teachMode))+"   主讲老师:"+t._s(e.teacherName))])],2)],1)}),1):r("m-empty",{key:"data"})],1),t.dataShow?r("van-sticky",[r("div",{staticClass:"button-group"},[r("van-button",{attrs:{type:"default",size:"large"},on:{click:t.onDateChange}},[t._v("课时调整")]),r("van-button",{attrs:{type:"primary",size:"large"},on:{click:t.onSubmit}},[t._v("去换课")])],1)]):t._e(),r("van-popup",{attrs:{position:"bottom"},model:{value:t.dataForm.status,callback:function(e){t.$set(t.dataForm,"status",e)},expression:"dataForm.status"}},[r("van-datetime-picker",{attrs:{type:"datetime","min-date":t.dataForm.minDate,"max-date":t.dataForm.maxDate,formatter:t.formatter},on:{cancel:function(e){t.dataForm.status=!1},confirm:t.onCurrentConfirm},model:{value:t.dataForm.currentDate,callback:function(e){t.$set(t.dataForm,"currentDate",e)},expression:"dataForm.currentDate"}})],1)],1)},a=[],o=r("a34a"),i=r.n(o),c=r("47ad"),s=r("d678"),u=r("5a0c"),l=r.n(u),h=r("ff51"),f=r("9afb"),d=(r("433b"),r("d399"));function p(t){t?d["a"].loading({duration:0,forbidClick:!0,message:"加载中..."}):d["a"].clear()}function m(t){return m="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},m(t)}function v(t,e,r,n,a,o,i){try{var c=t[o](i),s=c.value}catch(u){return void r(u)}c.done?e(s):Promise.resolve(s).then(n,a)}function y(t){return function(){var e=this,r=arguments;return new Promise(function(n,a){var o=t.apply(e,r);function i(t){v(o,n,a,i,c,"next",t)}function c(t){v(o,n,a,i,c,"throw",t)}i(void 0)})}}var g={name:"periodadjust",components:{MCalendar:c["a"],MEmpty:s["a"]},data:function(){return{dataForm:{status:!1,minDate:new Date(2018,0,1),maxDate:new Date(2025,10,1),currentDate:new Date},radioSelect:null,radioSelectList:[],dataList:[],dataShow:!0,radioDisabled:!0,getMonthDay:[]}},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.getCourseDate(e),this.getCourseMonth(e)},methods:{onSelectDay:function(t){new Date(this.getFormartDateIOS(new Date))>=new Date(this.getFormartDateIOS(t))?this.radioDisabled=!0:this.radioDisabled=!1,this.getCourseDate(this.getFormartDate(t))},onChangeMonth:function(t){this.getCourseMonth(l()(t).format("YYYY-MM-DD"))},onCheckRadio:function(t){this.radioDisabled||(this.radioSelect=t.id,this.radioSelectList=t)},getCourseMonth:function(){var t=y(i.a.mark(function t(e){var r=this;return i.a.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return p(!0),t.prev=1,t.next=4,Object(f["o"])({month:e,type:"VIP"}).then(function(t){var e=t.data;200==e.code&&(r.getMonthDay=[],e.data.forEach(function(t){r.getMonthDay.push(l()(t).format("DD"))}),r.isCalendar=!0)});case 4:p(!1),t.next=10;break;case 7:t.prev=7,t.t0=t["catch"](1),p(!1);case 10:case"end":return t.stop()}},t,null,[[1,7]])}));function e(e){return t.apply(this,arguments)}return e}(),getCourseDate:function(){var t=y(i.a.mark(function t(e){var r=this;return i.a.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return p(!0),t.prev=1,t.next=4,Object(f["p"])({date:e,type:"VIP"}).then(function(t){var e=t.data;200==e.code&&e.data&&(r.dataList=e.data.rows,r.dataShow=e.data.rows.length>0)});case 4:p(!1),t.next=10;break;case 7:t.prev=7,t.t0=t["catch"](1),p(!1);case 10:case"end":return t.stop()}},t,null,[[1,7]])}));function e(e){return t.apply(this,arguments)}return e}(),onSubmit:function(){if(this.radioSelect){var t=this.radioSelectList,e=t.classDate.split(" ")[0],r=t.startClassTime.split(" ")[1];this.$router.push({path:"/PeriodChange",query:{checkId:this.radioSelect,classDate:e,startTime:r,name:t.name}})}else this.$toast("请选择需要交换的课程")},getFormartDateIOS:function(t){var e=new Date(t),r=e.getFullYear()+"/"+(e.getMonth()+1)+"/"+e.getDate();return r},getFormartDate:function(t){var e=new Date(t),r=e.getFullYear()+"-"+(e.getMonth()+1)+"-"+e.getDate();return r},onDateChange:function(){this.radioSelect?this.dataForm.status=!0:this.$toast("请选择需要调整的课程")},onCurrentConfirm:function(t){var e=this,r=[];this.dataList.forEach(function(t){t.id==e.radioSelect&&(r=t)});var n="2019/12/18 "+this.getDateInfo(r.startClassTime),a="2019/12/18 "+this.getDateInfo(r.endClassTime),o=new Date(n),i=new Date(a),c=parseInt(Math.abs(i.getTime()-o.getTime())/1e3/60),s=new Date(t),u=new Date(t);u.setMinutes(s.getMinutes()+c),s.toDateString()===u.toDateString()?Object(f["e"])({actualTeacherId:r.actualTeacherId,id:this.radioSelect,classDate:this.getFormartDate(s),startClassTimeStr:this.getDateInfo(s),endClassTimeStr:this.getDateInfo(u)}).then(function(t){var r=t.data;200==r.code?(e.$toast("调整成功"),setTimeout(function(){Object(h["b"])().iPhone?window.webkit.messageHandlers.DAYA.postMessage(JSON.stringify({api:"back"})):Object(h["b"])().android?DAYA.postMessage(JSON.stringify({api:"back"})):e.$router.push("/business")},500)):e.$toast(r.msg)}):this.$toast("课时调整不允许跨天调整")},getDateInfo:function(t){var e=t;"object"!==m(t)&&(e=t.replace(/-/gi,"/"));var r=new Date(e),n=r.getHours()>=10?r.getHours():"0"+r.getHours(),a=r.getMinutes()>=10?r.getMinutes():"0"+r.getMinutes();return n+":"+a+":00"},formatter:function(t,e){return"year"===t?"".concat(e,"年"):"month"===t?"".concat(e,"月"):"day"===t?"".concat(e,"日"):"hour"===t?"".concat(e,"时"):"minute"===t?"".concat(e,"分"):e}}},w=g,D=(r("b92d"),r("2877")),b=Object(D["a"])(w,n,a,!1,null,"b1192890",null);e["default"]=b.exports},"96cf":function(t,e,r){var n=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,a="function"===typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function s(t,e,r,n){var a=e&&e.prototype instanceof m?e:m,o=Object.create(a.prototype),i=new F(n||[]);return o._invoke=L(t,r,i),o}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(n){return{type:"throw",arg:n}}}t.wrap=s;var l="suspendedStart",h="suspendedYield",f="executing",d="completed",p={};function m(){}function v(){}function y(){}var g={};g[o]=function(){return this};var w=Object.getPrototypeOf,D=w&&w(w(E([])));D&&D!==r&&n.call(D,o)&&(g=D);var b=y.prototype=m.prototype=Object.create(g);function S(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function x(t){function e(r,a,o,i){var c=u(t[r],t,a);if("throw"!==c.type){var s=c.arg,l=s.value;return l&&"object"===typeof l&&n.call(l,"__await")?Promise.resolve(l.__await).then(function(t){e("next",t,o,i)},function(t){e("throw",t,o,i)}):Promise.resolve(l).then(function(t){s.value=t,o(s)},function(t){return e("throw",t,o,i)})}i(c.arg)}var r;function a(t,n){function a(){return new Promise(function(r,a){e(t,n,r,a)})}return r=r?r.then(a,a):a()}this._invoke=a}function L(t,e,r){var n=l;return function(a,o){if(n===f)throw new Error("Generator is already running");if(n===d){if("throw"===a)throw o;return M()}r.method=a,r.arg=o;while(1){var i=r.delegate;if(i){var c=k(i,r);if(c){if(c===p)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===l)throw n=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=f;var s=u(t,e,r);if("normal"===s.type){if(n=r.done?d:h,s.arg===p)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n=d,r.method="throw",r.arg=s.arg)}}}function k(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator["return"]&&(r.method="return",r.arg=e,k(t,r),"throw"===r.method))return p;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var a=u(n,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,p;var o=a.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,p):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,p)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function F(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function E(t){if(t){var r=t[o];if(r)return r.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function r(){while(++a<t.length)if(n.call(t,a))return r.value=t[a],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}return{next:M}}function M(){return{value:e,done:!0}}return v.prototype=b.constructor=y,y.constructor=v,y[c]=v.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,c in t||(t[c]="GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},S(x.prototype),x.prototype[i]=function(){return this},t.AsyncIterator=x,t.async=function(e,r,n,a){var o=new x(s(e,r,n,a));return t.isGeneratorFunction(r)?o:o.next().then(function(t){return t.done?t.value:o.next()})},S(b),b[c]="Generator",b[o]=function(){return this},b.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){while(e.length){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=E,F.prototype={constructor:F,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0],e=t.completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function a(n,a){return c.type="throw",c.arg=t,r.next=n,a&&(r.method="next",r.arg=e),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,p):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;C(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:E(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),p}},t}(t.exports);try{regeneratorRuntime=n}catch(a){Function("r","regeneratorRuntime = r")(n)}},a34a:function(t,e,r){t.exports=r("96cf")},b92d:function(t,e,r){"use strict";var n=r("39c3"),a=r.n(n);a.a}}]);