(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/cust/create"],{"014c":function(e,n,t){"use strict";(function(e){t("3690");u(t("66fd"));var n=u(t("0521"));function u(e){return e&&e.__esModule?e:{default:e}}wx.__webpack_require_UNI_MP_PLUGIN__=t,e(n.default)}).call(this,t("543d")["createPage"])},"0521":function(e,n,t){"use strict";t.r(n);var u=t("a989"),o=t("e983");for(var i in o)"default"!==i&&function(e){t.d(n,e,(function(){return o[e]}))}(i);t("058a");var r,a=t("f0c5"),l=Object(a["a"])(o["default"],u["b"],u["c"],!1,null,null,null,!1,u["a"],r);n["default"]=l.exports},"058a":function(e,n,t){"use strict";var u=t("6127"),o=t.n(u);o.a},6127:function(e,n,t){},"77da":function(e,n,t){"use strict";(function(e){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var t={data:function(){return{isEdit:!1,form:{name:null,phone:null,sex:"male",remark:null,estate_id:null,estate_name:null,saler_id:null,saler_name:null},customer_id:null,submitButtonDisabled:!0,rules:{name:[{required:!0,message:"姓名不得为空",trigger:["change","blur"]}],phone:[{required:!0,message:"手机号不得为空",trigger:["change","blur"]},{len:11,message:"手机号格式不正确",trigger:["change","blur"]}],estate_name:[{required:!0,message:"意向项目不能为空",trigger:["change"]}]},propertySelectShow:!1,propertySelectList:[],salerSelectShow:!1,salerSelectList:[],submitModalShow:!1,modalShow:!1,modalContent:""}},onLoad:function(e){var n=this,t=n.getOpenerEventChannel();t.on&&t.on("data",(function(e){e&&(n.form.name=e.info.name,n.form.phone=e.info.phone,n.form.sex=e.info.sex,n.form.remark=e.info.demand,n.form.id=e.info.id,n.isEdit=!0,wx.setNavigationBarTitle({title:"编辑客户-"+e.info.name}))}))},created:function(){},onReady:function(){this.$refs.uForm.setRules(this.rules)},methods:{propertySelectConfirm:function(e){var n=this;e.map((function(e,t){n.form.estate_id=e.value,n.form.estate_name=e.label}))},submitHandle:function(){var n=this,t=this;this.$refs.uForm.validate((function(u){if(u){var o="apicustomeradd",i={phone_type:1,name:t.form.name,phone:t.form.phone,sex:t.form.sex,demand:t.form.remark};t.isEdit&&(o="apicustomeredit",i.id=t.form.id),e.api.cust[o](i).then((function(u){t.isEdit?e.$msgConfirm("编辑成功",(function(){e.reLaunch({url:"/pages/cust/list"})}),(function(){e.reLaunch({url:"/pages/cust/list"})})):e.$msgConfirm("添加成功,是否前往客户列表？",(function(){e.reLaunch({url:"/pages/cust/list"})}),(function(){n.form={name:null,phone:null,sex:"male",remark:null,estate_id:null,estate_name:null}}))}))}else console.log("验证失败")}))},getPhoneNumber:function(e){var n=this;if("getPhoneNumber:fail user deny"==e.detail.errMsg)return n.$refs.uToast.show({title:"您可以在个人设置中再次绑定",type:"warning"}),void setTimeout((function(){n.reLunchUser()}),1500);console.log(e.detail.errMsg),console.log(e.detail.iv),console.log(e.detail.encryptedData);var t=e.detail.iv,u=e.detail.encryptedData;wx.login({success:function(e){e.code?n.setUserPhoneNumber(u,t,e.code):(this.$refs.uToast.show({title:e.errMsg,type:"warning"}),console.log("登录失败！"+e.errMsg))}})},hideKeyboard:function(){e.hideKeyboard()},getFormatDate:function(e){if(void 0==e||""==e)return"";var n=e;return parseInt(e)<10&&(n="0"+e),n}}};n.default=t}).call(this,t("543d")["default"])},a989: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 u}));var u={uForm:function(){return t.e("uni_modules/vk-uview-ui/components/u-form/u-form").then(t.bind(null,"ce96"))},uFormItem:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/vk-uview-ui/components/u-form-item/u-form-item")]).then(t.bind(null,"23cb"))},uInput:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/vk-uview-ui/components/u-input/u-input")]).then(t.bind(null,"6943"))},uRadioGroup:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/vk-uview-ui/components/u-radio-group/u-radio-group")]).then(t.bind(null,"9183"))},uRadio:function(){return t.e("uni_modules/vk-uview-ui/components/u-radio/u-radio").then(t.bind(null,"0505"))},uGap:function(){return t.e("uni_modules/vk-uview-ui/components/u-gap/u-gap").then(t.bind(null,"dc7f"))},uButton:function(){return t.e("uni_modules/vk-uview-ui/components/u-button/u-button").then(t.bind(null,"ce9e"))},uSelect:function(){return t.e("uni_modules/vk-uview-ui/components/u-select/u-select").then(t.bind(null,"2de4"))},uModal:function(){return t.e("uni_modules/vk-uview-ui/components/u-modal/u-modal").then(t.bind(null,"f813"))},uToast:function(){return t.e("uni_modules/vk-uview-ui/components/u-toast/u-toast").then(t.bind(null,"934c"))}},o=function(){var e=this,n=e.$createElement;e._self._c},i=[]},e983:function(e,n,t){"use strict";t.r(n);var u=t("77da"),o=t.n(u);for(var i in u)"default"!==i&&function(e){t.d(n,e,(function(){return u[e]}))}(i);n["default"]=o.a}},[["014c","common/runtime","common/vendor"]]]);