(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["dynamic/pages/technician/detail"],{"0d66":function(t,e,i){"use strict";var n=i("fe13"),a=i.n(n);a.a},1293:function(t,e,i){"use strict";i.r(e);var n=i("740b"),a=i.n(n);for(var o in n)["default"].indexOf(o)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(o);e["default"]=a.a},"562f":function(t,e,i){"use strict";(function(t,e){var n=i("47a9");i("7043");n(i("3240"));var a=n(i("5703"));t.__webpack_require_UNI_MP_PLUGIN__=i,e(a.default)}).call(this,i("3223")["default"],i("df3c")["createPage"])},5703:function(t,e,i){"use strict";i.r(e);var n=i("e5dc"),a=i("1293");for(var o in a)["default"].indexOf(o)<0&&function(t){i.d(e,t,(function(){return a[t]}))}(o);i("0d66");var r=i("828b"),s=Object(r["a"])(a["default"],n["b"],n["c"],!1,null,null,null,!1,n["a"],void 0);e["default"]=s.exports},"740b":function(t,e,i){"use strict";(function(t){var n=i("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=n(i("7eb4")),o=n(i("ee10")),r=n(i("7ca3")),s=i("8f59");function c(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function u(t){for(var e=1;e=this.list.last_page||this.loading||(this.param.page=this.param.page+1,this.loading=!0,this.getList())},methods:u(u(u({},(0,s.mapActions)(["getConfigInfo","getUserInfo","getCarList","getServiceCoachList"])),(0,s.mapMutations)(["updateUserItem"])),{},{initIndex:function(){var t=arguments,e=this;return(0,o.default)(a.default.mark((function i(){var n,o,r,s,c,u;return a.default.wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(n=t.length>0&&void 0!==t[0]&&t[0],o=e.options.pid,r=void 0===o?0:o,e.isGzhLogin,s=e.userInfo.id,c=void 0===s?0:s,!r||c){i.next=7;break}return i.next=7,e.getUserInfo();case 7:if(e.configInfo.id&&!n){i.next=10;break}return i.next=10,e.getConfigInfo();case 10:return i.next=12,e.getDetail();case 12:return i.next=14,e.getList();case 14:u=e.configInfo.navBarHeight,e.videoNavHeight=1*u+15+"px",e.$util.setNavigationBarColor({bg:e.primaryColor});case 17:case"end":return i.stop()}}),i)})))()},initRefresh:function(){this.param.page=1,this.initIndex(!0)},getDetail:function(){var t=this;return(0,o.default)(a.default.mark((function e(){var i,n,o,r,s,c,u,l,d;return a.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(i=t.options.id,n=t.location,n.lat){e.next=7;break}return e.next=5,t.$util.getBmapLocation();case 5:n=e.sent,t.updateUserItem({key:"location",val:n});case 7:return o=n,r=o.lat,s=void 0===r?0:r,c=o.lng,u=void 0===c?0:c,e.next=10,t.$api.dynamic.coachDynamicInfo({id:i,lat:s,lng:u});case 10:l=e.sent,d=l.text.length>42,l.have_show_text=d,t.showText=!d,t.detail=l,t.$util.hideAll();case 16:case"end":return e.stop()}}),e)})))()},getList:function(){var t=this;return(0,o.default)(a.default.mark((function e(){var i,n,o;return a.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i=t.list,n=t.param,e.next=3,t.$api.dynamic.commentList(n);case 3:o=e.sent,1==t.param.page||(o.data=i.data.concat(o.data)),t.list=o,t.loading=!1,t.$util.hideAll();case 7:case"end":return e.stop()}}),e)})))()},goBanner:function(t){this.$util.previewImage({current:t,urls:this.detail.imgs})},scrolltolower:function(t){this.list.current_page>=this.list.last_page||this.loading||(this.param.page=this.param.page+1,this.loading=!0,this.getList())},toShowHide:function(t){this[t]=!this[t]},inputBlur:function(){var t=this;this.showComment&&this.$refs.comment_item.close(),this.$nextTick((function(){t.showComment=!1,t.inputFocus=!1}),0)},toChangeItem:function(e){var i=this;return(0,o.default)(a.default.mark((function n(){var o,r,s,c,u,l,d,f,p,h,m,g,v,x,_,b,w,y,k,$;return a.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:o=i.detail,r=o.id,s=o.coach_id,c=o.cover,u=o.type,l=o.follow_status,d=o.thumbs_status,f=o.thumbs_num,n.t0=e,n.next=1===n.t0||2===n.t0?4:3===n.t0?10:4===n.t0?17:5===n.t0||6===n.t0?20:25;break;case 4:return p={1:{methodKey:"dynamic",methodModel:"followAddOrCancek",param:{dynamic_id:r,coach_id:s}},2:{methodKey:"dynamic",methodModel:"thumbsAddOrCancek",param:{dynamic_id:r}}},h=p[e],m=h.methodKey,g=h.methodModel,v=h.param,n.next=8,i.$api[m][g](v);case 8:return 1==e?i.detail.follow_status=l?0:1:(x=d?-1:1,i.detail.thumbs_num=f+x,i.detail.thumbs_status=x>0?1:0),n.abrupt("break",25);case 10:return i.showText=!1,_=i.scrollTop,b=i.pageScrollTop,1==u&&(!_||_&&b<_)&&(_?t.pageScrollTo({scrollTop:_,duration:0}):(w=i.configInfo.navBarHeight,y=void 0===w?88:w,k=t.createSelectorQuery().in(i),k.select(".comment-list-info").boundingClientRect((function(e){i.scrollTop=e.top-y,t.pageScrollTo({scrollTop:e.top-y,duration:0})})).exec())),i.showComment=1==u,i.$refs.comment_item.open(),setTimeout((function(){i.$nextTick((function(){i.inputFocus=!0}),10)}),200),n.abrupt("break",25);case 17:return i.$refs.show_item.close(),i.$util.goUrl({url:"/dynamic/pages/technician/edit?id=".concat(r)}),n.abrupt("break",25);case 20:return i.$refs.show_item.close(),$=5==e?"del_dynamic_item":"check_text_item",5==e&&(i.popupInfo={id:r,name:"",image:c,index:-1}),i.$refs[$].open(),n.abrupt("break",25);case 25:case"end":return n.stop()}}),n)})))()},validate:function(t){var e=new this.$util.Validate;this.rule.map((function(i){var n=i.name;e.add(t[n],i)}));var i=e.start();return i},toComment:function(){var t=this;return(0,o.default)(a.default.mark((function e(){var i,n,o,r,s,c;return a.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(i=t.$util.deepCopy(t.subForm),n=t.options.id,i.dynamic_id=n,o=t.validate(i),!o){e.next=6;break}return e.abrupt("return");case 6:if(i.text=i.text.substring(0,200),!t.lockTap){e.next=9;break}return e.abrupt("return");case 9:return t.lockTap=!0,t.$util.showLoading(),e.prev=11,e.next=14,t.$api.dynamic.commentAdd(i);case 14:r=e.sent,s=r.status,c=void 0===s?1:s,t.$util.hideAll(),t.$util.showToast({title:1==c?"正在审核中":"评论成功"}),t.lockTap=!1,t.subForm.text="",t.showComment&&t.$refs.comment_item.close(),t.$nextTick((function(){t.showComment=!1,t.inputFocus=!1}),0),setTimeout((function(){t.initRefresh()}),1e3),e.next=29;break;case 26:e.prev=26,e.t0=e["catch"](11),setTimeout((function(){t.lockTap=!1,t.$util.hideAll()}),2e3);case 29:case"end":return e.stop()}}),e,null,[[11,26]])})))()},toDel:function(t){var e=this.list.data[t],i=e.id,n=(e.cover,e.status);this.popupInfo={id:i,name:"",image:"",index:t,status:n},this.$refs.del_item.open()},confirmDel:function(){var t=this;return(0,o.default)(a.default.mark((function e(){var i,n,o,r,s,c,u;return a.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(i=t.popupInfo,n=i.id,o=i.index,r=i.status,s=t.detail.comment_num,!t.lockTap){e.next=4;break}return e.abrupt("return");case 4:return t.lockTap=!0,t.$util.showLoading(),c=-1==o?"del_dynamic_item":"del_item",u=-1==o?"dynamicDel":"commentDel",e.prev=8,e.next=11,t.$api.dynamic[u]({id:n});case 11:t.lockTap=!1,t.$util.hideAll(),t.$util.showToast({title:"删除成功"}),t.$refs[c].close(),-1!=o?(t.list.data.splice(o,1),1!=r&&(t.detail.comment_num=s-1)):setTimeout((function(){t.$util.back(),t.$util.goUrl({url:1,openType:"navigateBack"})}),2e3),e.next=21;break;case 18:e.prev=18,e.t0=e["catch"](8),setTimeout((function(){t.lockTap=!1,t.$util.hideAll()}),2e3);case 21:case"end":return e.stop()}}),e,null,[[8,18]])})))()},getServiceList:function(){var t=this;return(0,o.default)(a.default.mark((function e(){var i,n,o,r,s;return a.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(i=t.detail.coach_info.is_work,i){e.next=4;break}return t.$util.showToast({title:"该".concat(t.$t("action.attendantName"),"未上班")}),e.abrupt("return");case 4:return n=t.detail.coach_id,e.next=7,t.getCarList({coach_id:n});case 7:return e.next=9,t.$api.service.coachServiceList({coach_id:n});case 9:o=e.sent,r=o.data,s=[],t.carList.list&&t.carList.list.length>0&&t.carList.list.map((function(t){s.push(t.service_id)})),r&&r.length>0&&r.map((function(e){if(s.includes(e.id)){var i=s.findIndex((function(t){return t==e.id}));e.num=t.carList.list[i].num,e.cart_id=t.carList.list[i].id}})),t.serviceList=r,t.$refs.technician_item.open();case 16:case"end":return e.stop()}}),e)})))()},changeNum:function(t,e){var i=this;return(0,o.default)(a.default.mark((function n(){var o,r,s,c,u,l,d,f,p,h,m,g,v;return a.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(o=i.detail.coach_id,r=i.serviceList[e],s=r.id,c=r.cart_id,u=void 0===c?0:c,!i.lockTap){n.next=4;break}return n.abrupt("return");case 4:if(i.lockTap=!0,l=t>0?"addCar":"delCar",d=t>0?{service_id:s,coach_id:o,num:1}:{id:u,num:1},"delCar"!=l||d.id){n.next=10;break}return i.lockTap=!1,n.abrupt("return");case 10:return n.prev=10,n.next=13,i.$api.order[l](d);case 13:return f=n.sent,p=i.serviceList[e],h=p.num,m=void 0===h?0:h,g=p.cart_id,v=void 0===g?0:g,i.serviceList[e].num=m+t,f&&t>0&&!v&&(i.serviceList[e].cart_id=f),i.serviceList[e].num<1&&(i.serviceList[e].cart_id=0),n.next=20,i.getCarList({coach_id:o});case 20:i.lockTap=!1,n.next=26;break;case 23:n.prev=23,n.t0=n["catch"](10),i.lockTap=!1;case 26:case"end":return n.stop()}}),n,null,[[10,23]])})))()},toOrder:function(){if(this.carList.car_count<1)this.$util.showToast({title:"请选择服务"});else{var t=this.detail.coach_id;this.$refs.technician_item.close(),this.$util.goUrl({url:"/user/pages/order?id=".concat(t)})}},toTechnicianInfo:function(){var t=this.detail.coach_id;this.$refs.technician_item.close(),this.$util.goUrl({url:"/user/pages/technician-info?id=".concat(t)})},screenChange:function(t){var e=this,i=t.detail.fullScreen,n=void 0!==i&&i;n||this.$nextTick((function(){e.videoContexts.pause(),e.videoContexts=null,e.isPlay=!1}))},playAndPauseVideo:function(){var e=this,i=this.videoContexts,n=void 0===i?null:i,a=this.$util.deepCopy(this.isPlay);if(null==n){var o=this.detail.id;this.videoContexts=t.createVideoContext("video_".concat(o),this),this.isPlay=!0}var r=a?"pause":"play";this.$nextTick((function(){e.videoContexts[r]()}))},onPlay:function(t){this.isPlay=!0},onPause:function(t){this.isPlay=!1},onEnded:function(t){this.isPlay=!1},onError:function(t){},onTimeUpdate:function(t){},onWaiting:function(t){},onProgress:function(t){},onLoadedMetaData:function(t){}})};e.default=l}).call(this,i("df3c")["default"])},e5dc:function(t,e,i){"use strict";i.d(e,"b",(function(){return n})),i.d(e,"c",(function(){return a})),i.d(e,"a",(function(){}));var n=function(){var t=this,e=t.$createElement,i=(t._self._c,t.detail.id&&1==t.detail.type?t.detail.imgs.length:null),n=t.detail.id&&1==t.detail.type&&!t.showText?t.detail.text.substring(0,42):null,a=t.detail.id&&1==t.detail.type?t.list.data.length:null,o=t.detail.id&&1==t.detail.type&&t.loading?t.list.current_page>=t.list.last_page&&t.list.data.length>0:null,r=t.detail.id&&(1==t.detail.type&&2==t.detail.status||2==t.detail.type)&&2==t.detail.type&&!t.showText?t.detail.text.substring(0,42):null,s=t.detail.id?3==t.detail.status&&t.detail.check_text&&t.detail.check_text.length>0:null,c=t.detail.id?t.list.data.length:null,u=t.detail.id&&t.loading?t.list.current_page>=t.list.last_page&&t.list.data.length>0:null,l=t.detail.id?!t.loading&&t.serviceList.length<=0:null;t._isMounted||(t.e0=function(e){return e.stopPropagation(),t.$refs.show_item.open()},t.e1=function(e){return e.stopPropagation(),t.$refs.show_item.open()},t.e2=function(e){return e.stopPropagation(),t.$refs.show_item.close()},t.e3=function(e){return e.stopPropagation(),t.$refs.check_text_item.close()},t.e4=function(e){return e.stopPropagation(),t.$refs.comment_item.close()}),t.$mp.data=Object.assign({},{$root:{g0:i,g1:n,g2:a,g3:o,g4:r,g5:s,g6:c,g7:u,g8:l}})},a=[]},fe13:function(t,e,i){}},[["562f","common/runtime","common/vendor"]]]);