webpackJsonp([21],{"5Hoj":function(t,e){},Me1P:function(t,e){},balU:function(t,e,n){"use strict";var i=n("RfZZ"),s=n("o69Z"),r=n("sM86"),o=n("54/E");function a(t){return Array.isArray(t)?t.map(function(t){return a(t)}):"object"==typeof t?Object(o.a)({},t):t}var u={title:String,loading:Boolean,showToolbar:Boolean,cancelButtonText:String,confirmButtonText:String,visibleItemCount:{type:Number,default:5},itemHeight:{type:Number,default:44}},c=n("pIDD"),l=Object(s.h)("picker-column"),h=l[0],m=l[1],f=h({props:{valueKey:String,className:String,itemHeight:Number,defaultIndex:Number,initialOptions:Array,visibleItemCount:Number},data:function(){return{startY:0,offset:0,duration:0,startOffset:0,options:a(this.initialOptions),currentIndex:this.defaultIndex}},created:function(){this.$parent.children&&this.$parent.children.push(this),this.setIndex(this.currentIndex)},destroyed:function(){var t=this.$parent.children;t&&t.splice(t.indexOf(this),1)},watch:{defaultIndex:function(){this.setIndex(this.defaultIndex)}},computed:{count:function(){return this.options.length}},methods:{onTouchStart:function(t){this.startY=t.touches[0].clientY,this.startOffset=this.offset,this.duration=0},onTouchMove:function(t){t.preventDefault();var e=t.touches[0].clientY-this.startY;this.offset=Object(s.g)(this.startOffset+e,-this.count*this.itemHeight,this.itemHeight)},onTouchEnd:function(){if(this.offset!==this.startOffset){this.duration=200;var t=Object(s.g)(Math.round(-this.offset/this.itemHeight),0,this.count-1);this.setIndex(t,!0)}},adjustIndex:function(t){for(var e=t=Object(s.g)(t,0,this.count);e<this.count;e++)if(!this.isDisabled(this.options[e]))return e;for(var n=t-1;n>=0;n--)if(!this.isDisabled(this.options[n]))return n},isDisabled:function(t){return Object(s.d)(t)&&t.disabled},getOptionText:function(t){return Object(s.d)(t)&&this.valueKey in t?t[this.valueKey]:t},setIndex:function(t,e){t=this.adjustIndex(t)||0,this.offset=-t*this.itemHeight,t!==this.currentIndex&&(this.currentIndex=t,e&&this.$emit("change",t))},setValue:function(t){for(var e=this.options,n=0;n<e.length;n++)if(this.getOptionText(e[n])===t)return this.setIndex(n)},getValue:function(){return this.options[this.currentIndex]}},render:function(t){var e=this,n=this.itemHeight,i=this.visibleItemCount,s={height:n*i+"px"},r=n*(i-1)/2,o={transition:this.duration+"ms",transform:"translate3d(0, "+(this.offset+r)+"px, 0)",lineHeight:n+"px"},a={height:n+"px"};return t("div",{style:s,class:[m(),this.className],on:{touchstart:this.onTouchStart,touchmove:this.onTouchMove,touchend:this.onTouchEnd,touchcancel:this.onTouchEnd}},[t("ul",{style:o},[this.options.map(function(n,i){return t("li",{style:a,class:["van-ellipsis",m("item",{disabled:e.isDisabled(n),selected:i===e.currentIndex})],domProps:{innerHTML:e.getOptionText(n)},on:{click:function(){e.setIndex(i,!0)}}})})])])}}),d=Object(s.h)("picker"),p=d[0],g=d[1],v=d[2],x=p({props:Object(i.a)({},u,{columns:Array,defaultIndex:{type:Number,default:0},valueKey:{type:String,default:"text"}}),data:function(){return{children:[]}},computed:{simple:function(){return this.columns.length&&!this.columns[0].values}},watch:{columns:function(){this.setColumns()}},methods:{setColumns:function(){var t=this;(this.simple?[{values:this.columns}]:this.columns).forEach(function(e,n){t.setColumnValues(n,a(e.values))})},emit:function(t){this.simple?this.$emit(t,this.getColumnValue(0),this.getColumnIndex(0)):this.$emit(t,this.getValues(),this.getIndexes())},onChange:function(t){this.simple?this.$emit("change",this,this.getColumnValue(0),this.getColumnIndex(0)):this.$emit("change",this,this.getValues(),t)},getColumn:function(t){return this.children[t]},getColumnValue:function(t){var e=this.getColumn(t);return e&&e.getValue()},setColumnValue:function(t,e){var n=this.getColumn(t);n&&n.setValue(e)},getColumnIndex:function(t){return(this.getColumn(t)||{}).currentIndex},setColumnIndex:function(t,e){var n=this.getColumn(t);n&&n.setIndex(e)},getColumnValues:function(t){return(this.children[t]||{}).options},setColumnValues:function(t,e){var n=this.children[t];n&&JSON.stringify(n.options)!==JSON.stringify(e)&&(n.options=e,n.setIndex(0))},getValues:function(){return this.children.map(function(t){return t.getValue()})},setValues:function(t){var e=this;t.forEach(function(t,n){e.setColumnValue(n,t)})},getIndexes:function(){return this.children.map(function(t){return t.currentIndex})},setIndexes:function(t){var e=this;t.forEach(function(t,n){e.setColumnIndex(n,t)})},onConfirm:function(){this.emit("confirm")},onCancel:function(){this.emit("cancel")}},render:function(t){var e=this,n=this.itemHeight,i=this.simple?[this.columns]:this.columns,s={height:n+"px"},o={height:n*this.visibleItemCount+"px"},a=this.showToolbar&&t("div",{class:["van-hairline--top-bottom",g("toolbar")]},[this.slots()||[t("div",{class:g("cancel"),on:{click:this.onCancel}},[this.cancelButtonText||v("cancel")]),this.slots("title")||this.title&&t("div",{class:["van-ellipsis",g("title")]},[this.title]),t("div",{class:g("confirm"),on:{click:this.onConfirm}},[this.confirmButtonText||v("confirm")])]]);return t("div",{class:g()},[a,this.loading&&t("div",{class:g("loading")},[t(c.a)]),t("div",{class:g("columns"),style:o,on:{touchmove:r.c}},[i.map(function(n,i){return t(f,{attrs:{valueKey:e.valueKey,className:n.className,itemHeight:e.itemHeight,defaultIndex:n.defaultIndex||e.defaultIndex,visibleItemCount:e.visibleItemCount,initialOptions:e.simple?n:n.values},on:{change:function(){e.onChange(i)}}})}),t("div",{class:["van-hairline--top-bottom",g("frame")],style:s})])])}});function y(t){return"[object Date]"===Object.prototype.toString.call(t)&&!isNaN(t.getTime())}function b(t){return("00"+t).slice(-2)}function C(t){if(t){for(;isNaN(parseInt(t,10));)t=t.slice(1);return parseInt(t,10)}}function V(t,e){return 32-new Date(t,e-1,32).getDate()}var I=Object(s.h)("datetime-picker"),A=I[0],T=I[1],S=(new Date).getFullYear();e.a=A({props:Object(i.a)({},u,{value:null,minHour:Number,minMinute:Number,type:{type:String,default:"datetime"},showToolbar:{type:Boolean,default:!0},format:{type:String,default:"YYYY.MM.DD HH时 mm分"},formatter:{type:Function,default:function(t,e){return e}},minDate:{type:Date,default:function(){return new Date(S-10,0,1)},validator:y},maxDate:{type:Date,default:function(){return new Date(S+10,11,31)},validator:y},maxHour:{type:Number,default:23},maxMinute:{type:Number,default:59}}),data:function(){return{innerValue:this.correctValue(this.value)}},watch:{value:function(t){t=this.correctValue(t),("time"===this.type?t===this.innerValue:t.valueOf()===this.innerValue.valueOf())||(this.innerValue=t,"time"===this.type&&this.updateColumnValue(t))},innerValue:function(t){this.$emit("input",t)},columns:function(){this.updateColumnValue(this.innerValue)}},computed:{ranges:function(){if("time"===this.type)return[{type:"hour",range:[this.minHour,this.maxHour]},{type:"minute",range:[this.minMinute,this.maxMinute]}];var t=this.getBoundary("max",this.innerValue),e=t.maxYear,n=t.maxDate,i=t.maxMonth,s=t.maxHour,r=t.maxMinute,o=this.getBoundary("min",this.innerValue),a=o.minYear,u=o.minDate,c=[{type:"year",range:[a,e]},{type:"month",range:[o.minMonth,i]},{type:"day",range:[u,n]},{type:"hour",range:[o.minHour,s]},{type:"minute",range:[o.minMinute,r]}];return"date"===this.type&&c.splice(3,2),"year-month"===this.type&&c.splice(2,3),c},columns:function(){var t=this;return this.ranges.map(function(e){var n=e.type,i=e.range;return{values:function(t,e){for(var n=-1,i=Array(t);++n<t;)i[n]=e(n);return i}(i[1]-i[0]+1,function(e){var s=i[0]+e;return s=s<10?"0"+s:""+s,t.formatter(n,s)})}})}},mounted:function(){this.updateColumnValue(this.innerValue)},methods:{correctValue:function(t){var e="time"!==this.type;if(e&&!y(t))t=this.minDate;else if(!t){var n=this.minHour;t=(n>10?n:"0"+n)+":00"}if(!e){var i=t.split(":"),r=i[0],o=i[1];return(r=b(Object(s.g)(r,this.minHour,this.maxHour)))+":"+(o=b(Object(s.g)(o,this.minMinute,this.maxMinute)))}return t=Math.max(t,this.minDate.getTime()),t=Math.min(t,this.maxDate.getTime()),new Date(t)},getBoundary:function(t,e){var n,i=this[t+"Date"],s=i.getFullYear(),r=1,o=1,a=0,u=0;return"max"===t&&(r=12,o=V(e.getFullYear(),e.getMonth()+1),a=23,u=59),e.getFullYear()===s&&(r=i.getMonth()+1,e.getMonth()+1===r&&(o=i.getDate(),e.getDate()===o&&(a=i.getHours(),e.getHours()===a&&(u=i.getMinutes())))),(n={})[t+"Year"]=s,n[t+"Month"]=r,n[t+"Date"]=o,n[t+"Hour"]=a,n[t+"Minute"]=u,n},onConfirm:function(){this.$emit("confirm",this.innerValue)},onChange:function(t){var e,n=this;if("time"===this.type){var i=t.getIndexes();e=i[0]+this.minHour+":"+(i[1]+this.minMinute)}else{var s=t.getValues(),r=C(s[0]),o=C(s[1]),a=V(r,o),u=C(s[2]);"year-month"===this.type&&(u=1),u=u>a?a:u;var c=0,l=0;"datetime"===this.type&&(c=C(s[3]),l=C(s[4])),e=new Date(r,o-1,u,c,l)}this.innerValue=this.correctValue(e),this.$nextTick(function(){n.$nextTick(function(){n.$emit("change",t)})})},updateColumnValue:function(t){var e=this,n=[],i=this.formatter;if("time"===this.type){var s=t.split(":");n=[i("hour",s[0]),i("minute",s[1])]}else n=[i("year",""+t.getFullYear()),i("month",b(t.getMonth()+1)),i("day",b(t.getDate()))],"datetime"===this.type&&n.push(i("hour",b(t.getHours())),i("minute",b(t.getMinutes()))),"year-month"===this.type&&(n=n.slice(0,2));this.$nextTick(function(){e.$refs.picker.setValues(n)})}},render:function(t){var e=this,n={};return Object.keys(u).forEach(function(t){n[t]=e[t]}),t(x,{class:T(),ref:"picker",attrs:{columns:this.columns},on:{change:this.onChange,confirm:this.onConfirm,cancel:function(){e.$emit("cancel")}},props:Object(i.a)({},n)})}})},"bdd/":function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAgCAYAAAAffCjxAAACbUlEQVRIS63VS2tTQRQH8P+5aWo0QreNS7+EK0VExBc+USwtqEnvnLFS0Z3L7AsVg0EnNYlGKfbW1ifdduG3yMKly6a7Qqw5MmEm3PSVG/HsLsz8mDnzn7mE/1QUd2q12vF8Pv/zX+weZIy5BmAJwFNmfjYs1oWMMScA/ACQJiIB8EQp9XwYrAtFUZTa3Nx8KyKTbrLFHjNzKSnW25rD3onIRAx7xMwvkmB9zbZYq9V6D+BODJtl5vIgrA/y29zY2Fgkotsx7CEzvzwI2wXZwcVicSSXyy0CuOUxEZnRWr/aD9sTimEfANx0kzsi8kBrXdkL2xeyg9fX10eazabN1g2PAWBmfr0TOxByGbPZWhKR67GVKa11NY4NhGLYsohc9VgQBNNhGNY9lghyPRvN5XLLAK54jIgKSqk39jsx5LHx8fEVIrrssD9BEOTDMGwMBbmcjbZarVUAlzxGRPeHhowxaQA2Fv4k7b2cHQpySATAPjm2LNJNfWIoiiK7pb5mA5hhZpO42aVS6VAmk/koIr7JnZ3BHLgih6yKyMXYsYdKqVriQNbr9Uy73f4E4HzshKZ9dhJB8/Pzh7PZ7GcA5zwiInmtdSPxpXXIVwBnY8g9rbV99PasXT0yxhwRkW9EdMbN2AZwl5nt+7Rv9UFzc3PZsbGx7yJyuhsSke1UKjUVhqF9Sg6sHtRoNLJbW1trAE65Gb8BTDKzzc7A6kLlcvloOp1eE5GTHiGiCaXUykDBDehClUrlgu0LgBQRte1fRClljz1x9ba2sLAw1el0KkEQTIRh+CWxEF+Rn1StVo8VCoVfwyJ2/MArkhT9C8gT+IK4h7n8AAAAAElFTkSuQmCC"},dKK0:function(t,e,n){"use strict";var i=n("nsZj"),s=(n.n(i),n("5Hoj"));n.n(s)},eVaN:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});n("eqfM");var i,s=n("/QYm"),r=n("bOdI"),o=n.n(r),a=(n("mMXg"),n("qYlo")),u=(n("dKK0"),n("balU")),c=n("CCn6"),l=n("rBG3"),h=n.n(l),m=n("bdd/"),f=n.n(m),d={name:"promptTime",data:function(){return{currentTime:"",dateVal:"",dateShow:!1,selectedValue:"",tishiTimer:h.a,youjiantou:f.a}},components:(i={},o()(i,u.a.name,u.a),o()(i,a.a.name,a.a),i),methods:{dateShowClick:function(){this.dateShow=!0,this.$nextTick(function(){document.querySelectorAll(".van-picker-column")[1].style.display="none";for(var t=document.querySelectorAll(".van-picker-column")[0].querySelectorAll("li"),e=0;e<t.length;e++)t[e].innerText=t[e].innerText+":00"})},dateConfirm:function(t){this.currentTime="aN:aN"==t?"00:00":t,this.contentFn()},dateConfirmNo:function(){this.contentFn()},contentFn:function(){this.dateShow=!1,this.$refs.timeSetting.style.borderBottom="1px solid #E2E2E2";for(var t=document.querySelectorAll(".van-picker-column")[0].querySelectorAll("li"),e=0;e<t.length;e++)t[e].innerText=t[e].innerText.split(":")[0]},preservationClick:function(){var t=this;if(this.currentTime){var e={time:this.currentTime};Object(c._4)(e).then(function(e){Object(s.a)("时间设定完成"),t.$router.go(-1)})}else Object(s.a)("请先设定时间"),this.$refs.timeSetting.style.borderBottom="1px solid red"}}},p={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"prompt-time"},[n("div",{staticClass:"title"},[t._v("请设置您希望接收上课提醒的时间")]),t._v(" "),n("div",{staticClass:"tishi-timer"},[n("img",{attrs:{src:t.tishiTimer,alt:""}})]),t._v(" "),n("div",{ref:"timeSetting",staticClass:"time-setting",on:{click:t.dateShowClick}},[n("div",{staticClass:"time-setting-text"},[t._v("\n 当前设定的时间\n ")]),t._v(" "),n("div",{staticClass:"time-setting-ti"},[n("span",[t._v(t._s(t.currentTime))]),t._v(" "),n("img",{attrs:{src:t.youjiantou,alt:""}})])]),t._v(" "),n("div",{staticClass:"preservation",on:{click:t.preservationClick}},[t._v("保存")]),t._v(" "),n("van-popup",{attrs:{position:"bottom"},model:{value:t.dateShow,callback:function(e){t.dateShow=e},expression:"dateShow"}},[n("van-datetime-picker",{attrs:{type:"time"},on:{confirm:t.dateConfirm,cancel:t.dateConfirmNo},model:{value:t.currentTime,callback:function(e){t.currentTime=e},expression:"currentTime"}})],1)],1)},staticRenderFns:[]};var g=n("VU/8")(d,p,!1,function(t){n("Me1P")},null,null);e.default=g.exports},rBG3:function(t,e,n){t.exports=n.p+"static/img/tishi_timer.e54eea1.png"}});
-
IvyXia123 authored51ac31f4