;(function(){function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable;})),keys.push.apply(keys,symbols);}return keys;}function _objectSpread(target){for(var i=1;i0){state$1.activeRow=res.data.background[0];state$1.subjectId=res.data.background[0].id;}state$1.teacherDetail=res.data.teacher;setAccompanyUrl();setUser();_context2.next=18;break;case 15:_context2.prev=15;_context2.t0=_context2["catch"](0);console.log(_context2.t0);case 18:case"end":return _context2.stop();}}},_callee2,null,[[0,15]]);}));return function getMusicList(){return _ref2.apply(this,arguments);};}();var followVideo=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee3(){var res;return regeneratorRuntime.wrap(function _callee3$(_context3){while(1){switch(_context3.prev=_context3.next){case 0:_context3.prev=0;_context3.next=3;return request.get('/api-website/student/starOrUnStar',{params:{userId:state$1.teacherDetail.userId,starStatus:state$1.teacherDetail.star?0:1}});case 3:res=_context3.sent;getMusicList();// state.otherVideoList = res.data _context3.next=10;break;case 7:_context3.prev=7;_context3.t0=_context3["catch"](0);console.log(_context3.t0);case 10:case"end":return _context3.stop();}}},_callee3,null,[[0,7]]);}));return function followVideo(){return _ref3.apply(this,arguments);};}();var getDetail=function getDetail(val){state$1.id=val;router.push({query:_objectSpread(_objectSpread({},route.query),{},{id:state$1.id})});state$1.showImg='';getMusicList();};watch(function(){return state$1.accompanyUrl;},function(accompanyUrl){state$1.accompanyUrl=accompanyUrl;});var setAccompanyUrl=function setAccompanyUrl(){var url=vaildTeachingUrl();state$1.accompanyUrl=url+"/accompany/colxiu-website.html?id=".concat(state$1.id,"&part-index=").concat(state$1.subjectId);// state.accompanyUrl = `http://192.168.3.8:3000/colxiu-website.html?id=${state.id}&part-index=${state.subjectId}` };onMounted(function(){// window.setSvg = (val)=>{ // setSvg(val) // } window.addEventListener('message',/*#__PURE__*/function(){var _ref4=_asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee4(e){var tempCanvas,showImg;return regeneratorRuntime.wrap(function _callee4$(_context4){while(1){switch(_context4.prev=_context4.next){case 0:console.log(e);state$1.imgData=e.data;// printHander() // alert(e.data); _context4.next=4;return imgToCanvas(state$1.imgData);case 4:tempCanvas=_context4.sent;showImg=convasToImg(tempCanvas);state$1.showImg=showImg;case 7:case"end":return _context4.stop();}}},_callee4);}));return function(_x2){return _ref4.apply(this,arguments);};}(),false);state$1.userType=getUserType();state$1.showCode=state$1.userType=='STUDENT'||!state$1.userType?true:false;// 拼链接 getMusicList();});var setUser=function setUser(){state$1.iconList=[];if(state$1.teacherDetail.tag.indexOf('STYLE')!=-1){state$1.iconList.push(styleIcon);}else{state$1.iconList.push(nostyleIcon);}if(state$1.teacherDetail.tag.indexOf('VIDEO')!=-1){state$1.iconList.push(videoIcon);}else{state$1.iconList.push(noVideoIcon);}if(state$1.teacherDetail.tag.indexOf('LIVE')!=-1){state$1.iconList.push(onlineIcon);}else{state$1.iconList.push(noOnlineIcon);}if(state$1.teacherDetail.tag.indexOf('MUSIC')!=-1){state$1.iconList.push(ablumIcon);}else{state$1.iconList.push(noAblumIcon);}};var printHander=/*#__PURE__*/function(){var _ref5=_asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee5(){var tempCanvas,showImg,titleCanvas,canvas,imgUrl,link;return regeneratorRuntime.wrap(function _callee5$(_context5){while(1){switch(_context5.prev=_context5.next){case 0:_context5.next=2;return imgToCanvas(state$1.imgData);case 2:tempCanvas=_context5.sent;showImg=convasToImg(tempCanvas);state$1.showImg=showImg;titleCanvas=addMusicTitle(tempCanvas,{title:state$1.musicDetail.musicSheetName,size:18});canvas=addWatermark(titleCanvas);imgUrl=convasToImg(canvas);link=document.createElement('a');link.setAttribute('download',state$1.musicDetail.musicSheetName+'.png');// 添加时间戳,防止浏览器缓存图片 state$1.imgUrl=imgUrl;link.href=imgUrl;link.click();case 13:case"end":return _context5.stop();}}},_callee5);}));return function printHander(){return _ref5.apply(this,arguments);};}();var gotoMusic=function gotoMusic(){router.push({name:'searchdetail',params:{search:state$1.teacherDetail.userName,type:'music'}});};var favoriteMusic=/*#__PURE__*/function(){var _ref6=_asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee7(){var tockn;return regeneratorRuntime.wrap(function _callee7$(_context7){while(1){switch(_context7.prev=_context7.next){case 0:tockn=getAuth();if(tockn){_context7.next=4;break;}state.loginPopupStatus=true;return _context7.abrupt("return");case 4:ElMessageBox.confirm("\u662F\u5426".concat(state$1.musicDetail.favorite?'取消收藏':'收藏',"\u8BE5\u66F2\u76EE\uFF1F"),'提示',{type:'warning'}).then(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee6(){var res;return regeneratorRuntime.wrap(function _callee6$(_context6){while(1){switch(_context6.prev=_context6.next){case 0:_context6.prev=0;_context6.next=3;return request.post("/api-website/music/sheet/favorite/".concat(state$1.id));case 3:res=_context6.sent;getMusicList();// state.otherVideoList = res.data _context6.next=10;break;case 7:_context6.prev=7;_context6.t0=_context6["catch"](0);console.log(_context6.t0);case 10:case"end":return _context6.stop();}}},_callee6,null,[[0,7]]);})));case 5:case"end":return _context7.stop();}}},_callee7);}));return function favoriteMusic(){return _ref6.apply(this,arguments);};}();return function(){return createVNode(Fragment,null,[createVNode("div",{"class":classes$1.wallWrap},[createVNode("div",{"class":classes$1.wall},null),createVNode("div",{"class":classes$1.musicWraps},[createVNode("div",{"class":[classes$1.width1200]},[createVNode("div",{"class":[classes$1.musicWrap]},[createVNode("div",{"class":classes$1.left},[createVNode("div",{"class":classes$1.title},[createVNode("div",{"class":classes$1.titleRight,"onClick":function onClick(){return printHander();}},[createVNode("img",{"src":printIcon,"alt":""},null),createVNode("p",null,[createTextVNode("\u4E0B\u8F7D\u4E50\u8C31")])])]),createVNode("div",{"class":classes$1.musicContent},[createVNode("img",{"class":classes$1.musicStag,"src":chargeImg[state$1.musicDetail.chargeType],"alt":""},null),createVNode("iframe",{"id":"containerPrint","ref":"print","style":"width: 538px;page-break-after:always; ","src":state$1.accompanyUrl,"class":classes$1.iframe},null),createVNode("p",{"class":classes$1.musicTitle},[state$1.musicDetail.musicSheetName]),state$1.showImg?createVNode("img",{"src":state$1.showImg,"alt":""},null):createVNode("div",null,[createVNode(Vue3Lottie,{"animationData":AstronautJSON,"class":classes$1.finch},null),createVNode("p",{"class":classes$1.finchLoad},[createTextVNode("\u52A0\u8F7D\u4E2D...")])])]),state$1.mp3Type=='MP3'?createVNode(ColVideo,{"src":state$1.activeRow.audioFileUrl,"styleValue":{height:'68px',bacground:'#333'},"type":'audto',"settings":['captions','quality','speed','loop','title'],"class":classes$1.audios,"poster":state$1.activeRow.title},null):createVNode(Fragment,null,[createVNode("div",{"class":classes$1.noMoreWrap},[createVNode("img",{"src":noMore,"alt":""},null),createVNode("p",null,[createTextVNode("\u6E29\u99A8\u63D0\u793A\uFF1A\u8BE5\u66F2\u76EE\u6682\u4E0D\u652F\u6301\u64AD\u653E\u5594\uFF5E")])])]),state$1.showCode?createVNode("div",{"class":classes$1.showCode},[createVNode("div",{"class":classes$1.showCodeWrap},[createVNode("img",{"class":classes$1.close,"src":iconClose,"alt":"","onClick":function onClick(){state$1.showCode=false;}},null),createVNode("img",{"class":classes$1.code,"src":sutdentDownLoad,"alt":""},null),createVNode("img",{"src":banner,"class":classes$1.banner,"alt":""},null)])]):null]),createVNode("div",{"class":classes$1.right},[createVNode("div",{"class":classes$1.musicInfo},[createVNode("h2",null,[createVNode("span",{"class":[classes$1.musicTag,classes$1[chargeClass[state$1.musicDetail.chargeType]]]},[chargeTypes[state$1.musicDetail.chargeType]]),state$1.musicDetail.musicSheetName]),createVNode("div",{"class":classes$1.collectWrap},[createVNode("div",{"class":classes$1.masker,"onClick":favoriteMusic},[createVNode("img",{"src":state$1.musicDetail.favorite?lineStart:start$1,"alt":""},null)]),createVNode("img",{"src":music,"class":classes$1.musiceIcon,"alt":""},null),createVNode("div",null,[createVNode("div",{"class":classes$1.collect,"onClick":favoriteMusic},[createVNode("img",{"src":state$1.musicDetail.favorite?oLineStart:oStart,"class":classes$1.start,"alt":""},null),createVNode("p",null,[state$1.musicDetail.favoriteNum,createTextVNode("\u4EBA\u6536\u85CF")])]),createVNode("div",{"class":classes$1.tagList},[state$1.tagList.map(function(item){return createVNode("div",{"class":classes$1.tag},[item]);})]),createVNode("p",{"class":classes$1.subTitle},[createTextVNode("\u4F5C\u66F2\u4EBA\uFF1A"),createVNode("span",null,[state$1.musicDetail.composer])]),createVNode("p",{"class":classes$1.subTitle},[createTextVNode("\u58F0\u90E8\uFF1A"),createVNode("span",null,[state$1.musicDetail.subjectNames])])])])]),createVNode("div",{"class":classes$1.btooom},[state$1.teacherDetail.userId?createVNode("div",{"class":classes$1.teacherInfo},[createVNode("h2",null,[createTextVNode("\u4E0A\u4F20\u8005")]),createVNode("div",{"class":classes$1.teacherHeadWrap},[createVNode("div",{"class":classes$1.teacherHeadLeft},[createVNode("img",{"src":state$1.teacherDetail.userAvatar?state$1.teacherDetail.userAvatar:iconTeacher,"alt":"","class":classes$1.teacherHeader},null),createVNode("div",{"class":classes$1.teacherHeadInfo},[createVNode("div",{"class":classes$1.teacherHeadName},[createVNode("p",null,[state$1.teacherDetail.userName]),state$1.userType=='STUDENT'?createVNode("div",{"class":[classes$1.teacherHeadRight,state$1.teacherDetail.star?classes$1.isStart:''],"onClick":function onClick(){return followVideo();}},[state$1.teacherDetail.star?'已关注':'+ 关注']):createVNode("div",{"class":classes$1.iconWrapList},[createVNode("img",{"src":state$1.teacherDetail.isVip?vipIcon$1:noVipIcon,"class":classes$1.vipIcon,"alt":""},null),state$1.iconList.map(function(item){return createVNode("img",{"class":classes$1.teacherDetailIcon,"src":item,"alt":""},null);})])])])]),createVNode("div",null,[createVNode("p",{"class":classes$1.fensNum},[state$1.teacherDetail.fansNum]),createVNode("p",{"class":classes$1.fens},[createTextVNode("\u7C89\u4E1D\u6570")])])])]):null,createVNode("div",{"class":classes$1.otherMusic},[createVNode("div",{"class":classes$1.videoNav},[createVNode("h5",null,[createTextVNode("TA\u7684\u66F2\u8C31")]),createVNode("div",{"class":classes$1.wrapRight,"onClick":function onClick(){return gotoMusic();}},[createVNode("span",null,[createTextVNode("\u66F4\u591A")]),createVNode("img",{"class":classes$1.arrow,"src":arrow$1,"alt":""},null)])]),createVNode("div",{"class":classes$1.otherMusicList},[state$1.musicList.map(function(item){return createVNode(musicItem,{"item":item,"onMusicDetail":function onMusicDetail(val){return getDetail(val);}},null);})])])])])])])])])]);};}}));}};});})();