1 |
- import{b as n,d as _,t as d,i as a,L as u,w as c,B as h,ak as S,C as D,ab as T,a$ as C}from"./index.9a8e7555.js";import{A as w}from"./index.9fdf45c1.js";import{C as l}from"./index.3b6c3426.js";import{C as L}from"./index.e50ea8f8.js";import"./index.7d9da821.js";import{S as N}from"./index.e9655eaa.js";import{L as b}from"./index.87809eea.js";/* empty css *//* empty css */import{o as P,g as O}from"./index.376fb8f6.js";import{o as i}from"./orderStatus.e7cb2458.js";import{C as x}from"./index.2c715c84.js";import{D as v}from"./function-call.c55294d7.js";import{D as Y}from"./index.db84d102.js";import"./use-tab-status.41627c38.js";import"./use-height.5caa9b61.js";import"./index.3fb1b5c3.js";import"./utils.72992dd7.js";import"./index.0c52a5ac.js";const A="_tradeList_ums1x_1",j="_searchTime_ums1x_1",F="_searchType_ums1x_2",E="_list_ums1x_14",k="_tradeLogo_ums1x_17",I="_tradeType_ums1x_24",B="_title_ums1x_27",M="_content_ums1x_28",$="_desc_ums1x_37",z="_num_ums1x_38",V="_btnList_ums1x_43";var o={tradeList:A,searchTime:j,searchType:F,list:E,tradeLogo:k,tradeType:I,title:B,content:M,desc:$,num:z,btnList:V};const R=async t=>{const e=t.goodType;let s={};switch(e){case"PINAO_ROOM":try{const r=await q(t.bizId);console.log("res",r),s={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)},q=async t=>{try{return(await n.get(`/api-teacher/pianoRoomSettings/detail/${t}`)).data}catch{throw new Error("\u83B7\u53D6\u65F6\u957F\u8BE6\u60C5\u5931\u8D25")}},G=(t,e)=>{const{orderNo:s,actualPrice:r,orderDesc:p,orderName:m,orderType:f,orderDetailList:y}=t;i.orderObject.orderType=f,i.orderObject.orderName=m,i.orderObject.orderDesc=p,i.orderObject.actualPrice=r,i.orderObject.orderNo=s,i.orderObject.actualPrice=r,i.orderObject.orderList=[];try{y.forEach(async g=>{await R(g)}),e&&e()}catch{}};function H(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!S(t)}var ht=_({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={...this.params,searchDate:d(this.currentDate).format("YYYY-MM")},{code:e,data:s}=await n.post("/api-teacher/userOrder/page",{data:{...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){v.confirm({message:"\u662F\u5426\u53D6\u6D88\u8BA2\u5355\uFF1F",confirmButtonText:"\u786E\u5B9A",confirmButtonColor:"var(--van-primary)",cancelButtonText:"\u53D6\u6D88"}).then(async()=>{try{await n.post("/api-teacher/userOrder/orderCancel",{data:{orderNo:t.orderNo}}),this.onSearch()}catch{}})},async onPay(t){try{const s=(await n.get(`/api-teacher/userOrder/detailByOrderNo/${t.orderNo}`)).data;G(s,()=>{this.$router.push({path:"/orderDetail",query:{orderType:s.orderType}})})}catch{}}},render(){let t;return a("div",{class:o.tradeList},[a(N,{position:"top"},{default:()=>[a(x,{isFixed:!1},null),a(l,{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(u,{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(u,{classPrefix:"iconfont",name:"down",size:12,color:"var(--van-primary)"},null)])})]}),this.dataShow?a(b,{loading:this.loading,finished:this.finished,finishedText:" ",class:[o.list],onLoad:this.getList},H(t=this.list.map(e=>a(L,{border:!1,onClick:()=>{this.onDetail(e)}},{default:()=>[a(l,{title:d(e.createTime).format("YYYY-MM-DD HH:mm"),value:P[e.status],valueClass:o.tradeType},null),a(l,{border:!1},{title:()=>a("div",{class:o.title},[a("span",null,[e.orderName]),a("span",{class:o.desc},[O[e.orderType]])]),default:()=>a("div",{class:o.content},[a("span",{class:o.price},[c("\uFFE5"),this.$filters.moneyFormat(e.actualPrice)])])}),e.status==="PAYING"||e.status==="WAIT_PAY"?a("div",{class:o.btnList},[a(h,{size:"small",round:!0,onClick:s=>{s.stopPropagation(),this.onCancelPay(e)}},{default:()=>[c("\u53D6\u6D88\u8BA2\u5355")]}),a(h,{size:"small",round:!0,type:"primary",onClick:s=>{s.stopPropagation(),this.onPay(e)}},{default:()=>[c("\u7EE7\u7EED\u652F\u4ED8")]})]):null]})))?t:{default:()=>[t]}):a(D,{btnStatus:!1,classImgSize:"SMALL",tips:"\u6682\u65E0\u8D2D\u4E70\u8BB0\u5F55"},null),a(T,{show:this.timeStatus,"onUpdate:show":e=>this.timeStatus=e,position:"bottom",round:!0,closeOnPopstate:!0},{default:()=>[a(Y,{type:"year-month",modelValue:this.currentDate,"onUpdate:modelValue":e=>this.currentDate=e,formatter:C,onCancel:()=>{this.timeStatus=!1},onConfirm:this.onConfirm},null)]}),a(w,{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{ht as default};
|