1 |
- import{d as O,O as x,P as R,S as f,Q as q,g as P,U as V,n as L,j as e,F as M,C as I,B,z as u,aR as H,bz as N,w as p,D as j}from"./index.394decd7.js";import{I as U}from"./index.ae2dd816.js";import{S as J}from"./index.3bbf4ddb.js";import"./index.f1b52763.js";import{T as z,a as y}from"./index.ae00317c.js";import{L as W}from"./index.dc786267.js";import{T as v}from"./index.88270f6d.js";import{C as A}from"./index.e6e212d8.js";import{a as G,b as $}from"./index.75a0444f.js";import{S as Q}from"./index.06b816c0.js";import{o as l}from"./orderStatus.535346ee.js";import"./use-id.e2f22365.js";import"./use-tab-status.723110ee.js";import"./use-refs.09b2d19c.js";import"./index.b9aedd1d.js";import"./icon-xin2.4ab2a52d.js";const K="_musicContent_1tq9g_1",X="_bgImg_1tq9g_12",Y="_bg_1tq9g_12",Z="_alumWrap_1tq9g_29",tt="_img_1tq9g_36",et="_iconPian_1tq9g_45",st="_numContent_1tq9g_64",at="_iconMenu_1tq9g_77",ot="_alumTitle_1tq9g_83",it="_alumDes_1tq9g_90",nt="_des_1tq9g_98",lt="_musicList_1tq9g_102",ct="_alumnList_1tq9g_138",rt="_btnGroup_1tq9g_141",ut="_systemHide_1tq9g_164",mt="_title_1tq9g_186",pt="_price_1tq9g_192",dt="_originalPrice_1tq9g_202",bt="_active_1tq9g_206",gt="_bottom_function_1tq9g_228",_t="_iconRightTop_1tq9g_234",ft="_iconClose_1tq9g_241",yt="_popupStatus_1tq9g_252",vt="_memberMeal_1tq9g_255",Ct="_titleMeal_1tq9g_255",ht="_iconArrowLine_1tq9g_265",Tt="_btn_1tq9g_141",St="_unit_1tq9g_288",Et="_priceSection_1tq9g_291",qt="_priceUnit_1tq9g_302";var s={musicContent:K,bgImg:X,bg:Y,alumWrap:Z,img:tt,iconPian:et,numContent:st,iconMenu:at,alumTitle:ot,alumDes:it,des:nt,musicList:lt,alumnList:ct,btnGroup:rt,"system-list":"_system-list_1tq9g_148",systemHide:ut,"system-item":"_system-item_1tq9g_169",title:mt,price:pt,originalPrice:dt,active:bt,bottom_function:gt,iconRightTop:_t,iconClose:ft,popupStatus:yt,memberMeal:vt,titleMeal:Ct,iconArrowLine:ht,btn:Tt,unit:St,priceSection:Et,priceUnit:qt},Pt="./assets/icon-right-top.1c7d1f37.png",C="./assets/icon-album-cover.101d7fe7.png",Ht=O({name:"train-tool",setup(){const d=sessionStorage.getItem("tool-subject-type");sessionStorage.removeItem("tool-subject-type");const c=x(),h=R(),b=f("rgba(55, 205, 177, 0)"),g=f("#fff"),t=q({details:{},buy:c.query.buy,albumId:c.query.albumId||null,activeTab:c.query.subjectType||"SUBJECT",loading:!1,finished:!1,isError:!1,list:[],popupStatus:!1,selectMember:{},buyList:[{purchaseCycle:6,salePrice:0,costPrice:0,status:!0},{purchaseCycle:12,salePrice:0,costPrice:0,status:!1},{purchaseCycle:18,salePrice:0,costPrice:0,status:!1},{purchaseCycle:24,salePrice:0,costPrice:0,status:!1}],ensembleCounts:!1,musicCounts:!1,subjectCounts:!1,tenantAlbumStatus:0,ablumStatus:!1,heightV:0}),m=q({page:1,rows:20}),T=f(P.platformType==="STUDENT"?"/api-student":"/api-teacher"),w=async()=>{try{let i=T.value+"/userTenantAlbumRecord/detail";t.albumId&&(i=i+"?albumId="+t.albumId);const{data:a}=await p.post(i);t.details=a||{},t.tenantAlbumStatus=a.tenantAlbumStatus,t.ablumStatus=a.status,t.buyList.forEach((r,n)=>{r.salePrice=(n+1)*a.salePrice,r.costPrice=(n+1)*a.costPrice}),t.selectMember={...t.buyList[0]},t.ensembleCounts=!(a.ensembleCounts<=0),t.subjectCounts=!(a.subjectCounts<=0),t.musicCounts=!(a.musicCounts<=0),t.subjectCounts?t.activeTab="SUBJECT":t.musicCounts?t.activeTab="MUSIC":t.ensembleCounts&&(t.activeTab="ENSEMBLE"),c.query.subjectType=="SUBJECT"&&t.subjectCounts?t.activeTab="SUBJECT":c.query.subjectType=="MUSIC"&&t.musicCounts?t.activeTab="MUSIC":c.query.subjectType=="ENSEMBLE"&&t.ensembleCounts&&(t.activeTab="ENSEMBLE"),d=="SUBJECT"&&t.subjectCounts?t.activeTab="SUBJECT":d=="MUSIC"&&t.musicCounts?t.activeTab="MUSIC":d=="ENSEMBLE"&&t.ensembleCounts&&(t.activeTab="ENSEMBLE")}catch{}},_=async()=>{if(t.loading)return;console.log(t.details,"state.details"),t.loading=!0,t.isError=!1;const i={albumId:t.details.id||null,subjectType:t.activeTab,...m};try{const{data:a}=await p.post(`${T.value}/tenantAlbumMusic/page`,{data:i});if(t.list.length>0&&a.pageNo===1)return;t.list=t.list.concat(a.rows||[]),m.page=a.pageNo+1,t.loading=!1,t.finished=a.pageNo>=a.totalPage,m.page=a.pageNo+1}catch{t.isError=!0}t.loading=!1};V(async()=>{G(document,"scroll",i=>{const{y:a}=$();a.value>20?(b.value="rgba(255, 255, 255)",g.value="black",L({api:"backIconChange",content:{iconStyle:"black"}})):(b.value="transparent",g.value="#fff",L({api:"backIconChange",content:{iconStyle:"white"}}))}),t.loading=!0,await w(),await _(),t.loading=!1});const k=async()=>{const i=t.selectMember,a=t.details;l.orderObject.orderType="TENANT_ALBUM",l.orderObject.orderName=a.name,l.orderObject.orderDesc=a.name,l.orderObject.actualPrice=i.salePrice,l.orderObject.orderNo="",l.orderObject.orderList=[{orderType:"TENANT_ALBUM",goodsName:a.name,actualPrice:i.salePrice,price:i.salePrice,...a,...i}];const n=(await p.post("/api-student/userOrder/getPendingOrder",{data:{goodType:"TENANT_ALBUM",bizId:a.id}})).data;n?(t.popupStatus=!1,j.confirm({title:"\u63D0\u793A",message:"\u60A8\u6709\u4E00\u4E2A\u672A\u652F\u4ED8\u7684\u8BA2\u5355\uFF0C\u662F\u5426\u7EE7\u7EED\u652F\u4ED8\uFF1F",theme:"round-button",className:"confirm-button-group",cancelButtonText:"\u53D6\u6D88\u8BA2\u5355",confirmButtonText:"\u7EE7\u7EED\u652F\u4ED8"}).then(async()=>{l.orderObject.orderNo=n.orderNo,l.orderObject.actualPrice=n.actualPrice,l.orderObject.discountPrice=n.discountPrice,l.orderObject.paymentConfig={...n.paymentConfig,paymentVendor:n.paymentVendor,paymentVersion:n.paymentVersion},S()}).catch(()=>{j.close(),D(n.orderNo)})):S()},S=()=>{const i=t.details;h.push({path:"/orderDetail",query:{orderType:"ALBUM",album:i.id}})},D=async i=>{try{await p.post("/api-student/userOrder/orderCancel/v2",{data:{orderNo:i}})}catch{}};return()=>{var i,a,r,n,E;return e("div",{class:s.trainTool},[(t.tenantAlbumStatus===0||!t.ablumStatus)&&t.buy!="1"?e(M,null,[e(v,{position:"top",onBarHeight:o=>{console.log(o,"height",o),t.heightV=o}},{default:()=>[e(A,{border:!1,isFixed:!1},null)]}),!t.loading&&e("div",{style:{height:"calc(100vh - var(--header-height))",display:"flex",alignItems:"center"}},[e(I,{tips:"\u6682\u65E0\u66F2\u76EE",classImgSize:"SMALL",btnStatus:!1},null)])]):e(M,null,[e(v,{position:"top",onBarHeight:o=>{console.log(o,"height",o),t.heightV=o}},{default:()=>[e(A,{background:b.value,border:!1,isFixed:!1,color:g.value,backIconColor:"white"},null)]}),e("img",{class:s.bgImg,src:(i=t.details)==null?void 0:i.coverImg},null),e("div",{class:s.musicContent},null),e("div",{class:s.bg},[e("div",{class:s.alumWrap},[e("div",{class:s.img},[e(U,{class:s.image,width:"100%",height:"100%",fit:"cover",src:((a=t.details)==null?void 0:a.coverImg)||C,errorIcon:C},null),e("div",{class:s.iconPian},[e(U,{class:s.image,width:"100%",height:"100%",fit:"cover",src:((r=t.details)==null?void 0:r.coverImg)||C},null)])]),e("div",{class:s.alumDes},[e("div",{class:[s.alumTitle,"van-ellipsis"]},[(n=t.details)==null?void 0:n.name]),e("div",{class:[s.des,"van-multi-ellipsis--l2"],style:{height:"32px",lineHeight:"16px"}},[(E=t.details)==null?void 0:E.describe])])])]),e("div",{class:s.musicList},[e(J,{position:"top",offsetTop:t.heightV},{default:()=>[e(z,{color:"var(--van-primary)",background:"transparent",lineWidth:20,shrink:!0,active:t.activeTab,"onUpdate:active":o=>t.activeTab=o,onChange:o=>{t.activeTab=o,m.page=1,t.list=[],_()}},{default:()=>[t.subjectCounts&&e(y,{title:"\u58F0\u90E8\u7EC3\u4E60",name:"SUBJECT"},null),t.musicCounts&&e(y,{title:"\u72EC\u594F\u66F2\u76EE",name:"MUSIC"},null),t.ensembleCounts&&e(y,{title:"\u5408\u594F\u7EC3\u4E60",name:"ENSEMBLE"},null)]})]}),e("div",{class:s.alumnList},[e(W,{loading:t.loading,finished:t.finished,"finished-text":" ",onLoad:_,immediateCheck:!1,error:t.isError},{default:()=>[t.list&&t.list.length?e(Q,{showNumber:!0,list:t.list,onDetail:o=>{sessionStorage.setItem("tool-subject-type",t.activeTab),h.push({path:"/music-detail",query:{id:o.id}})}},null):!t.loading&&e(I,{tips:"\u6682\u65E0\u66F2\u76EE",classImgSize:"SMALL",btnStatus:!1},null)]})])]),P.platformType==="STUDENT"&&t.buy!="1"&&e(v,{position:"bottom"},{default:()=>{var o;return[e("div",{class:s.btnGroup},[e(B,{round:!0,block:!0,disabled:((o=t.details)==null?void 0:o.musicNum)<=0,color:"linear-gradient(270deg, #FF204B 0%, #FE5B71 100%)",onClick:()=>t.popupStatus=!0},{default:()=>[u("\u8D2D\u4E70\u6559\u7A0B")]})])]}})]),e(H,{show:t.popupStatus,"onUpdate:show":o=>t.popupStatus=o,position:"bottom",round:!0,zIndex:9999,"safe-area-inset-bottom":!0,closeable:!1,class:s.popupStatus,onClose:()=>t.popupStatus=!1},{default:()=>[e("div",{class:s.bottom_function},[e("i",{class:s.iconClose,onClick:()=>t.popupStatus=!1},null),e("img",{src:Pt,class:s.iconRightTop},null),e("div",{class:s.memberMeal},[e("div",{class:s.titleMeal},[e("span",null,[u("\u8BF7\u9009\u62E9\u6559\u7A0B\u8D2D\u4E70\u5468\u671F")])]),e("div",{class:s["system-list"]},[t.buyList.map(o=>e("div",{class:[s["system-item"],o.status&&s.active],onClick:()=>{t.buyList.forEach(F=>{F.status=!1}),o.status=!0,t.selectMember=o}},[e("p",{class:s.title},[o.purchaseCycle,u("\u4E2A\u6708")]),e("p",{class:s.price},[e("span",null,[u("\uFFE5")]),N(o.salePrice,"0,0[.]00")]),o.salePrice<o.costPrice&&e("del",{class:s.originalPrice},[u("\uFFE5"),N(o.costPrice,"0,0[.]00")])]))])]),e("div",{class:s.btnGroup},[e(B,{round:!0,block:!0,class:s.btn,onClick:k},{default:()=>[u("\u70B9\u51FB\u8D2D\u4E70")]})])])]})])}}});export{Ht as default};
|