1 |
- import{g as L,u as b,w as d,d as v,P as A,Q as S,U as x,j as r,br as Y,M as B,z as p,by as N,F as I,B as E,C as z,aR as M,b1 as k,Z as O,D as F}from"./index.e6d6174e.js";import{L as G}from"./index.f904775d.js";import"./index.9093bc60.js";import"./index.b4a53c6a.js";import{T as $,a as C}from"./index.54627972.js";import"./index.bcc8eff6.js";import{C as V}from"./index.4aea64de.js";import{C as P}from"./index.af99cf22.js";import{I as j}from"./index.67c54471.js";import{S as R}from"./index.c42f80e3.js";import{i as U}from"./icon_member.663cb792.js";import{C as H}from"./index.045f03fd.js";import{b as q}from"./bg-image.e9966434.js";import{T as W}from"./index.275665ec.js";import{m as J,o as Q}from"./index.68f32c85.js";import{o as m}from"./orderStatus.fea01d83.js";import{D as Z}from"./index.27ea524d.js";import"./use-tab-status.e9ba8498.js";import"./use-id.f239f36f.js";import"./use-refs.eb803454.js";import"./index.17d70acf.js";import"./index.d8c651bf.js";import"./use-height.8140ea04.js";import"./index.684ca989.js";import"./utils.5fa3f1eb.js";import"./index.00bf6672.js";const K="_sticky_oix9c_1",X="_label_oix9c_17",ee="_bgImg_oix9c_30",te="_tagTabs_oix9c_38",ae="_tradeList_oix9c_63",re="_orderSection_oix9c_75",oe="_list_oix9c_78",se="_tradeLogo_oix9c_81",ne="_tradeType_oix9c_88",ce="_title_oix9c_91",ie="_name_oix9c_100",ue="_desc_oix9c_103",de="_description_oix9c_109",le="_d_oix9c_103",pe="_paymentPrice_oix9c_119",me="_songLength_oix9c_142",ye="_btnList_oix9c_152";var c={sticky:K,label:X,bgImg:ee,tagTabs:te,tradeList:ae,orderSection:re,list:oe,tradeLogo:se,tradeType:ne,title:ce,name:ie,desc:ue,description:de,d:le,paymentPrice:pe,songLength:me,btnList:ye};const h=L.platformType==="STUDENT"?"/api-student":"/api-teacher",ge=async(t,e)=>{const y=t.goodType;let u={};switch(y){case"LIVE":try{const a=await be(t.bizId),i=[];(a.planList||[]).forEach(g=>{const n=g.startTime||new Date,o=g.endTime||new Date;i.push({courseTime:`${b(n).format("YYYY-MM-DD")} ${b(n).format("HH:mm")}~${b(o).format("HH:mm")}`,coursePlan:g.plan,id:g.courseId})}),u={orderType:t.goodType,goodName:t.goodName,courseGroupId:a.courseGroupId,courseGroupName:a.courseGroupName,coursePrice:a.coursePrice,teacherName:a.userName||`\u6E38\u5BA2${a.teacherId||""}`,teacherId:a.teacherId,avatar:a.avatar,courseInfo:i}}catch(a){throw new Error(a.message)}break;case"PRACTICE":{u={...JSON.parse(t.bizContent),teacherName:t.username,starGrade:t.starGrade,avatar:t.avatar};break}case"VIDEO":{try{const a=await fe(t.bizId),{lessonGroup:i,detailList:T}=a;u={orderType:t.goodType,goodName:t.goodName,courseGroupId:i.id,courseGroupName:i.lessonName,coursePrice:i.lessonPrice,teacherName:i.username,teacherId:i.teacherId,avatar:i.avatar,courseInfo:T}}catch(a){throw new Error(a.message)}break}case"VIP":try{const a=await he(t.id);u={orderType:t.goodType,goodName:t.goodName,id:t.id,title:J[a.period]||"",price:e!=null&&e.couponAmount?Number((a.salePrice-e.couponAmount+e.discountPrice).toFixed(2)):a.salePrice||t.actualPrice,startTime:b(a.startTime).format("YYYY-MM-DD"),endTime:b(a.endTime).format("YYYY-MM-DD")}}catch(a){throw new Error(a.message)}break;case"MUSIC":try{const a=await Te(t.bizId);u={orderType:t.goodType,goodName:t.goodName,...a}}catch(a){throw new Error(a.message)}break;case"ALBUM":try{const a=await _e(t.bizId);u={orderType:t.goodType,goodName:t.goodName,...a}}catch(a){throw new Error(a.message)}break;case"TENANT_ALBUM":try{const a=await De(t.bizId);u={orderType:t.goodType,goodName:t.goodName,...a}}catch(a){throw new Error(a.message)}break;case"ACTI_REGIST":try{const a=await we(t.bizId);u={orderType:t.goodType,goodsName:a.activityName,activityId:a.id,actualPrice:a.registrationPrice}}catch(a){throw new Error(a.message)}break}u.orderType=y,u.goodName=t.goodName,m.orderObject.orderList.push(u)},fe=async t=>{try{return(await d.get(`${h}/videoLesson/selectVideoLesson`,{params:{groupId:t}})).data}catch{throw new Error("\u83B7\u53D6\u89C6\u9891\u8BFE\u8BE6\u60C5\u5931\u8D25")}},be=async t=>{try{return(await d.get(`${h}/courseGroup/queryLiveCourseInfo`,{params:{groupId:t}})).data}catch{throw new Error("\u83B7\u53D6\u76F4\u64AD\u8BFE\u8BE6\u60C5\u5931\u8D25")}},he=async t=>{try{return(await d.get(`${h}/vipCardRecord/detail/`+t)).data||[]}catch{throw new Error("\u83B7\u53D6\u4F1A\u5458\u8BE6\u60C5\u5931\u8D25")}},Te=async t=>{try{return(await d.get(`${h}/music/sheet/detail/${t}`)).data}catch{throw new Error("\u83B7\u53D6\u66F2\u76EE\u8BE6\u60C5\u5931\u8D25")}},we=async t=>{try{return(await d.post(`${h}/open/activity/info/${t}`)).data}catch{throw new Error("\u83B7\u53D6\u66F2\u76EE\u8BE6\u60C5\u5931\u8D25")}},_e=async t=>{try{return(await d.post(`${h}/music/album/detail`,{data:{id:t}})).data}catch{throw new Error("\u83B7\u53D6\u4E13\u8F91\u8BE6\u60C5\u5931\u8D25")}},De=async t=>{try{return(await d.post(`${h}/userTenantAlbumRecord/detail`,{data:{albumId:t}})).data}catch{throw new Error("\u83B7\u53D6\u673A\u6784\u4E13\u8F91\u8BE6\u60C5\u5931\u8D25")}},Ne=(t,e)=>{const{orderNo:y,actualPrice:u,orderDesc:a,orderName:i,orderType:T,orderDetailList:g,couponAmount:n,discountPrice:o,paymentConfig:s}=t;m.orderObject.orderType=T,m.orderObject.orderName=i,m.orderObject.orderDesc=a,m.orderObject.actualPrice=u,m.orderObject.orderNo=y,m.orderObject.discountPrice=o,m.orderObject.orderList=[],m.orderObject.paymentConfig=s;try{g.forEach(async l=>{await ge(l,{couponAmount:n,discountPrice:o})}),e&&e()}catch{}};function Ie(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!O(t)}var Ze=v({name:"MusicList",setup(){const t=A(),e=S({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,currentDate:new Date,list:[],dataShow:!0,loading:!1,finished:!1,searchName:"\u5168\u90E8",params:{status:"",page:1,rows:20},type:"buy"}),y=async()=>{if(!e.loading){e.loading=!0;try{const n={...e.params,searchDate:b(e.currentDate).format("YYYY-MM")},o=e.type==="buy"?"/api-student/userOrder/page":"/api-student/userOrderRefunds/page",{code:s,data:l}=await d.post(o,{data:{...n,dateTime:e.type==="refund"?n.searchDate:void 0,timeType:e.type==="refund"?"MONTH":void 0}});if(s===200){const f=l||{};e.list=e.list.concat(f.rows||[]),e.finished=f.pageNo>=f.totalPage,e.params.page=f.pageNo+1,e.dataShow=e.list.length>0}}catch{e.dataShow=!1,e.finished=!0}e.loading=!1}},u=n=>{e.type!=="refund"&&t.push({path:"/tradeDetail",query:{orderNo:n.orderNo,path:"tradeRecord"}})},a=n=>{e.currentDate=n,e.timeStatus=!1,i()},i=()=>{e.dataShow=!0,e.loading=!1,e.finished=!1,e.list=[],e.params.page=1,y()},T=async n=>{F.confirm({message:"\u662F\u5426\u53D6\u6D88\u8BA2\u5355\uFF1F",confirmButtonText:"\u786E\u5B9A",confirmButtonColor:"var(--van-primary)",cancelButtonText:"\u53D6\u6D88"}).then(async()=>{try{await d.post("/api-student/userOrder/orderCancel",{data:{orderNo:n.orderNo}}),i()}catch{}})},g=async n=>{try{const s=(await d.get(`/api-student/userOrder/detailByOrderNo/${n.orderNo}`)).data;Ne({...s,paymentConfig:n.paymentConfig},()=>{t.push({path:"/orderDetail",query:{orderType:s.orderType}})})}catch{}};return x(()=>{y()}),()=>{let n;return r(I,null,[r("div",{class:c.sticky},[r(W,null,{default:()=>[r(H,{background:"transparent",isFixed:!1,border:!1,color:"#131415"},null),r(R,{onSearch:i,type:"tenant",background:"transparent",inputBackground:"transparent"},{left:()=>r("div",{class:c.label,onClick:()=>e.timeStatus=!0},[Y(e.currentDate,"YYYY-MM"),r(B,{classPrefix:"iconfont",name:"down",size:12,color:"#131415"},null)])}),r($,{color:"var(--van-primary)",background:"transparent",lineWidth:20,shrink:!0,class:c.tagTabs,"onClick-tab":o=>{e.type=o.name==="REFUND"?"refund":"buy",e.params.status=o.name,i()}},{default:()=>[r(C,{title:"\u5168\u90E8",name:""},null),e.actions.map(o=>r(C,{title:o.name,name:o.status},null))]})]}),r("img",{class:c.bgImg,src:q},null)]),r("div",{class:c.tradeList},[e.dataShow?r(G,{loading:e.loading,finished:e.finished,finishedText:" ",class:[c.list],onLoad:y},Ie(n=e.list.map(o=>r(V,{border:!1,onClick:()=>{u(o)}},{default:()=>[r(P,{border:!1,title:b(o.createTime).format("YYYY-MM-DD HH:mm"),value:e.type==="buy"?Q[o.status]:o.operateReason,valueClass:c.tradeType},null),o.orderDetailList&&o.orderDetailList.map(s=>r(P,{border:!1,class:c.orderSection},{icon:()=>{var l;return r(j,{src:s.goodType==="VIP"?U:(l=s.bizInfo)==null?void 0:l.bizCover,class:c.tradeLogo},null)},title:()=>{var l,f,w,_,D;return r("div",{class:c.goodsSection},[r("div",{class:[c.title]},[r("span",{class:[c.name,"van-ellipsis"]},[(l=s.bizInfo)==null?void 0:l.bizName]),r("span",{class:c.desc},[p("\xA5"),N(s.actualPrice)])]),r("div",{class:c.description},[r("span",{class:[c.d,"van-ellipsis"]},[(f=s.bizInfo)==null?void 0:f.bizDesc]),s.goodType!=="VIP"&&r(I,null,[s.goodType==="TENANT_ALBUM"?r("span",{class:c.t},[p("x"),(w=s.bizInfo)==null?void 0:w.bizValidTime,p("\u4E2A\u6708")]):r("span",{class:c.t},[p("\u6C38\u4E45")])])]),((_=s.bizInfo)==null?void 0:_.bizMusicCount)&&r("span",{class:c.songLength},[p("\u5171"),(D=s.bizInfo)==null?void 0:D.bizMusicCount,p("\u9996")])])}})),r("div",{class:c.paymentPrice},[["PAYING","WAIT_PAY"].includes(o.status)?"\u9700\u4ED8\u6B3E":"\u5B9E\u4ED8\u6B3E",r("span",null,[r("i",null,[p("\xA5")]),N(o.actualPrice)])]),o.status==="PAYING"||o.status==="WAIT_PAY"?r("div",{class:c.btnList},[r(E,{size:"small",round:!0,onClick:s=>{s.stopPropagation(),T(o)}},{default:()=>[p("\u53D6\u6D88\u8BA2\u5355")]}),r(E,{size:"small",round:!0,type:"primary",onClick:s=>{s.stopPropagation(),g(o)}},{default:()=>[p("\u7EE7\u7EED\u4ED8\u6B3E")]})]):null]})))?n:{default:()=>[n]}):r(z,{btnStatus:!1,classImgSize:"SMALL",tips:e.type==="buy"?"\u6682\u65E0\u8D2D\u4E70\u8BB0\u5F55":"\u6682\u65E0\u9000\u6B3E\u8BB0\u5F55"},null)]),r(M,{show:e.timeStatus,"onUpdate:show":o=>e.timeStatus=o,position:"bottom",round:!0,closeOnPopstate:!0},{default:()=>[r(Z,{type:"year-month",modelValue:e.currentDate,"onUpdate:modelValue":o=>e.currentDate=o,formatter:k,onCancel:()=>{e.timeStatus=!1},onConfirm:a},null)]})])}}});export{Ze as default};
|