123456789 |
- ;(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);});};}var __vite_style__=document.createElement('style');__vite_style__.innerHTML="._tradeRecord_k8m2o_1 .van-tab--active{color:var(--van-primary)}._tradeRecord_k8m2o_1 .van-tab__text,._tradeRecord_k8m2o_1 ._tab_k8m2o_11{display:flex;width:100%;height:100%;align-items:center;justify-content:center}._tradeList_ums1x_1 ._searchTime_ums1x_1,._tradeList_ums1x_1 ._searchType_ums1x_2{color:#1a1a1a;font-size:.37333rem}._tradeList_ums1x_1 .iconfont-down{margin-left:.10667rem}._tradeList_ums1x_1 .van-cell-group{overflow:hidden;border-radius:.26667rem;margin-bottom:.32rem}._tradeList_ums1x_1 ._list_ums1x_14{padding:0 .37333rem}._tradeList_ums1x_1 ._tradeLogo_ums1x_17{width:.93333rem;height:.93333rem;border-radius:50%;margin-right:.26667rem;overflow:hidden}._tradeList_ums1x_1 ._tradeType_ums1x_24{color:var(--van-primary)}._tradeList_ums1x_1 ._title_ums1x_27,._tradeList_ums1x_1 ._content_ums1x_28{padding-top:.02667rem;display:flex;justify-content:space-between;flex-direction:column;line-height:.48rem;color:#333;font-size:.37333rem}._tradeList_ums1x_1 ._desc_ums1x_37,._tradeList_ums1x_1 ._num_ums1x_38{padding-top:.08rem;font-size:.34667rem;color:#999}._btnList_ums1x_43{display:flex;align-items:center;justify-content:flex-end;padding-bottom:var(--van-cell-vertical-padding);padding-right:var(--van-cell-horizontal-padding)}._btnList_ums1x_43 .van-button+.van-button{margin-left:.26667rem}\n";document.head.appendChild(__vite_style__);System.register(['./vendor-legacy.73abbe39.js','./index-legacy.8581423a.js','./index-legacy.637f35562.js','./index-legacy.f25f109a5.js','./index-legacy.f25f109a2.js','./index-legacy.f25f109a.js','./index-legacy.f25f109a6.js','./index-legacy.4b2d517a.js','./index-legacy.9f5d8c8e.js','./tradeOrder-legacy.303c3124.js','./orderStatus-legacy.f44528f2.js'],function(exports){'use strict';var defineComponent,dayjs,Dialog,createVNode,Sticky,Cell,Icon,List$1,CellGroup,createTextVNode,Button,isVNode,Popup,DatetimePicker,ActionSheet,useRect,Tabs,Tab,request,ColResult,formatterDate,orderType,goodsType,tradeOrder;return{setters:[function(module){defineComponent=module.d;dayjs=module.h;Dialog=module.D;createVNode=module.b;Sticky=module.S;Cell=module.p;Icon=module.q;List$1=module.t;CellGroup=module.m;createTextVNode=module.j;Button=module.B;isVNode=module.v;Popup=module.P;DatetimePicker=module.w;ActionSheet=module.A;useRect=module.x;Tabs=module.y;Tab=module.z;},function(){},function(){},function(){},function(){},function(){},function(){},function(module){request=module.r;ColResult=module.C;formatterDate=module.f;},function(module){orderType=module.o;goodsType=module.g;},function(module){tradeOrder=module.t;},function(){}],execute:function execute(){var tradeRecord="_tradeRecord_k8m2o_1";var tab="_tab_k8m2o_11";var styles$1={tradeRecord:tradeRecord,tab:tab};var tradeList="_tradeList_ums1x_1";var searchTime="_searchTime_ums1x_1";var searchType="_searchType_ums1x_2";var list="_list_ums1x_14";var tradeLogo="_tradeLogo_ums1x_17";var tradeType="_tradeType_ums1x_24";var title="_title_ums1x_27";var content="_content_ums1x_28";var desc="_desc_ums1x_37";var num="_num_ums1x_38";var btnList="_btnList_ums1x_43";var styles={tradeList:tradeList,searchTime:searchTime,searchType:searchType,list:list,tradeLogo:tradeLogo,tradeType:tradeType,title:title,content:content,desc:desc,num:num,btnList:btnList};function _isSlot(s){return typeof s==='function'||Object.prototype.toString.call(s)==='[object Object]'&&!isVNode(s);}var List=defineComponent({name:'list',props:{type:{type:String,default:'buy'},height:{type:Number,default:44}},data:function data(){return{timeStatus:false,currentDate:new Date(),typeStatus:false,// 订单状态 WAIT_PAY 待支付 PAYING 支付中 PAID 已付款 CLOSE 已关闭 FAIL 支付失败 (多选用,分割)
- actions:[{name:'全部'},{name:'待支付',status:'WAIT_PAY'},{name:'支付中',status:'PAYING'},{name:'已付款',status:'PAID'},{name:'已关闭',status:'CLOSE'},{name:'支付失败',status:'FAIL'}],list:[],dataShow:true,// 判断是否有数据
- loading:false,finished:false,searchName:'全部',params:{status:'',page:1,rows:20}};},methods:{getList:function getList(){var _this=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee(){var params,url,_yield$request$post,code,data,result;return regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:if(!_this.loading){_context.next=2;break;}return _context.abrupt("return");case 2:_this.loading=true;_context.prev=3;params=_objectSpread(_objectSpread({},_this.params),{},{searchDate:dayjs(_this.currentDate).format('YYYY-MM')});url=_this.type==='buy'?'/api-student/userOrder/page':'/api-student/userOrderRefunds/page';_context.next=8;return request.post(url,{data:_objectSpread(_objectSpread({},params),{},{dateTime:_this.type==='refund'?params.searchDate:undefined,timeType:_this.type==='refund'?'MONTH':undefined})});case 8:_yield$request$post=_context.sent;code=_yield$request$post.code;data=_yield$request$post.data;if(code===200){result=data||{};_this.list=_this.list.concat(result.rows||[]);_this.finished=result.pageNo>=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)];}})];}})]);}}));}};});})();
|