chunk-419f8c6e.2068e329.js 5.9 KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-419f8c6e"],{"1b69":function(e,t,n){"use strict";n("96cf");var r=n("1da1"),a=n("5daa"),i=n("5f87"),s={};window.ajaxTimeout=2e4,t.a=Object(r.a)(regeneratorRuntime.mark((function e(){var t,n,o,c,u,d,f,l=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=0<l.length&&void 0!==l[0]?l[0]:"",n=1<l.length&&void 0!==l[1]?l[1]:{},c=3<l.length&&void 0!==l[3]?l[3]:{},u=4<l.length&&void 0!==l[4]?l[4]:s,d=5<l.length?l[5]:void 0,o=(o=2<l.length&&void 0!==l[2]?l[2]:"GET").toLowerCase(),f={method:o,baseURL:"",url:a.a.baseURL+t,data:n,params:c,processData:!0,timeout:window.ajaxTimeout,headers:u,onUploadProgress:d},d&&"function"==typeof d&&(f.onUploadProgress=d),axios.interceptors.request.use((function(e){return e.data.token||(e.data.token=Object(i.e)()),e}),(function(e){return Promise.reject(new Error("服务器异常,请联系管理员!"))})),axios.interceptors.response.use(function(){var e=Object(r.a)(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return 200===t.status&&100<=(n=t.data.code)&&n<=104&&Object(i.j)(),e.abrupt("return",t);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),(function(e){return Promise.reject(e.response.data)})),e.abrupt("return",new Promise((function(e,t){axios(f).then((function(t){e(t.data)})).catch((function(e){e.response&&e.response.data?t(e.response.data):t(e)}))})));case 12:case"end":return e.stop()}}),e)})))},"45b9":function(e,t,n){"use strict";n.r(t),n("7f7f"),n("96cf");var r,a,i,s=n("1da1"),o=n("74ce"),c=n("9f53"),u=n("9163"),d=n("61f7");s={mixins:[c.a],data:function(){return{id:"0",title:"",areaList:u.areaList,addressInfo:{id:"",name:"",tel:"",addressDetail:"",areaCode:""},loading:!1,isDefault:!1}},created:(i=Object(s.a)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.$route.query.id)return this.title="编辑地址",this.id=this.$route.query.id,e.next=5,this.initData();e.next=7;break;case 5:e.next=9;break;case 7:this.title="新建地址",this.id="0";case 9:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)}),methods:{validator:function(e){return!!Object(d.a)(e)},onClickLeft:function(){window.history.back(-1)},onSave:(a=Object(s.a)(regeneratorRuntime.mark((function e(t){var n,r,a=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.loading){e.next=27;break}if(this.loading=!0,r=t.areaCode,n={contector:t.name,mobile:t.tel,provice:r.substr(0,2)+"0000",city:r.substr(0,4)+"00",area:t.areaCode,addr:t.addressDetail},r={},"0"===this.id)return e.next=8,o.a.add(n);e.next=11;break;case 8:r=e.sent,e.next=15;break;case 11:return n.id=this.id,e.next=14,o.a.update(n);case 14:r=e.sent;case 15:if(this.loading=!1,!r||0!=r.code){e.next=21;break}this.show_title("".concat(this.title,"成功!")),setTimeout((function(){a.onClickLeft()}),1500),e.next=27;break;case 21:if(r&&100<=r.code&&r.code<=104)return e.next=24,this.logout();e.next=26;break;case 24:e.next=27;break;case 26:this.show_title(r.msg);case 27:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)}),initData:(r=Object(s.a)(regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.loading){e.next=17;break}return this.loading=!0,e.next=4,o.a.detail({id:this.id});case 4:if(t=e.sent,this.loading=!1,!t||0!==t.code||!t.data){e.next=11;break}n=t.data,this.addressInfo={id:n.id,name:n.contector,tel:n.mobile,addressDetail:n.addr,areaCode:n.area},e.next=17;break;case 11:if(t&&100<=t.code&&t.code<=104)return e.next=14,this.logout();e.next=16;break;case 14:e.next=17;break;case 16:this.show_title(t.msg);case 17:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})}},n("7644"),n=n("2877"),s=Object(n.a)(s,(function(){var e=this,t=e.$createElement;t=e._self._c||t;return t("div",{staticClass:"addressView",staticStyle:{"padding-top":"46px"}},[t("van-nav-bar",{staticClass:"van-nav-bar-my-fixed",attrs:{title:e.title,fixed:"","left-arrow":""},on:{"click-left":e.onClickLeft}}),t("van-address-edit",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{"area-list":e.areaList,"show-postal":!1,"show-delete":!1,"tel-validator":e.validator,"address-info":e.addressInfo,"show-set-default":!1,"show-search-result":!1,"search-result":[],"area-columns-placeholder":["请选择","请选择","请选择"],"default-tag-text":"默认"},on:{save:e.onSave}})],1)}),[],!1,null,"f600c160",null);t.default=s.exports},"61f7":function(e,t,n){"use strict";function r(e){return/^[A-Za-z]+$/.test(e)}function a(e){return/^1[3|4|5|6|7|8|9][0-9]\d{8}$/.test(e)}function i(e){return/^[0-9]*$/.test(e)}n.d(t,"c",(function(){return r})),n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return i})),t=n("6b54")},"74ce":function(e,t,n){"use strict";var r=n("1b69"),a="home/";t.a={list:function(e,t){return Object(r.a)(a+"addrlist",e,"post",t)},add:function(e,t){return Object(r.a)(a+"addradd",e,"post",t)},del:function(e,t){return Object(r.a)(a+"addrdel",e,"post",t)},detail:function(e,t){return Object(r.a)(a+"addrinfo",e,"post",t)},update:function(e,t){return Object(r.a)(a+"addredit",e,"post",t)}}},7644:function(e,t,n){"use strict";n("dc0c")},"9f53":function(e,t,n){"use strict";n("433b");var r,a=n("d399");n("96cf"),n=n("1da1");t.a={methods:{logout:(r=Object(n.a)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("/login"!==this.$route.path)return e.next=3,this.$store.dispatch("user/logout");e.next=4;break;case 3:this.$router.push("/login");case 4:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)}),show_title:function(e){Object(a.a)({message:e})}}}},dc0c:function(e,t,n){}}]);