!function(){function e(d){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(d)}function d(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */d=function(){return a};var a={},n=Object.prototype,o=n.hasOwnProperty,i=Object.defineProperty||function(e,d,a){e[d]=a.value},c="function"==typeof Symbol?Symbol:{},m=c.iterator||"@@iterator",r=c.asyncIterator||"@@asyncIterator",t=c.toStringTag||"@@toStringTag";function s(e,d,a){return Object.defineProperty(e,d,{value:a,enumerable:!0,configurable:!0,writable:!0}),e[d]}try{s({},"")}catch(C){s=function(e,d,a){return e[d]=a}}function p(e,d,a,n){var o=d&&d.prototype instanceof u?d:u,c=Object.create(o.prototype),m=new L(n||[]);return i(c,"_invoke",{value:x(e,a,m)}),c}function g(e,d,a){try{return{type:"normal",arg:e.call(d,a)}}catch(C){return{type:"throw",arg:C}}}a.wrap=p;var O={};function u(){}function I(){}function l(){}var f={};s(f,m,(function(){return this}));var h=Object.getPrototypeOf,v=h&&h(h(E([])));v&&v!==n&&o.call(v,m)&&(f=v);var y=l.prototype=u.prototype=Object.create(f);function b(e){["next","throw","return"].forEach((function(d){s(e,d,(function(e){return this._invoke(d,e)}))}))}function w(d,a){function n(i,c,m,r){var t=g(d[i],d,c);if("throw"!==t.type){var s=t.arg,p=s.value;return p&&"object"==e(p)&&o.call(p,"__await")?a.resolve(p.__await).then((function(e){n("next",e,m,r)}),(function(e){n("throw",e,m,r)})):a.resolve(p).then((function(e){s.value=e,m(s)}),(function(e){return n("throw",e,m,r)}))}r(t.arg)}var c;i(this,"_invoke",{value:function(e,d){function o(){return new a((function(a,o){n(e,d,a,o)}))}return c=c?c.then(o,o):o()}})}function x(e,d,a){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return P()}for(a.method=o,a.arg=i;;){var c=a.delegate;if(c){var m=S(c,a);if(m){if(m===O)continue;return m}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if("suspendedStart"===n)throw n="completed",a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);n="executing";var r=g(e,d,a);if("normal"===r.type){if(n=a.done?"completed":"suspendedYield",r.arg===O)continue;return{value:r.arg,done:a.done}}"throw"===r.type&&(n="completed",a.method="throw",a.arg=r.arg)}}}function S(e,d){var a=d.method,n=e.iterator[a];if(void 0===n)return d.delegate=null,"throw"===a&&e.iterator.return&&(d.method="return",d.arg=void 0,S(e,d),"throw"===d.method)||"return"!==a&&(d.method="throw",d.arg=new TypeError("The iterator does not provide a '"+a+"' method")),O;var o=g(n,e.iterator,d.arg);if("throw"===o.type)return d.method="throw",d.arg=o.arg,d.delegate=null,O;var i=o.arg;return i?i.done?(d[e.resultName]=i.value,d.next=e.nextLoc,"return"!==d.method&&(d.method="next",d.arg=void 0),d.delegate=null,O):i:(d.method="throw",d.arg=new TypeError("iterator result is not an object"),d.delegate=null,O)}function k(e){var d={tryLoc:e[0]};1 in e&&(d.catchLoc=e[1]),2 in e&&(d.finallyLoc=e[2],d.afterLoc=e[3]),this.tryEntries.push(d)}function j(e){var d=e.completion||{};d.type="normal",delete d.arg,e.completion=d}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function E(e){if(e){var d=e[m];if(d)return d.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,n=function d(){for(;++a=0;--n){var i=this.tryEntries[n],c=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var m=o.call(i,"catchLoc"),r=o.call(i,"finallyLoc");if(m&&r){if(this.prev=0;--a){var n=this.tryEntries[a];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev=0;--d){var a=this.tryEntries[d];if(a.finallyLoc===e)return this.complete(a.completion,a.afterLoc),j(a),O}},catch:function(e){for(var d=this.tryEntries.length-1;d>=0;--d){var a=this.tryEntries[d];if(a.tryLoc===e){var n=a.completion;if("throw"===n.type){var o=n.arg;j(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,d,a){return this.delegate={iterator:E(e),resultName:d,nextLoc:a},"next"===this.method&&(this.arg=void 0),O}},a}function a(e,d){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);d&&(n=n.filter((function(d){return Object.getOwnPropertyDescriptor(e,d).enumerable}))),a.push.apply(a,n)}return a}function n(e){for(var d=1;de.length)&&(d=e.length);for(var a=0,n=new Array(d);a=1?function(e){var d=e.replace(/(^\s*)|(\s*$)/g,"");return(d=(d=(d=d.replace(/[\.]*/g,"")).replace(/(^0[\d]*)$/g,"0")).replace(/^0\d$/g,"0")).replace(/[^\d]/g,"")}(e):""},m=function(){var i=c(d().mark((function i(){var c;return d().wrap((function(d){for(;;)switch(d.prev=d.next){case 0:if(d.prev=0,o.name){d.next=4;break}return w("请选择收货人"),d.abrupt("return");case 4:if(o.phoneNumber&&/^((13[0-9])|(14(0|[5-7]|9))|(15([0-3]|[5-9]))|(16(2|[5-7]))|(17[0-8])|(18[0-9])|(19([0-3]|[5-9])))\d{8}$/.test(o.phoneNumber)){d.next=7;break}return w("手机号输入有误"),d.abrupt("return");case 7:if(o.pcrStr){d.next=10;break}return w("请选择所在地区"),d.abrupt("return");case 10:if(o.detailAddress){d.next=13;break}return w("请输入详细地址"),d.abrupt("return");case 13:if(o.isClick=!0,c={name:o.name,phoneNumber:o.phoneNumber,province:o.province,city:o.city,region:o.region,detailAddress:o.detailAddress,defaultStatus:o.defaultStatus},!e.query.id){d.next=20;break}return d.next=18,x.post("/edu-app/userReceiveAddress/update",{hideLoading:!1,data:n({id:e.query.id},c)});case 18:d.next=22;break;case 20:return d.next=22,x.post("/edu-app/userReceiveAddress/save",{hideLoading:!1,data:n({},c)});case 22:o.isClick=!1,a.back(),d.next=29;break;case 26:d.prev=26,d.t0=d.catch(0),o.isClick=!1;case 29:case"end":return d.stop()}}),i,null,[[0,26]])})));return function(){return i.apply(this,arguments)}}(),r=function(){var a=c(d().mark((function a(){var n,i;return d().wrap((function(d){for(;;)switch(d.prev=d.next){case 0:return d.prev=0,d.next=3,x.get("/edu-app/userReceiveAddress/detail/"+e.query.id);case 3:n=d.sent,i=n.data,o.name=i.name,o.phoneNumber=i.phoneNumber,o.province=i.province,o.city=i.city,o.region=i.region?i.region:"",o.pcrStr=(i.provinceName||"")+(i.cityName||"")+(i.regionName||""),o.detailAddress=i.detailAddress,o.defaultStatus=i.defaultStatus,d.next=17;break;case 15:d.prev=15,d.t0=d.catch(0);case 17:case"end":return d.stop()}}),a,null,[[0,15]])})));return function(){return a.apply(this,arguments)}}();return h((function(){e.query.id&&r()})),function(){return t("div",{class:k.operation},[t(j,{inset:!0,class:k.form},{default:function(){return[t(L,{label:"收货人",placeholder:"请输入收货人姓名",modelValue:o.name,"onUpdate:modelValue":function(e){return o.name=e},autocomplete:"off"},null),t(L,{label:"手机号",placeholder:"请输入收货人手机号",modelValue:o.phoneNumber,"onUpdate:modelValue":function(e){return o.phoneNumber=e},maxlength:11,type:"tel",autocomplete:"off",formatter:i},null),t(L,{label:"所在地区",placeholder:"省/市/区",readonly:!0,isLink:!0,modelValue:o.pcrStr,onClick:function(){o.showPicker=!0}},null),t(L,{label:"详细地址",placeholder:"街道/小区楼栋/乡村名称",type:"textarea",rows:3,autocomplete:"off",modelValue:o.detailAddress,"onUpdate:modelValue":function(e){return o.detailAddress=e},maxlength:100},null)]}}),t(j,{inset:!0,style:{marginTop:"12px"}},{default:function(){return[t(E,{title:"设置为默认地址",center:!0,class:k.default},{value:function(){return t(_,{modelValue:o.defaultStatus,"onUpdate:modelValue":function(e){return o.defaultStatus=e},size:"23px"},null)}})]}}),t(S,{position:"bottom"},{default:function(){return[t("div",{class:"btnGroup"},[t(v,{type:"primary",block:!0,round:!0,class:k.createBtn,onClick:m,disabled:o.isClick},{default:function(){return[y("确认")]}})])]}}),t(b,{show:o.showPicker,"onUpdate:show":function(e){return o.showPicker=e},position:"bottom",round:!0,class:"popupBottomSearch"},{default:function(){return[t(P,{showToolbar:!0,columns:G,columnsFieldNames:{text:"name",value:"code",children:"areas"},onCancel:function(){return o.showPicker=!1},onConfirm:function(e){console.log(e,"val");var d=e.selectedOptions||[];o.pcrStr="",2===d.length?d.forEach((function(e,d){o.pcrStr+=e.name,0===d?o.province=e.code:1===d&&(o.city=e.code)})):d.forEach((function(e,d){o.pcrStr+=e.name,0===d?o.province=e.code:1===d?o.city=e.code:2===d&&(o.region=e.code)})),o.showPicker=!1}},null)]}})])}}}))}}}))}();