;(function(){function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable;})),keys.push.apply(keys,symbols);}return keys;}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?ownKeys(Object(source),!0).forEach(function(key){_defineProperty(target,key,source[key]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key));});}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}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.64e789e6.js','./index-legacy.5deccbb1.js','./vendor-legacy.73abbe39.js','./index-legacy.f25f109a2.js','./index-legacy.f25f109a.js','./index-legacy.8581423a.js','./index-legacy.637f35562.js','./item-legacy.63daf25e.js','./shop-mall-legacy.da9e3584.js','./cart-legacy.e8d257f5.js','./index-legacy.f25f109a4.js'],function(exports){'use strict';var ColHeader,moneyFormat,request,ColResult,defineComponent,createVNode,createTextVNode,Fragment,Button,Cell,Dialog,Tabs,Tab,List,CellGroup,isVNode,styles,Item,orderState,cartConfirm;return{setters:[function(module){ColHeader=module.C;},function(module){moneyFormat=module.m;request=module.r;ColResult=module.C;},function(module){defineComponent=module.d;createVNode=module.b;createTextVNode=module.j;Fragment=module.F;Button=module.B;Cell=module.p;Dialog=module.D;Tabs=module.y;Tab=module.z;List=module.t;CellGroup=module.m;isVNode=module.v;},function(){},function(){},function(){},function(){},function(module){styles=module.s;Item=module.I;},function(module){orderState=module.o;},function(module){cartConfirm=module.c;},function(){}],execute:function execute(){var AfterSaleBtns=defineComponent({name:'AfterSaleBtns',props:{item:{type:Object,default:{}},onCancelOrder:{type:Function,default:function _default(n){}},onPayOrder:{type:Function,default:function _default(n){}},onConfirmReceipt:{type:Function,default:function _default(n){}},onAginOrder:{type:Function,default:function _default(n){}}},setup:function setup(_ref){var item=_ref.item,onCancelOrder=_ref.onCancelOrder,onPayOrder=_ref.onPayOrder,onConfirmReceipt=_ref.onConfirmReceipt,onAginOrder=_ref.onAginOrder;return function(){return createVNode(Cell,{"center":true},{title:function title(){return createVNode("div",{"class":styles.orderPrice},[createVNode("div",null,[createTextVNode("\u8BA2\u5355\u91D1\u989D"),createVNode("span",{"class":styles.price,"style":{paddingLeft:'5px'}},[createVNode("i",null,[createTextVNode("\xA5 ")]),moneyFormat(item.payAmount+item.integrationAmount)])]),!!item.couponAmount&&createVNode("div",{"class":styles.coupon},[createTextVNode("\u4F18\u60E0\u5238: -\xA5 "),moneyFormat(item.couponAmount)])]);},default:function _default(){return createVNode("div",{"class":styles.btnList},[item.status===0||item.status===6?createVNode(Fragment,null,[createVNode(Button,{"size":"small","round":true,"onClick":function onClick(e){e.stopPropagation();onCancelOrder(item);}},{default:function _default(){return[createTextVNode("\u53D6\u6D88\u8BA2\u5355")];}}),createVNode(Button,{"size":"small","round":true,"type":"primary","onClick":function onClick(e){e.stopPropagation();onPayOrder(item);}},{default:function _default(){return[createTextVNode("\u7EE7\u7EED\u652F\u4ED8")];}})]):null,item.status===2?createVNode(Button,{"size":"small","round":true,"type":"primary","onClick":function onClick(e){e.stopPropagation();onConfirmReceipt(item);}},{default:function _default(){return[createTextVNode("\u786E\u8BA4\u6536\u8D27")];}}):null]);}});};}});function _isSlot(s){return typeof s==='function'||Object.prototype.toString.call(s)==='[object Object]'&&!isVNode(s);}var index=exports('default',defineComponent({name:'shop-order',data:function data(){return{active:0,list:[],dataShow:true,// 判断是否有数据
loading:false,finished:false,params:{search:'',groupStatus:'APPLY',page:1,rows:20},page:{pageNum:1,pageSize:20}};},watch:{active:function active(val){this.init();this.getList();}},methods:{init:function init(){this.page.pageNum=1;this.finished=false;this.list=[];this.dataShow=true;},getList:function getList(){var _this=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee(){var _yield$request$get,code,data;return regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:if(!(_this.loading||_this.finished)){_context.next=2;break;}return _context.abrupt("return");case 2:_this.loading=true;_context.prev=3;_context.next=6;return request.get('/api-mall-portal/order/list',{params:_objectSpread(_objectSpread({},_this.page),{},{status:_this.active===0?'0,6':_this.active===1?'1,2':'3,4'})});case 6:_yield$request$get=_context.sent;code=_yield$request$get.code;data=_yield$request$get.data;if(code===200&&data.list){_this.page.pageNum+=1;_this.list=[].concat(_this.list,data.list);}if(_this.list.length>=data.total){_this.finished=true;}if(_this.list.length===0){_this.dataShow=false;}_context.next=18;break;case 14:_context.prev=14;_context.t0=_context["catch"](3);_this.finished=true;_this.dataShow=false;case 18:_this.loading=false;case 19:case"end":return _context.stop();}}},_callee,null,[[3,14]]);}))();},onClickRight:function onClickRight(){this.$router.push('/afterSale');},cancelOrder:function cancelOrder(item){var _this2=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee2(){var dialog,_yield$request$post,code,data;return regeneratorRuntime.wrap(function _callee2$(_context2){while(1){switch(_context2.prev=_context2.next){case 0:_context2.next=2;return Dialog.confirm({title:'提示',message:'确认取消订单?',confirmButtonText:'取消订单',confirmButtonColor:'var(--van-primary)'});case 2:dialog=_context2.sent;if(!(dialog==='confirm')){_context2.next=10;break;}_context2.next=6;return request.post('/api-mall-portal/order/cancelUserOrder',{params:{orderId:item.id}});case 6:_yield$request$post=_context2.sent;code=_yield$request$post.code;data=_yield$request$post.data;if(code===200){_this2.init();_this2.getList();}case 10:case"end":return _context2.stop();}}},_callee2);}))();},payOrder:function payOrder(item){cartConfirm.orderInfo=item;this.$router.push({path:'/cartConfirmAgin'});},// 再来一单
onAginOrder:function onAginOrder(item){var _this3=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee3(){var res,code,data;return regeneratorRuntime.wrap(function _callee3$(_context3){while(1){switch(_context3.prev=_context3.next){case 0:_context3.prev=0;_context3.next=3;return request.post('/api-mall-portal/order/oneOrder',{params:{orderId:item.id}});case 3:res=_context3.sent;code=res.code,data=res.data;if(code===200){cartConfirm.calcAmount=data.calcAmount;cartConfirm.cartPromotionItemList=data.cartPromotionItemList;cartConfirm.memberReceiveAddressList=data.memberReceiveAddressList;_this3.$router.push({path:'/cartConfirm'});}console.log(res);_context3.next=11;break;case 9:_context3.prev=9;_context3.t0=_context3["catch"](0);case 11:case"end":return _context3.stop();}}},_callee3,null,[[0,9]]);}))();},// 确认收货
onConfirmReceipt:function onConfirmReceipt(item){var _this4=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee4(){var dialog,res;return regeneratorRuntime.wrap(function _callee4$(_context4){while(1){switch(_context4.prev=_context4.next){case 0:_context4.next=2;return Dialog.confirm({title:'提示',message:'确认收货?',confirmButtonText:'收货',confirmButtonColor:'var(--van-primary)'});case 2:dialog=_context4.sent;if(!(dialog==='confirm')){_context4.next=8;break;}_context4.next=6;return request.post('/api-mall-portal/order/confirmReceiveOrder',{params:{orderId:item.id}});case 6:res=_context4.sent;if(res.code===200){_this4.init();_this4.getList();}case 8:case"end":return _context4.stop();}}},_callee4);}))();}},render:function render(){var _this5=this;var _slot2;var tabs=[{name:0,title:'待支付'},{name:1,title:'待收货'},{name:2,title:'已完成'}];return createVNode("div",{"class":styles.shopOrder},[createVNode(ColHeader,{"ref":"colHeader","class":"header"},null),createVNode(Tabs,{"active":this.active,"onUpdate:active":function onUpdateActive($event){return _this5.active=$event;},"color":"var(--van-primary)","lineWidth":28,"animated":true,"swipeable":true},_isSlot(_slot2=tabs.map(function(tab){var _slot;return createVNode(Tab,{"name":tab.name,"title":tab.title},{default:function _default(){return[_this5.active===tab.name&&_this5.dataShow?createVNode(List,{"loading":_this5.loading,"finished":_this5.finished,"finishedText":" ","class":[styles.goodsList],"onLoad":_this5.getList},_isSlot(_slot=_this5.list.map(function(item){return createVNode(Fragment,null,[createVNode(CellGroup,{"class":styles.cellGroup,"border":false,"onClick":function onClick(){_this5.$router.push({path:'/shopOrderDetail',query:{id:item.id}});}},{default:function _default(){return[createVNode(Cell,{"title":item.createTime,"titleClass":styles.payTime,"value":orderState[item.status],"valueClass":[0,4,5,6].includes(item.status)?styles.payStatus:styles.paySuccess},null),item.orderItemList&&item.orderItemList.length?item.orderItemList.map(function(n){return createVNode(Item,{"item":n},null);}):null,createVNode(AfterSaleBtns,{"item":item,"onCancelOrder":_this5.cancelOrder,"onPayOrder":_this5.payOrder,"onConfirmReceipt":_this5.onConfirmReceipt,"onAginOrder":_this5.onAginOrder},null)];}})]);}))?_slot:{default:function _default(){return[_slot];}}):createVNode(ColResult,{"btnStatus":false,"classImgSize":"SMALL","tips":"暂无订单"},null)];}});}))?_slot2:{default:function _default(){return[_slot2];}})]);}}));}};});})();
