import{j as e,k as t,o as s,a as l,w as r,g as a,p as o,t as u,q as n,n as c,d as i,m as d,u as f,F as h,i as I,v as _}from"./index.35bb0716.js";import{a as T}from"./api.cd3647ee.js";import{_ as p}from"./plugin-vue_export-helper.21dcd24c.js";var C={getQueryString(e){const t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),s=decodeURIComponent(window.location.search).substr(1).match(t);return null!=s?s[2]:null},numberConverter(e){if(!e)return 0;const t=Math.trunc(e).toString().replace(/(\d)(?=(?:\d{3})+$)/g,"$1,");let s="";const l=e.toString().split(".");return 2===l.length?(s=l[1].toString(),t+"."+s):t+s},secondsTransferPipe:e=>(Math.floor(e/3600)>0?Math.floor(e/3600):"00")+":"+(Math.floor(e%3600/60)>0?Math.floor(e%3600/60):"00")+":"+(Math.floor(e%60)>0?Math.floor(e%60):"00")};var b=p({data:()=>({fileId:null,lecturerId:null,tabType:3,lecturerInfo:{},courseInfo:{}}),methods:{switchTab(e){this.tabType=e,3===e?this.lecturerQuery():2==e?this.relatedCoursesList():this.courseDetail()},lecturerQuery(){T.lecturerQuery({id:this.lecturerId}).then((t=>{console.log("讲师信息",t),t.success?this.lecturerInfo=t.data.lecturerInfos[0]:e({title:t.message,duration:2e3,icon:"none"})}))},courseDetail(){T.courseDetail({fileId:this.fileId}).then((e=>{console.log("课程详情",e),e.success&&(this.courseInfo=e.data.data,this.lecturerId=e.data.data.fileLecturerId,this.lecturerQuery())}))},relatedCoursesList(){T.relatedCoursesList({fileId:this.fileId}).then((e=>{console.log("相关课程详情",e),e.success&&(this.relatedCoursesLists=e.data.data)}))},secondsTransferPipe:e=>C.secondsTransferPipe(e),buy(){t({url:`/pages/orderConfirm/orderConfirm?fileId=${this.fileId}`})}},mounted(){this.switchTab(1)},onLoad(e){this.fileId=e.fileId,this.courseDetail()}},[["render",function(e,t,T,p,C,b){const m=I,y=_;return s(),l(m,{class:"container"},{default:r((()=>[a(m,{class:"courseBannerBox"}),a(m,{class:"courseTitleContent"},{default:r((()=>[a(m,{class:"courseTitle"},{default:r((()=>[o("h4",null,u(C.courseInfo.fileTitle),1),a(m,{class:"shareF"},{default:r((()=>[a(m)])),_:1})])),_:1}),a(m,{class:"dataBox"},{default:r((()=>[o("strong",null,"￥"+u(C.courseInfo.coursePrice),1),a(y,null,{default:r((()=>[n(u(C.courseInfo.salesNumber)+"人购买",1)])),_:1})])),_:1})])),_:1}),a(m,{class:"courseProBox"},{default:r((()=>[a(m,{class:"tab"},{default:r((()=>[a(y,{class:c({actived:1===C.tabType}),onClick:t[0]||(t[0]=e=>b.switchTab(1))},{default:r((()=>[n("介绍")])),_:1},8,["class"]),a(y,{class:c({actived:2===C.tabType}),onClick:t[1]||(t[1]=e=>b.switchTab(2))},{default:r((()=>[n("相关课程")])),_:1},8,["class"]),a(y,{class:c({actived:3===C.tabType}),onClick:t[2]||(t[2]=e=>b.switchTab(3))},{default:r((()=>[n("讲师")])),_:1},8,["class"])])),_:1}),a(m,{class:"tabContent"},{default:r((()=>[1===C.tabType?(s(),l(m,{key:0,class:"courseIntroContent"},{default:r((()=>{var e;return[a(m,{innerHTML:null==(e=C.courseInfo)?void 0:e.fileIntroduce,class:"richTextContent"},null,8,["innerHTML"])]})),_:1})):i("",!0),2===C.tabType?(s(),l(m,{key:1,class:"relationCourseListsContent"},{default:r((()=>[a(m,{class:"totalCourseCount"},{default:r((()=>[n("共"+u(e.relatedCoursesLists?e.relatedCoursesLists.length:0)+"节",1)])),_:1}),(s(!0),d(h,null,f(e.relatedCoursesLists,((e,t)=>(s(),l(m,{class:"courseItemContent",key:e.fileId},{default:r((()=>[a(m,{class:"courseInfoContent"},{default:r((()=>[o("h4",null,u(t+1)+"."+u(e.fileTitle),1),a(m,{class:"timeContent"},{default:r((()=>[a(m,{class:""},{default:r((()=>[n("00:00/"+u(b.secondsTransferPipe(Number(e.courseTotalTime))),1)])),_:2},1024)])),_:2},1024)])),_:2},1024),a(m,{class:"statusBtnContent"},{default:r((()=>[n(" 试听 ")])),_:1})])),_:2},1024)))),128))])),_:1})):i("",!0),3===C.tabType?(s(),l(m,{key:2,class:"lecturerContent"},{default:r((()=>{var e;return[a(m,{class:"lecturerIntro"},{default:r((()=>[a(m,{class:"lecturerUrl"}),a(m,null,{default:r((()=>{var e;return[o("p",null,[a(y,{class:"lecturerName"},{default:r((()=>[n(u(C.lecturerInfo.lecturerName),1)])),_:1})]),(null==(e=C.lecturerInfo)?void 0:e.lecturerRankNames)?(s(!0),d(h,{key:0},f(C.lecturerInfo.lecturerRankNames.split(","),(e=>(s(),d("p",{class:"lecturerTitle"},[a(y,null,{default:r((()=>[n(u(e),1)])),_:2},1024)])))),256)):i("",!0)]})),_:1})])),_:1}),o("h4",null,[a(y,null,{default:r((()=>[n("讲师介绍")])),_:1})]),a(m,{innerHTML:null==(e=C.lecturerInfo)?void 0:e.lecturerIntroduce,class:"lecturerText richTextContent"},null,8,["innerHTML"])]})),_:1})):i("",!0),a(m,{class:"buyBox",onClick:t[3]||(t[3]=e=>b.buy())},{default:r((()=>[a(y,null,{default:r((()=>[n("购买")])),_:1})])),_:1})])),_:1})])),_:1})])),_:1})}],["__scopeId","data-v-b9aec294"]]);export{b as default};
