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
5.4 KiB
1 lines
5.4 KiB
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["dynamic/pages/technician/edit"],{"0a31":function(e,t,r){"use strict";var n=r("5faa"),i=r.n(n);i.a},"5faa":function(e,t,r){},b573:function(e,t,r){"use strict";r.r(t);var n=r("d92e"),i=r.n(n);for(var a in n)["default"].indexOf(a)<0&&function(e){r.d(t,e,(function(){return n[e]}))}(a);t["default"]=i.a},c939:function(e,t,r){"use strict";(function(e,t){var n=r("47a9");r("7043");n(r("3240"));var i=n(r("d253"));e.__webpack_require_UNI_MP_PLUGIN__=r,t(i.default)}).call(this,r("3223")["default"],r("df3c")["createPage"])},d253:function(e,t,r){"use strict";r.r(t);var n=r("ffe8"),i=r("b573");for(var a in i)["default"].indexOf(a)<0&&function(e){r.d(t,e,(function(){return i[e]}))}(a);r("0a31");var o=r("828b"),u=Object(o["a"])(i["default"],n["b"],n["c"],!1,null,null,null,!1,n["a"],void 0);t["default"]=u.exports},d92e:function(e,t,r){"use strict";(function(e){var n=r("47a9");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(r("7eb4")),a=n(r("34cf")),o=n(r("ee10")),u=n(r("7ca3")),c=r("8f59");function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){(0,u.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var f={data:function(){return{options:{},subForm:{id:0,cover:[],imgs:[],type:1,title:"",text:"",lat:"",lng:"",address:""},rule:[{name:"cover",checkType:"isNotNull",errorMsg:"请上传封面图"},{name:"imgs",checkType:"isNotNull",errorMsg:""},{name:"title",checkType:"isNotNull",errorMsg:"请输入标题",regType:2},{name:"text",checkType:"isNotNull",errorMsg:"请输入正文内容",regType:2},{name:"address",checkType:"isNotNull",errorMsg:"请选择定位地点"}],lockTap:!1}},computed:(0,c.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},haveShieldOper:function(e){return e.user.haveShieldOper}}),onLoad:function(e){var t=e.type;t*=1,this.options=e,this.subForm.type=t,this.rule[1].errorMsg=1==t?"请上传图片":"请上传视频",this.initIndex(),this.$util.setNavigationBarColor({bg:this.primaryColor})},methods:l(l({},(0,c.mapMutations)(["updateUserItem"])),{},{initIndex:function(){var e=this;return(0,o.default)(i.default.mark((function t(){var r,n,a,o;return i.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(r=e.options.id,n=void 0===r?0:r,n){t.next=3;break}return t.abrupt("return");case 3:return t.next=5,e.$api.dynamic.coachDynamicInfo({id:n});case 5:for(o in a=t.sent,a.cover=[{path:a.cover}],a.imgs=a.imgs.map((function(e){return{path:e}})),e.subForm)e.subForm[o]=a[o];case 9:case"end":return t.stop()}}),t)})))()},imgUpload:function(e){var t=e.imagelist,r=e.imgtype;this.subForm[r]=t},toChooseLocation:function(t){var r=this;return(0,o.default)(i.default.mark((function t(){var n,o,u,c,s,l,f,d,p,m,v,h,g,b,y,k;return i.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r.$util.checkAuth({type:"userLocation"});case 2:return n=r.location,o=n.lat,void 0===o?"":o,u=n.lng,void 0===u?"":u,c=r.subForm,s=c.id,l=void 0===s?0:s,f=c.lat,d=c.lng,l&&(f,d),p={},t.next=9,e.chooseLocation(p);case 9:if(m=t.sent,v=(0,a.default)(m,2),h=v[1],g=h.address,b=void 0===g?"":g,y=h.longitude,k=h.latitude,y){t.next=18;break}return t.abrupt("return");case 18:r.subForm.address=b,r.subForm.lat=k,r.subForm.lng=y;case 21:case"end":return t.stop()}}),t)})))()},validate:function(e){var t=new this.$util.Validate;this.rule.map((function(r){var n=r.name;t.add(e[n],r)}));var r=t.start();return r},submit:function(){var e=this;return(0,o.default)(i.default.mark((function t(){var r,n,a,o,u,c,s;return i.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(r=e.$util.deepCopy(e.subForm),r.imgs=r.imgs&&r.imgs.length>0?r.imgs.map((function(e){return e.path})):[],n=1==r.type?r.imgs.length>0?r.imgs[0]:"":r.cover&&r.cover.length>0?r.cover[0].path:"",r.cover=n,a=e.validate(r),!a){t.next=8;break}return e.$util.showToast({title:a}),t.abrupt("return");case 8:if(!e.lockTap){t.next=10;break}return t.abrupt("return");case 10:return e.lockTap=!0,e.$util.showLoading(),t.prev=12,o=r.id?"dynamicUpdate":"dynamicAdd",t.next=16,e.$api.dynamic[o](r);case 16:u=t.sent,c=u.status,s=void 0===c?1:c,e.$util.hideAll(),e.$util.showToast({title:1==s?"正在审核中":r.id?"编辑成功":"发布成功"}),e.updateUserItem({key:"haveShieldOper",val:1}),setTimeout((function(){e.$util.back(),e.$util.goUrl({url:1,openType:"navigateBack"})}),2e3),t.next=28;break;case 25:t.prev=25,t.t0=t["catch"](12),setTimeout((function(){e.lockTap=!1,e.$util.hideAll()}),2e3);case 28:case"end":return t.stop()}}),t,null,[[12,25]])})))()}})};t.default=f}).call(this,r("df3c")["default"])},ffe8:function(e,t,r){"use strict";r.d(t,"b",(function(){return n})),r.d(t,"c",(function(){return i})),r.d(t,"a",(function(){}));var n=function(){var e=this.$createElement;this._self._c},i=[]}},[["c939","common/runtime","common/vendor"]]]); |