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.
 
 
 

1 lines
14 KiB

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["dynamic/pages/detail"],{"0276":function(t,e,i){"use strict";i.r(e);var n=i("ea35"),a=i("9038");for(var o in a)["default"].indexOf(o)<0&&function(t){i.d(e,t,(function(){return a[t]}))}(o);i("9b0e");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},"0d88":function(t,e,i){},"37de":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("7ca3")),r=n(i("ee10")),s=i("8f59"),c=n(i("cf61"));function u(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 l(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?u(Object(i),!0).forEach((function(e){(0,o.default)(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):u(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var d={data:function(){return{iconType:{1:"icon-kefuwu",2:"iconjishifuwu",3:"iconkeyuyue",4:"iconkeyuyue"},textType:{1:"可服务",2:"服务中",3:"可预约",4:"不可预约"},options:{},detail:{},videoNavHeight:"15px",showText:!1,loading:!0,param:{page:1},list:{data:[]},serviceList:[],videoContexts:null,isPlay:!1,scrollTop:0,pageScrollTop:0,showComment:!1,inputFocus:!1,subForm:{text:""},rule:[{name:"text",checkType:"isNotNull",errorMsg:"请输入评论内容",regType:2}],popupInfo:{},lockTap:!1}},computed:(0,s.mapState)({primaryColor:function(t){return t.config.configInfo.primaryColor},subColor:function(t){return t.config.configInfo.subColor},configInfo:function(t){return t.config.configInfo},userInfo:function(t){return t.user.userInfo},location:function(t){return t.user.location},isGzhLogin:function(t){return t.user.isGzhLogin},carList:function(t){return t.order.carList}}),onLoad:function(t){var e=this;return(0,r.default)(a.default.mark((function i(){return a.default.wrap((function(i){while(1)switch(i.prev=i.next){case 0:return e.$util.showLoading(),e.options=t,e.param.dynamic_id=t.id,e.$util.showLoading(),i.next=6,e.initIndex();case 6:case"end":return i.stop()}}),i)})))()},onUnload:function(){console.log("====onUnload"),this.isPlay&&this.videoContexts.pause()},onPageScroll:function(t){var e=t.scrollTop;this.pageScrollTop=e},onPullDownRefresh:function(){t.showNavigationBarLoading(),this.initRefresh(),t.stopPullDownRefresh()},onReachBottom:function(){this.list.current_page>=this.list.last_page||this.loading||(this.param.page=this.param.page+1,this.loading=!0,this.getList())},onShareAppMessage:function(t){var e=this.userInfo.id,i=void 0===e?0:e,n=this.detail,a=n.id,o=n.title,r=n.cover,s="/dynamic/pages/detail?pid=".concat(i,"&id=").concat(a);return this.$util.log(s),{title:o,imageUrl:r,path:s}},methods:l(l(l({},(0,s.mapActions)(["getConfigInfo","getUserInfo","getCarList","getServiceCoachList"])),(0,s.mapMutations)(["updateUserItem"])),{},{initIndex:function(){var t=arguments,e=this;return(0,r.default)(a.default.mark((function i(){var n,o,r;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],e.configInfo.id&&!n){i.next=4;break}return i.next=4,e.getConfigInfo();case 4:return o=e.userInfo.id,void 0===o?0:o,e.isGzhLogin,i.next=8,e.getDetail(n);case 8:r=e.configInfo.navBarHeight,e.detail.type,e.videoNavHeight=1*r+15+"px",e.$util.setNavigationBarColor({bg:e.primaryColor});case 12:case"end":return i.stop()}}),i)})))()},initRefresh:function(){this.param.page=1,this.initIndex(!0)},toAppShare:function(){var t=this.userInfo.id,e=void 0===t?0:t,i=this.detail,n=i.id,a=(i.title,i.cover,c.default.siteroot),o=a.split("/index.php")[0];"".concat(o,"/h5/#/dynamic/pages/detail?id=").concat(n,"&pid=").concat(e)},getDetail:function(){var t=arguments,e=this;return(0,r.default)(a.default.mark((function i(){var n,o,r,s,c,u,l,d,f,p;return a.default.wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(t.length>0&&void 0!==t[0]&&t[0],n=e.options.id,o=e.location,r=void 0===o?{lat:0,lng:0}:o,r.lat){i.next=8;break}return i.next=6,e.$util.getBmapLocation();case 6:r=i.sent,e.updateUserItem({key:"location",val:r});case 8:return s=r,c=s.lat,u=void 0===c?0:c,l=s.lng,d=void 0===l?0:l,i.next=11,e.$api.dynamic.dynamicInfo({id:n,lat:u,lng:d});case 11:return f=i.sent,p=f.text.length>42,f.have_show_text=p,e.showText=!p,e.detail=f,e.$util.hideAll(),i.next=19,e.getList();case 19:case"end":return i.stop()}}),i)})))()},getList:function(){var t=this;return(0,r.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}))},toChangeItem:function(e){var i=this;return(0,r.default)(a.default.mark((function n(){var o,r,s,c,u,l,d,f,p,h,m,g,v,x,_,w,b,y;return a.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(o=i.detail,r=o.id,s=o.coach_id,c=o.type,u=o.follow_status,l=o.thumbs_status,d=o.thumbs_num,3!=e){n.next=9;break}return i.showText=!1,f=i.scrollTop,p=i.pageScrollTop,1==c&&(!f||f&&p<f)&&(f?t.pageScrollTo({scrollTop:f,duration:0}):(h=i.configInfo.navBarHeight,m=void 0===h?88:h,g=t.createSelectorQuery().in(i),g.select(".comment-list-info").boundingClientRect((function(e){i.scrollTop=e.top-m,t.pageScrollTo({scrollTop:e.top-m,duration:0})})).exec())),i.showComment=1==c,i.$refs.comment_item.open(),setTimeout((function(){i.$nextTick((function(){i.inputFocus=!0}),10)}),200),n.abrupt("return");case 9:return v={1:{methodKey:"dynamic",methodModel:"followAddOrCancek",param:{dynamic_id:r,coach_id:s}},2:{methodKey:"dynamic",methodModel:"thumbsAddOrCancek",param:{dynamic_id:r}},4:{methodKey:"mine",methodModel:"shieldCoachAdd",param:{type:1,coach_id:s}}},x=v[e],_=x.methodKey,w=x.methodModel,b=x.param,n.next=13,i.$api[_][w](b);case 13:n.t0=e,n.next=1===n.t0?16:2===n.t0?18:4===n.t0?22:25;break;case 16:return i.detail.follow_status=u?0:1,n.abrupt("break",25);case 18:return y=l?-1:1,i.detail.thumbs_num=d+y,i.detail.thumbs_status=y>0?1:0,n.abrupt("break",25);case 22:return i.$util.showToast({title:"操作成功"}),setTimeout((function(){i.$util.back(),i.$util.goUrl({url:1,openType:"navigateBack"})}),2e3),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,r.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})),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.del_auth),a=e.status;n&&(this.popupInfo={id:i,name:"",image:"",index:t,status:a},this.$refs.del_item.open())},confirmDel:function(){var t=this;return(0,r.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.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(),e.prev=6,e.next=9,t.$api.dynamic.commentDel({id:n});case 9:t.lockTap=!1,t.$util.hideAll(),t.list.data.splice(o,1),1!=r&&(t.detail.comment_num=s-1),t.$util.showToast({title:"删除成功"}),t.$refs.del_item.close(),e.next=20;break;case 17:e.prev=17,e.t0=e["catch"](6),setTimeout((function(){t.lockTap=!1,t.$util.hideAll()}),2e3);case 20:case"end":return e.stop()}}),e,null,[[6,17]])})))()},getServiceList:function(){var t=this;return(0,r.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,r.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=d}).call(this,i("df3c")["default"])},"413f":function(t,e,i){"use strict";(function(t,e){var n=i("47a9");i("7043");n(i("3240"));var a=n(i("0276"));t.__webpack_require_UNI_MP_PLUGIN__=i,e(a.default)}).call(this,i("3223")["default"],i("df3c")["createPage"])},9038:function(t,e,i){"use strict";i.r(e);var n=i("37de"),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},"9b0e":function(t,e,i){"use strict";var n=i("0d88"),a=i.n(n);a.a},ea35: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&&2==t.detail.status&&2===t.detail.coach_info.status&&1==t.detail.type?t.detail.imgs.length:null),n=t.detail.id&&2==t.detail.status&&2===t.detail.coach_info.status&&1==t.detail.type&&!t.showText?t.detail.text.substring(0,42):null,a=t.detail.id&&2==t.detail.status&&2===t.detail.coach_info.status&&1==t.detail.type?t.list.data.length:null,o=t.detail.id&&2==t.detail.status&&2===t.detail.coach_info.status&&1==t.detail.type&&t.loading?t.list.current_page>=t.list.last_page&&t.list.data.length>0:null,r=t.detail.id&&2==t.detail.status&&2===t.detail.coach_info.status&&2==t.detail.type&&!t.showText?t.detail.text.substring(0,42):null,s=t.detail.id&&2==t.detail.type?t.list.data.length:null,c=t.detail.id&&2==t.detail.type&&t.loading?t.list.current_page>=t.list.last_page&&t.list.data.length>0:null,u=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.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}})},a=[]}},[["413f","common/runtime","common/vendor"]]]);