1 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-7b35482c"],{"13b6":function(e,t,n){"use strict";n.r(t);var r,a,s,i,o=n("2909"),c=(n("47e2"),n("2241")),u=(n("96cf"),n("1da1")),d=n("74ce"),h={mixins:[n("9f53").a],data:function(){return{delId:"",chosenAddressId:"",isRes:this.$route.query.id||"0",list:[],total:0,parmValue:{page:1,size:10},loading:!1}},created:(i=Object(u.a)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.$route&&this.$route.query&&this.$route.query.id?this.isRes="1":this.isRes="0";case 1:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)}),mounted:function(){this.searchList()},methods:{onClickLeft:function(){window.history.back(-1)},onClickRight:function(){var e=this;this.loading||(""!==this.delId?c.a.confirm({title:"确认删除?",message:"确认删除该地址?"}).then(Object(u.a)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.delAddr(e.delId);case 2:case"end":return t.stop()}}),t)})))).catch((function(){})):this.show_title("请选择地址!"))},customerService:function(){this.serviceShow=!0},gotoInfor:function(){this.$router.push({path:"/personalInfor"})},onAdd:function(){this.$router.push({path:"/addressView"})},onEdit:function(e){this.loading||window.vm.$router.push({path:"/addressView",query:{id:e.id}})},onSelect:function(e){"1"===this.isRes?this.$store.dispatch("user/set_ad",e).then((function(e){window.history.back(-1)})):this.delId=e.id},pageData:(s=Object(u.a)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.parmValue.page++,e.next=3,this.searchList();case 3:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)}),delAddr:(a=Object(u.a)(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.loading=!0,e.next=3,d.a.del({id:t});case 3:if(n=e.sent,this.loading=!1,n&&0==n.code)return this.show_title("地址删除成功!"),e.next=9,this.searchList();e.next=11;break;case 9:e.next=17;break;case 11:if(n&&100<=n.code&&n.code<=104)return e.next=14,this.logout();e.next=16;break;case 14:e.next=17;break;case 16:this.show_title(n.msg);case 17:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)}),searchList:(r=Object(u.a)(regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.loading){e.next=22;break}return 1===this.parmValue.page&&(this.list=[]),e.next=5,d.a.list(this.parmValue);case 5:if(!(t=e.sent)||0!=t.code||!t.data){e.next=15;break}(r=t.data.list).map((function(e){var t=e.city_name===e.provice_name?e.provice_name:e.provice_name+e.city_name;return e.name=e.contector,e.tel=e.mobile,e.address=t+e.area_name+e.addr,e})),(n=this.list).push.apply(n,Object(o.a)(r)),""===this.chosenAddressId&&0<this.list.length&&(this.chosenAddressId=this.list[0].id),this.total=t.data.count,e.next=22;break;case 15:if(t&&100<=t.code&&t.code<=104)return e.next=18,this.logout();e.next=20;break;case 18:e.next=22;break;case 20:this.show_title(t.msg),1!==this.parmValue.page&&this.parmValue.page--;case 22:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})}};n("5f93"),n=n("2877"),h=Object(n.a)(h,(function(){var e=this,t=e.$createElement;t=e._self._c||t;return t("div",{staticClass:"address",staticStyle:{"padding-top":"46px"}},[t("van-nav-bar",{staticClass:"van-nav-bar-my-fixed",attrs:{title:"我的地址","left-arrow":"","right-text":"1"===e.isRes?"":"删除",fixed:""},on:{"click-left":e.onClickLeft,"click-right":e.onClickRight}}),t("van-address-list",{attrs:{list:e.list,"disabled-list":[]},on:{add:e.onAdd,select:e.onSelect,edit:e.onEdit},model:{value:e.chosenAddressId,callback:function(t){e.chosenAddressId=t},expression:"chosenAddressId"}}),0<e.total&&e.list.length<e.total&&0<e.list.length?t("div",{staticClass:"addmore",on:{click:e.pageData}},[e._v("\n 点击加载更多!\n ")]):e._e()],1)}),[],!1,null,"745ff536",null);t.default=h.exports},"1b69":function(e,t,n){"use strict";n("96cf");var r=n("1da1"),a=n("5daa"),s=n("5f87"),i={};window.ajaxTimeout=2e4,t.a=Object(r.a)(regeneratorRuntime.mark((function e(){var t,n,o,c,u,d,h,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]:i,d=5<l.length?l[5]:void 0,o=(o=2<l.length&&void 0!==l[2]?l[2]:"GET").toLowerCase(),h={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&&(h.onUploadProgress=d),axios.interceptors.request.use((function(e){return e.data.token||(e.data.token=Object(s.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 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(s.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(h).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)})))},"5f93":function(e,t,n){"use strict";n("de64")},"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)}}},"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})}}}},de64:function(e,t,n){}}]);
|