(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["user/pages/choose-technician"],{"26da":function(t,e,n){"use strict";(function(t){var i=n("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=i(n("7eb4")),r=i(n("34cf")),c=i(n("7ca3")),o=i(n("ee10")),s=n("8f59");function u(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function l(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:l(l(l({},(0,s.mapActions)(["getCityList"])),(0,s.mapMutations)(["updateUserItem","updateTechnicianItem"])),{},{initIndex:function(){var t=arguments,e=this;return(0,o.default)(a.default.mark((function n(){return a.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:t.length>0&&void 0!==t[0]&&t[0],e.pageLen=getCurrentPages().length,e.getList(0==e.cityList.length);case 3:case"end":return n.stop()}}),n)})))()},initRefresh:function(){this.param.page=1,this.initIndex(!0)},pickerChange:function(t,e){var n=t.target.value;this.updateTechnicianItem({key:"cityIndex",val:n}),this.updateTechnicianItem({key:"cityId",val:this.cityList[n].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(e){var n=this;return(0,o.default)(a.default.mark((function e(){var i,c,o,s,u,l,d,f,p,h,g,v,m,y,b,_,x,w;return a.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,n.$util.checkAuth({type:"userLocation"});case 2:return i=n.location,c=i.lat,void 0===c?"":c,o=i.lng,void 0===o?"":o,s={},e.next=7,t.chooseLocation(s);case 7:if(u=e.sent,l=(0,r.default)(u,2),d=l[1],f=d.address,p=void 0===f?"":f,h=d.longitude,g=d.latitude,v=d.province,m=void 0===v?"":v,y=d.city,b=void 0===y?"":y,_=d.district,x=void 0===_?"":_,h){e.next=22;break}return e.abrupt("return");case 22:return w={lng:h,lat:g,address:p,province:m,city:b,district:x},n.updateUserItem({key:"location",val:w}),n.param.page=1,e.next=27,n.getList(!0,1);case 27:case"end":return e.stop()}}),e)})))()},getList:function(){var t=arguments,e=this;return(0,o.default)(a.default.mark((function n(){var i,r,c,o,s,u,l,d,f,p,h,g,v,m,y,b,_,x,w,I,L,k;return a.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(i=t.length>0&&void 0!==t[0]&&t[0],r=t.length>1&&void 0!==t[1]?t[1]:0,c=e.location,c.lat&&(!c.lat||"定位失败"!=c.address)){n.next=8;break}return n.next=6,e.$util.getBmapLocation();case 6:c=n.sent,e.updateUserItem({key:"location",val:c});case 8:if(o=c,s=o.lng,u=void 0===s?0:s,l=o.lat,d=void 0===l?0:l,!i){n.next=12;break}return n.next=12,e.getCityList({lng:u,lat:d,change:r});case 12:if(f=e.options,p=f.id,h=f.store_id,g=void 0===h?0:h,v=e.list,m=e.param,y=e.cityList,b=e.cityIndex,_=e.cityId,x=y.findIndex((function(t){return t.id==_})),-1!=x){n.next=21;break}return e.$refs.choose_city_item.open(),e.loading=!1,e.$util.hideAll(),e.list={data:[],last_page:1,current_page:1},n.abrupt("return");case 21:return _=-1==x?0:_,b=-1==x?0:x,e.updateTechnicianItem({key:"cityIndex",val:b}),e.updateTechnicianItem({key:"cityId",val:_}),m=Object.assign({},m,{ser_id:p,store_id:g,lng:u,lat:d,city_id:_}),w=e.configInfo.coach_format,I=void 0===w?1:w,L=1==I?"serviceCoachList":"typeServiceCoachList",n.next=30,e.$api.service[L](m);case 30:k=n.sent,1==e.param.page||(k.data=v.data.concat(k.data)),e.list=k,e.loading=!1,e.$util.hideAll();case 34:case"end":return n.stop()}}),n)})))()},toShowPopup:function(t,e){var n=this;return(0,o.default)(a.default.mark((function i(){return a.default.wrap((function(i){while(1)switch(i.prev=i.next){case 0:n.$refs.technician_list_popup.toShowPopup(n.list.data[t],e);case 1:case"end":return i.stop()}}),i)})))()},toCollect:function(t){var e=this;return(0,o.default)(a.default.mark((function n(){var i,r,c,o,s;return a.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return i=e.list.data[t],r=i.id,c=i.is_collect,o=i.collect_num,s=c?"delCollect":"addCollect",n.next=4,e.$api.mine[s]({coach_id:r});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?o-1:o+1;case 7:case"end":return n.stop()}}),n)})))()},goInfo:function(t){var e=this.list.data[t],n=e.id,i=e.store,a=void 0===i?{}:i,r=this.configInfo.plugAuth,c=void 0===r?{}:r;this.$util.goUrl({url:c.store&&a&&a.id?"/shopstore/pages/detail?id=".concat(a.id):"/user/pages/technician-info?id=".concat(n)})},toOrder:function(t){var e=this;return(0,o.default)(a.default.mark((function n(){var i,r,c,o,s,u;return a.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(i=e.list.data[t],r=i.id,c=i.is_work,o=void 0===c?0:c,o){n.next=3;break}return n.abrupt("return");case 3:if(s=e.options.id,!e.lockTap){n.next=6;break}return n.abrupt("return");case 6:return e.lockTap=!0,n.prev=7,n.next=10,e.$api.order.addCar({service_id:s,coach_id:r,num:1,is_top:1,coach_service:1});case 10:e.lockTap=!1,u="/user/pages/order?id=".concat(r,"&ser_id=").concat(s),e.$util.goUrl({url:u}),n.next=18;break;case 15:n.prev=15,n.t0=n["catch"](7),e.lockTap=!1;case 18:case"end":return n.stop()}}),n,null,[[7,15]])})))()},toBack:function(){var t=this.pageLen,e=t>1?1:"/pages/service",n=t>1?"navigateBack":"reLaunch";this.$util.goUrl({url:e,openType:n})}})};e.default=d}).call(this,n("df3c")["default"])},"417f":function(t,e,n){"use strict";n.r(e);var i=n("c904"),a=n("f417");for(var r in a)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(r);n("b0de");var c=n("828b"),o=Object(c["a"])(a["default"],i["b"],i["c"],!1,null,null,null,!1,i["a"],void 0);e["default"]=o.exports},"968a":function(t,e,n){"use strict";(function(t,e){var i=n("47a9");n("7043");i(n("3240"));var a=i(n("417f"));t.__webpack_require_UNI_MP_PLUGIN__=n,e(a.default)}).call(this,n("3223")["default"],n("df3c")["createPage"])},b0de:function(t,e,n){"use strict";var i=n("beb4"),a=n.n(i);a.a},beb4:function(t,e,n){},c904:function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){}));var i=function(){var t=this,e=t.$createElement,n=(t._self._c,t.cityList&&t.cityList.length>0),i=n&&-1!==t.cityIndex?t.cityList[t.cityIndex].title.length:null,a=n&&-1!==t.cityIndex&&i>3?t.cityList[t.cityIndex].title.substring(0,3):null,r=t.$t("action.attendantName"),c=t.list.data&&t.list.data.length>0,o=t.loading?t.list.current_page>=t.list.last_page&&t.list.data.length>0&&t.location.lng:null,s=!t.loading&&t.list.data.length<=0&&1==t.list.current_page&&t.location.address;t._isMounted||(t.e0=function(e){return e.stopPropagation(),t.$refs.choose_city_item.close()}),t.$mp.data=Object.assign({},{$root:{g0:n,g1:i,g2:a,m0:r,g3:c,g4:o,g5:s}})},a=[]},f417:function(t,e,n){"use strict";n.r(e);var i=n("26da"),a=n.n(i);for(var r in i)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(r);e["default"]=a.a}},[["968a","common/runtime","common/vendor"]]]);