1 |
- !function(){var e=["musicSheet"];function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,i=[],o=!0,s=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(c){s=!0,a=c}finally{try{o||null==n.return||n.return()}finally{if(s)throw a}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function s(e,t,n,r,a,i,o){try{var s=e[i](o),c=s.value}catch(u){return void n(u)}s.done?t(c):Promise.resolve(c).then(r,a)}function c(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function o(e){s(i,r,a,o,c,"next",e)}function c(e){s(i,r,a,o,c,"throw",e)}o(void 0)}))}}System.register(["./base-legacy.8637ad29.js","./utils-legacy.1caeb47c.js","./loading-legacy.80b3ec4f.js","./lib-flexible-legacy.4ee496fa.js","./request-legacy.93a7122e.js","./index-legacy.379d0d8b.js","./index-legacy.d6989fc2.js","./index.module-legacy.2fb72ca1.js","./wx_bg-legacy.975b70cd.js","./index-legacy.5d761eb4.js","./runtime-core.esm-bundler-legacy.203f7120.js","./index-legacy.187eea19.js","./index-legacy.568f2616.js","./_commonjsHelpers-legacy.1db667c6.js","./index-legacy.a561dd96.js","./TransposeCalculator-legacy.f07a233b.js"],(function(n,r){"use strict";var i,s,u,l,p,d,m,f,g,y,v,h,b,_,w,x,k,S,j,O,I,T,P,R,A,C,D,U,M,z,B=document.createElement("style");return B.textContent=":root{--van-dialog-has-title-message-text-color: var(--van-gray-4) !important;--van-dialog-message-font-size: .42667rem !important;--van-dialog-confirm-button-text-color: #2dc7aa !important;--van-button-default-font-size: .37333rem !important}._musicSheet_19i2y_7{padding-top:0!important;padding-bottom:1.06667rem!important;padding-bottom:constant(safe-area-inset-bottom)!important;padding-bottom:env(safe-area-inset-bottom)!important;height:-webkit-fill-available;background:#fff!important;background-color:#fff!important;box-shadow:none!important}._musicSheet_19i2y_7 img{display:none!important}._btnWraper_19i2y_21{position:fixed;bottom:.53333rem;z-index:9;width:100%;padding:.26667rem 0;text-align:center}._btn_19i2y_21{width:6.48rem;height:1.17333rem;background:linear-gradient(180deg,#59e5d5 0%,#2dc7aa 100%);box-shadow:0 .05333rem .18667rem rgba(45,199,170,.25);border-radius:.74667rem;font-size:.48rem}._btn_19i2y_21 ._btnCont_19i2y_37{height:auto;padding:0;background-color:transparent;border:none}._popup_19i2y_43 .plyr{min-width:auto}._popup_19i2y_43 .plyr__poster{background-image:url(./videobg.png)!important;background-size:cover!important}._share_19i2y_50{width:9.46667rem;height:1.65333rem;margin:auto;display:flex;background:url("+new URL("bg-f214a841.svg",r.meta.url).href+") no-repeat center;background-size:contain;margin-top:.21333rem;align-items:center;justify-content:space-between;position:fixed;top:0;z-index:999;margin-left:50%;transform:translate(-50%)}._share_19i2y_50 ._avatar_19i2y_66{width:1.06667rem;height:1.06667rem;margin:0 .34667rem}._share_19i2y_50 ._mate_19i2y_71{display:flex;align-items:center;margin-left:.48rem;margin-right:.42667rem;justify-content:space-between;flex:1}._share_19i2y_50 ._info_19i2y_79{color:#ff7100;font-size:.42667rem;width:2.66667rem}._share_19i2y_50 ._info_19i2y_79>span{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:100%;display:block}._share_19i2y_50 ._info_19i2y_79>span:last-child{font-size:.37333rem}._share_19i2y_50 ._topbtn_19i2y_94{width:3.89333rem;height:.85333rem;background:linear-gradient(180deg,#ffc000 0%,#ff6c00 100%);border-radius:.42667rem;color:#fff;font-size:.34667rem}._fullimg_19i2y_102 img{display:block!important}html,body{background-color:#fff!important}\n",document.head.appendChild(B),{setters:[null,function(e){i=e.b,s=e.q,u=e.f,l=e.c},function(e){p=e.b},null,function(e){d=e.P,m=e.r,f=e.z,g=e.T,y=e.a},function(e){v=e.u,h=e.E,b=e.M,_=e.D,w=e.l,x=e.d,k=e.f,S=e.o},null,function(e){j=e.s},function(e){O=e.w},function(e){I=e.I},function(e){T=e.K,P=e.d,R=e.C,A=e.c,C=e.M,D=e.F,U=e.N},function(e){M=e.B},function(e){z=e.S},null,null,null],execute:function(){var n="_musicSheet_19i2y_7",B="_btnWraper_19i2y_21",N="_btn_19i2y_21",E="_share_19i2y_50",L="_avatar_19i2y_66",q="_mate_19i2y_71",F="_info_19i2y_79",V="_topbtn_19i2y_94",W="_fullimg_19i2y_102",K=""+new URL("right-5d046f40.svg",r.meta.url).href,H=i(),J=v(),X=T(0),$=function(){if(H.isApp){if(H.isTeacher)return void _.alert({message:"请使用酷乐秀学生端扫码打开"}).then((function(){f({api:"back"})}));var e=sessionStorage.getItem("behaviorId")||""+(new Date).valueOf(),t=s.stringifyUrl({url:location.origin+"/accompany",query:{id:J.id,behaviorId:e,client:H.isTeacher?"teacher":"student",recomUserId:J.userType&&"STUDENT"==J.userType?"":J.recomUserId,activityId:J.activityId||"0",discounts:X.value}});f({api:"openAccompanyWebView",content:{url:t,orientation:0,isHideTitle:!0,statusBarTextColor:!1,isOpenLight:!0}})}else{var n=location.origin+"/student/#/share-music-sheet",r={url:n+="?recomUserId=".concat(J.userType&&"STUDENT"==J.userType?"":J.recomUserId,"&id=").concat(J.id,"&activityId=").concat(J.activityId||"0"),action:J.action||"h5",pageTag:J.pageTag||1},a=encodeURIComponent(JSON.stringify(r));/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)?window.location.href="ColexiuStudent://linkUrl=".concat(a):/(Android)/i.test(navigator.userAgent)?(r.url=encodeURIComponent(r.url),window.location.href="colexiustudent://html:8888/SplashActivity?url=".concat(encodeURIComponent(JSON.stringify(r)))):g("请用手机或移动设备打开")}},G=function(){var e=c(regeneratorRuntime.mark((function e(t,n){var r,a,i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,y(t);case 2:return r=e.sent,a=T(""),i=x(r),a.value=k(i.parsedXML,{title:n.musicSheetName}),o=Number(J["part-index"])||0,a.value=S(a.value,o),e.abrupt("return",a);case 9:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),Q=P({name:"Colexiu",setup:function(){var r=T(!1),i=T(!0),s=T(!1),u=T(""),l=T(""),p=t(function(t){var n=T("loading"),r=T({}),i=T({}),s=T(!1);return U(c(regeneratorRuntime.mark((function t(){var c,u,l,p;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return J.activityId&&m.post("/open/activity/state/"+J.activityId,{prefix:"/api-teacher"}).then((function(e){X.value=e.data.check,s.value=!!e.data.check,s.value||_.alert({message:"优惠活动已结束,您将按原价购买"})})).catch((function(){})),n.value="loading",t.prev=2,t.next=5,m.post("/open/musicShareProfit",{prefix:"/api-teacher",requestType:"json",data:{bizId:J.id,userId:J.recomUserId}});case 5:c=t.sent,u=c.data,l=u.musicSheet,p=o(u,e),r.value=a({},l),i.value=p,n.value="success",t.next=16;break;case 12:t.prev=12,t.t0=t.catch(2),n.value="error",console.log(t.t0);case 16:case"end":return t.stop()}}),t,null,[[2,12]])})))),[n,r,i,s]}(J.id),4),f=p[0],g=p[1],v=p[2],x=p[3];R(f,c(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("success"!==f.value||!g.value.xmlFileUrl){e.next=11;break}if(!g.value.musicImg){e.next=7;break}return i.value=!1,e.next=5,w(g.value.musicImg+"?_t="+(new Date).valueOf());case 5:return l.value=e.sent,e.abrupt("return");case 7:return e.next=9,G(g.value.xmlFileUrl,g.value);case 9:t=e.sent,u.value=t.value;case 11:case"end":return e.stop()}}),e)}))));var k=function(e){var t=e.Drawer.Backends[0],n=Math.max(t.width,t.height),r=5*Math.floor(n/240),a=5*Math.floor(n/200),i=t.CanvasRenderingCtx;i.font="50px 宋体",i.fillStyle="rgba(0,0,0,.1)",i.rotate(-30*Math.PI/180);for(var o=0;o<r;o++)for(var s=0;s<a;s++)i.fillText("酷乐秀",240*o-n,200*s-n/2)},S=function(){var e=c(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t,e.abrupt("return",m("/open/getUploadSign",{method:"post",data:{filename:t,bucketName:"daya",postData:{filename:t,acl:"public-read",key:n,unknowValueField:[]}},requestType:"json"}));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),P=function(){var e=c(regeneratorRuntime.mark((function e(t,n,r){var a,i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,y(t,{responseType:"blob"});case 2:return a=e.sent,(i=new FormData).append("policy",r.policy),i.append("signature",r.signature),i.append("acl","public-read"),i.append("KSSAccessKeyId",r.kssAccessKeyId),i.append("name",n),i.append("key",n),i.append("file",a),e.next=13,y("https://ks3-cn-beijing.ksyuncs.com/daya",{method:"POST",body:i});case 13:return o=e.sent,console.log(o),e.next=17,y("/api-student/open/music/sheet/img",{method:"post",data:{musicImg:"https://ks3-cn-beijing.ksyuncs.com/daya/"+n,musicSheetId:g.value.id}});case 17:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),Q=function(){var e=c(regeneratorRuntime.mark((function e(t){var n,r,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n="music-sheet/"+g.value.musicSheetName+".png",r=t.Drawer.Backends[0].canvas.toDataURL("image/png"),e.next=5,S(n);case 5:return a=e.sent,e.next=8,P(r,n,a.data);case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log(e.t0);case 13:k(t),$(),i.value=!1;case 16:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(t){return e.apply(this,arguments)}}(),Y=function(){s.value=!0,i.value=!1},Z=function(){H.weixin?r.value=!0:($(),H.isApp||setTimeout((function(){location.href=location.origin+"/student/#/download"}),3e3))};return function(){var e=i.value||"loading"===f.value,t=s.value||"error"===f.value,a=v.value&&x.value;return A("div",{class:[j.container],style:{background:"#fff",paddingTop:a?"80px":0}},[a&&A("div",{class:E},[A(I,{radius:"100%",class:L,src:v.value.avatar},null),A("div",{class:q},[A("div",{class:F},[A("span",null,[v.value.name,C("老师")]),A("span",null,[C("专属分享~")])]),A(M,{class:V,onClick:Z},{default:function(){return[C("开通会员专属优惠"),A("img",{src:K},null)]}})])]),A("div",{id:"colexiu-detail-music-sheet",class:[j.musicSheet,n],style:{paddingBottom:"100px!important"}},[e&&!t&&A(z,{class:j.skeleton,rowWidth:"80%",title:!0,row:3},null),t&&A(h,null,null),l.value&&A(D,null,[A("h3",{style:{fontSize:"24px",fontWeight:"normal",textAlign:"center",padding:"0 10px",marginTop:"36px",marginBottom:"0px"},class:"van-ellipsis"},[g.value.musicSheetName]),A(I,{class:W,src:l.value,alt:"",style:{width:"100%",display:"block!important"}},null)]),!l.value&&u.value&&A(D,null,[A("h3",{style:{fontSize:"24px",fontWeight:"normal",textAlign:"center",padding:"0 10px",marginTop:"36px",marginBottom:"0px"},class:"van-ellipsis"},[g.value.musicSheetName]),A(b,{score:u.value,showSection:!1,opotions:{drawTitle:!1,drawComposer:!0,drawLyricist:!1,drawMetronomeMarks:!0,drawMeasureNumbers:!0,autoResize:!1,backend:"canvas"},EngravingRules:{VoiceSpacingMultiplierVexflow:.65,VoiceSpacingAddendVexflow:2,MinSkyBottomDistBetweenStaves:2,MinSkyBottomDistBetweenSystems:3,BetweenStaffDistance:2.5,StaffDistance:3.5,MinimumDistanceBetweenSystems:1,PageBottomMargin:0,PageLeftMargin:2,PageRightMargin:2},onRerender:Q,onRenderError:Y},null)])]),A("div",{class:B},[A(M,{onClick:Z,class:N,color:"linear-gradient(to bottom, #55F1CC, #2DC7AA)"},{default:function(){return[H.isApp?"打卡小酷Ai开始练习吧!":"下载酷乐秀立即练习"]}})]),A(d,{show:r.value,position:"top",style:{background:"none"}},{default:function(){return[A("img",{src:O,style:{width:"80%",display:"block",margin:"auto"}},null)]}})])}}});document.body.style.setProperty("--osdm-zoom",""+u()),p(),l(Q).mount("#app")}}}))}();
|