(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/peopleList/addPeople"],{"0366":function(e,n,t){},2016:function(e,n,t){"use strict";(function(e){t("7a99");r(t("66fd"));var n=r(t("77f1"));function r(e){return e&&e.__esModule?e:{default:e}}wx.__webpack_require_UNI_MP_PLUGIN__=t,e(n.default)}).call(this,t("543d")["createPage"])},4907:function(e,n,t){"use strict";t.d(n,"b",(function(){return o})),t.d(n,"c",(function(){return i})),t.d(n,"a",(function(){return r}));var r={uCell:function(){return Promise.all([t.e("common/vendor"),t.e("node-modules/uview-ui/components/u-cell/u-cell")]).then(t.bind(null,"a4da"))},"u-Form":function(){return Promise.all([t.e("common/vendor"),t.e("node-modules/uview-ui/components/u--form/u--form")]).then(t.bind(null,"e281"))},uFormItem:function(){return Promise.all([t.e("common/vendor"),t.e("node-modules/uview-ui/components/u-form-item/u-form-item")]).then(t.bind(null,"2d3a"))},"u-Input":function(){return Promise.all([t.e("common/vendor"),t.e("node-modules/uview-ui/components/u--input/u--input")]).then(t.bind(null,"2000"))},uIcon:function(){return Promise.all([t.e("common/vendor"),t.e("node-modules/uview-ui/components/u-icon/u-icon")]).then(t.bind(null,"55f2"))},"u-Textarea":function(){return Promise.all([t.e("common/vendor"),t.e("node-modules/uview-ui/components/u--textarea/u--textarea")]).then(t.bind(null,"562f"))}},o=function(){var e=this,n=e.$createElement;e._self._c;e._isMounted||(e.e0=function(n){e.showgender=!0})},i=[]},"53ec":function(e,n,t){"use strict";(function(e){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var t={data:function(){return{genderArray:["男","女"],typeArray:["身份证","临时身份证","士兵证","暂住证","外交护照","普通护照","台湾居民来往大陆通行证","港澳居民来往内地通行证","港澳同胞回乡证","其他证件（包括联合国通行证 欧洲共同体护照等）"],index:0,form:{userInfo:{name:"",gender:"",birthday:"",certificate_type:"",phone:"",certificate_no:"",emergency_name:"",emergency_phone:"",food_taboos:"",hope_improve:""}},rules:{"userInfo.name":{type:"string",required:!0,message:"请填写姓名",trigger:["blur","change"]},"userInfo.gender":{type:"string",max:1,required:!0,message:"请选择男或女",trigger:["blur","change"]},"userInfo.certificate_no":{type:"string",len:18,required:!0,message:"请填写正确的证件号",trigger:["blur"]},"userInfo.certificate_type":{type:"string",required:!0,message:"请填写证件类型",trigger:["blur","change"]},"userInfo.phone":{type:"string",required:!0,len:11,message:"请输入手机号码",trigger:["blur","change"]},"userInfo.emergency_name":{type:"string",required:!0,message:"请填写紧急人姓名",trigger:["blur"]},"userInfo.emergency_phone":{type:"number",required:!0,len:11,message:"请填写紧急联系人电话",trigger:["blur","change"]}},radio:"",switchVal:!1,state:1,id:0}},onLoad:function(e){var n=JSON.parse(e.info);1==n.gender?n.gender="男":2==n.gender&&n.gender,this.id=n.id,this.form.userInfo=n,this.form.userInfo.certificate_type=n.certificate_type_text,this.state=e.state,console.log(this.state)},methods:{bindPickerChange:function(e){console.log("picker发送选择改变，携带值为",e.detail.value),console.log(this.genderArray[e.detail.value]),this.form.userInfo.gender=this.genderArray[e.detail.value]},bindType:function(e){this.form.userInfo.certificate_type=this.typeArray[e.detail.value]},bindDateChange:function(e){console.log(e),this.form.userInfo.birthday=e.detail.value},submit:function(){var n=JSON.parse(JSON.stringify(this.form.userInfo));console.log(n),"男"==n.gender?n.gender=1:"女"==n.gender&&(n.gender=2),"身份证"==n.certificate_type&&(n.certificate_type=1),n.id=this.id,e.$u.http.post("/api/traveler/edit",n,{custom:{auth:!0}}).then((function(n){e.showToast({icon:"success",title:"修改成功"}),setTimeout((function(){e.navigateBack({delta:1})}),1500)})).catch((function(e){}))},add:function(){console.log(this.$store.state.token,"xxxxxxxxxxx");var n=JSON.parse(JSON.stringify(this.form.userInfo));console.log(n),"男"==n.gender?n.gender=1:"女"==n.gender&&(n.gender=2),"身份证"==n.certificate_type&&(n.certificate_type=1),e.$u.http.post("/api/traveler/add",n,{custom:{auth:!0}}).then((function(n){e.showToast({icon:"success",title:"添加成功"}),setTimeout((function(){e.navigateBack({delta:1})}),1500)})).catch((function(n){console.log(n),e.showToast({icon:"error",title:n.message})}))}}};n.default=t}).call(this,t("543d")["default"])},"77f1":function(e,n,t){"use strict";t.r(n);var r=t("4907"),o=t("d6f4");for(var i in o)"default"!==i&&function(e){t.d(n,e,(function(){return o[e]}))}(i);t("8134");var u,a=t("f0c5"),s=Object(a["a"])(o["default"],r["b"],r["c"],!1,null,null,null,!1,r["a"],u);n["default"]=s.exports},8134:function(e,n,t){"use strict";var r=t("0366"),o=t.n(r);o.a},d6f4:function(e,n,t){"use strict";t.r(n);var r=t("53ec"),o=t.n(r);for(var i in r)"default"!==i&&function(e){t.d(n,e,(function(){return r[e]}))}(i);n["default"]=o.a}},[["2016","common/runtime","common/vendor"]]]);