1 |
- import{g as Y,w as g,y as l,d as L,Q as z,S as B,V as O,j as o,bw as k,N as M,A as D,bC as E,F as C,B as I,C as V,aS as F,b8 as G,$ as R,D as $}from"./ResizeObserver.es.39b48a47.js";import{L as j}from"./index.6c529ad4.js";import"./index.608320e9.js";import"./index.0e35d2fb.js";import{T as x,a as P}from"./index.5d4d28cc.js";import"./index.b8eefd8d.js";import{C as H}from"./index.9f5e14d1.js";import{C as A}from"./index.db115763.js";import{I as U}from"./index.fcbcb027.js";import{S as _}from"./index.e10a1ae2.js";import{i as q}from"./icon_member.4d7750c3.js";import{s as c}from"./index.module.37c25674.js";import{C as W}from"./index.970ad07b.js";import{b as J}from"./bg-image-1.a320f35c.js";import{T as Q}from"./index.e90d2179.js";import{m as K,o as X}from"./index.07111672.js";import{o as y}from"./orderStatus.fbc0ddaf.js";import{D as Z}from"./index.c1da7507.js";import"./use-tab-status.bcc0c503.js";import"./use-id.b004ff17.js";import"./use-refs.07204da6.js";import"./index.428ab1a8.js";import"./index.dc19bc54.js";import"./utils.eda083a9.js";import"./index.6617ac99.js";const h=Y.platformType==="STUDENT"?"/api-student":"/api-teacher",ee=async(a,e)=>{var b;const f=a.goodType;let u={};switch(f){case"LIVE":try{const t=await te(a.bizId),i=[];(t.planList||[]).forEach(s=>{const r=s.startTime||new Date,n=s.endTime||new Date;i.push({courseTime:`${g(r).format("YYYY-MM-DD")} ${g(r).format("HH:mm")}~${g(n).format("HH:mm")}`,coursePlan:s.plan,id:s.courseId})}),u={orderType:a.goodType,goodName:a.goodName,courseGroupId:t.courseGroupId,courseGroupName:t.courseGroupName,coursePrice:t.coursePrice,teacherName:t.userName||`\u6E38\u5BA2${t.teacherId||""}`,teacherId:t.teacherId,avatar:t.avatar,courseInfo:i}}catch(t){throw new Error(t.message)}break;case"PRACTICE":{u={...JSON.parse(a.bizContent),teacherName:a.username,starGrade:a.starGrade,avatar:a.avatar};break}case"VIDEO":{try{const t=await ae(a.bizId),{lessonGroup:i,detailList:T}=t;u={orderType:a.goodType,goodName:a.goodName,courseGroupId:i.id,courseGroupName:i.lessonName,coursePrice:i.lessonPrice,teacherName:i.username,teacherId:i.teacherId,avatar:i.avatar,courseInfo:T}}catch(t){throw new Error(t.message)}break}case"VIP":try{const t=await re(a.id);u={orderType:a.goodType,goodName:a.goodName,id:a.id,title:K[t.period]||"",price:e!=null&&e.couponAmount?Number((t.salePrice-e.couponAmount+e.discountPrice).toFixed(2)):t.salePrice||a.actualPrice,startTime:g(t.startTime).format("YYYY-MM-DD"),endTime:g(t.endTime).format("YYYY-MM-DD")}}catch(t){throw new Error(t.message)}break;case"MUSIC":try{const t=await oe(a.bizId);u={orderType:a.goodType,goodName:a.goodName,...t}}catch(t){throw new Error(t.message)}break;case"ALBUM":try{const t=await ne(a.bizId);u={orderType:a.goodType,goodName:a.goodName,...t}}catch(t){throw new Error(t.message)}break;case"TENANT_ALBUM":try{const t=await ce(a.bizId);u={orderType:a.goodType,goodName:a.goodName,...t,purchaseNum:((b=a.bizInfo)==null?void 0:b.bizValidTime)||t.purchaseNum}}catch(t){throw new Error(t.message)}break;case"ACTI_REGIST":try{const t=await se(a.bizId);u={orderType:a.goodType,goodsName:t.activityName,activityId:t.id,actualPrice:t.registrationPrice}}catch(t){throw new Error(t.message)}break}u.orderType=f,u.goodName=a.goodName,y.orderObject.orderList.push(u)},ae=async a=>{try{return(await l.get(`${h}/videoLesson/selectVideoLesson`,{params:{groupId:a}})).data}catch{throw new Error("\u83B7\u53D6\u89C6\u9891\u8BFE\u8BE6\u60C5\u5931\u8D25")}},te=async a=>{try{return(await l.get(`${h}/courseGroup/queryLiveCourseInfo`,{params:{groupId:a}})).data}catch{throw new Error("\u83B7\u53D6\u76F4\u64AD\u8BFE\u8BE6\u60C5\u5931\u8D25")}},re=async a=>{try{return(await l.get(`${h}/vipCardRecord/detail/`+a)).data||[]}catch{throw new Error("\u83B7\u53D6\u4F1A\u5458\u8BE6\u60C5\u5931\u8D25")}},oe=async a=>{try{return(await l.get(`${h}/music/sheet/detail/${a}`)).data}catch{throw new Error("\u83B7\u53D6\u66F2\u76EE\u8BE6\u60C5\u5931\u8D25")}},se=async a=>{try{return(await l.post(`${h}/open/activity/info/${a}`)).data}catch{throw new Error("\u83B7\u53D6\u66F2\u76EE\u8BE6\u60C5\u5931\u8D25")}},ne=async a=>{try{return(await l.post(`${h}/music/album/detail`,{data:{id:a}})).data}catch{throw new Error("\u83B7\u53D6\u4E13\u8F91\u8BE6\u60C5\u5931\u8D25")}},ce=async a=>{try{return(await l.post(`${h}/userTenantAlbumRecord/detail`,{requestType:"form",data:{albumId:a}})).data}catch{throw new Error("\u83B7\u53D6\u673A\u6784\u4E13\u8F91\u8BE6\u60C5\u5931\u8D25")}},ue=(a,e)=>{const{orderNo:f,actualPrice:u,orderDesc:b,orderName:t,orderType:i,orderDetailList:T,couponAmount:s,discountPrice:r,paymentConfig:n,paymentVendor:p,paymentVersion:w}=a;y.orderObject.orderType=i,y.orderObject.orderName=t,y.orderObject.orderDesc=b,y.orderObject.actualPrice=u,y.orderObject.orderNo=f,y.orderObject.discountPrice=r,y.orderObject.orderList=[],y.orderObject.paymentConfig={...n,paymentVendor:p,paymentVersion:w};try{T.forEach(async d=>{await ee(d,{couponAmount:s,discountPrice:r})}),e&&e()}catch{}};function ie(a){return typeof a=="function"||Object.prototype.toString.call(a)==="[object Object]"&&!R(a)}var Me=L({name:"MusicList",setup(){const a=z(),e=B({actions:[{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"}],timeStatus:!1,currentSearchDate:new Date,currentDate:new Date,list:[],dataShow:!0,loading:!1,finished:!1,searchName:"\u5168\u90E8",params:{status:"",keyword:"",page:1,rows:20},type:"buy"}),f=async()=>{var s;if(!e.loading){e.loading=!0;try{const r={...e.params,searchDate:g(e.currentSearchDate).format("YYYY-MM")},n=e.type==="buy"?"/api-student/userOrder/page":"/api-student/userOrderRefunds/page",{code:p,data:w}=await l.post(n,{data:{...r,dateTime:e.type==="refund"?r.searchDate:void 0,timeType:e.type==="refund"?"MONTH":void 0}});if(p===200){const d=w||{};(s=d.rows)==null||s.forEach(S=>{(S.orderDetailList||[]).forEach(m=>{const N=m.goodType==="DISCOUNT"?m.bizContent:m.bizContent?JSON.parse(m.bizContent):{};if(N&&N.purchaseType){const v={MONTH:1,QUARTERLY:3,YEAR_HALF:6,YEAR:12};N.purchaseType==="DAY"?m.unit="\u5929":(m.unit="\u4E2A\u6708",m.bizInfo.bizValidTime=m.bizInfo.bizValidTime*v[N.purchaseType])}else m.unit="\u4E2A\u6708"})}),e.list=e.list.concat(d.rows||[]),e.finished=d.pageNo>=d.totalPage,e.params.page=d.pageNo+1,e.dataShow=e.list.length>0}}catch(r){console.log(r,"e"),e.dataShow=!1,e.finished=!0}e.loading=!1}},u=s=>{e.type!=="refund"&&a.push({path:"/goodsDetail",query:{orderNo:s.orderNo,path:"tradeRecord"}})},b=s=>{e.currentDate=s,e.currentSearchDate=s,e.timeStatus=!1,t()},t=s=>{e.dataShow=!0,e.loading=!1,e.finished=!1,e.list=[],e.params.page=1,e.params.keyword=s,f()},i=async s=>{$.confirm({message:"\u662F\u5426\u53D6\u6D88\u8BA2\u5355\uFF1F",confirmButtonText:"\u786E\u5B9A",confirmButtonColor:"var(--van-primary)",cancelButtonText:"\u53D6\u6D88"}).then(async()=>{try{await l.post("/api-student/userOrder/orderCancel",{data:{orderNo:s.orderNo}}),t()}catch{}})},T=async s=>{try{const n=(await l.get(`/api-student/userOrder/detailByOrderNo/${s.orderNo}`)).data;ue({...n,paymentConfig:s.paymentConfig},()=>{a.push({path:"/orderDetail",query:{orderType:n.orderType}})})}catch{}};return O(()=>{f()}),()=>{let s;return o(C,null,[o("div",{class:c.sticky},[o(Q,null,{default:()=>[o(W,{background:"transparent",isFixed:!1,border:!1,color:"#131415"},null),o(_,{onSearch:t,type:"tenant",background:"transparent",inputBackground:"transparent"},{left:()=>o("div",{class:c.label,onClick:()=>e.timeStatus=!0},[k(e.currentSearchDate,"YYYY-MM"),o(M,{classPrefix:"iconfont",name:"down",size:12,color:"#948D93"},null)])}),o(x,{color:"var(--van-primary)",background:"transparent",lineWidth:20,shrink:!0,class:c.tagTabs,"onClick-tab":r=>{e.type=r.name==="REFUND"?"refund":"buy",e.params.status=r.name,t()}},{default:()=>[o(P,{title:"\u5168\u90E8",name:""},null),e.actions.map(r=>o(P,{title:r.name,name:r.status},null))]})]}),o("img",{class:c.bgImg,src:J},null)]),o("div",{class:c.tradeList},[e.dataShow?o(j,{finished:e.finished,finishedText:" ",class:[c.list],onLoad:f},ie(s=e.list.map(r=>o(H,{border:!1,onClick:()=>{u(r)}},{default:()=>[o(A,{border:!1,title:g(r.createTime).format("YYYY-MM-DD HH:mm"),value:e.type==="buy"?X[r.status]:r.operateReason,valueClass:c.tradeType},null),r.orderDetailList&&r.orderDetailList.map(n=>o(A,{border:!1,class:c.orderSection},{icon:()=>{var p;return o(U,{src:n.goodType==="VIP"?q:(p=n.bizInfo)==null?void 0:p.bizCover,class:c.tradeLogo},null)},title:()=>{var p,w,d;return o("div",{class:c.goodsSection},[o("div",{class:[c.title]},[o("span",{class:[c.name,"van-ellipsis"]},[(p=n.bizInfo)==null?void 0:p.bizName]),o("span",{class:c.desc},[D("\xA5"),E(n.actualPrice)])]),o("div",{class:c.description},[o("span",{class:[c.d,"van-ellipsis"]},[(w=n.bizInfo)==null?void 0:w.bizDesc]),n.goodType!=="VIP"&&o(C,null,[n.goodType==="TENANT_ALBUM"?o("span",{class:c.t},[D("x"),(d=n.bizInfo)==null?void 0:d.bizValidTime,n.unit]):o("span",{class:c.t},[D("\u6C38\u4E45")])])])])}})),o("div",{class:c.paymentPrice},[["PAYING","WAIT_PAY"].includes(r.status)?"\u9700\u4ED8\u6B3E":r.status==="CLOSE"?"\u8BA2\u5355\u91D1\u989D":"\u5B9E\u4ED8\u6B3E",o("span",null,[o("i",null,[D("\xA5")]),E(r.actualPrice)])]),r.status==="PAYING"||r.status==="WAIT_PAY"?o("div",{class:c.btnList},[o(I,{size:"small",round:!0,onClick:n=>{n.stopPropagation(),i(r)}},{default:()=>[D("\u53D6\u6D88\u8BA2\u5355")]}),o(I,{size:"small",round:!0,type:"primary",onClick:n=>{n.stopPropagation(),T(r)}},{default:()=>[D("\u7EE7\u7EED\u4ED8\u6B3E")]})]):null]})))?s:{default:()=>[s]}):o(V,{btnStatus:!1,classImgSize:"CERT",tips:e.type==="buy"?"\u6682\u65E0\u8D2D\u4E70\u8BB0\u5F55":"\u6682\u65E0\u9000\u6B3E\u8BB0\u5F55"},null)]),o(F,{show:e.timeStatus,"onUpdate:show":r=>e.timeStatus=r,position:"bottom",round:!0,closeOnPopstate:!0},{default:()=>[o(Z,{type:"year-month",modelValue:e.currentDate,"onUpdate:modelValue":r=>e.currentDate=r,formatter:G,onCancel:()=>{e.timeStatus=!1},onConfirm:b},null)]})])}}});export{Me as default};
|