(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-car-addCar"],{"3c8f":function(e,t,n){"use strict";n.r(t);var a=n("d30c"),i=n.n(a);for(var r in a)["default"].indexOf(r)<0&&function(e){n.d(t,e,(function(){return a[e]}))}(r);t["default"]=i.a},"50a5":function(e,t,n){var a=n("c86c");t=a(!1),t.push([e.i,".container[data-v-6519c476]{padding:20px}.container .car-number-input[data-v-6519c476]{width:100%}.container .tag_title[data-v-6519c476]{width:80px;height:30px;display:flex;align-items:center}.container .btn[data-v-6519c476]{margin-top:20px}",""]),e.exports=t},"85a4":function(e,t,n){"use strict";n.r(t);var a=n("c45f"),i=n("3c8f");for(var r in i)["default"].indexOf(r)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(r);n("cf19");var u=n("828b"),c=Object(u["a"])(i["default"],a["b"],a["c"],!1,null,"6519c476",null,!1,a["a"],void 0);t["default"]=c.exports},"9f29":function(e,t,n){var a=n("50a5");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);var i=n("967d").default;i("1f6a5923",a,!0,{sourceMap:!1,shadowMode:!1})},c45f:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return r})),n.d(t,"a",(function(){return a}));var a={"u-Form":n("051a").default,uFormItem:n("f521").default,carNumberInput:n("c48e").default,"u-Input":n("eaa2").default,uButton:n("14ce").default},i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("v-uni-view",{staticClass:"container"},[n("u--form",{ref:"uForm",attrs:{labelPosition:"left",model:e.form,rules:e.rules,labelWidth:"120"}},[n("u-form-item",{ref:"item1",attrs:{label:"车牌号码",prop:"form.vehicleNo",borderBottom:!0,required:!0}},[n("car-number-input",{staticClass:"car-number-input",attrs:{defaultStr:e.form.vehicleNo},on:{numberInputResult:function(t){arguments[0]=t=e.$handleEvent(t),e.numberInputResult.apply(void 0,arguments)}}}),n("u--input",{attrs:{border:"none",maxlength:"8",placeholder:"请输入车牌号码"},model:{value:e.form.vehicleNo,callback:function(t){e.$set(e.form,"vehicleNo",t)},expression:"form.vehicleNo"}})],1)],1),n("u-button",{staticClass:"btn",attrs:{type:"primary",text:"提交信息",shape:"circle"},on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.add.apply(void 0,arguments)}}})],1)},r=[]},cf19:function(e,t,n){"use strict";var a=n("9f29"),i=n.n(a);i.a},d30c:function(e,t,n){"use strict";n("6a54");var a=n("f5bd").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n("0c26"),n("dd2b"),n("c223"),n("fd3c"),n("aa9c"),n("bf0f");var i=a(n("2634")),r=a(n("9b1b")),u=a(n("2fdc")),c=n("75a0"),o={data:function(){return{form:{id:"",vehicleNo:"",vehicleType:"",car_jsz:"",qy_carNo:"",qy_dyz:"",qy_xsz:""},rules:{},array:["货车","卡车","厢式货车"],index:null,fileList1:[],fileList2:[],fileList3:[]}},onLoad:function(e){this.form.vehicleNo=e.vehicleNo,this.form.id=e.id},methods:{add:function(){var e=this;return(0,u.default)((0,i.default)().mark((function t(){return(0,i.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(""!=e.form.vehicleNo&&(7==e.form.vehicleNo.trim().length||8==e.form.vehicleNo.trim().length)){t.next=3;break}return uni.showToast({title:"请填写正确的车牌号",icon:"none"}),t.abrupt("return",!1);case 3:if(!e.form.id){t.next=8;break}return t.next=6,(0,c.post)("/myapi/api/yq_driver/updateBindVehicle",(0,r.default)({},e.form)).then((function(e){1==e.code&&(uni.showToast({title:"修改成功",icon:"none"}),setTimeout((function(){uni.navigateTo({url:"/pages/car/car"})}),500))}));case 6:t.next=10;break;case 8:return t.next=10,(0,c.post)("/myapi/api/yq_driver/bindVehicle",(0,r.default)({},e.form)).then((function(e){1==e.code&&(uni.showToast({title:"绑定成功",icon:"none"}),setTimeout((function(){uni.navigateTo({url:"/pages/car/car"})}),500))}));case 10:case"end":return t.stop()}}),t)})))()},numberInputResult:function(e){this.form.vehicleNo=e},bindPickerChange:function(e){this.index=e.detail.value},deletePic:function(e){this["fileList".concat(e.name)].splice(e.index,1)},afterRead:function(e){var t=this;return(0,u.default)((0,i.default)().mark((function n(){var a,u,c,o,l;return(0,i.default)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:a=[].concat(e.file),u=t["fileList".concat(e.name)].length,a.map((function(n){t["fileList".concat(e.name)].push((0,r.default)((0,r.default)({},n),{},{status:"uploading",message:"上传中"}))})),c=0;case 4:if(!(c<a.length)){n.next=14;break}return n.next=7,t.uploadFilePromise(a[c].url);case 7:o=n.sent,l=t["fileList".concat(e.name)][u],t["fileList".concat(e.name)].splice(u,1,Object.assign(l,{status:"success",message:"",url:o})),u++;case 11:c++,n.next=4;break;case 14:case"end":return n.stop()}}),n)})))()},uploadFilePromise:function(e){return new Promise((function(t,n){uni.uploadFile({url:"http://192.168.2.21:7001/upload",filePath:e,name:"file",formData:{user:"test"},success:function(e){setTimeout((function(){t(e.data.data)}),1e3)}})}))}}};t.default=o}}]);