lockArena.js 4.4 KB
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/arenaControl/lockArena"],{3641:function(t,e,r){"use strict";(function(t){var n=r("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var u=n(r("7eb4")),o=n(r("ee10")),a=r("362d"),c={data:function(){return{show:!1,hourList:[],query:{groundId:"",orderDate:"",hourList:[{startHour:"",endHour:"",isLocked:0}]}}},onLoad:function(t){var e=this;return(0,o.default)(u.default.mark((function r(){return u.default.wrap((function(r){while(1)switch(r.prev=r.next){case 0:e.query.groundId=t.groundId,e.getlist(t.groundId);case 2:case"end":return r.stop()}}),r)})))()},onReady:function(){this.$refs.datetimePicker.setFormatter(this.formatter),this.query.orderDate=t.$u.timeFormat(Number(new Date),"yyyy-mm-dd")},computed:{formatBgColor:function(){return function(t){switch(!0){case t>=0&&t<=5:return"#FFF8E6";case t>=6&&t<=11:return"#E8F4FF";case t>=12&&t<=17:return"#E7FAF0";case t>=18&&t<=23:return"#FFE6E6";default:return"#FFE6E6"}}},formatborderColor:function(){return function(t){switch(!0){case t>=0&&t<=5:return"#FFE9B0";case t>=6&&t<=11:return"#B6DCFF";case t>=12&&t<=17:return"#A6EDC7";case t>=18&&t<=23:return"#FFB0B0";default:return"#FFB0B0"}}},formatTextColor:function(){return function(t){switch(!0){case t>=0&&t<=5:return"#FFB336";case t>=6&&t<=11:return"#50ABFF";case t>=12&&t<=17:return"#27B500";case t>=18&&t<=23:return"#D90000";default:return"#D90000"}}}},methods:{formatter:function(t,e){var r={year:"".concat(e,"年"),month:"".concat(e,"月"),day:"".concat(e,"日")};return r[t]},onConfirm:function(e,r){this.query.orderDate=t.$u.timeFormat(e,"yyyy-mm-dd"),this.show=!1},getlist:function(e){var r=this;return(0,o.default)(u.default.mark((function n(){var o;return u.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return o=t.$u.timeFormat(Number(new Date),"yyyy-mm-dd"),n.next=3,(0,a.businessTimeList)({currentDate:o,groundId:e});case 3:r.hourList=n.sent;case 4:case"end":return n.stop()}}),n)})))()},lockArena:function(e){this.query.hourList[0].startHour=e.startHour,this.query.hourList[0].endHour=e.endHour,this.query.hourList[0].isLocked=0===e.isLocked?1:0;var r=this,n=this.query.groundId;t.showModal({title:"提示",content:0===e.isLocked?"锁定时间段后,该时间段将不能预定此场地,是否锁定":"是否要解锁此场地",success:function(){var c=(0,o.default)(u.default.mark((function o(c){return u.default.wrap((function(u){while(1)switch(u.prev=u.next){case 0:if(!c.confirm){u.next=7;break}return u.next=3,(0,a.lockGround)(r.query);case 3:t.$u.toast(0===e.isLocked?"锁定成功":"解锁成功"),r.getlist(n),u.next=8;break;case 7:c.cancel&&t.$u.toast("取消锁定");case 8:case"end":return u.stop()}}),o)})));return function(t){return c.apply(this,arguments)}}()})}}};e.default=c}).call(this,r("df3c")["default"])},"51df":function(t,e,r){"use strict";r.r(e);var n=r("3641"),u=r.n(n);for(var o in n)["default"].indexOf(o)<0&&function(t){r.d(e,t,(function(){return n[t]}))}(o);e["default"]=u.a},a05f:function(t,e,r){"use strict";var n=r("d7dc"),u=r.n(n);u.a},d06c:function(t,e,r){"use strict";r.r(e);var n=r("fdf4"),u=r("51df");for(var o in u)["default"].indexOf(o)<0&&function(t){r.d(e,t,(function(){return u[t]}))}(o);r("a05f");var a=r("828b"),c=Object(a["a"])(u["default"],n["b"],n["c"],!1,null,"33edd949",null,!1,n["a"],void 0);e["default"]=c.exports},d7dc:function(t,e,r){},f87b:function(t,e,r){"use strict";(function(t,e){var n=r("47a9");r("c5a3");n(r("3240"));var u=n(r("d06c"));t.__webpack_require_UNI_MP_PLUGIN__=r,e(u.default)}).call(this,r("3223")["default"],r("df3c")["createPage"])},fdf4:function(t,e,r){"use strict";r.d(e,"b",(function(){return u})),r.d(e,"c",(function(){return o})),r.d(e,"a",(function(){return n}));var n={uIcon:function(){return Promise.all([r.e("common/vendor"),r.e("uni_modules/uview-ui/components/u-icon/u-icon")]).then(r.bind(null,"cfe0"))},uDatetimePicker:function(){return Promise.all([r.e("common/vendor"),r.e("uni_modules/uview-ui/components/u-datetime-picker/u-datetime-picker")]).then(r.bind(null,"5afe"))}},u=function(){var t=this,e=t.$createElement,r=(t._self._c,t.__map(t.hourList,(function(e,r){var n=t.__get_orig(e),u=t.formatTextColor(r),o=t.formatBgColor(r),a=t.formatborderColor(r);return{$orig:n,m0:u,m1:o,m2:a}})));t._isMounted||(t.e0=function(e){t.show=!0},t.e1=function(e){t.show=!1},t.e2=function(e){t.show=!1}),t.$mp.data=Object.assign({},{$root:{l0:r}})},o=[]}},[["f87b","common/runtime","common/vendor"]]]);