index-legacy.2f09304d.js 9.8 KB

1
  1. !function(){function t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function e(e){for(var r=1;r<arguments.length;r++){var a=null!=arguments[r]?arguments[r]:{};r%2?t(Object(a),!0).forEach((function(t){n(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):t(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function n(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function r(t,e,n,r,a,i,o){try{var s=t[i](o),u=s.value}catch(c){return void n(c)}s.done?e(u):Promise.resolve(u).then(r,a)}function a(t){return function(){var e=this,n=arguments;return new Promise((function(a,i){var o=t.apply(e,n);function s(t){r(o,a,i,s,u,"next",t)}function u(t){r(o,a,i,s,u,"throw",t)}s(void 0)}))}}var i=document.createElement("style");i.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(i),System.register(["./index-legacy.f8641610.js","./index-legacy.4ddb0119.js","./index-legacy.00d337cc.js","./index-legacy.a8de4840.js","./index-legacy.40132992.js","./index-legacy.fc510843.js","./index-legacy.c36297f9.js","./index-legacy.b8ae2f28.js","./index-legacy.13f535d5.js","./index-legacy.8361d47d.js","./tradeOrder-legacy.e5c67f0f.js","./index-legacy.d3a31cb9.js","./hooks-legacy.1d4168e3.js","./use-id-legacy.30c2e9af.js","./use-tab-status-legacy.5d29085f.js","./use-refs-legacy.e503281e.js","./orderStatus-legacy.43d498d4.js","./utils-legacy.95136076.js","./index-legacy.375505ca.js"],(function(t){"use strict";var n,r,i,o,s,u,c,d,l,f,m,p,h,_,y,g,v,x,b,j,w,S,L,O,T;return{setters:[function(t){n=t.d,r=t.x,i=t.e,o=t.D,s=t.i,u=t.N,c=t.A,d=t.B,l=t.C,f=t.aT,m=t.b2,p=t.$,h=t.Y},function(t){_=t.S},function(){},function(t){y=t.T,g=t.a},function(t){v=t.A},function(t){x=t.C},function(t){b=t.C},function(){},function(t){j=t.L},function(t){w=t.o,S=t.g},function(t){L=t.t},function(t){O=t.D},function(t){T=t.u},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){var P="_tradeRecord_k8m2o_1",k="_tab_k8m2o_11",C={tradeList:"_tradeList_ums1x_1",searchTime:"_searchTime_ums1x_1",searchType:"_searchType_ums1x_2",list:"_list_ums1x_14",tradeLogo:"_tradeLogo_ums1x_17",tradeType:"_tradeType_ums1x_24",title:"_title_ums1x_27",content:"_content_ums1x_28",desc:"_desc_ums1x_37",num:"_num_ums1x_38",btnList:"_btnList_ums1x_43"};var D=n({name:"list",props:{type:{type:String,default:"buy"},height:{type:Number,default:44}},data:function(){return{timeStatus:!1,currentDate:new Date,typeStatus:!1,actions:[{name:"全部"},{name:"待支付",status:"WAIT_PAY"},{name:"支付中",status:"PAYING"},{name:"已付款",status:"PAID"},{name:"已关闭",status:"CLOSE"},{name:"支付失败",status:"FAIL"}],list:[],dataShow:!0,loading:!1,finished:!1,searchName:"全部",params:{status:"",page:1,rows:20}}},methods:{getList:function(){var t=this;return a(regeneratorRuntime.mark((function n(){var a,o,s,u,c,d;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!t.loading){n.next=2;break}return n.abrupt("return");case 2:return t.loading=!0,n.prev=3,a=e(e({},t.params),{},{searchDate:r(t.currentDate).format("YYYY-MM")}),o="buy"===t.type?"/api-student/userOrder/page":"/api-student/userOrderRefunds/page",n.next=8,i.post(o,{data:e(e({},a),{},{dateTime:"refund"===t.type?a.searchDate:void 0,timeType:"refund"===t.type?"MONTH":void 0})});case 8:s=n.sent,u=s.code,c=s.data,200===u&&(d=c||{},t.list=t.list.concat(d.rows||[]),t.finished=d.pageNo>=d.totalPage,t.params.page=d.pageNo+1,t.dataShow=t.list.length>0),n.next=18;break;case 14:n.prev=14,n.t0=n.catch(3),t.dataShow=!1,t.finished=!0;case 18:t.loading=!1;case 19:case"end":return n.stop()}}),n,null,[[3,14]])})))()},onDetail:function(t){"refund"!==this.type&&this.$router.push({path:"/tradeDetail",query:{orderNo:t.orderNo,path:"tradeRecord"}})},onConfirm:function(t){this.currentDate=t,this.timeStatus=!1,this.onSearch()},onSelect:function(t){this.params.status=t.status,this.searchName=t.name,this.onSearch()},onSearch:function(){this.dataShow=!0,this.loading=!1,this.finished=!1,this.list=[],this.params.page=1,this.getList()},onCancelPay:function(t){var e=this;return a(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:o.confirm({message:"是否取消订单?",confirmButtonText:"确定",confirmButtonColor:"var(--van-primary)",cancelButtonText:"取消"}).then(a(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,i.post("/api-student/userOrder/orderCancel",{data:{orderNo:t.orderNo}});case 3:e.onSearch(),n.next=8;break;case 6:n.prev=6,n.t0=n.catch(0);case 8:case"end":return n.stop()}}),n,null,[[0,6]])}))));case 1:case"end":return n.stop()}}),n)})))()},onPay:function(t){var e=this;return a(regeneratorRuntime.mark((function n(){var r,a;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,i.get("/api-student/userOrder/detailByOrderNo/".concat(t.orderNo));case 3:r=n.sent,a=r.data,L(a,(function(){e.$router.push({path:"/orderDetail",query:{orderType:a.orderType}})})),n.next=10;break;case 8:n.prev=8,n.t0=n.catch(0);case 10:case"end":return n.stop()}}),n,null,[[0,8]])})))()}},render:function(){var t,e,n=this;return s("div",{class:C.tradeList},[s(_,{position:"top",offsetTop:this.height},{default:function(){return[s(x,{center:!0,style:{backgroundColor:"#F7F8F9"}},{title:function(){return s("div",{class:C.searchTime,onClick:function(){n.timeStatus=!0}},[s("span",null,[n.$filters.dateFormat(n.currentDate,"YYYY-MM")]),s(u,{classPrefix:"iconfont",name:"down",size:12,color:"var(--van-primary)"},null)])},value:function(){return"buy"===n.type?s("div",{class:C.searchType,onClick:function(){n.typeStatus=!0}},[s("span",null,[n.searchName]),s(u,{classPrefix:"iconfont",name:"down",size:12,color:"var(--van-primary)"},null)]):null}})]}}),this.dataShow?s(j,{loading:this.loading,finished:this.finished,finishedText:" ",class:[C.list],onLoad:this.getList},(e=t=this.list.map((function(t){return s(b,{border:!1,onClick:function(){n.onDetail(t)}},{default:function(){return[s(x,{title:r(t.createTime).format("YYYY-MM-DD HH:mm"),value:"buy"===n.type?w[t.status]:t.operateReason,valueClass:C.tradeType},null),s(x,{border:!1},{title:function(){return s("div",{class:C.title},[s("span",null,[t.orderName]),s("span",{class:C.desc},[S[t.orderType]])])},default:function(){return s("div",{class:C.content},[s("span",{class:C.price},[c("¥"),"buy"===n.type?n.$filters.moneyFormat(t.actualPrice):n.$filters.moneyFormat(t.actualAmount)])])}}),"PAYING"===t.status||"WAIT_PAY"===t.status?s("div",{class:C.btnList},[s(d,{size:"small",round:!0,onClick:function(e){e.stopPropagation(),n.onCancelPay(t)}},{default:function(){return[c("取消订单")]}}),s(d,{size:"small",round:!0,type:"primary",onClick:function(e){e.stopPropagation(),n.onPay(t)}},{default:function(){return[c("继续支付")]}})]):null]}})})),"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!p(e)?t:{default:function(){return[t]}})):s(l,{btnStatus:!1,classImgSize:"SMALL",tips:"buy"===this.type?"暂无购买记录":"暂无退款记录"},null),s(f,{show:this.timeStatus,"onUpdate:show":function(t){return n.timeStatus=t},position:"bottom",round:!0,closeOnPopstate:!0},{default:function(){return[s(O,{type:"year-month",modelValue:n.currentDate,"onUpdate:modelValue":function(t){return n.currentDate=t},formatter:m,onCancel:function(){n.timeStatus=!1},onConfirm:n.onConfirm},null)]}}),s(v,{show:this.typeStatus,"onUpdate:show":function(t){return n.typeStatus=t},actions:this.actions,closeOnClickAction:!0,cancelText:"取消",onSelect:this.onSelect,onCancel:function(){n.typeStatus=!1}},null)])}});t("default",n({name:"tradeRecord",data:function(){return{active:"buy",height:44}},mounted:function(){var t=this;this.$nextTick((function(){var e=h(t.$refs.tabs).height;t.height=e})),T("交易记录")},render:function(){var t=this;return s("div",{class:P},[s(y,{active:this.active,"onUpdate:active":function(e){return t.active=e},color:"var(--van-primary)",sticky:!0,lineWidth:28},{default:function(){return[s(g,{name:"buy"},{default:function(){return[s(D,{height:t.height},null)]},title:function(){return s("div",{class:k,ref:"tabs"},[c("购买记录")])}}),s(g,{name:"refund",title:"退费记录"},{default:function(){return[s(D,{height:t.height,type:"refund"},null)]}})]}})])}}))}}}))}();