;(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=result.totalPage;_this.params.page=result.pageNo+1;_this.dataShow=_this.list.length>0;}_context.next=18;break;case 14:_context.prev=14;_context.t0=_context["catch"](3);_this.dataShow=false;_this.finished=true;case 18:_this.loading=false;case 19:case"end":return _context.stop();}}},_callee,null,[[3,14]]);}))();},onDetail:function onDetail(item){if(this.type==='refund')return;this.$router.push({path:'/tradeDetail',query:{orderNo:item.orderNo,path:'tradeRecord'}});},onConfirm:function onConfirm(date){this.currentDate=date;this.timeStatus=false;this.onSearch();},onSelect:function onSelect(item){this.params.status=item.status;this.searchName=item.name;this.onSearch();},onSearch:function onSearch(){this.dataShow=true;this.loading=false;this.finished=false;this.list=[];this.params.page=1;this.getList();},onCancelPay:function onCancelPay(item){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:// orderPay: { // cancelUrl: '/api-student/userOrder/orderCancel', // payUrl: '/api-student/userOrder/orderPay' // } Dialog.confirm({message:'是否取消订单?',confirmButtonText:'确定',confirmButtonColor:'var(--van-primary)',cancelButtonText:'取消'}).then(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee2(){return regeneratorRuntime.wrap(function _callee2$(_context2){while(1){switch(_context2.prev=_context2.next){case 0:_context2.prev=0;_context2.next=3;return request.post('/api-student/userOrder/orderCancel',{data:{orderNo:item.orderNo}});case 3:// Toast('取消成功') _this2.onSearch();_context2.next=8;break;case 6:_context2.prev=6;_context2.t0=_context2["catch"](0);case 8:case"end":return _context2.stop();}}},_callee2,null,[[0,6]]);})));case 1:case"end":return _context3.stop();}}},_callee3);}))();},onPay:function onPay(item){var _this3=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee4(){var res,result;return regeneratorRuntime.wrap(function _callee4$(_context4){while(1){switch(_context4.prev=_context4.next){case 0:_context4.prev=0;_context4.next=3;return request.get("/api-student/userOrder/detailByOrderNo/".concat(item.orderNo));case 3:res=_context4.sent;result=res.data;tradeOrder(result,function(){_this3.$router.push({path:'/orderDetail',query:{orderType:result.orderType}});});_context4.next=10;break;case 8:_context4.prev=8;_context4.t0=_context4["catch"](0);case 10:case"end":return _context4.stop();}}},_callee4,null,[[0,8]]);}))();}},render:function render(){var _this4=this;var _slot;return createVNode("div",{"class":styles.tradeList},[createVNode(Sticky,{"position":"top","offsetTop":this.height},{default:function _default(){return[createVNode(Cell,{"center":true,"style":{backgroundColor:'#F7F8F9'}},{title:function title(){return createVNode("div",{"class":styles.searchTime,"onClick":function onClick(){_this4.timeStatus=true;}},[createVNode("span",null,[_this4.$filters.dateFormat(_this4.currentDate,'YYYY-MM')]),createVNode(Icon,{"classPrefix":"iconfont","name":"down","size":12,"color":"var(--van-primary)"},null)]);},value:function value(){if(_this4.type==='buy'){return createVNode("div",{"class":styles.searchType,"onClick":function onClick(){_this4.typeStatus=true;}},[createVNode("span",null,[_this4.searchName]),createVNode(Icon,{"classPrefix":"iconfont","name":"down","size":12,"color":"var(--van-primary)"},null)]);}return null;}})];}}),this.dataShow?createVNode(List$1,{"loading":this.loading,"finished":this.finished,"finishedText":" ","class":[styles.list],"onLoad":this.getList},_isSlot(_slot=this.list.map(function(item){return createVNode(CellGroup,{"border":false,"onClick":function onClick(){_this4.onDetail(item);}},{default:function _default(){return[createVNode(Cell,{"title":dayjs(item.createTime).format('YYYY-MM-DD HH:mm'),"value":_this4.type==='buy'?orderType[item.status]:item.operateReason,"valueClass":styles.tradeType},null),createVNode(Cell,{"border":false},{title:function title(){return createVNode("div",{"class":styles.title},[createVNode("span",null,[item.orderName]),createVNode("span",{"class":styles.desc},[goodsType[item.orderType]])]);},default:function _default(){return createVNode("div",{"class":styles.content},[createVNode("span",{"class":styles.price},[createTextVNode("\uFFE5"),_this4.type==='buy'?_this4.$filters.moneyFormat(item.actualPrice):_this4.$filters.moneyFormat(item.actualAmount)])]);}}),item.status==='PAYING'||item.status==='WAIT_PAY'?createVNode("div",{"class":styles.btnList},[createVNode(Button,{"size":"small","round":true,"onClick":function onClick(e){e.stopPropagation();_this4.onCancelPay(item);}},{default:function _default(){return[createTextVNode("\u53D6\u6D88\u8BA2\u5355")];}}),createVNode(Button,{"size":"small","round":true,"type":"primary","onClick":function onClick(e){e.stopPropagation();_this4.onPay(item);}},{default:function _default(){return[createTextVNode("\u7EE7\u7EED\u652F\u4ED8")];}})]):null];}});}))?_slot:{default:function _default(){return[_slot];}}):createVNode(ColResult,{"btnStatus":false,"classImgSize":"SMALL","tips":this.type==='buy'?'暂无购买记录':'暂无退款记录'},null),createVNode(Popup,{"show":this.timeStatus,"onUpdate:show":function onUpdateShow($event){return _this4.timeStatus=$event;},"position":"bottom","round":true,"closeOnPopstate":true},{default:function _default(){return[createVNode(DatetimePicker,{"type":"year-month","modelValue":_this4.currentDate,"onUpdate:modelValue":function onUpdateModelValue($event){return _this4.currentDate=$event;},"formatter":formatterDate,"onCancel":function onCancel(){_this4.timeStatus=false;},"onConfirm":_this4.onConfirm},null)];}}),createVNode(ActionSheet,{"show":this.typeStatus,"onUpdate:show":function onUpdateShow($event){return _this4.typeStatus=$event;},"actions":this.actions,"closeOnClickAction":true,"cancelText":"取消","onSelect":this.onSelect,"onCancel":function onCancel(){_this4.typeStatus=false;}},null)]);}});var index=exports('default',defineComponent({name:'tradeRecord',data:function data(){return{active:'buy',height:44};},mounted:function mounted(){var _this5=this;this.$nextTick(function(){var _useRect=useRect(_this5.$refs.tabs),height=_useRect.height;// console.log(height, (this as any).$refs.tabs) _this5.height=height;});},render:function render(){var _this6=this;return createVNode("div",{"class":styles$1.tradeRecord},[createVNode(Tabs,{"active":this.active,"onUpdate:active":function onUpdateActive($event){return _this6.active=$event;},"color":"var(--van-primary)","sticky":true,"lineWidth":28},{default:function _default(){return[createVNode(Tab,{"name":"buy"},{default:function _default(){return[createVNode(List,{"height":_this6.height},null)];},title:function title(){return createVNode("div",{"class":styles$1.tab,"ref":"tabs"},[createTextVNode("\u8D2D\u4E70\u8BB0\u5F55")]);}}),createVNode(Tab,{"name":"refund","title":"退费记录"},{default:function _default(){return[createVNode(List,{"height":_this6.height,"type":"refund"},null)];}})];}})]);}}));}};});})();