create.js 5.0 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/cust/create"],{"48ec":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,"e893"))},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,"a81d"))},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,"830c"))},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,"f0c0"))},uRadio:function(){return t.e("uni_modules/vk-uview-ui/components/u-radio/u-radio").then(t.bind(null,"79d4"))},uGap:function(){return t.e("uni_modules/vk-uview-ui/components/u-gap/u-gap").then(t.bind(null,"9db7"))},uButton:function(){return t.e("uni_modules/vk-uview-ui/components/u-button/u-button").then(t.bind(null,"51b1b"))},uSelect:function(){return t.e("uni_modules/vk-uview-ui/components/u-select/u-select").then(t.bind(null,"17bf"))},uModal:function(){return t.e("uni_modules/vk-uview-ui/components/u-modal/u-modal").then(t.bind(null,"85bf"))},uToast:function(){return t.e("uni_modules/vk-uview-ui/components/u-toast/u-toast").then(t.bind(null,"9568"))}},o=function(){var e=this.$createElement;this._self._c},i=[]},"6e0b":function(e,n,t){"use strict";t.r(n);var u=t("8c85"),o=t.n(u);for(var i in u)["default"].indexOf(i)<0&&function(e){t.d(n,e,(function(){return u[e]}))}(i);n["default"]=o.a},"8c85":function(e,n,t){"use strict";(function(e,t){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var u={data:function(){return{isEdit:!1,form:{name:null,realname: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(n){var t=this,u=t.getOpenerEventChannel();u.on&&u.on("data",(function(n){n&&(t.form.name=n.info.name,t.form.realname=n.info.realname,t.form.phone=n.info.phone,t.form.sex=n.info.sex,t.form.remark=n.info.demand,t.form.id=n.info.id,t.isEdit=!0,e.setNavigationBarTitle({title:"编辑客户-"+n.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 e=this,n=this;this.$refs.uForm.validate((function(u){if(u){var o="apicustomeradd",i={phone_type:1,name:n.form.name,realname:n.form.realname,phone:n.form.phone.replace(/\s+/g,""),sex:n.form.sex,demand:n.form.remark};n.isEdit&&(o="apicustomeredit",i.id=n.form.id),t.api.cust[o](i).then((function(u){n.isEdit?t.$msgConfirm("编辑成功",(function(){t.reLaunch({url:"/pages/cust/list"})}),(function(){t.reLaunch({url:"/pages/cust/list"})})):t.$msgConfirm("添加成功,是否前往客户列表?",(function(){t.reLaunch({url:"/pages/cust/list"})}),(function(){e.form={name:null,realname:null,phone:null,sex:"male",remark:null,estate_id:null,estate_name:null}}))}))}else console.log("验证失败")}))},getPhoneNumber:function(n){var t=this;if("getPhoneNumber:fail user deny"==n.detail.errMsg)return t.$refs.uToast.show({title:"您可以在个人设置中再次绑定",type:"warning"}),void setTimeout((function(){t.reLunchUser()}),1500);console.log(n.detail.errMsg),console.log(n.detail.iv),console.log(n.detail.encryptedData);var u=n.detail.iv,o=n.detail.encryptedData;e.login({success:function(e){e.code?t.setUserPhoneNumber(o,u,e.code):(this.$refs.uToast.show({title:e.errMsg,type:"warning"}),console.log("登录失败!"+e.errMsg))}})},hideKeyboard:function(){t.hideKeyboard()},getFormatDate:function(e){if(void 0==e||""==e)return"";var n=e;return parseInt(e)<10&&(n="0"+e),n}}};n.default=u}).call(this,t("bc2e")["default"],t("543d")["default"])},"9a73":function(e,n,t){"use strict";var u=t("d572"),o=t.n(u);o.a},d572:function(e,n,t){},ef79:function(e,n,t){"use strict";(function(e,n){var u=t("4ea4");t("2ab2");u(t("66fd"));var o=u(t("fd1f"));e.__webpack_require_UNI_MP_PLUGIN__=t,n(o.default)}).call(this,t("bc2e")["default"],t("543d")["createPage"])},fd1f:function(e,n,t){"use strict";t.r(n);var u=t("48ec"),o=t("6e0b");for(var i in o)["default"].indexOf(i)<0&&function(e){t.d(n,e,(function(){return o[e]}))}(i);t("9a73");var r=t("f0c5"),a=Object(r["a"])(o["default"],u["b"],u["c"],!1,null,null,null,!1,u["a"],void 0);n["default"]=a.exports}},[["ef79","common/runtime","common/vendor"]]]);