1 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-ff2dfb32"],{"1b69":function(e,t,a){"use strict";a("96cf");var r=a("1da1"),n=a("5daa"),i=a("5f87"),s={};window.ajaxTimeout=2e4,t.a=Object(r.a)(regeneratorRuntime.mark((function e(){var t,a,o,c,d,u,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]:"",a=1<l.length&&void 0!==l[1]?l[1]:{},c=3<l.length&&void 0!==l[3]?l[3]:{},d=4<l.length&&void 0!==l[4]?l[4]:s,u=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:n.a.baseURL+t,data:a,params:c,processData:!0,timeout:window.ajaxTimeout,headers:d,onUploadProgress:u},u&&"function"==typeof u&&(f.onUploadProgress=u),axios.interceptors.request.use((function(e){return e.data.token||(e.data.token=Object(i.c)()),e}),(function(e){return Promise.reject(new Error("服务器异常,请联系管理员!"))})),axios.interceptors.response.use(function(){var e=Object(r.a)(regeneratorRuntime.mark((function e(t){var a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return 200===t.status&&100<=(a=t.data.code)&&a<=104&&Object(i.d)(),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,a){"use strict";a.r(t),a("7f7f"),a("96cf");var r,n,i,s=a("1da1"),o=a("74ce"),c=a("9f53"),d=a("9163");s={mixins:[c.a],data:function(){return{id:"0",title:"",areaList:d.areaList,addressInfo:{id:"",name:"",tel:"",addressDetail:"",areaCode:""},loading:!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:{onClickLeft:function(){window.history.back(-1)},onSave:(n=Object(s.a)(regeneratorRuntime.mark((function e(t){var a,r,n=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,a={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(a);e.next=11;break;case 8:r=e.sent,e.next=15;break;case 11:return a.id=this.id,e.next=14,o.a.update(a);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(){n.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 n.apply(this,arguments)}),initData:(r=Object(s.a)(regeneratorRuntime.mark((function e(){var t,a;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}a=t.data,this.addressInfo={id:a.id,name:a.contector,tel:a.mobile,addressDetail:a.addr,areaCode:a.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)})}},a("b27a"),a=a("2877"),s=Object(a.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,"address-info":e.addressInfo,"show-set-default":!1,"show-search-result":!1,"search-result":[],"area-columns-placeholder":["请选择","请选择","请选择"]},on:{save:e.onSave}})],1)}),[],!1,null,"1e892feb",null);t.default=s.exports},"527c":function(e,t,a){},"74ce":function(e,t,a){"use strict";var r=a("1b69"),n="home/";t.a={list:function(e,t){return Object(r.a)(n+"addrlist",e,"post",t)},add:function(e,t){return Object(r.a)(n+"addradd",e,"post",t)},del:function(e,t){return Object(r.a)(n+"addrdel",e,"post",t)},detail:function(e,t){return Object(r.a)(n+"addrinfo",e,"post",t)},update:function(e,t){return Object(r.a)(n+"addredit",e,"post",t)}}},"9f53":function(e,t,a){"use strict";a("433b");var r,n=a("d399");a("96cf"),a=a("1da1");t.a={methods:{logout:(r=Object(a.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(n.a)({message:e})}}}},b27a:function(e,t,a){"use strict";a("527c")}}]);
|