1 |
- var D=Object.defineProperty,C=Object.defineProperties;var j=Object.getOwnPropertyDescriptors;var u=Object.getOwnPropertySymbols;var w=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var h=(t,e,s)=>e in t?D(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,n=(t,e)=>{for(var s in e||(e={}))w.call(e,s)&&h(t,s,e[s]);if(u)for(var s of u(e))N.call(e,s)&&h(t,s,e[s]);return t},p=(t,e)=>C(t,j(e));import{d as b,g as m,D as L,a,S as P,q as d,u as f,w as O,C as v,j as l,B as y,x as Y,P as A,J as F,A as E}from"./vendor.75c233d7.js";import{r as c,C as I,j as k}from"./index.99ecdf56.js";import{o as B,g as M}from"./index.376fb8f6.js";import{o as i}from"./orderStatus.abddf121.js";import{C as z}from"./index.27606be5.js";const $="_tradeList_ums1x_1",V="_searchTime_ums1x_1",q="_searchType_ums1x_2",R="_list_ums1x_14",G="_tradeLogo_ums1x_17",H="_tradeType_ums1x_24",U="_title_ums1x_27",W="_content_ums1x_28",J="_desc_ums1x_37",K="_num_ums1x_38",Q="_btnList_ums1x_43";var o={tradeList:$,searchTime:V,searchType:q,list:R,tradeLogo:G,tradeType:H,title:U,content:W,desc:J,num:K,btnList:Q};const X=async t=>{const e=t.goodType;let s={};switch(e){case"PINAO_ROOM":try{const r=await Z(t.bizId);console.log("res",r),s=n({orderType:t.goodType,goodsName:t.goodName},r)}catch(r){throw new Error(r.message)}break}s.orderType=e,s.goodName=t.goodName,i.orderObject.orderList.push(s)},Z=async t=>{try{return(await c.get(`/api-teacher/pianoRoomSettings/detail/${t}`)).data}catch{throw new Error("\u83B7\u53D6\u65F6\u957F\u8BE6\u60C5\u5931\u8D25")}},tt=(t,e)=>{const{orderNo:s,actualPrice:r,orderDesc:g,orderName:_,orderType:S,orderDetailList:x}=t;i.orderObject.orderType=S,i.orderObject.orderName=_,i.orderObject.orderDesc=g,i.orderObject.actualPrice=r,i.orderObject.orderNo=s,i.orderObject.actualPrice=r,i.orderObject.orderList=[];try{x.forEach(async T=>{await X(T)}),e&&e()}catch{}};function et(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!Y(t)}var ft=b({name:"list",data(){return{timeStatus:!1,currentDate:new Date,typeStatus:!1,actions:[{name:"\u5168\u90E8"},{name:"\u5F85\u652F\u4ED8",status:"WAIT_PAY"},{name:"\u652F\u4ED8\u4E2D",status:"PAYING"},{name:"\u5DF2\u4ED8\u6B3E",status:"PAID"},{name:"\u5DF2\u5173\u95ED",status:"CLOSE"},{name:"\u652F\u4ED8\u5931\u8D25",status:"FAIL"}],list:[],dataShow:!0,loading:!1,finished:!1,searchName:"\u5168\u90E8",params:{status:"",page:1,rows:20}}},methods:{async getList(){if(!this.loading){this.loading=!0;try{const t=p(n({},this.params),{searchDate:m(this.currentDate).format("YYYY-MM")}),{code:e,data:s}=await c.post("/api-teacher/userOrder/page",{data:n({},t)});if(e===200){const r=s||{};this.list=this.list.concat(r.rows||[]),this.finished=r.pageNo>=r.totalPage,this.params.page=r.pageNo+1,this.dataShow=this.list.length>0}}catch{this.dataShow=!1,this.finished=!0}this.loading=!1}},onDetail(t){this.$router.push({path:"/tradeDetail",query:{orderNo:t.orderNo,path:"tradeRecord"}})},onConfirm(t){this.currentDate=t,this.timeStatus=!1,this.onSearch()},onSelect(t){this.params.status=t.status,this.searchName=t.name,this.onSearch()},onSearch(){this.dataShow=!0,this.loading=!1,this.finished=!1,this.list=[],this.params.page=1,this.getList()},async onCancelPay(t){L.confirm({message:"\u662F\u5426\u53D6\u6D88\u8BA2\u5355\uFF1F",confirmButtonText:"\u786E\u5B9A",confirmButtonColor:"var(--van-primary)",cancelButtonText:"\u53D6\u6D88"}).then(async()=>{try{await c.post("/api-teacher/userOrder/orderCancel",{data:{orderNo:t.orderNo}}),this.onSearch()}catch{}})},async onPay(t){try{const s=(await c.get(`/api-teacher/userOrder/detailByOrderNo/${t.orderNo}`)).data;tt(s,()=>{this.$router.push({path:"/orderDetail",query:{orderType:s.orderType}})})}catch{}}},render(){let t;return a("div",{class:o.tradeList},[a(P,{position:"top"},{default:()=>[a(z,{isFixed:!1},null),a(d,{center:!0,style:{backgroundColor:"#F7F8F9"}},{title:()=>a("div",{class:o.searchTime,onClick:()=>{this.timeStatus=!0}},[a("span",null,[this.$filters.dateFormat(this.currentDate,"YYYY-MM")]),a(f,{classPrefix:"iconfont",name:"down",size:12,color:"var(--van-primary)"},null)]),value:()=>a("div",{class:o.searchType,onClick:()=>{this.typeStatus=!0}},[a("span",null,[this.searchName]),a(f,{classPrefix:"iconfont",name:"down",size:12,color:"var(--van-primary)"},null)])})]}),this.dataShow?a(O,{loading:this.loading,finished:this.finished,finishedText:" ",class:[o.list],onLoad:this.getList},et(t=this.list.map(e=>a(v,{border:!1,onClick:()=>{this.onDetail(e)}},{default:()=>[a(d,{title:m(e.createTime).format("YYYY-MM-DD HH:mm"),value:B[e.status],valueClass:o.tradeType},null),a(d,{border:!1},{title:()=>a("div",{class:o.title},[a("span",null,[e.orderName]),a("span",{class:o.desc},[M[e.orderType]])]),default:()=>a("div",{class:o.content},[a("span",{class:o.price},[l("\uFFE5"),this.$filters.moneyFormat(e.actualPrice)])])}),e.status==="PAYING"||e.status==="WAIT_PAY"?a("div",{class:o.btnList},[a(y,{size:"small",round:!0,onClick:s=>{s.stopPropagation(),this.onCancelPay(e)}},{default:()=>[l("\u53D6\u6D88\u8BA2\u5355")]}),a(y,{size:"small",round:!0,type:"primary",onClick:s=>{s.stopPropagation(),this.onPay(e)}},{default:()=>[l("\u7EE7\u7EED\u652F\u4ED8")]})]):null]})))?t:{default:()=>[t]}):a(I,{btnStatus:!1,classImgSize:"SMALL",tips:"\u6682\u65E0\u8D2D\u4E70\u8BB0\u5F55"},null),a(A,{show:this.timeStatus,"onUpdate:show":e=>this.timeStatus=e,position:"bottom",round:!0,closeOnPopstate:!0},{default:()=>[a(F,{type:"year-month",modelValue:this.currentDate,"onUpdate:modelValue":e=>this.currentDate=e,formatter:k,onCancel:()=>{this.timeStatus=!1},onConfirm:this.onConfirm},null)]}),a(E,{show:this.typeStatus,"onUpdate:show":e=>this.typeStatus=e,actions:this.actions,closeOnClickAction:!0,cancelText:"\u53D6\u6D88",onSelect:this.onSelect,onCancel:()=>{this.typeStatus=!1}},null)])}});export{ft as default};
|