王总上门按摩后台代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
shangmenanmo/public/h6/static/js/technician-pages-time-manag...

1 lines
10 KiB

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["technician-pages-time-manage"],{"0b33":function(t,e,i){"use strict";i.d(e,"b",(function(){return n})),i.d(e,"c",(function(){return s})),i.d(e,"a",(function(){return a}));var a={wPicker:i("13f3").default},n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-uni-view",{staticClass:"technician-time-manage"},[i("v-uni-view",{staticClass:"fill-base pd-lg flex-between"},[i("v-uni-view",{staticClass:"flex-1 flex-y-baseline f-title c-title"},[t._v("是否接单"),i("v-uni-view",{staticClass:"f-paragraph ml-sm",style:{color:1==t.form.is_work?t.primaryColor:"#999"}},[t._v(t._s(1==t.form.is_work?"接单":"休息"))])],1),i("v-uni-view",{on:{click:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.toChangeItem.apply(void 0,arguments)}}},[i("i",{staticClass:"iconfont icon-switch c-caption ml-sm",class:[{"icon-switch-on":1==t.form.is_work}],style:{color:1==t.form.is_work?t.primaryColor:""}})])],1),i("v-uni-view",{staticClass:"fill-base mt-md b-1px-b"},[i("v-uni-view",{staticClass:"f-title c-title pd-lg"},[t._v("选择接单时间")])],1),i("v-uni-view",{staticClass:"flex-center fill-base f-paragraph c-desc pt-lg pb-lg b-1px-b"},[i("v-uni-view",{staticClass:"item-time flex-center flex-column",on:{click:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.toShowTime("start_time")}}},[i("v-uni-view",[t._v("开始时间")]),i("v-uni-view",{staticClass:"mt-sm",style:{color:t.form.start_time?t.primaryColor:"#999"}},[t._v(t._s(t.form.start_time||"选择时间"))])],1),i("v-uni-view",{staticClass:"item-time flex-center flex-column b-1px-l",on:{click:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.toShowTime("end_time")}}},[i("v-uni-view",[t._v("结束时间")]),i("v-uni-view",{staticClass:"mt-sm",style:{color:t.form.end_time?t.primaryColor:"#999"}},[t._v(t._s(t._f("handleStartEndTime")(t.form,t.toDay))+t._s(t.form.end_time||"选择时间"))])],1)],1),i("v-uni-view",{staticClass:"fill-base pb-lg",staticStyle:{"border-bottom-left-radius":"32rpx","border-bottom-right-radius":"32rpx"}},[i("v-uni-view",{staticClass:"flex pl-md pr-md pt-lg pb-lg"},[i("v-uni-view",{staticClass:"f-mini-title"},[t._v("设置不可接单时间")]),i("v-uni-view",{staticClass:"f-paragraph c-disable"},[t._v("(只能设置近"+t._s(t.dayList.length)+"天的时间)")])],1),i("tab",{attrs:{list:t.dayList,activeIndex:1*t.dayCurrent,activeColor:t.primaryColor,width:"150rpx",height:"80rpx"},on:{change:function(e){arguments[0]=e=t.$handleEvent(e),t.handerTabChange.apply(void 0,arguments)}}})],1),t.dayList.length>0?i("v-uni-view",{staticClass:"date-list flex pt-md"},t._l(t.dayList[t.dayCurrent].sub,(function(e,a){return i("v-uni-view",{key:a,staticClass:"date-item radius-16 flex-center ml-md mt-md",class:t.isTimes(e.time_str)||1==e.is_order||3==t.form.coach_status?"date-item-prohibit c-disable":"fill-base c-5A677E",style:{background:3==t.form.coach_status||0!=e.status||0!=e.is_order||t.isTimes(e.time_str)?"":t.primaryColor,color:0!=e.status||0!=e.is_order||t.isTimes(e.time_str)?"":"#fff"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.getDateTime(a)}}},[i("v-uni-view",{staticClass:"text-center"},[i("v-uni-view",{staticClass:"f-mini-title"},[t._v(t._s(e.time_text))]),i("v-uni-view",{staticClass:"f-caption"},[t._v(t._s(t.isTimes(e.time_str)||0==e.status?"不可预约":"可预约"))])],1)],1)})),1):t._e(),i("v-uni-view",{staticClass:"space-max-footer"}),i("w-picker",{ref:"time",attrs:{visible:t.showTime,mode:"time",value:t.toDayTime,current:!1,second:!1,themeColor:t.primaryColor},on:{"update:visible":function(e){arguments[0]=e=t.$handleEvent(e),t.showTime=e},confirm:function(e){arguments[0]=e=t.$handleEvent(e),t.onConfirm.apply(void 0,arguments)}}}),3!=t.form.coach_status?i("fix-bottom-button",{attrs:{text:[{text:"保存",type:"confirm",isAuth:!0}],bgColor:"#fff"},on:{confirm:function(e){arguments[0]=e=t.$handleEvent(e),t.submit.apply(void 0,arguments)}}}):t._e()],1)},s=[]},"41b6":function(t,e,i){var a=i("8a39");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);var n=i("967d").default;n("f998d6e4",a,!0,{sourceMap:!1,shadowMode:!1})},"8a39":function(t,e,i){var a=i("c86c");e=a(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.technician-time-manage .iconfont[data-v-ebf42042]{font-size:%?80?%;line-height:%?34?%}.technician-time-manage .item-time[data-v-ebf42042]{width:50%}.technician-time-manage .date-title[data-v-ebf42042]{padding-bottom:%?60?%}.technician-time-manage .date-title uni-text[data-v-ebf42042]{border-bottom:3px solid transparent}.technician-time-manage .date-list[data-v-ebf42042]{word-break:break-all;flex-flow:wrap}.technician-time-manage .date-list .date-item[data-v-ebf42042]{width:%?163?%;height:%?110?%;border:1px solid #e5e5e5}.technician-time-manage .date-list .date-item-prohibit[data-v-ebf42042]{background:#f6f7f7}.technician-time-manage .date-list .c-5A677E[data-v-ebf42042]{color:#5a677e}',""]),t.exports=e},9490:function(t,e,i){"use strict";i("6a54");var a=i("f5bd").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,i("bf0f"),i("2797"),i("c223");var n=a(i("2634")),s=a(i("2fdc")),o=a(i("9b1b")),r=i("8f59"),c=a(i("cd23")),u=a(i("13f3")),l=a(i("bfa8")),f={components:{wPicker:u.default,tab:l.default},data:function(){return{toDay:"",toDayTime:"",showKey:"",showTime:!1,form:{id:0,is_work:0,start_time:"",end_time:"",coach_status:0,time_unit:""},dayList:[],dayCurrent:0}},computed:(0,r.mapState)({primaryColor:function(t){return t.config.configInfo.primaryColor},subColor:function(t){return t.config.configInfo.subColor},userInfo:function(t){return t.user.userInfo}}),onLoad:function(){this.initIndex()},methods:(0,o.default)((0,o.default)({},(0,r.mapMutations)(["updateTechnicianItem"])),{},{initIndex:function(){var t=this;return(0,s.default)((0,n.default)().mark((function e(){var i,a,s;return(0,n.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t.$jweixin.isWechat()){e.next=4;break}return e.next=3,t.$jweixin.initJssdk();case 3:t.$jweixin.wxReady((function(){t.$jweixin.hideOptionMenu()}));case 4:return i=new Date(Math.ceil((new Date).getTime())),t.toDay=t.$util.formatTime(i,"YY-M-D"),t.toDayTime=t.$util.formatTime(i,"h:m"),e.next=9,t.$api.technician.timeConfig();case 9:for(s in a=e.sent,t.form)t.form[s]=a[s];a.day_list.forEach((function(t,e){t.title=0==e?"今天":t.dat_text,t.sub=[]})),t.form.time_unit=a.time_unit,t.dayList=a.day_list,t.$util.setNavigationBarColor({bg:t.primaryColor}),t.toCount();case 16:case"end":return e.stop()}}),e)})))()},toChangeItem:function(){3!=this.form.coach_status&&(this.form.is_work=1==this.form.is_work?0:1)},toShowTime:function(t){3!=this.form.coach_status&&(this.showKey=t,this.showTime=!0)},onConfirm:function(t){this.form[this.showKey]=t.result,this.toCount()},toCount:function(){var t=this.toDay,e=void 0===t?"":t,i=this.form,a=i.start_time,n=void 0===a?"":a,s=i.end_time,o=void 0===s?"":s;e&&n&&o&&(this.dayList.forEach((function(t){t.sub=[]})),this.getTimeCall())},getTimeCall:function(){var t=this;return(0,s.default)((0,n.default)().mark((function e(){var i,a,s,o,r,c,u,l;return(0,n.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.$util.showLoading(),i=t.form,a=i.start_time,s=void 0===a?"":a,o=i.end_time,r=void 0===o?"":o,c=t.dayCurrent,u=t.dayList,e.next=5,t.$api.technician.getTime({start_time:s,end_time:r,dat_str:u[c].dat_str});case 5:l=e.sent,t.dayList[c].sub=l,t.$util.hideAll();case 8:case"end":return e.stop()}}),e)})))()},setDate:function(t){this.dayCurrent=t},getDateTime:function(t){if(3!=this.form.coach_status){var e=this.dayCurrent,i=this.dayList[e].sub,a=void 0===i?[]:i,n=a[t],s=n.is_click,o=n.is_order,r=n.status;a&&1==o||(this.dayList[e].sub[t].is_click=0==s?1:0,this.dayList[e].sub[t].status=0==r?1:0)}},handerTabChange:function(t){3!=this.form.coach_status&&(this.dayCurrent=t,this.dayList[t].sub&&this.dayList[t].sub.length||this.getTimeCall())},isTimes:function(t){var e=new Date;return e.getTime()/1e3>t},submit:function(){var t=this;return(0,s.default)((0,n.default)().mark((function e(){var i,a;return(0,n.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(i=t.$util.deepCopy(t.form),i.start_time&&i.end_time){e.next=4;break}return t.$util.showToast({title:i.start_time?"请选择结束时间":"请选择开始时间"}),e.abrupt("return");case 4:return delete i.coach_status,a=t.$util.deepCopy(t.dayList),i.time_text=a,t.$util.showLoading(),e.next=10,t.$api.technician.setTimeConfig(i);case 10:t.$util.hideAll(),t.$util.showToast({title:"保存成功"}),t.updateTechnicianItem({key:"haveOperItem",val:!0}),setTimeout((function(){t.$util.back(),t.$util.goUrl({url:1,openType:"navigateBack"})}),1e3);case 14:case"end":return e.stop()}}),e)})))()}}),filters:{handleStartEndTime:function(t,e){var i="",a=t.start_time,n=t.end_time,s="".concat(e," ").concat(a),o="".concat(e," ").concat(n);return a&&n&&c.default.DateToUnix(s)>=c.default.DateToUnix(o)&&(i="次日"),i}}};e.default=f},aef1:function(t,e,i){"use strict";i.r(e);var a=i("9490"),n=i.n(a);for(var s in a)["default"].indexOf(s)<0&&function(t){i.d(e,t,(function(){return a[t]}))}(s);e["default"]=n.a},d1ec:function(t,e,i){"use strict";var a=i("41b6"),n=i.n(a);n.a},ffb1:function(t,e,i){"use strict";i.r(e);var a=i("0b33"),n=i("aef1");for(var s in n)["default"].indexOf(s)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(s);i("d1ec");var o=i("828b"),r=Object(o["a"])(n["default"],a["b"],a["c"],!1,null,"ebf42042",null,!1,a["a"],void 0);e["default"]=r.exports}}]);