;(function(){function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}System.register(['./index-legacy.1fe2c45b.js','./vendor-legacy.73abbe39.js','./index-legacy.5deccbb1.js','./address-legacy.743bd3e3.js'],function(exports){'use strict';var styles,ColSticky,defineComponent,Dialog,Toast,createVNode,Icon,Button,createTextVNode,request,ColResult,addressInfo;return{setters:[function(module){styles=module.s;ColSticky=module.C;},function(module){defineComponent=module.d;Dialog=module.D;Toast=module.T;createVNode=module.b;Icon=module.q;Button=module.B;createTextVNode=module.j;},function(module){request=module.r;ColResult=module.C;},function(module){addressInfo=module.a;}],execute:function execute(){var iconEdit="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAmCAMAAACbFsmhAAAAAXNSR0IArs4c6QAAAS9QTFRFAAAAAAAAQEBAQEBAYGBgVVVVTU1NRkZGTk5OSUlJUVFRTU1NSUlJVVVVTk5OTExMTU1NUVFRT09PU1NTUVFRUFBQUlJSUFBQUVFRUlJSUFBQUlJSUVFRUlJSUFBQUlJSUVFRUFBQUVFRUVFRUlJSUlJSUFBQUVFRUFBQUVFRUVFRUVFRUlJSUVFRUlJSUlJSUFBQUFBQUVFRUVFRUFBQUlJSUVFRUVFRUVFRUFBQUVFRUVFRUVFRUlJSUVFRUFBQUVFRUVFRUFBQUlJSUVFRUlJSUVFRUFBQUVFRUVFRUVFRUlJSUVFRUVFRUlJSUlJSUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUFBQUVFRUVFRUVFRUVFRUFBQUVFRUVFRt+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+3u7/Dx9PX3+Pv7/P7dnb/OAAAA00lEQVQ4y+2TxQ4CMRRFi7u7u7u7Dq73/7+GdAikMwMhJLCCszl5r6fdlZAbkfEBDMdJlEhIQ0JG3Cg3WFVyDOUltipR5ATiwk0McIoiP+ATbnyA/63Inc1TmkAzL+C+yboIh5dwpHZ61Zxq5MMYEmrejoCMSha086M8rGWiPqpUmj0C1CHs+Esl9JhoijaVBUhSpwAzdQuzf/RzkWJx9lB7z5z8aUT01uts05HnkYhvRUOMHkUDjJmpAHRzEjpAkYl088efd65nHzbWV9Jk3TBdTy/uwn7sp9f1zwAAAABJRU5ErkJggg==";var index=exports('default',defineComponent({name:'address-list',data:function data(){return{dataShow:true,// 判断是否在数据
list:[]};},mounted:function mounted(){var _this=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee(){var _yield$request$get,data;return regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:_context.prev=0;_context.next=3;return request.get('/api-mall-portal/member/address/list');case 3:_yield$request$get=_context.sent;data=_yield$request$get.data;_this.list=data;_this.dataShow=_this.list.length>0?true:false;_context.next=11;break;case 9:_context.prev=9;_context.t0=_context["catch"](0);case 11:case"end":return _context.stop();}}},_callee,null,[[0,9]]);}))();},methods:{onEdit:function onEdit(e,address){e.stopPropagation();this.$router.push({path:'/editAddress',query:{id:address===null||address===void 0?void 0:address.id}});},onDelete:function onDelete(e,address){var _this2=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee3(){return regeneratorRuntime.wrap(function _callee3$(_context3){while(1){switch(_context3.prev=_context3.next){case 0:e.stopPropagation();try{Dialog.confirm({title:'提示',message:'确认删除收货地址吗？',confirmButtonColor:'var(--van-primary)'}).then(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee2(){return regeneratorRuntime.wrap(function _callee2$(_context2){while(1){switch(_context2.prev=_context2.next){case 0:_context2.next=2;return request.post("/api-mall-portal/member/address/delete/".concat(address.id));case 2:setTimeout(function(){Toast('删除成功');var index=_this2.list.findIndex(function(item){return item.id===address.id;});_this2.list.splice(index||_this2.list.length-1,1);// 删除成功之后需要在次判断有没有数据
_this2.dataShow=_this2.list.length>0?true:false;},100);case 3:case"end":return _context2.stop();}}},_callee2);})));}catch(_unused2){//
}case 2:case"end":return _context3.stop();}}},_callee3);}))();},onDetail:function onDetail(address){var type=this.$route.query.type;if(type==='getAddress'){console.log(address,'onDetail');addressInfo.id=address.id;addressInfo.defaultStatus=address.defaultStatus?1:0;addressInfo.province=address.province;addressInfo.city=address.city;addressInfo.region=address.region;addressInfo.name=address.name;addressInfo.phoneNumber=address.phoneNumber;addressInfo.detailAddress=address.detailAddress;addressInfo.memberId=address.memberId;addressInfo.postCode=address.postCode;this.$router.back();}}},render:function render(){var _this3=this;return createVNode("div",{"class":styles.addressList},[this.list.map(function(address){return createVNode("div",{"class":styles.address,"onClick":function onClick(){return _this3.onDetail(address);}},[createVNode("div",{"class":styles.content},[createVNode("p",null,[createVNode("span",{"class":styles.name},[address.name]),createVNode("span",null,[address.phoneNumber&&address.phoneNumber.replace(/^(\d{3})\d{4}(\d+)/,'$1****$2')])]),createVNode("p",{"class":styles.addressContent},[address.province,address.city,address.region,address.detailAddress])]),createVNode("div",{"class":styles.icon},[createVNode(Icon,{"name":iconEdit,"size":18,"onClick":function onClick(e){return _this3.onEdit(e,address);}},null),createVNode(Icon,{"name":iconDel,"size":18,"style":{marginLeft:'16px'},"onClick":function onClick(e){return _this3.onDelete(e,address);}},null)])]);}),!this.dataShow&&createVNode(ColResult,{"tips":"暂无数据","classImgSize":"SMALL","btnStatus":false},null),createVNode(ColSticky,{"position":"bottom","background":"white"},{default:function _default(){return[createVNode("div",{"class":['btnGroup'],"style":{paddingTop:'12px'}},[createVNode(Button,{"block":true,"round":true,"type":"primary","onClick":_this3.onEdit},{default:function _default(){return[createTextVNode("\u6DFB\u52A0\u65B0\u5730\u5740")];}})])];}})]);}}));}};});})();
