(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["user-pages-choose-technician"],{"417f":function(t,e,i){"use strict";i.r(e);var n=i("b22b"),a=i("f417");for(var c in a)["default"].indexOf(c)<0&&function(t){i.d(e,t,(function(){return a[t]}))}(c);i("eef4");var o=i("828b"),s=Object(o["a"])(a["default"],n["b"],n["c"],!1,null,"7f228e8c",null,!1,n["a"],void 0);e["default"]=s.exports},a6c9:function(t,e,i){"use strict";i("6a54");var n=i("f5bd").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,i("c223"),i("bd06");var a=n(i("5de6")),c=n(i("9b1b")),o=n(i("2634")),s=n(i("2fdc")),r=i("8f59"),u=n(i("a0e3")),l=n(i("ba2d")),d={components:{technicianListItem:u.default,technicianListPopup:l.default},data:function(){return{isLoad:!1,options:{},param:{page:1,ser_id:0,coach_name:""},list:{data:[]},loading:!0,lockTap:!1,pageLen:1}},computed:(0,r.mapState)({primaryColor:function(t){return t.config.configInfo.primaryColor},subColor:function(t){return t.config.configInfo.subColor},configInfo:function(t){return t.config.configInfo},cityId:function(t){return t.technician.cityId},cityIndex:function(t){return t.technician.cityIndex},cityList:function(t){return t.technician.cityList},loginType:function(t){return t.user.loginType},userInfo:function(t){return t.user.userInfo},location:function(t){return t.user.location}}),onLoad:function(t){var e=this;return(0,s.default)((0,o.default)().mark((function i(){return(0,o.default)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return e.options=t,i.next=3,e.initIndex();case 3:e.isLoad=!0;case 4:case"end":return i.stop()}}),i)})))()},onPullDownRefresh:function(){uni.showNavigationBarLoading(),this.initRefresh(),uni.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())},methods:(0,c.default)((0,c.default)((0,c.default)({},(0,r.mapActions)(["getCityList"])),(0,r.mapMutations)(["updateUserItem","updateTechnicianItem"])),{},{initIndex:function(){var t=arguments,e=this;return(0,s.default)((0,o.default)().mark((function i(){var n;return(0,o.default)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(n=t.length>0&&void 0!==t[0]&&t[0],n||!e.$jweixin.isWechat()){i.next=5;break}return i.next=4,e.$jweixin.initJssdk();case 4:e.$jweixin.wxReady((function(){e.$jweixin.hideOptionMenu()}));case 5:e.pageLen=getCurrentPages().length,e.getList(0==e.cityList.length);case 7:case"end":return i.stop()}}),i)})))()},initRefresh:function(){this.param.page=1,this.initIndex(!0)},pickerChange:function(t,e){var i=t.target.value;this.updateTechnicianItem({key:"cityIndex",val:i}),this.updateTechnicianItem({key:"cityId",val:this.cityList[i].id}),this.param.page=1,this.getList()},toOpenLocation:function(){this.$util.checkAuth({type:"userLocation"})},toSearch:function(t){this.param.page=1,this.param.coach_name=t,this.getList()},toChooseLocation:function(t){var e=this;return(0,s.default)((0,o.default)().mark((function t(){var i,n,c,s,r,u,l,d,f,p,h,v,g,m,x,y,w,_,b,k,C,I,L;return(0,o.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$util.checkAuth({type:"userLocation"});case 2:if(i=e.location,n=i.lat,c=void 0===n?"":n,s=i.lng,r=void 0===s?"":s,u={},c||r){t.next=16;break}if(!e.$jweixin.isWechat()){t.next=16;break}return e.$util.showLoading(),t.next=9,e.$jweixin.wxReady2();case 9:return t.next=11,e.$jweixin.getWxLocation();case 11:l=t.sent,d=l.latitude,f=l.longitude,c=d,r=f;case 16:return u={latitude:c,longitude:r},t.next=19,uni.chooseLocation(u);case 19:if(p=t.sent,h=(0,a.default)(p,2),v=h[1],g=v.address,m=void 0===g?"":g,x=v.longitude,y=v.latitude,w=v.province,_=void 0===w?"":w,b=v.city,k=void 0===b?"":b,C=v.district,I=void 0===C?"":C,x){t.next=34;break}return t.abrupt("return");case 34:return L={lng:x,lat:y,address:m,province:_,city:k,district:I},e.updateUserItem({key:"location",val:L}),e.param.page=1,t.next=39,e.getList(!0,1);case 39:case"end":return t.stop()}}),t)})))()},getList:function(){var t=arguments,e=this;return(0,s.default)((0,o.default)().mark((function i(){var n,a,c,s,r,u,l,d,f,p,h,v,g,m,x,y,w,_,b,k,C,I,L,$,T,j,O,P,E,R,A,B,M,S,U,W,F,J,N,D;return(0,o.default)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(n=t.length>0&&void 0!==t[0]&&t[0],a=t.length>1&&void 0!==t[1]?t[1]:0,c=e.location,c.lat&&(!c.lat||"定位失败"!=c.address)){i.next=26;break}if(!e.$jweixin.isWechat()){i.next=25;break}return e.$util.showLoading(),i.next=8,e.$jweixin.wxReady2();case 8:if(s=c,r=s.lat,u=void 0===r?"":r,l=s.lng,d=void 0===l?"":l,u||d){i.next=18;break}return i.next=12,e.$jweixin.getWxLocation();case 12:f=i.sent,p=f.latitude,h=f.longitude,u=p,d=h,c={lng:d,lat:u,address:"定位失败",province:"",city:"",district:""};case 18:if(!u||!d){i.next=25;break}return v="".concat(u,",").concat(d),i.next=22,e.$api.base.getMapInfo({location:v});case 22:g=i.sent,m=JSON.parse(g),x=m.status,y=m.result,0==x&&(w=y.address,_=y.address_component,b=_.province,k=_.city,C=_.district,c={lng:d,lat:u,address:w,province:b,city:k,district:C});case 25:e.updateUserItem({key:"location",val:c});case 26:if(I=c,L=I.lng,$=void 0===L?0:L,T=I.lat,j=void 0===T?0:T,!n){i.next=30;break}return i.next=30,e.getCityList({lng:$,lat:j,change:a});case 30:if(O=e.options,P=O.id,E=O.store_id,R=void 0===E?0:E,A=e.list,B=e.param,M=e.cityList,S=e.cityIndex,U=e.cityId,W=M.findIndex((function(t){return t.id==U})),-1!=W){i.next=39;break}return e.$refs.choose_city_item.open(),e.loading=!1,e.$util.hideAll(),e.list={data:[],last_page:1,current_page:1},i.abrupt("return");case 39:return U=-1==W?0:U,S=-1==W?0:W,e.updateTechnicianItem({key:"cityIndex",val:S}),e.updateTechnicianItem({key:"cityId",val:U}),B=Object.assign({},B,{ser_id:P,store_id:R,lng:$,lat:j,city_id:U}),F=e.configInfo.coach_format,J=void 0===F?1:F,N=1==J?"serviceCoachList":"typeServiceCoachList",i.next=48,e.$api.service[N](B);case 48:D=i.sent,1==e.param.page||(D.data=A.data.concat(D.data)),e.list=D,e.loading=!1,e.$util.hideAll();case 52:case"end":return i.stop()}}),i)})))()},toShowPopup:function(t,e){var i=this;return(0,s.default)((0,o.default)().mark((function n(){return(0,o.default)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:i.$refs.technician_list_popup.toShowPopup(i.list.data[t],e);case 1:case"end":return n.stop()}}),n)})))()},toCollect:function(t){var e=this;return(0,s.default)((0,o.default)().mark((function i(){var n,a,c,s,r;return(0,o.default)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=e.list.data[t],a=n.id,c=n.is_collect,s=n.collect_num,r=c?"delCollect":"addCollect",i.next=4,e.$api.mine[r]({coach_id:a});case 4:e.$util.showToast({title:c?"取消成功":"收藏成功"}),e.list.data[t].is_collect=1==c?0:1,e.list.data[t].collect_num=1==c?s-1:s+1;case 7:case"end":return i.stop()}}),i)})))()},goInfo:function(t){var e=this.list.data[t],i=e.id,n=e.store,a=void 0===n?{}:n,c=this.configInfo.plugAuth,o=void 0===c?{}:c;this.$util.goUrl({url:o.store&&a&&a.id?"/shopstore/pages/detail?id=".concat(a.id):"/user/pages/technician-info?id=".concat(i)})},toOrder:function(t){var e=this;return(0,s.default)((0,o.default)().mark((function i(){var n,a,c,s,r,u;return(0,o.default)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(n=e.list.data[t],a=n.id,c=n.is_work,s=void 0===c?0:c,s){i.next=3;break}return i.abrupt("return");case 3:if(r=e.options.id,!e.lockTap){i.next=6;break}return i.abrupt("return");case 6:return e.lockTap=!0,i.prev=7,i.next=10,e.$api.order.addCar({service_id:r,coach_id:a,num:1,is_top:1,coach_service:1});case 10:e.lockTap=!1,u="/user/pages/order?id=".concat(a,"&ser_id=").concat(r),e.$util.goUrl({url:u}),i.next=18;break;case 15:i.prev=15,i.t0=i["catch"](7),e.lockTap=!1;case 18:case"end":return i.stop()}}),i,null,[[7,15]])})))()},toBack:function(){var t=this.pageLen,e=t>1?1:"/pages/service",i=t>1?"navigateBack":"reLaunch";this.$util.goUrl({url:e,openType:i})}})};e.default=d},b22b: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||e;return i("v-uni-view",{staticClass:"pages-technician"},[i("fixed",[i("uni-nav-bar",{attrs:{fixed:!1,shadow:!1,statusBar:!0,onlyLeft:!0,color:"#fff",backgroundColor:t.primaryColor}},[i("v-uni-view",{staticClass:"map-info flex-y-center",attrs:{slot:"left"},on:{click:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.toChooseLocation.apply(void 0,arguments)}},slot:"left"},[i("v-uni-view",{staticClass:"flex-y-center c-base"},[i("i",{staticClass:"iconfont iconjuli mr-sm"}),i("v-uni-view",{staticClass:"map-text max-400 ellipsis"},[t._v(t._s(t.location&&t.location.address?t.location.address:t.isLoad?"定位失败":"定位中..."))]),i("i",{staticClass:"iconfont icon-down"})],1)],1)],1),i("v-uni-view",{staticClass:"fix-info choose fill-body rel"},[i("v-uni-view",{staticClass:"space-top abs",style:{background:t.primaryColor}}),i("v-uni-view",{staticClass:"search-info fill-base pt-lg pl-lg pr-lg pb-md abs"},[i("v-uni-view",{staticClass:"flex-center pb-md"},[i("v-uni-view",{staticClass:"city-info"},[i("v-uni-picker",{attrs:{value:t.cityIndex,range:t.cityList,"range-key":"title"},on:{change:function(e){arguments[0]=e=t.$handleEvent(e),t.pickerChange(e)}}},[i("v-uni-view",{staticClass:"city-info flex-y-center"},[i("v-uni-view",[t.cityList&&t.cityList.length>0?[t._v(t._s(-1===t.cityIndex?"未知":t.cityList[t.cityIndex].title.length>3?t.cityList[t.cityIndex].title.substring(0,3)+"...":t.cityList[t.cityIndex].title))]:[t._v("请选择")]],2),i("i",{staticClass:"iconfont iconshaixuanxia-1 ml-sm"})],1)],1)],1),i("v-uni-view",{staticClass:"flex-1"},[i("search",{attrs:{type:"input",keyword:t.param.coach_name,padding:0,radius:30,backgroundColor:"#F0F0F0",placeholder:"请输入"+t.$t("action.attendantName")+"姓名"},on:{input:function(e){arguments[0]=e=t.$handleEvent(e),t.toSearch.apply(void 0,arguments)}}})],1)],1)],1)],1)],1),t.list.data&&t.list.data.length>0?i("v-uni-view",{staticClass:"ml-md mr-md",class:[{"flex-warp":2===t.configInfo.coach_list_format}]},t._l(t.list.data,(function(e,n){return i("v-uni-view",{key:n,class:[{"mt-md":1===t.configInfo.coach_list_format&&0!=n||2===t.configInfo.coach_list_format},{"mr-md":2===t.configInfo.coach_list_format&&n%2==0}]},[i("technician-list-item",{attrs:{info:e},on:{comment:function(e){arguments[0]=e=t.$handleEvent(e),t.toShowPopup(n,"message")},collect:function(e){arguments[0]=e=t.$handleEvent(e),t.toCollect(n)},order:function(e){arguments[0]=e=t.$handleEvent(e),t.toOrder(n)}}})],1)})),1):t._e(),t.loading?i("load-more",{attrs:{noMore:t.list.current_page>=t.list.last_page&&t.list.data.length>0,loading:t.loading}}):t._e(),!t.loading&&t.list.data.length<=0&&1==t.list.current_page?i("abnor"):t._e(),i("technician-list-popup",{ref:"technician_list_popup"}),i("uni-popup",{ref:"choose_city_item",attrs:{type:"top",custom:!0,zIndex:999}},[i("v-uni-view",{style:{height:t.configInfo.navBarHeight+8+"px"}}),i("v-uni-view",{staticClass:"choose-city-popup rel"},[i("v-uni-image",{staticClass:"city-img",attrs:{src:"https://lbqny.migugu.com/admin/anmo/technician/no_city.png"}}),i("v-uni-view",{staticClass:"text f-paragraph c-base abs"},[t._v("很抱歉,该城市未开通, 点击左上角切换其他城市下单服务")]),i("v-uni-view",{staticClass:"flex-between"},[i("v-uni-view"),i("v-uni-view",{staticClass:"item-btn flex-center f-paragraph c-title text-bold radius",on:{click:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.$refs.choose_city_item.close()}}},[t._v("知道了")])],1)],1)],1),i("v-uni-view",{staticClass:"space-max-footer"}),i("fix-bottom-button",{attrs:{text:[{type:"confirm",text:t.pageLen>1?"返回上页":"返回首页"}],bgColor:"#fff"},on:{confirm:function(e){arguments[0]=e=t.$handleEvent(e),t.toBack.apply(void 0,arguments)}}})],1)},a=[]},df22:function(t,e,i){var n=i("f0a4");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var a=i("967d").default;a("c339f156",n,!0,{sourceMap:!1,shadowMode:!1})},eef4:function(t,e,i){"use strict";var n=i("df22"),a=i.n(n);a.a},f0a4:function(t,e,i){var n=i("c86c");e=n(!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/* 文章场景相关 */',""]),t.exports=e},f417:function(t,e,i){"use strict";i.r(e);var n=i("a6c9"),a=i.n(n);for(var c in n)["default"].indexOf(c)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(c);e["default"]=a.a}}]);