index.16e677b3.js 8.5 KB

1
  1. import{d as D,O as w,P as j,S as _,Q as A,g as F,U as R,n as P,j as t,z as l,C as x,B as T,aR as V,by as E,w as m,D as S}from"./index.e6d6174e.js";import{I}from"./index.67c54471.js";import"./index.9093bc60.js";import"./index.b4a53c6a.js";import{T as z,a as h}from"./index.54627972.js";import{L as G}from"./index.f904775d.js";import{T as L}from"./index.275665ec.js";import{C as J}from"./index.045f03fd.js";import{u as Q,a as W}from"./index.684ca989.js";import{S as Y}from"./index.e8449f92.js";import{o as c}from"./orderStatus.fea01d83.js";import"./use-id.f239f36f.js";import"./use-tab-status.e9ba8498.js";import"./use-refs.eb803454.js";import"./index.d8c651bf.js";import"./use-height.8140ea04.js";import"./icon-xin.18c43f84.js";const H="_musicContent_1ahbo_1",K="_bgImg_1ahbo_12",X="_bg_1ahbo_12",q="_alumWrap_1ahbo_29",Z="_img_1ahbo_36",$="_iconPian_1ahbo_45",ee="_numContent_1ahbo_64",te="_iconMenu_1ahbo_77",se="_alumTitle_1ahbo_83",ae="_alumDes_1ahbo_90",oe="_des_1ahbo_98",ie="_musicList_1ahbo_102",ce="_alumnList_1ahbo_132",ne="_btnGroup_1ahbo_135",le="_systemHide_1ahbo_158",re="_title_1ahbo_180",ue="_price_1ahbo_186",me="_originalPrice_1ahbo_196",pe="_active_1ahbo_200",de="_bottom_function_1ahbo_222",be="_iconRightTop_1ahbo_228",_e="_iconClose_1ahbo_235",he="_popupStatus_1ahbo_246",ge="_memberMeal_1ahbo_249",fe="_titleMeal_1ahbo_249",ve="_iconArrowLine_1ahbo_259",Ce="_btn_1ahbo_135",ye="_unit_1ahbo_282",Ae="_priceSection_1ahbo_285",Pe="_priceUnit_1ahbo_296";var s={musicContent:H,bgImg:K,bg:X,alumWrap:q,img:Z,iconPian:$,numContent:ee,iconMenu:te,alumTitle:se,alumDes:ae,des:oe,musicList:ie,alumnList:ce,btnGroup:ne,"system-list":"_system-list_1ahbo_142",systemHide:le,"system-item":"_system-item_1ahbo_163",title:re,price:ue,originalPrice:me,active:pe,bottom_function:de,iconRightTop:be,iconClose:_e,popupStatus:he,memberMeal:ge,titleMeal:fe,iconArrowLine:ve,btn:Ce,unit:ye,priceSection:Ae,priceUnit:Pe},Te="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAYCAYAAAD6S912AAAAAXNSR0IArs4c6QAAAU9JREFUSEvNlT8sBFEQh79ZHVGJ5E5EJLcqhU6nUEgkFFZzlYpGobhOIoJEIVFsp6ERhWhQnOQ6BYlEpxAFIkG4RJQnCrcjK/7d7e2623vEK9/7zW++l3kzTzC85MNP7ZEUyLTCIEoSoSEyl1JEuBfIgS7Jxe6lr38z1K7RIVVvC6QpHrAWRKy0nG/viU+mcBLf7POOBYEeUdtZVZiIR1YaJbAmnu3cAO0mDIFb8VLOS0kBLAGnH9pao3PcPcDOPnj6pVOKPuG3HWC4D3EzVQFrxoXsQYk2aNjbDRsLiGVFvxrPg7E5OD79wdA/7khAoiWaMv8I1/mAJkhY1WXDRX9g2JmE9XmkQpX16RlmViB7GIoYJEwPIIuToQGaO4Kp5RoMmxthdrzyO/QJ3U04u6rB8P8Vpbz16iF8bz2zw8H4+DI+YI1/Ab/ySdVT2PLYVxYzj1+d5XjBAAAAAElFTkSuQmCC",Ee="./assets/icon-right-top.1c7d1f37.png",M="./assets/icon-album-cover.101d7fe7.png",Ge=D({name:"train-tool",setup(){const B=w(),g=j(),p=_("rgba(55, 205, 177, 0)"),d=_("#fff"),e=A({details:{},albumId:B.query.albumId||null,activeTab:"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},{purchaseCycle:30,salePrice:0,costPrice:0,status:!1},{purchaseCycle:36,salePrice:0,costPrice:0,status:!1}],ensembleCounts:!1,musicCounts:!1,subjectCounts:!1}),u=A({page:1,rows:20}),f=_(F.platformType==="STUDENT"?"/api-student":"/api-teacher"),N=async()=>{try{const{data:a}=await m.post(f.value+"/userTenantAlbumRecord/detail?albumId="+e.albumId);e.details=a||{},console.log(e.details,"details"),e.buyList.forEach((o,r)=>{o.salePrice=(r+1)*a.salePrice,o.costPrice=(r+1)*a.costPrice}),e.selectMember={...e.buyList[0]},e.ensembleCounts=!(a.ensembleCounts<=0),e.subjectCounts=!(a.subjectCounts<=0),e.musicCounts=!(a.musicCounts<=0),e.subjectCounts?e.activeTab="SUBJECT":e.ensembleCounts?e.activeTab="ENSEMBLE":e.musicCounts&&(e.activeTab="MUSIC")}catch{}},b=async()=>{if(e.loading)return;console.log(e.details,"state.details"),e.loading=!0,e.isError=!1;const a={albumId:e.details.id||null,subjectType:e.activeTab,...u};try{const{data:o}=await m.post(`${f.value}/tenantAlbumMusic/page`,{data:a});if(e.list.length>0&&o.pageNo===1)return;e.list=e.list.concat(o.rows||[]),u.page=o.pageNo+1,e.loading=!1,e.finished=o.pageNo>=o.totalPage,u.page=o.pageNo+1}catch{e.isError=!0}e.loading=!1};R(async()=>{Q(document,"scroll",a=>{const{y:o}=W();o.value>20?(p.value="rgba(255, 255, 255)",d.value="black",P({api:"backIconChange",content:{iconStyle:"black"}})):(p.value="transparent",d.value="#fff",P({api:"backIconChange",content:{iconStyle:"white"}}))}),await N(),await b()});const k=async()=>{const a=e.selectMember,o=e.details;c.orderObject.orderType="TENANT_ALBUM",c.orderObject.orderName=o.name,c.orderObject.orderDesc=o.name,c.orderObject.actualPrice=a.salePrice,c.orderObject.orderNo="",c.orderObject.orderList=[{orderType:"TENANT_ALBUM",goodsName:o.name,actualPrice:a.salePrice,price:a.salePrice,...o,...a}];const n=(await m.post("/api-student/userOrder/getPendingOrder",{data:{goodType:"TENANT_ALBUM",bizId:o.id}})).data;n?(e.popupStatus=!1,S.confirm({title:"\u63D0\u793A",message:"\u60A8\u6709\u4E00\u4E2A\u672A\u652F\u4ED8\u7684\u8BA2\u5355\uFF0C\u662F\u5426\u7EE7\u7EED\u652F\u4ED8\uFF1F",confirmButtonColor:"#269a93",cancelButtonText:"\u53D6\u6D88\u8BA2\u5355",confirmButtonText:"\u7EE7\u7EED\u652F\u4ED8"}).then(async()=>{c.orderObject.orderNo=n.orderNo,c.orderObject.actualPrice=n.actualPrice,c.orderObject.discountPrice=n.discountPrice,c.orderObject.paymentConfig=n.paymentConfig,v()}).catch(()=>{S.close(),O(n.orderNo)})):v()},v=()=>{const a=e.details;g.push({path:"/orderDetail",query:{orderType:"ALBUM",album:a.id}})},O=async a=>{try{await m.post("/api-student/userOrder/orderCancel/v2",{data:{orderNo:a}})}catch{}};return()=>{var a,o,r,n,C,y;return t("div",{class:s.trainTool},[t(L,{position:"top"},{default:()=>[t(J,{background:p.value,border:!1,isFixed:!1,color:d.value,backIconColor:"white"},null)]}),t("img",{class:s.bgImg,src:(a=e.details)==null?void 0:a.coverImg},null),t("div",{class:s.musicContent},null),t("div",{class:s.bg},[t("div",{class:s.alumWrap},[t("div",{class:s.img},[t(I,{class:s.image,width:"100%",height:"100%",fit:"cover",src:((o=e.details)==null?void 0:o.coverImg)||M,errorIcon:M},null),t("span",{class:s.numContent},[t("img",{src:Te,class:s.iconMenu},null),l("\u5171"),(r=e.details)==null?void 0:r.musicNum,l("\u9996")]),t("div",{class:s.iconPian},[t(I,{class:s.image,width:"100%",height:"100%",fit:"cover",src:(n=e.details)==null?void 0:n.coverImg},null)])]),t("div",{class:s.alumDes},[t("div",{class:[s.alumTitle,"van-ellipsis"]},[(C=e.details)==null?void 0:C.name]),t("div",{class:[s.des,"van-multi-ellipsis--l2"],style:{height:"32px",lineHeight:"16px"}},[(y=e.details)==null?void 0:y.describe])])])]),t("div",{class:s.musicList},[t(z,{color:"var(--van-primary)",background:"transparent",lineWidth:20,shrink:!0,active:e.activeTab,"onUpdate:active":i=>e.activeTab=i,onChange:i=>{e.activeTab=i,u.page=1,e.list=[],b()}},{default:()=>[e.subjectCounts&&t(h,{title:"\u58F0\u90E8\u7EC3\u4E60",name:"SUBJECT"},null),e.musicCounts&&t(h,{title:"\u5408\u594F\u7EC3\u4E60",name:"ENSEMBLE"},null),e.ensembleCounts&&t(h,{title:"\u72EC\u594F\u66F2\u76EE",name:"MUSIC"},null)]}),t("div",{class:s.alumnList},[t(G,{loading:e.loading,finished:e.finished,"finished-text":" ",onLoad:b,immediateCheck:!1,error:e.isError},{default:()=>[e.list&&e.list.length?t(Y,{showNumber:!0,list:e.list,onDetail:i=>{g.push({path:"/music-detail",query:{id:i.id}})}},null):!e.loading&&t(x,{tips:"\u6682\u65E0\u66F2\u76EE",classImgSize:"SMALL",btnStatus:!1},null)]})])]),!e.loading&&!e.details.ifBuy&&t(L,{position:"bottom"},{default:()=>[t("div",{class:s.btnGroup},[t(T,{round:!0,block:!0,color:"#FE2451",onClick:()=>e.popupStatus=!0},{default:()=>[l("\u8D2D\u4E70\u6559\u7A0B")]})])]}),t(V,{show:e.popupStatus,"onUpdate:show":i=>e.popupStatus=i,position:"bottom",round:!0,zIndex:9999,"safe-area-inset-bottom":!0,closeable:!1,class:s.popupStatus,onClose:()=>e.popupStatus=!1},{default:()=>[t("div",{class:s.bottom_function},[t("i",{class:s.iconClose,onClick:()=>e.popupStatus=!1},null),t("img",{src:Ee,class:s.iconRightTop},null),t("div",{class:s.memberMeal},[t("div",{class:s.titleMeal},[t("span",null,[l("\u8BF7\u9009\u62E9\u6559\u7A0B\u8D2D\u4E70\u5468\u671F")])]),t("div",{class:s["system-list"]},[e.buyList.map(i=>t("div",{class:[s["system-item"],i.status&&s.active],onClick:()=>{e.buyList.forEach(U=>{U.status=!1}),i.status=!0,e.selectMember=i}},[t("p",{class:s.title},[i.purchaseCycle,l("\u4E2A\u6708")]),t("p",{class:s.price},[t("span",null,[l("\uFFE5")]),E(i.salePrice,"0,0[.]00")]),t("del",{class:s.originalPrice},[l("\uFFE5"),E(i.costPrice,"0,0[.]00")])]))])]),t("div",{class:s.btnGroup},[t(T,{round:!0,block:!0,class:s.btn,onClick:k},{default:()=>[l("\u70B9\u51FB\u8D2D\u4E70")]})])])]})])}}});export{Ge as default};