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
12 KiB
1 lines
12 KiB
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["agent/pages/technician/apply"],{"24f1":function(e,t,n){"use strict";(function(e,t){var r=n("47a9");n("7043");r(n("3240"));var i=r(n("cfec"));e.__webpack_require_UNI_MP_PLUGIN__=n,t(i.default)}).call(this,n("3223")["default"],n("df3c")["createPage"])},"893d":function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){return r}));var r={wPicker:function(){return n.e("components/w-picker/w-picker").then(n.bind(null,"13f3"))}},i=function(){var e=this,t=e.$createElement,n=(e._self._c,e.isLoad?e.configInfo.plugAuth.store&&e.storeList.length>0:null),r=e.isLoad?e.$t("action.attendantName"):null,i=e.isLoad?e.$t("action.attendantName"):null,a=e.isLoad?e.form.text.length:null,o=!e.isLoad||a>300?null:e.form.text.length,c=e.isLoad&&1===e.form.is_work?e._f("handleStartEndTime")(e.form,e.toDay):null,u=e.isLoad?e.fdd_agreement&&e.fdd_agreement.hasOwnProperty("viewpdf_url"):null;e._isMounted||(e.e0=function(t,n){var r=arguments[arguments.length-1].currentTarget.dataset,i=r.eventParams||r["event-params"];n=i.index;t.stopPropagation(),e.form.sex=n}),e.$mp.data=Object.assign({},{$root:{g0:n,m0:r,m1:i,g1:a,g2:o,f0:c,g3:u}})},a=[]},c13c:function(e,t,n){"use strict";(function(e){var r=n("47a9");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n("7eb4")),a=r(n("34cf")),o=r(n("ee10")),c=r(n("7ca3")),u=r(n("cd23")),s=n("8f59");function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){(0,c.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var f={components:{wPicker:function(){n.e("components/w-picker/w-picker").then(function(){return resolve(n("13f3"))}.bind(null,n)).catch(n.oe)}},data:function(){var e;return{isLoad:!1,options:{},cityList:[],cityIndex:-1,storeList:[],storeIndex:-1,toDay:"",toDayTime:"",showKey:"",showTime:!1,workList:[{id:1,title:"接单"},{id:0,title:"休息"}],fdd_agreement:{},form:(e={id:0,user_id:"",nickName:"",coach_name:"",mobile:"",sex:0,birthday:"",work_time:"",city_id:"",store_id:"",lng:"",lat:"",address:"",text:"",id_code:"",id_card:[],id_card_fan:[],id_card_people:[],license:[],work_img:[],self_img:[]},(0,c.default)(e,"city_id",""),(0,c.default)(e,"video",[]),(0,c.default)(e,"order_num",0),(0,c.default)(e,"is_work",1),(0,c.default)(e,"start_time","00:00"),(0,c.default)(e,"end_time","23:59"),e),rule:[{name:"coach_name",checkType:"isNotNull",errorMsg:"输入您的姓名",regType:2},{name:"birthday",checkType:"isNotNull",errorMsg:"请选择您的生日",regType:2},{name:"mobile",checkType:"isMobile",errorMsg:"输入手机号"},{name:"work_time",checkType:"isNotNull",errorMsg:"请输入从业年份,例如:5"},{name:"city_id",checkType:"isNotNull",errorMsg:"请选择意向工作城市"},{name:"address",checkType:"isNotNull",errorMsg:"请选择所在地址"},{name:"text",checkType:"isNotNull",errorMsg:"请输入"+this.$t("action.attendantName")+"简介",regType:2},{name:"id_code",checkType:"isIdCard",errorMsg:"输入您的身份证号码"},{name:"id_card",checkType:"isNotNull",errorMsg:"请上传身份证人像面"},{name:"id_card_fan",checkType:"isNotNull",errorMsg:"请上传身份证国徽面"},{name:"id_card_people",checkType:"isNotNull",errorMsg:"请上传手持身份证照片"},{name:"license",checkType:"isNotNull",errorMsg:"请上传资格证书"},{name:"work_img",checkType:"isNotNull",errorMsg:"请上传工作形象照"},{name:"self_img",checkType:"isNotNull",errorMsg:"请上传个人生活照"},{name:"order_num",checkType:"isNumber",errorMsg:"请输入虚拟订单量",regType:2}],have_user_id:!1,lockTap:!1}},computed:(0,s.mapState)({primaryColor:function(e){return e.config.configInfo.primaryColor},subColor:function(e){return e.config.configInfo.subColor},configInfo:function(e){return e.config.configInfo},userInfo:function(e){return e.user.userInfo},location:function(e){return e.user.location}}),onLoad:function(t){var n=this;return(0,o.default)(i.default.mark((function r(){var a,o;return i.default.wrap((function(r){while(1)switch(r.prev=r.next){case 0:return a=t.id,o=void 0===a?0:a,n.options=t,n.$util.showLoading(),r.next=5,n.initIndex();case 5:n.coach_status,e.setNavigationBarTitle({title:o?"编辑":"新增"+n.$t("action.attendantName")}),n.isLoad=!0;case 8:case"end":return r.stop()}}),r)})))()},methods:l(l(l({},(0,s.mapActions)(["getConfigInfo","getUserInfo"])),(0,s.mapMutations)(["updateUserItem"])),{},{initIndex:function(){var e=arguments,t=this;return(0,o.default)(i.default.mark((function n(){var r,a,o,c,u,s;return i.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(r=e.length>0&&void 0!==e[0]&&e[0],t.configInfo.id&&t.configInfo.hasOwnProperty("plugAuth")&&(!t.configInfo.hasOwnProperty("plugAuth")||t.configInfo.plugAuth.hasOwnProperty("store"))&&!r){n.next=4;break}return n.next=4,t.getConfigInfo();case 4:return t.$util.setNavigationBarColor({bg:t.primaryColor}),a=new Date(Math.ceil((new Date).getTime())),t.toDay=t.$util.formatTime(a,"YY-M-D"),t.toDayTime=t.$util.formatTime(a,"h:m"),n.next=10,Promise.all([t.getCityList(),t.getStoreList()]);case 10:if(o=t.options.id,c=void 0===o?0:o,c){n.next=14;break}return t.$util.hideAll(),n.abrupt("return");case 14:return n.next=16,t.$api.agent.coachInfo({id:c});case 16:for(s in u=n.sent,u.id_card=u.id_card.map((function(e){return{path:e}})),u.id_card_fan=[u.id_card[1]],u.id_card_people=[u.id_card[2]],u.id_card.splice(1,3),u.license=u.license.map((function(e){return{path:e}})),u.work_img=[{path:u.work_img}],u.self_img=u.self_img.map((function(e){return{path:e}})),u.video=u.video&&u.video.length>0?[{path:u.video}]:[],t.cityIndex=t.cityList.findIndex((function(e){return e.id==u.city_id})),t.storeIndex=t.storeList.findIndex((function(e){return e.id==u.store_id})),u.birthday=u.birthday?t.$util.formatTime(1e3*u.birthday,"YY-M-D"):"",t.form)t.form[s]=u[s];t.have_user_id=u.id&&u.user_id,t.fdd_agreement=u.fdd_agreement,t.$util.hideAll();case 32:case"end":return n.stop()}}),n)})))()},initRefresh:function(){this.initIndex(!0)},getStoreList:function(){var e=this;return(0,o.default)(i.default.mark((function t(){var n,r,a;return i.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(n=e.configInfo.plugAuth.store,r=void 0!==n&&n,!r){t.next=7;break}return t.next=4,e.$api.agent.storeSelect();case 4:a=t.sent,a.unshift({id:0,title:"不挂靠门店"}),e.storeList=a;case 7:case"end":return t.stop()}}),t)})))()},getCityList:function(){var e=this;return(0,o.default)(i.default.mark((function t(){var n,r,a,o,c,u,s;return i.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(n=e.location,n.lat){t.next=6;break}return t.next=4,e.$util.getBmapLocation();case 4:n=t.sent,e.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){t.next=15;break}return t.next=10,e.$api.base.getCity({lng:o,lat:u});case 10:s=t.sent,e.$util.hideAll(),e.cityList=s,e.cityIndex=s.length>0?0:-1,e.form.city_id=s.length>0?s[0].id:"";case 15:case"end":return t.stop()}}),t)})))()},toFddSign:function(){var e=this;return(0,o.default)(i.default.mark((function t(){var n,r;return i.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.updateUserItem({key:"fddExtsign",val:""}),n=e.fdd_agreement.viewpdf_url,r=void 0===n?"":n,e.updateUserItem({key:"fddExtsign",val:r}),e.$util.goUrl({url:"/user/pages/common/web?url=fddExtsign"});case 4:case"end":return t.stop()}}),t)})))()},pickerChange:function(e,t){var n=e.target.value;if("birthday"===t){var r=this.$util.DateToUnix(n);return r>new Date(Math.ceil((new Date).getTime()))/1e3?void this.$util.showToast({title:"不能选择未来时间哦"}):void(this.form[t]=n)}this["".concat(t,"Index")]=n,this.form["".concat(t,"_id")]=this["".concat(t,"List")][n].id},imgUpload:function(e){var t=e.imagelist,n=e.imgtype;this.form[n]=t},toSetItem:function(e){var t=this.workList[e].id;this.form.is_work=t},toShowTime:function(e){this.showKey=e,this.showTime=!0},onConfirm:function(e){this.form[this.showKey]=e.result},toChooseLocation:function(t){var n=this;return(0,o.default)(i.default.mark((function t(){var r,o,c,u,s,d,l,f,p,m,h,g,_,v,y,w;return i.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.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,d=void 0===s?0:s,l=u.lat,f=u.lng,d&&(l,f),p={},t.next=9,e.chooseLocation(p);case 9:if(m=t.sent,h=(0,a.default)(m,2),g=h[1],_=g.address,v=void 0===_?"":_,y=g.longitude,w=g.latitude,v){t.next=18;break}return t.abrupt("return");case 18:n.form.address=v,n.form.lng=y,n.form.lat=w;case 21:case"end":return t.stop()}}),t)})))()},toChooseUser:function(){var e=this.have_user_id;e||this.$util.goUrl({url:"/agent/pages/technician/user"})},validate:function(e){var t=new this.$util.Validate;this.rule.map((function(n){var r=n.name;t.add(e[r],n)}));var n=t.start();return n},submit:function(){var e=this;return(0,o.default)(i.default.mark((function t(){var n,r,a,o,c,u,s,d,l;return i.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(n=e.$util.deepCopy(e.form),r=["id_card","id_card_fan","id_card_people","work_img","video"],r.map((function(e){n[e]=n[e].length>0?n[e][0].path:""})),n.license=n.license.map((function(e){return e.path})),n.self_img=n.self_img.map((function(e){return e.path})),a=e.validate(n),!a){t.next=9;break}return e.$util.showToast({title:a}),t.abrupt("return");case 9:if(o=n.is_work,c=void 0===o?0:o,u=n.start_time,s=n.end_time,!c||u&&s){t.next=13;break}return e.$util.showToast({title:u?"请选择结束时间":"请选择开始时间"}),t.abrupt("return");case 13:if(n.birthday=e.$util.DateToUnix(n.birthday),n.id_card=[n.id_card,n.id_card_fan,n.id_card_people],delete n.id_card_fan,delete n.id_card_people,delete n.nickName,n.id&&delete n.admin_id,!e.lockTap){t.next=21;break}return t.abrupt("return");case 21:return e.lockTap=!0,e.$util.showLoading(),t.prev=23,d=e.options.is_edit,void 0===d?0:d,l=n.id?"coachDataUpdate":"coachApply",t.next=28,e.$api.agent[l](n);case 28:e.$util.hideAll(),e.$util.showToast({title:"提交成功"}),setTimeout((function(){e.$util.back(),e.$util.goUrl({url:1,openType:"navigateBack"})}),2e3),t.next=36;break;case 33:t.prev=33,t.t0=t["catch"](23),setTimeout((function(){e.lockTap=!1,e.$util.hideAll()}),2e3);case 36:case"end":return t.stop()}}),t,null,[[23,33]])})))()}}),filters:{handleStartEndTime:function(e,t){var n="",r=e.start_time,i=e.end_time,a="".concat(t," ").concat(r),o="".concat(t," ").concat(i);return r&&i&&u.default.DateToUnix(a)>=u.default.DateToUnix(o)&&(n="次日"),n}}};t.default=f}).call(this,n("df3c")["default"])},ca50:function(e,t,n){"use strict";n.r(t);var r=n("c13c"),i=n.n(r);for(var a in r)["default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(a);t["default"]=i.a},cfec:function(e,t,n){"use strict";n.r(t);var r=n("893d"),i=n("ca50");for(var a in i)["default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(a);n("eb7b");var o=n("828b"),c=Object(o["a"])(i["default"],r["b"],r["c"],!1,null,null,null,!1,r["a"],void 0);t["default"]=c.exports},eb7b:function(e,t,n){"use strict";var r=n("fe44"),i=n.n(r);i.a},fe44:function(e,t,n){}},[["24f1","common/runtime","common/vendor"]]]); |