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/edit"],{"65f9":function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){}));var r=function(){var e=this,t=e.$createElement,n=(e._self._c,e.isLoad?e.configInfo.short_code_status&&11==e.form.mobile.length&&e.form.mobile!==e.old_phone: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;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}})},i=[]},"800d":function(e,t,n){"use strict";(function(e,t){var r=n("47a9");n("7043");r(n("3240"));var i=r(n("ae69"));e.__webpack_require_UNI_MP_PLUGIN__=n,t(i.default)}).call(this,n("3223")["default"],n("df3c")["createPage"])},ae69:function(e,t,n){"use strict";n.r(t);var r=n("65f9"),i=n("c996");for(var a in i)["default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(a);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},c996:function(e,t,n){"use strict";n.r(t);var r=n("dcd6"),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},dcd6: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=n("8f59");function s(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?s(Object(n),!0).forEach((function(t){(0,c.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}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(){var e;return{isLoad:!1,options:{},cityList:[],cityIndex:-1,storeList:[],storeIndex:0,old_phone:"",authTime:0,timer:null,coach_status:0,form:(e={id:0,admin_id:0,coach_name:"",mobile:"",short_code:"",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",[]),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:"请上传个人生活照"}],lockTap:!1}},computed:(0,u.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(e){var t=this;return(0,o.default)(i.default.mark((function n(){var r,a,o,c,u;return i.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(r=e,a=r.admin_id,o=void 0===a?0:a,c=r.is_edit,u=void 0===c?0:c,e.is_edit=u,!o){n.next=8;break}return n.next=5,t.updateCommonOptions(e);case 5:n.t0=n.sent,n.next=9;break;case 8:n.t0=e;case 9:return e=n.t0,t.options=e,t.form.admin_id=o,t.$util.showLoading(),n.next=15,t.initIndex();case 15:t.isLoad=!0;case 16:case"end":return n.stop()}}),n)})))()},onUnload:function(){this.timer&&clearInterval(this.timer)},methods:l(l(l({},(0,u.mapActions)(["getConfigInfo","getUserInfo","updateCommonOptions"])),(0,u.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 n.next=6,t.getCityList();case 6:return t.$util.setNavigationBarColor({bg:t.primaryColor}),n.next=9,t.$api.technician.coachInfo();case 9:return a=n.sent,t.form.admin_id=a.id?a.admin_id:0,n.next=13,t.getStoreList();case 13:if(!a||a.id){n.next=16;break}return t.$util.hideAll(),n.abrupt("return");case 16:for(u in o=["id_card","license","self_img"],o.map((function(e){a[e]=a[e]&&a[e].length>0?a[e].map((function(e){return{path:e}})):[]})),a.id_card&&a.id_card.length>1&&(a.id_card_fan=[a.id_card[1]],a.id_card_people=[a.id_card[2]],a.id_card.splice(1,3)),c=["work_img","video"],c.map((function(e){a[e]=a[e]&&a[e].length>0?[{path:a[e]}]:[]})),a.birthday=a.birthday?t.$util.formatTime(1e3*a.birthday,"YY-M-D"):"",t.form)t.form[u]=a[u];s=["mobile","status"],s.map((function(e){t["mobile"==e?"old_phone":"coach_status"]=a[e]})),t.cityIndex=t.cityList.findIndex((function(e){return e.id==a.city_id})),t.storeIndndex=t.storeList.findIndex((function(e){return e.id==a.store_id})),t.$util.hideAll();case 28:case"end":return n.stop()}}),n)})))()},initRefresh:function(){this.initIndex(!0)},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=14;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.form.city_id=s.length>0?s[0].id:0;case 14:case"end":return t.stop()}}),t)})))()},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.form.admin_id,r=void 0===n?0:n,r){t.next=3;break}return t.abrupt("return");case 3:return t.next=5,e.$api.mine.getStoreSelect({admin_id:r});case 5:a=t.sent,a.unshift({id:0,title:"不挂靠门店"}),e.storeList=a;case 8: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},toSend:function(){var e=this;return(0,o.default)(i.default.mark((function t(){var n,r,a,o;return i.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(n=e.authTime,!n){t.next=3;break}return t.abrupt("return");case 3:if(r=e.form.mobile,a=void 0===r?"":r,null!=a&&/^(1[0-9]{10})$/.test(a)){t.next=7;break}return e.$util.showToast({title:null==a?"请输入手机号":"".concat(a," 手机号无效")}),t.abrupt("return");case 7:if(!e.lockTap){t.next=9;break}return t.abrupt("return");case 9:return e.lockTap=!0,e.$util.showLoading(),t.prev=11,t.next=14,e.$api.user.sendShortMsg({phone:a});case 14:e.$util.hideAll(),e.lockTap=!1,o=60,e.timer=setInterval((function(){0!==o?(o--,e.authTime=o):clearInterval(e.timer)}),1e3),t.next=23;break;case 20:t.prev=20,t.t0=t["catch"](11),setTimeout((function(){e.lockTap=!1,e.$util.hideAll()}),2e3);case 23:case"end":return t.stop()}}),t,null,[[11,20]])})))()},imgUpload:function(e){var t=e.imagelist,n=e.imgtype;this.form[n]=t},toChooseLocation:function(t){var n=this;return(0,o.default)(i.default.mark((function t(){var r,o,c,u,s,l,d,f,p,h,m,g,_,v,b,k;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,l=void 0===s?0:s,d=u.lat,f=u.lng,l&&(d,f),p={},t.next=9,e.chooseLocation(p);case 9:if(h=t.sent,m=(0,a.default)(h,2),g=m[1],_=g.address,v=void 0===_?"":_,b=g.longitude,k=g.latitude,v){t.next=18;break}return t.abrupt("return");case 18:n.form.address=v,n.form.lng=b,n.form.lat=k;case 21:case"end":return t.stop()}}),t)})))()},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;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]&&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(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.admin_id,o=e.old_phone,c=e.configInfo.short_code_status,!c||o==n.mobile||null!=n.short_code&&6==n.short_code.length){t.next=19;break}return e.$util.showToast({title:"请输入6位数短信验证码"}),t.abrupt("return");case 19:if(c&&o!=n.mobile||delete n.short_code,!e.lockTap){t.next=22;break}return t.abrupt("return");case 22:return e.lockTap=!0,e.$util.showLoading(),t.prev=24,t.next=27,e.$api.technician.coachUpdateV2(n);case 27:e.$util.hideAll(),e.$util.showToast({title:"提交成功"}),e.timer&&clearInterval(e.timer),setTimeout((function(){getCurrentPages().length>1&&e.$util.back(),e.$util.goUrl({url:"/pages/mine",openType:"reLaunch"})}),2e3),t.next=36;break;case 33:t.prev=33,t.t0=t["catch"](24),setTimeout((function(){e.lockTap=!1,e.$util.hideAll()}),2e3);case 36:case"end":return t.stop()}}),t,null,[[24,33]])})))()}})};t.default=d}).call(this,n("df3c")["default"])}},[["800d","common/runtime","common/vendor"]]]);