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
11 KiB

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["technician/pages/apply"],{"06f7":function(t,e,n){"use strict";var r=n("5269"),i=n.n(r);i.a},"4f2a":function(t,e,n){"use strict";n.r(e);var r=n("5dd4"),i=n("64ed");for(var a in i)["default"].indexOf(a)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(a);n("06f7");var o=n("828b"),c=Object(o["a"])(i["default"],r["b"],r["c"],!1,null,null,null,!1,r["a"],void 0);e["default"]=c.exports},5269:function(t,e,n){},"5dd4":function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){}));var r=function(){var t=this,e=t.$createElement,n=(t._self._c,t.isLoad?t.options.admin_id&&-1!=t.coach_status||!t.options.admin_id&&[1,2,3].includes(t.coach_status):null);t._isMounted||(t.e0=function(e){return t.$util.goUrl({url:"/pages/mine",openType:"reLaunch"})},t.e1=function(e,n){var r=arguments[arguments.length-1].currentTarget.dataset,i=r.eventParams||r["event-params"];n=i.index;e.stopPropagation(),t.form.sex=n}),t.$mp.data=Object.assign({},{$root:{g0:n}})},i=[]},"64ed":function(t,e,n){"use strict";n.r(e);var r=n("6d16"),i=n.n(r);for(var a in r)["default"].indexOf(a)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(a);e["default"]=i.a},"6d16":function(t,e,n){"use strict";(function(t){var r=n("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n("7eb4")),a=r(n("34cf")),o=r(n("7ca3")),c=r(n("ee10")),u=n("8f59");function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function l(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(Object(n),!0).forEach((function(e){(0,o.default)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var d={components:{wPicker:function(){n.e("components/w-picker/w-picker").then(function(){return resolve(n("13f3"))}.bind(null,n)).catch(n.oe)}},data:function(){return{isLoad:!1,options:{},cityList:[],cityIndex:-1,storeList:[],storeIndex:0,tipArr:{1:[{text:"审核成功后将直接入驻平台",color:0}],2:[{text:"恭喜您,审核通过!",color:0},{text:"快去管理订单吧",color:0}],3:[{text:"平台管理员已取消授权",color:0}],4:[{text:"请联系平台管理人员询问原因",color:0}]},buttonArr:{1:[{text:"个人中心",type:"cancel"}],2:[{text:"去管理",type:"confirm"}],3:[{text:"个人中心",type:"cancel"}],4:[{text:"再次申请",type:"confirm"},{text:"个人中心",type:"cancel"}]},title:{1:"等待审核",2:"您已经是"+this.$t("action.attendantName")+"了",3:"取消授权",4:"申请失败"},image:{1:"https://lbqny.migugu.com/admin/public/apply_wait.jpg",2:"https://lbqny.migugu.com/admin/public/apply_suc.jpg",3:"https://lbqny.migugu.com/admin/public/apply_fail.jpg",4:"https://lbqny.migugu.com/admin/public/apply_fail.jpg"},coach_status:-1,max_level:0,authTime:0,timer:null,form:{id:0,admin_id:0,partner_id:0,coach_name:"",mobile:"",short_code:"",sex:0,birthday:"",work_time:"",city_id:"",store_id:"",lng:"",lat:"",address:"",text:"",id_code:"",id_card:[],license:[],work_img:[],self_img:[],video:[]},rule:[{name:"coach_name",checkType:"isNotNull",errorMsg:"输入您的姓名",regType:2},{name:"birthday",checkType:"isNotNull",errorMsg:"请选择您的生日",regType:2},{name:"mobile",checkType:"isMobile",errorMsg:"输入手机号"},{name:"work_img",checkType:"isNotNull",errorMsg:"请上传工作形象照"}],lockTap:!1}},computed:(0,u.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}}),onLoad:function(e){var n=this;return(0,c.default)(i.default.mark((function r(){var a,o,c,u,s,l;return i.default.wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(a=e,o=a.admin_id,c=void 0===o?0:o,u=a.partner_id,s=void 0===u?0:u,!c&&!s){r.next=7;break}return r.next=4,n.updateCommonOptions(e);case 4:r.t0=r.sent,r.next=8;break;case 7:r.t0=e;case 8:return e=r.t0,n.options=e,n.form.admin_id=c,n.form.partner_id=s,n.$util.showLoading(),r.next=15,n.initIndex();case 15:l=n.coach_status,t.setNavigationBarTitle({title:-1==l?"申请"+n.$t("action.attendantName"):""}),n.isLoad=!0;case 18:case"end":return r.stop()}}),r)})))()},onUnload:function(){this.timer&&clearInterval(this.timer)},methods:l(l(l({},(0,u.mapActions)(["getConfigInfo","getUserInfo","updateCommonOptions"])),(0,u.mapMutations)(["updateUserItem"])),{},{initIndex:function(){var t=arguments,e=this;return(0,c.default)(i.default.mark((function n(){var r,o,c,u,s,l,d,f,p,h,m,g,v,b,_,x;return i.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(r=t.length>0&&void 0!==t[0]&&t[0],e.configInfo.id&&e.configInfo.hasOwnProperty("plugAuth")&&(!e.configInfo.hasOwnProperty("plugAuth")||e.configInfo.plugAuth.hasOwnProperty("store"))&&!r){n.next=4;break}return n.next=4,e.getConfigInfo();case 4:return n.next=6,e.getCityList();case 6:return n.next=8,Promise.all([e.$api.technician.coachInfo(),e.getStoreList()]);case 8:if(o=n.sent,c=(0,a.default)(o,1),u=c[0],e.$util.setNavigationBarColor({bg:e.primaryColor}),e.max_level=u.max_level,!u||u.id){n.next=16;break}return e.$util.hideAll(),n.abrupt("return");case 16:for(g in s=["id_card","license","self_img"],s.map((function(t){u[t]=u[t]&&u[t].length>0?u[t].map((function(t){return{path:t}})):[]})),u.id_card&&u.id_card.length>1&&(u.id_card_fan=[u.id_card[1]],u.id_card_people=[u.id_card[2]],u.id_card.splice(1,3)),l=["work_img","video"],l.map((function(t){u[t]=u[t]&&u[t].length>0?[{path:u[t]}]:[]})),u.birthday=u.birthday?e.$util.formatTime(1e3*u.birthday,"YY-M-D"):"",d=e.options,f=d.admin_id,p=void 0===f?0:f,h=d.partner_id,m=void 0===h?0:h,p&&(u.admin_id=p),m&&(u.partner_id=m),e.form)e.form[g]=u[g];v=u.city_id,b=u.store_id,_=u.status,x=u.sh_text,e.cityIndex=e.cityList.findIndex((function(t){return t.id==v})),e.storeIndex=e.storeList.findIndex((function(t){return t.id==b})),e.coach_status=p||4!=_?_:-1,4==_&&x&&(e.tipArr[4][0].text=x),e.$util.hideAll();case 32:case"end":return n.stop()}}),n)})))()},initRefresh:function(){this.initIndex(!0)},getCityList:function(){var t=this;return(0,c.default)(i.default.mark((function e(){var n,r,a,o,c,u,s;return i.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=t.location,n.lat){e.next=6;break}return e.next=4,t.$util.getBmapLocation();case 4:n=e.sent,t.updateUserItem({key:"location",val:n});case 6:if(r=n,a=r.lng,o=void 0===a?0:a,c=r.lat,u=void 0===c?0:c,!u||!o){e.next=14;break}return e.next=10,t.$api.base.getCity({lng:o,lat:u});case 10:s=e.sent,t.$util.hideAll(),t.cityList=s,t.form.city_id=s.length>0?s[0].id:0;case 14:case"end":return e.stop()}}),e)})))()},getStoreList:function(){var t=this;return(0,c.default)(i.default.mark((function e(){var n,r,a;return i.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=t.form.admin_id,r=void 0===n?0:n,r){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,t.$api.mine.getStoreSelect({admin_id:r});case 5:a=e.sent,a.unshift({id:0,title:"不挂靠门店"}),t.storeList=a;case 8:case"end":return e.stop()}}),e)})))()},pickerChange:function(t,e){var n=t.target.value;if("birthday"===e){var r=this.$util.DateToUnix(n);return r>new Date(Math.ceil((new Date).getTime()))/1e3?void this.$util.showToast({title:"不能选择未来时间哦"}):void(this.form[e]=n)}this["".concat(e,"Index")]=n,this.form["".concat(e,"_id")]=this["".concat(e,"List")][n].id},toSend:function(){var t=this;return(0,c.default)(i.default.mark((function e(){var n,r,a,o;return i.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=t.authTime,!n){e.next=3;break}return e.abrupt("return");case 3:if(r=t.form.mobile,a=void 0===r?"":r,null!=a&&/^(1[0-9]{10})$/.test(a)){e.next=7;break}return t.$util.showToast({title:null==a?"请输入手机号":"".concat(a," 手机号无效")}),e.abrupt("return");case 7:if(!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.user.sendShortMsg({phone:a});case 14:t.$util.hideAll(),t.lockTap=!1,o=60,t.timer=setInterval((function(){0!==o?(o--,t.authTime=o):clearInterval(t.timer)}),1e3),e.next=23;break;case 20:e.prev=20,e.t0=e["catch"](11),setTimeout((function(){t.lockTap=!1,t.$util.hideAll()}),2e3);case 23:case"end":return e.stop()}}),e,null,[[11,20]])})))()},imgUpload:function(t){var e=t.imagelist,n=t.imgtype;this.form[n]=e},toChooseLocation:function(e){var n=this;return(0,c.default)(i.default.mark((function e(){var r,o,c,u,s,l,d,f,p,h,m,g,v,b,_,x;return i.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 r=n.location,o=r.lat,void 0===o?"":o,c=r.lng,void 0===c?"":c,u=n.form,s=u.id,l=void 0===s?0:s,d=u.lat,f=u.lng,l&&(d,f),p={},e.next=9,t.chooseLocation(p);case 9:if(h=e.sent,m=(0,a.default)(h,2),g=m[1],v=g.address,b=void 0===v?"":v,_=g.longitude,x=g.latitude,b){e.next=18;break}return e.abrupt("return");case 18:n.form.address=b,n.form.lng=_,n.form.lat=x;case 21:case"end":return e.stop()}}),e)})))()},confirm:function(){var e=this;return(0,c.default)(i.default.mark((function n(){var r;return i.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(r=e.coach_status,4!=r){n.next=5;break}return e.coach_status=-1,t.setNavigationBarTitle({title:e.$t("action.attendantName")}),n.abrupt("return");case 5:e.$util.goUrl({url:"/pages/mine?type=2",openType:"reLaunch"});case 6:case"end":return n.stop()}}),n)})))()},validate:function(t){var e=new this.$util.Validate;this.rule.map((function(n){var r=n.name;e.add(t[r],n)}));var n=e.start();return n},submit:function(){var t=this;return(0,c.default)(i.default.mark((function e(){var n,r,a;return i.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=t.$util.deepCopy(t.form),n.work_img=n.work_img.length>0?n.work_img[0].path:"",r=t.validate(n),!r){e.next=6;break}return t.$util.showToast({title:r}),e.abrupt("return");case 6:if(a=t.configInfo.short_code_status,!a||null!=n.short_code&&6==n.short_code.length){e.next=10;break}return t.$util.showToast({title:"请输入6位数短信验证码"}),e.abrupt("return");case 10:if(a||delete n.short_code,n.birthday=t.$util.DateToUnix(n.birthday),!t.lockTap){e.next=14;break}return e.abrupt("return");case 14:return t.lockTap=!0,t.$util.showLoading(),e.prev=16,e.next=19,t.$api.technician.coachApply(n);case 19:t.$util.hideAll(),t.$util.showToast({title:"提交成功,即将跳转个人中心"}),t.timer&&clearInterval(t.timer),setTimeout((function(){getCurrentPages().length>1&&t.$util.back(),t.$util.goUrl({url:"/pages/mine",openType:"reLaunch"})}),2e3),e.next=28;break;case 25:e.prev=25,e.t0=e["catch"](16),setTimeout((function(){t.lockTap=!1,t.$util.hideAll()}),2e3);case 28:case"end":return e.stop()}}),e,null,[[16,25]])})))()}})};e.default=d}).call(this,n("df3c")["default"])},d1d1:function(t,e,n){"use strict";(function(t,e){var r=n("47a9");n("7043");r(n("3240"));var i=r(n("4f2a"));t.__webpack_require_UNI_MP_PLUGIN__=n,e(i.default)}).call(this,n("3223")["default"],n("df3c")["createPage"])}},[["d1d1","common/runtime","common/vendor"]]]);