index-legacy.5616d2be.js 14 KB

1
  1. !function(){function e(e,t,n,i,r,c,s){try{var a=e[c](s),o=a.value}catch(u){return void n(u)}a.done?t(o):Promise.resolve(o).then(i,r)}function t(t){return function(){var n=this,i=arguments;return new Promise((function(r,c){var s=t.apply(n,i);function a(t){e(s,r,c,a,o,"next",t)}function o(t){e(s,r,c,a,o,"throw",t)}a(void 0)}))}}System.register(["./index.module-legacy.ee18af4b.js","./icon_level3-legacy.16a3757a.js","./index-legacy.c99e8e49.js","./index-legacy.b2528a15.js","./index-legacy.207dc8c2.js","./index-legacy.a7e74731.js","./index-legacy.ca42ae97.js","./logo-legacy.cf4b3bd2.js","./share-legacy.6cf7d519.js","./music-legacy.80266f81.js","./index-legacy.c610561c.js","./orderStatus-legacy.8039009d.js","./index-legacy.8361d47d.js","./icon_teacher-legacy.42ba77b1.js"],(function(e){"use strict";var n,i,r,c,s,a,o,u,l,d,p,g,f,v,m,h,b,y,k,I,T,_,j,S,O,C,x,M,w,A,E,L,R,N,D,P,B,U,z,q,G,H;return{setters:[function(e){n=e._,i=e.a,r=e.b,c=e.c,s=e.d,a=e.e,o=e.f,u=e.g,l=e.h,d=e.i,p=e.j,g=e.k,f=e.l,v=e.s},function(e){m=e._,h=e.c,b=e.d},function(e){y=e.C},function(e){k=e.d,I=e.b,T=e.s,_=e.e,j=e.D,S=e.x,O=e.p,C=e.l,x=e.T,M=e.i,w=e.A,A=e.F,E=e.B,L=e.aT},function(e){R=e.C},function(e){N=e.C},function(e){D=e.I},function(e){P=e.l},function(e){B=e.s},function(e){U=e.g},function(e){z=e.q},function(e){q=e.o},function(e){G=e.d},function(e){H=e.i}],execute:function(){var Y=e("getAssetsHomeFile",(function(e){var t="./images/".concat(e);return{"./images/icon-lv.png":n,"./images/icon_arrow_left.png":i,"./images/icon_arrow_right.png":r,"./images/icon_close.png":c,"./images/icon_king.png":s,"./images/icon_level.png":m,"./images/icon_level2.png":h,"./images/icon_level3.png":b,"./images/icon_music.png":a,"./images/icon_no_level.png":o,"./images/icon_score.png":u,"./images/icon_subject.png":l,"./images/icon_time.png":d,"./images/star_bg.png":p,"./images/title_bg.png":g,"./images/wx_bg.png":f}[t].default}));e("default",k({name:"track-review-activity",data:function(){var e=this.$route.query;return{id:e.id,recomUserId:e.recomUserId||"",activeInfo:{},popupStatus:!1,wxStatus:!1,behaviorId:U(),selectMusic:{},hiddenProperty:null}},computed:{rankingMethod:function(){return this.activeInfo.rankingMethod||""},activityMusic:function(){var e=this.activeInfo;return("TOTAL_SCORE"===e.rankingMethod?e.subjectInfos:e.activityMusicVoList)||[]},userSelectMusic:function(){var e=!1;return this.activityMusic.forEach((function(t){1===t.join&&(e=!0)})),e},rewardList:function(){var e=this.activeInfo,t=e.activityRewardList||[];if(t&&t.length>0)if("TOTAL_SCORE"===e.rankingMethod)t=[t];else{var n=t.sort((function(e,t){return Number(e.group)<Number(t.group)?-1:1}));t=this.groupBy(n,(function(e){return[e.group]}))}return t||[]}},mounted:function(){var e=this;return t(regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getMusicInfo();case 2:if(I().isApp){t.next=6;break}t.next=15;break;case 6:if("TEACHER"!==T.platformType){t.next=11;break}return e.onBackDialog("请使用酷乐秀学生端扫码打开"),t.abrupt("return");case 11:console.log(e.hiddenProperty,"hidden property"),e.hiddenProperty="hidden"in document?"hidden":"webkitHidden"in document?"webkitHidden":"mozHidden"in document?"mozHidden":null,n=e.hiddenProperty.replace(/hidden/i,"visibilitychange"),document.addEventListener(n,e.onVisibilityChange);case 15:e.checkActivityTime();case 16:case"end":return t.stop()}}),t)})))()},unmounted:function(){if(this.hiddenProperty){var e=this.hiddenProperty.replace(/hidden/i,"visibilitychange");document.removeEventListener(e,this.onVisibilityChange)}},methods:{groupBy:function(e,t){var n={};return e.forEach((function(e){var i=JSON.stringify(t(e));n[i]=n[i]||[],n[i].push(e)})),Object.keys(n).map((function(e){return n[e]}))},onVisibilityChange:function(){document[this.hiddenProperty]||this.getMusicInfo()},getMusicInfo:function(){var e=this;return t(regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,_.post("/api-student/open/activity/info/"+e.id);case 3:n=t.sent,e.activeInfo=n.data,document.title=e.activeInfo.activityName,t.next=10;break;case 8:t.prev=8,t.t0=t.catch(0);case 10:case"end":return t.stop()}}),t,null,[[0,8]])})))()},checkActivityTime:function(){try{var e=this.activeInfo;if(1!==e.activityState)return j.alert({message:"活动已结束,感谢你的关注!",theme:"round-button",confirmButtonColor:"#2dc7aa"}),this.onBackDialog("活动已结束,感谢你的关注!"),!1;var t=S(),n=S(e.activityStart),i=S(e.activityEnd);return S(t).isBefore(S(n))?(this.onBackDialog("活动尚未开始,请您耐心等待!"),!1):!!S(t).isBefore(S(i))||(this.onBackDialog("活动已结束,感谢你的关注!"),!1)}catch(r){}},onBackDialog:function(e){j.alert({message:e,theme:"round-button",confirmButtonColor:"#2dc7aa"}).then((function(){O({api:"back"})}))},onJoinActve:function(){var e=this;return t(regeneratorRuntime.mark((function t(){var n,i,r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(I().isApp){t.next=4;break}return e.popupStatus=!0,C(),t.abrupt("return");case 4:if(n=e.activeInfo,t.prev=5,e.checkActivityTime()){t.next=8;break}return t.abrupt("return");case 8:if("CHARGE"!==n.registrationMethod){t.next=22;break}return t.next=11,_.post("/api-student/userOrder/getPendingOrder",{data:{goodType:"ACTI_REGIST",bizId:n.id}});case 11:r=t.sent,q.orderObject.orderType="ACTI_REGIST",q.orderObject.orderName=n.activityName,q.orderObject.orderDesc=n.activityName,q.orderObject.actualPrice=n.registrationPrice,q.orderObject.orderNo=(null===(i=r.data)||void 0===i?void 0:i.orderNo)||"",q.orderObject.recomUserId=e.recomUserId,q.orderObject.orderList=[{orderType:"ACTI_REGIST",goodsName:n.activityName,activityId:n.id,actualPrice:n.registrationPrice,recomUserId:e.recomUserId}],e.$router.push({path:"/orderDetail",query:{orderType:"ACTI_REGIST",activityId:n.id}}),t.next=26;break;case 22:return t.next=24,_.post("/api-student/activity/joinActivity/".concat(n.id));case 24:setTimeout((function(){x("报名成功")}),300),e.getMusicInfo();case 26:t.next=30;break;case 28:t.prev=28,t.t0=t.catch(5);case 30:case"end":return t.stop()}}),t,null,[[5,28]])})))()},onOpenMusic:function(){var e=this;return t(regeneratorRuntime.mark((function t(){var n,i,r,c;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,n=e.selectMusic,console.log(n,"selectMusic"),i="","TOTAL_SCORE"===e.rankingMethod?(e.activeInfo.activityMusicVoList||[]).forEach((function(e){console.log(e,n),e.subjectId!=n.subjectId||i||(i=e.evaluationId)})):i=n.evaluationId,1===n.join){t.next=9;break}return t.next=8,_.post("/api-student/activity/evaluation/".concat(i));case 8:e.selectMusic.join=1;case 9:if(e.popupStatus=!1,"TOTAL_SCORE"!==e.rankingMethod){t.next=13;break}return e.$router.push({path:"/track-song",query:{subjectId:n.subjectId,id:e.id}}),t.abrupt("return");case 13:r=I(),c=z.stringifyUrl({url:location.origin+"/accompany",query:{id:n.musicSheetId,behaviorId:e.behaviorId,client:r.isStudent?"student":"teacher",setting:JSON.stringify({mode:"EVALUATING",resets:["SPEED"],difficulty:n.evaluationDifficulty,feeType:"FREE",submitData:{evaluationId:e.selectMusic.evaluationId}})}}),O({api:"openAccompanyWebView",content:{url:c,orientation:0,isHideTitle:!0,statusBarTextColor:!1,isOpenLight:!0}}),t.next=20;break;case 18:t.prev=18,t.t0=t.catch(0);case 20:case"end":return t.stop()}}),t,null,[[0,18]])})))()},onOpenApp:function(){if(I().isApp)this.popupStatus=!1;else{if(I().weixin)return void(this.wxStatus=!0);var e=location.origin+"/student/#/track-review-activity?id=".concat(this.id,"&recomUserId=").concat(this.recomUserId);B(e,{}),setTimeout((function(){window.location.href=location.origin+"/student/#/download"}),3e3)}}},render:function(){var e=this;return console.log(this.activeInfo),console.log(this.activeInfo.subjectUrl+"?time"+ +new Date),M("div",{class:v.review,style:{backgroundColor:this.activeInfo.backgroundUrl,backgroundSize:"contain"}},[M("img",{class:v.bannerImg,src:this.activeInfo.subjectUrl},null),M("div",{class:v.reviewContainer},[M("div",{class:[v.section,v.activeTime]},[M("div",{class:v.activeBg},[M("img",{src:Y("icon_time.png")},null),M("p",null,[M("span",null,[w("活动时间:")]),S(this.activeInfo.activityStart).format("YYYY-MM-DD"),w(" ~ "),S(this.activeInfo.activityEnd).format("YYYY-MM-DD")])])]),M("div",{class:[v.section]},[M("div",{class:v.title},[M("img",{src:Y("icon_arrow_left.png")},null),M("span",null,[w("活动介绍")]),M("img",{src:Y("icon_arrow_right.png")},null)]),M("div",{class:v.tips},[this.activeInfo.describe])]),M("div",{class:[v.section]},[M("h2",{class:v.title2},[M("span",null,[M("i",{class:v.titlePrefix},null),w("活动奖品")]),M("span",{class:v.titleTips,onClick:function(){return e.$router.push({path:"/leaderboard",query:{id:e.id}})}},[w("查看挑战排行榜"),M("img",{style:{width:"16px",marginLeft:"4px"},src:Y("icon-lv.png")},null)])]),this.rewardList.map((function(t,n){return M(A,null,[M("div",{class:v.prizeTitle},["TOTAL_SCORE"===e.rankingMethod?M("div",{class:v.prizeTitle_score},[w("总评测分数达到 "),e.activeInfo.rankingScore||0,w("分即可获奖")]):M(A,null,[0===n&&M(D,{class:v.prizeLevel,src:Y("icon_level.png")},null),1===n&&M(D,{class:v.prizeLevel,src:Y("icon_level2.png")},null),2===n&&M(D,{class:v.prizeLevel,src:Y("icon_level3.png")},null),w("第"),++n,w("名奖品")])]),M("div",{class:v.prizeSection},[t.map((function(e){return M("div",{class:[v.prize]},[M(D,{src:e.imgUrl},null),M("div",{class:v.prizeContainer},[M("div",{class:v.prizeName},[e.rewardName]),M("div",{class:v.prizeDesc},[e.rewardDescribe])])])}))])])}))]),M("div",{class:[v.section],style:{backgroundColor:"#fff"}},[M("h2",{class:v.title2},[M("span",null,[M("i",{class:v.titlePrefix},null),w("活动"),"TOTAL_SCORE"===this.rankingMethod?"声部":"曲目"]),"TOTAL_SCORE"===this.rankingMethod?M("span",{class:v.titleTips,onClick:function(){e.$router.push({path:"/track-subject-song",query:{id:e.id}})}},[w("查看曲目")]):M("span",{class:v.titleTips},[w("共"),this.activityMusic.length||0,w("首曲目")])]),this.activityMusic.map((function(t){return M(N,{class:v.musicItem,border:!1},{default:function(){return[M(R,{center:!0,titleClass:[v.musicTitle,"TOTAL_SCORE"==e.rankingMethod&&v.musicTitleScore],isLink:"TOTAL_SCORE"===e.rankingMethod},{icon:function(){return M(D,{src:Y("TOTAL_SCORE"!==e.rankingMethod?"icon_music.png":"icon_subject.png"),class:v.iconMusic},null)},title:function(){return M("span",{class:v.musicName},["TOTAL_SCORE"===e.rankingMethod?t.subjectName:t.musicSheetName])},value:function(){return M("span",{onClick:function(){"TOTAL_SCORE"===e.rankingMethod&&e.$router.push({path:"/track-subject-song",query:{id:e.id,subjectId:t.subjectId}})}},["TOTAL_SCORE"===e.rankingMethod?"共".concat(t.musicNums,"首活动曲目"):t.musicSubject])}}),M(R,{center:!0,class:v.cellLevel},{icon:function(){return M("div",{class:v.kingSection},[M(D,{src:Y("icon_king.png"),class:v.iconKing},null),M("p",{class:v.score},[t.userId?t.score:"--",M("span",null,[w("分")])])])},title:function(){return M("div",{class:v.users},[M("div",{class:v.userInfo},[M("div",{class:v.userImg},[t.userId?M(A,null,[M(D,{src:t.userAvatar||H,class:v.userLogo,fit:"cover"},null),M("img",{src:Y("icon_level.png"),class:v.iconLevel},null)]):M("div",{class:v.userLogo},[M("img",{class:v.img,src:Y("icon_no_level.png")},null)])]),M("div",{class:v.userName},[t.userId?M(A,null,[M("p",{class:v.name},[t.username]),M("p",null,[M("span",{class:v.subjectName},[t.userSubject])])]):M("span",{class:v.noText},[w("虚位以待")])])]),M("div",{class:v.userBtn},[M(E,{round:!0,style:{padding:"0 8px",height:"32px"},color:"linear-gradient(180deg, #FFA200 0%, #FF6900 100%)",disabled:0===e.activeInfo.join||e.userSelectMusic&&1!=t.join,onClick:function(){e.checkActivityTime()&&(e.selectMusic=t,1===t.join?"TOTAL_SCORE"===e.rankingMethod?e.$router.push({path:"/track-song",query:{id:e.id,subjectId:t.subjectId,subjectName:t.subjectName}}):e.onOpenMusic():e.popupStatus=!0)}},{default:function(){return[w("立刻挑战")]}})])])}})]}})}))]),M("div",{class:[v.section]},[M("div",{class:v.title},[M("img",{src:Y("icon_arrow_left.png")},null),M("span",null,[w("活动规则")]),M("img",{src:Y("icon_arrow_right.png")},null)]),M("div",{class:v.tips},[this.activeInfo.ruleDescribe])])]),1!==this.activeInfo.join&&M(y,{position:"bottom"},{default:function(){return[M("div",{class:v.btnGroup},[M(E,{round:!0,class:v.submit,block:!0,onClick:e.onJoinActve},{default:function(){return[w("报名参与")]}})])]}}),M(L,{show:this.popupStatus,"onUpdate:show":function(t){return e.popupStatus=t},round:!0,style:{width:"90%"},closeOnClickOverlay:!1},{default:function(){return[M("div",{class:v.popupContainer},[M("div",{class:[v.popupTitle,"van-hairline--bottom"]},[M("i",{class:v.line},null),w("提示"),M("img",{src:Y("icon_close.png"),class:v.popupClose,onClick:function(){return e.popupStatus=!1}},null)]),M("div",{class:v.popupContent},[I().isApp?M(A,null,["TOTAL_SCORE"===e.rankingMethod?M(A,null,[M("p",null,[w("确定要参加 "),M("span",null,[e.selectMusic.subjectName]),w("(声部)的比拼吗?")]),M("p",{class:v.popupTips},[w("每位用户仅可选择一个声部参与挑战哦!")])]):M(A,null,[M("p",null,[w("确定要参加"),M("span",null,[e.selectMusic.musicSheetName]),w("评测"),M("span",null,[G[e.activeInfo.evaluationDifficulty]]),w("的比拼吗?")]),M("p",{class:v.popupTips},[w("每位用户仅可选择一首曲目的一个难度哦!")])])]):M("div",{class:v.appOut},[M("img",{src:P},null),M("p",null,[w("请在酷乐秀APP内打开活动链接!")])])]),I().isApp?M("div",{class:["btnGroup, btnMore",v.popupBtn]},[M(E,{type:"primary",round:!0,plain:!0,onClick:function(){return e.popupStatus=!1}},{default:function(){return[w("再想想")]}}),M(E,{type:"primary",round:!0,onClick:e.onOpenMusic},{default:function(){return[w("就是它了")]}})]):M("div",{class:["btnGroup, btnMore",v.popupBtn]},[M(E,{type:"primary",round:!0,onClick:e.onOpenApp},{default:function(){return[w("确定")]}})])])]}}),this.wxStatus&&M("div",{class:v.wxpopup,onClick:function(){e.wxStatus=!1}},[M("img",{src:Y("wx_bg.png"),alt:""},null)])])}}))}}}))}();