index.js 5.4KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/userBinding/index"],{1735:function(t,e,n){"use strict";n.r(e);var a=n("79f1"),r=n("54ef");for(var i in r)"default"!==i&&function(t){n.d(e,t,(function(){return r[t]}))}(i);n("ac5d");var u,o=n("f0c5"),d=Object(o["a"])(r["default"],a["b"],a["c"],!1,null,null,null,!1,a["a"],u);e["default"]=d.exports},"25ae":function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=c(n("a34a")),r=c(n("1079")),i=c(n("3d69")),u=c(n("d125")),o=n("0b44"),d=n("26cb");function c(t){return t&&t.__esModule?t:{default:t}}function s(t,e,n,a,r,i,u){try{var o=t[i](u),d=o.value}catch(c){return void n(c)}o.done?e(d):Promise.resolve(d).then(a,r)}function f(t){return function(){var e=this,n=arguments;return new Promise((function(a,r){var i=t.apply(e,n);function u(t){s(i,a,r,u,o,"next",t)}function o(t){s(i,a,r,u,o,"throw",t)}u(void 0)}))}}function l(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}function p(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?l(Object(n),!0).forEach((function(e){b(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function b(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var v={mixins:[u.default],data:function(){return{name:"",idCard:"",mobile:"",code:"",aespass:""}},onLoad:function(){this.getCode()},methods:p(p({},(0,d.mapMutations)(["setIsBand","setConfigList","setFiledList","setOrg"])),{},{nameInput:function(t){this.name=t.detail},userIdInput:function(t){this.idCard=t.detail},numberInput:function(t){this.mobile=t.detail},codeInput:function(t){this.code=t.detail},send:function(){return this.mobile?/^1(3|4|5|7|8|9|6)\d{9}$/i.test(this.mobile)?void this.sendCodes():(0,i.default)("请输入正确的手机号码"):(0,i.default)("请填写手机号码")},getCode:function(){var t=this;return f(a.default.mark((function e(){var n;return a.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,(0,o.getCode)({},!0);case 2:n=e.sent,t.aespass=n.data.data.aespass;case 4:case"end":return e.stop()}}),e)})))()},sendCodes:function(){var t=this;return f(a.default.mark((function e(){var n,r,i;return a.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return n=t.mobile,r=t.aespass,i={phone:n.toString(),aespass:r},t.sendCode(),e.next=6,(0,o.sendCode)(i,!0);case 6:e.sent;case 7:case"end":return e.stop()}}),e)})))()},bind:function(){var e=this;return f(a.default.mark((function n(){var u,d,c,s,f;return a.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(e.name){n.next=2;break}return n.abrupt("return",(0,i.default)("请填写患者姓名"));case 2:if(u=e.idCard.toUpperCase(),(0,r.default)(u)){n.next=6;break}return(0,i.default)("请输入正确的身份证号"),n.abrupt("return");case 6:if(e.mobile){n.next=8;break}return n.abrupt("return",(0,i.default)("请填写手机号码"));case 8:if(/^1(3|4|5|7|8|9|6)\d{9}$/i.test(e.mobile)){n.next=10;break}return n.abrupt("return",(0,i.default)("请输入正确的手机号码"));case 10:if(e.code){n.next=12;break}return n.abrupt("return",(0,i.default)("请填写验证码"));case 12:return d={name:e.name,id_card_no:e.idCard,mobile:e.mobile,code:e.code},n.next=15,(0,o.bindMobile)(d,!0);case 15:c=n.sent,c.data.data.result?(0,i.default)("验证码错误"):1==c.data.data.is_bind?(s={is_bind:!0,userInfo:c.data.data.patient},e.setIsBand(s),c.data.data.patient.id>0&&(e.getDataConfig(c.data.data.patient.id),e.getFieldConfig(c.data.data.patient.id)),c.data.data.template_id.id>0&&(f={org:c.data.data.template_id},e.setOrg(f)),(0,i.default)("绑定成功"),setTimeout((function(){t.navigateBack()}),1e3)):(0,i.default)("绑定失败,重新绑定");case 18:case"end":return n.stop()}}),n)})))()},getFieldConfig:function(t){var e=this;return f(a.default.mark((function n(){var r,i,u;return a.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r={patient_id:t},n.next=3,(0,o.getFieldConfig)(r);case 3:i=n.sent,u={filedList:i.data.data},e.setFiledList(u);case 6:case"end":return n.stop()}}),n)})))()},getDataConfig:function(t){var e=this;return f(a.default.mark((function n(){var r,i,u;return a.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r={patient_id:t},n.next=3,(0,o.getDataConfig)(r);case 3:i=n.sent,u={configList:i.data.data.list},e.setConfigList(u);case 6:case"end":return n.stop()}}),n)})))()}})};e.default=v}).call(this,n("543d")["default"])},"54ef":function(t,e,n){"use strict";n.r(e);var a=n("25ae"),r=n.n(a);for(var i in a)"default"!==i&&function(t){n.d(e,t,(function(){return a[t]}))}(i);e["default"]=r.a},"79f1":function(t,e,n){"use strict";var a;n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){return a}));var r=function(){var t=this,e=t.$createElement;t._self._c},i=[]},ac5d:function(t,e,n){"use strict";var a=n("fa17"),r=n.n(a);r.a},ccc4:function(t,e,n){"use strict";(function(t){n("4c9b");a(n("66fd"));var e=a(n("1735"));function a(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,n("543d")["createPage"])},fa17:function(t,e,n){}},[["ccc4","common/runtime","common/vendor"]]]);