import{_ as u,c as p,d as m}from"./icon_discount.202ead11.js";import{_ as f,a as _}from"./share-vip-tips.975e41da.js";import{_ as g,a as h}from"./wx_bg.5eddda0b.js";import{C as b}from"./index.595413c7.js";import{S as n}from"./index.aaa1b4cd.js";import{U as y}from"./index.bf975db5.js";import{d as x,D as w,a as t,x as v,B as j,j as I}from"./vendor.d7020c85.js";import{b as i,s as l,p as r,r as S}from"./index.b34c925a.js";import{C as T}from"./index.64856558.js";import{s as C}from"./share.9e078e34.js";import{q as d}from"./index.339fc024.js";/* empty css *//* empty css */import"./bars.4f1962a6.js";/* empty css */import"./icon_teacher.cb128c00.js";import"./icon_timer2.5fb1750d.js";import"./icon-jiaozi.20e415ca.js";const U="_introduction_q1sek_1",D="_wxpopup_q1sek_9";var a={"video-detail":"_video-detail_q1sek_1",introduction:U,wxpopup:D};function q(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!v(e)}const N=e=>{const s=`../images/${e}`;return{"../images/icon-cert.png":u,"../images/icon_discount.png":p,"../images/icon_music.png":m,"../images/music-share-banner.png":f,"../images/share-banner.png":g,"../images/share-vip-tips.png":_,"../images/wx_bg.png":h}[s].default};var Q=x({name:"VideoDetail",data(){const e=this.$route.query;return{userInfo:{},detailList:[],buyUserList:[],dataShow:!0,loading:!1,finished:!1,recomUserId:e.recomUserId,params:{videoLessonGroupId:e.groupId,page:1,rows:20},wxStatus:!1}},created(){if(i().isApp)if(l.platformType==="STUDENT"){const e=this.$route.query;e.recomUserId=e.userType&&e.userType=="STUDENT"?"":e.recomUserId,i().ios?window.location.replace(`${location.origin}/student/#/videoDetail?${d.stringify(e)}`):(r({api:"openWebView",content:{url:`${location.origin}/student/#/videoDetail?${d.stringify(e)}`,orientation:1,isHideTitle:!1}}),r({api:"back"}));return}else l.platformType==="TEACHER"&&w.alert({title:"\u63D0\u793A",message:"\u8BF7\u4F7F\u7528\u9177\u4E50\u79C0\u5B66\u751F\u7AEF\u626B\u7801\u6253\u5F00",confirmButtonColor:"#2dc7aa"}).then(()=>{r({api:"back"})});else this.reCall()},async mounted(){try{const s=(await S.post("/api-teacher/open/videoShareProfit",{data:{bizId:this.params.videoLessonGroupId,userId:this.recomUserId}})).data||{},{lessonGroup:o,detailList:c}=s.videoGroup;this.userInfo={username:s.name,headUrl:s.avatar,buyNum:o.countStudent,lessonNum:o.lessonCount,lessonName:o.lessonName,lessonDesc:o.lessonDesc,lessonPrice:o.lessonPrice,lessonCoverUrl:o.lessonCoverUrl},this.detailList=c||[]}catch{}},methods:{locationReplace(e){history.replaceState?(history.replaceState(null,document.title,e),window.location.reload()):location.replace(e)},reCall(){const{origin:e}=location;let s=e+"/student/#/videoDetail";const o=this.$route.query;s+=`?recomUserId=${o.userType&&o.userType=="STUDENT"?"":this.recomUserId}&groupId=${o.groupId}`,console.log(s),C(s,{})},onShare(){if(i().weixin){this.wxStatus=!0;return}this.reCall(),setTimeout(()=>{window.location.href=location.origin+"/student/#/download"},3e3)}},render(){let e;return t("div",{class:[a["video-detail"],"mb12"]},[t(y,{userInfo:this.userInfo,showBuy:!1},null),t(n,{border:!0},{default:()=>[t("p",{class:a.introduction},[this.userInfo.lessonDesc])]}),t(n,{title:"\u8BFE\u7A0B\u5217\u8868",icon:"courseList",contentStyle:{paddingTop:"0"}},q(e=this.detailList.map(s=>t(b,{class:"mb12",detail:{id:s.id,title:s.videoTitle,content:s.videoContent,imgUrl:s.coverUrl}},null)))?e:{default:()=>[e]}),t(T,{position:"bottom"},{default:()=>[t("div",{class:["btnGroup"],style:{paddingTop:"12px"}},[t(j,{block:!0,round:!0,type:"primary",onClick:this.onShare},{default:()=>[I("\u4E0B\u8F7D\u9177\u4E50\u79C0\u8FDB\u5165\u8BFE\u7A0B")]})])]}),this.wxStatus&&t("div",{class:a.wxpopup,onClick:()=>{this.wxStatus=!1}},[t("img",{src:N("wx_bg.png"),alt:""},null)])])}});export{Q as default,N as getAssetsHomeFile};