1 |
- import{_ as b,a as C,b as I,c as E,d as T,e as A,f as k,g as S,h as M,i as F,j as O,k as B,l as w,s as e}from"./index.module.1e3f21b8.js";import{_ as j,c as D,d as L}from"./icon_level3.5bff162c.js";import{d as N,f as l,g as R,y as m,D as f,w as r,n as _,h as P,T as x,v as U,j as i,A as n,F as p,B as g,aS as z}from"./ResizeObserver.es.39b48a47.js";import{C as $}from"./index.b1c0c586.js";import{C as y}from"./index.db115763.js";import{C as q}from"./index.9f5e14d1.js";import{I as d}from"./index.fcbcb027.js";import{l as V}from"./logo.bcac726b.js";import{s as G}from"./share.098d3d09.js";import{g as H}from"./music.27f3de35.js";import{o as h}from"./orderStatus.fbc0ddaf.js";import{d as Y}from"./index.07111672.js";import{i as J}from"./icon_teacher.40b6f077.js";import{C as K}from"./index.970ad07b.js";import"./index.dc19bc54.js";const u=t=>{const s=`./images/${t}`;return{"./images/icon-lv.png":b,"./images/icon_arrow_left.png":C,"./images/icon_arrow_right.png":I,"./images/icon_close.png":E,"./images/icon_king.png":T,"./images/icon_level.png":j,"./images/icon_level2.png":D,"./images/icon_level3.png":L,"./images/icon_music.png":A,"./images/icon_no_level.png":k,"./images/icon_score.png":S,"./images/icon_subject.png":M,"./images/icon_time.png":F,"./images/star_bg.png":O,"./images/title_bg.png":B,"./images/wx_bg.png":w}[s].default};var di=N({name:"track-review-activity",data(){const t=this.$route.query;return{id:t.id,recomUserId:t.recomUserId||"",activeInfo:{},popupStatus:!1,wxStatus:!1,behaviorId:H(),selectMusic:{},hiddenProperty:null}},computed:{rankingMethod(){return this.activeInfo.rankingMethod||""},activityMusic(){const t=this.activeInfo;return(t.rankingMethod==="TOTAL_SCORE"?t.subjectInfos:t.activityMusicVoList)||[]},userSelectMusic(){let t=!1;return this.activityMusic.forEach(s=>{s.join===1&&(t=!0)}),t},rewardList(){const t=this.activeInfo;let s=t.activityRewardList||[];if(s&&s.length>0)if(t.rankingMethod==="TOTAL_SCORE")s=[s];else{const o=s.sort((a,c)=>Number(a.group)<Number(c.group)?-1:1);s=this.groupBy(o,a=>[a.group])}return s||[]}},async mounted(){if(await this.getMusicInfo(),l().isApp)if(R.platformType==="TEACHER"){this.onBackDialog("\u8BF7\u4F7F\u7528\u9177\u4E50\u79C0\u5B66\u751F\u7AEF\u626B\u7801\u6253\u5F00");return}else{console.log(this.hiddenProperty,"hidden property"),this.hiddenProperty="hidden"in document?"hidden":"webkitHidden"in document?"webkitHidden":"mozHidden"in document?"mozHidden":null;const t=this.hiddenProperty.replace(/hidden/i,"visibilitychange");document.addEventListener(t,this.onVisibilityChange)}this.checkActivityTime()},unmounted(){if(this.hiddenProperty){const t=this.hiddenProperty.replace(/hidden/i,"visibilitychange");document.removeEventListener(t,this.onVisibilityChange)}},methods:{groupBy(t,s){const o={};return t.forEach(a=>{const c=JSON.stringify(s(a));o[c]=o[c]||[],o[c].push(a)}),Object.keys(o).map(function(a){return o[a]})},onVisibilityChange(){document[this.hiddenProperty]||this.getMusicInfo()},async getMusicInfo(){try{const t=await m.post("/api-student/open/activity/info/"+this.id);this.activeInfo=t.data,document.title=this.activeInfo.activityName}catch{}},checkActivityTime(){try{const t=this.activeInfo;if(t.activityState!==1)return f.alert({message:"\u6D3B\u52A8\u5DF2\u7ED3\u675F\uFF0C\u611F\u8C22\u4F60\u7684\u5173\u6CE8\uFF01",theme:"round-button",confirmButtonColor:"#2dc7aa"}),this.onBackDialog("\u6D3B\u52A8\u5DF2\u7ED3\u675F\uFF0C\u611F\u8C22\u4F60\u7684\u5173\u6CE8\uFF01"),!1;const s=r(),o=r(t.activityStart),a=r(t.activityEnd);return r(s).isBefore(r(o))?(this.onBackDialog("\u6D3B\u52A8\u5C1A\u672A\u5F00\u59CB\uFF0C\u8BF7\u60A8\u8010\u5FC3\u7B49\u5F85\uFF01"),!1):r(s).isBefore(r(a))?!0:(this.onBackDialog("\u6D3B\u52A8\u5DF2\u7ED3\u675F\uFF0C\u611F\u8C22\u4F60\u7684\u5173\u6CE8\uFF01"),!1)}catch{}},onBackDialog(t){f.alert({message:t,theme:"round-button",confirmButtonColor:"#2dc7aa"}).then(()=>{_({api:"back"})})},async onJoinActve(){var s;if(!l().isApp){this.popupStatus=!0,P();return}const t=this.activeInfo;try{if(!this.checkActivityTime())return;if(t.registrationMethod==="CHARGE"){const o=await m.post("/api-student/userOrder/getPendingOrder",{data:{goodType:"ACTI_REGIST",bizId:t.id}});h.orderObject.orderType="ACTI_REGIST",h.orderObject.orderName=t.activityName,h.orderObject.orderDesc=t.activityName,h.orderObject.actualPrice=t.registrationPrice,h.orderObject.orderNo=((s=o.data)==null?void 0:s.orderNo)||"",h.orderObject.recomUserId=this.recomUserId,h.orderObject.orderList=[{orderType:"ACTI_REGIST",goodsName:t.activityName,activityId:t.id,actualPrice:t.registrationPrice,price:t.registrationPrice,recomUserId:this.recomUserId}],this.$router.push({path:"/orderDetail",query:{orderType:"ACTI_REGIST",activityId:t.id}})}else await m.post(`/api-student/activity/joinActivity/${t.id}`),setTimeout(()=>{x("\u62A5\u540D\u6210\u529F")},300),this.getMusicInfo()}catch{}},async onOpenMusic(){try{const t=this.selectMusic;console.log(t,"selectMusic");let s="";if(this.rankingMethod==="TOTAL_SCORE"?(this.activeInfo.activityMusicVoList||[]).forEach(v=>{console.log(v,t),v.subjectId==t.subjectId&&!s&&(s=v.evaluationId)}):s=t.evaluationId,t.join!==1&&(await m.post(`/api-student/activity/evaluation/${s}`),this.selectMusic.join=1),this.popupStatus=!1,this.rankingMethod==="TOTAL_SCORE"){this.$router.push({path:"/track-song",query:{subjectId:t.subjectId,id:this.id}});return}const o=l(),a="/klx-music-score/",c=U.stringifyUrl({url:location.origin+a,query:{id:t.musicSheetId,behaviorId:this.behaviorId,systemType:o.isStudent?"student":"teacher",setting:JSON.stringify({mode:"EVALUATING",resets:["SPEED"],difficulty:t.evaluationDifficulty,feeType:"FREE",submitData:{evaluationId:this.selectMusic.evaluationId}})}});_({api:"openAccompanyWebView",content:{url:c,orientation:0,isHideTitle:!0,statusBarTextColor:!1,isOpenLight:!0}})}catch{}},onOpenApp(){if(l().isApp)this.popupStatus=!1;else{if(l().weixin){this.wxStatus=!0;return}const{origin:t}=location,s=t+`/student/#/track-review-activity?id=${this.id}&recomUserId=${this.recomUserId}`;G(s,{}),setTimeout(()=>{window.location.href=location.origin+"/student/#/download"},3e3)}}},render(){return console.log(this.activeInfo),console.log(this.activeInfo.subjectUrl+"?time"+ +new Date),i("div",{class:e.review,style:{backgroundColor:this.activeInfo.backgroundUrl,backgroundSize:"contain"}},[i(K,null,null),i("img",{class:e.bannerImg,src:this.activeInfo.subjectUrl},null),i("div",{class:e.reviewContainer},[i("div",{class:[e.section,e.activeTime]},[i("div",{class:e.activeBg},[i("img",{src:u("icon_time.png")},null),i("p",null,[i("span",null,[n("\u6D3B\u52A8\u65F6\u95F4\uFF1A")]),r(this.activeInfo.activityStart).format("YYYY-MM-DD"),n(" ~ "),r(this.activeInfo.activityEnd).format("YYYY-MM-DD")])])]),i("div",{class:[e.section]},[i("div",{class:e.title},[i("img",{src:u("icon_arrow_left.png")},null),i("span",null,[n("\u6D3B\u52A8\u4ECB\u7ECD")]),i("img",{src:u("icon_arrow_right.png")},null)]),i("div",{class:e.tips},[this.activeInfo.describe])]),i("div",{class:[e.section]},[i("h2",{class:e.title2},[i("span",null,[i("i",{class:e.titlePrefix},null),n("\u6D3B\u52A8\u5956\u54C1")]),i("span",{class:e.titleTips,onClick:()=>this.$router.push({path:"/leaderboard",query:{id:this.id}})},[n("\u67E5\u770B\u6311\u6218\u6392\u884C\u699C"),i("img",{style:{width:"16px",marginLeft:"4px"},src:u("icon-lv.png")},null)])]),this.rewardList.map((t,s)=>i(p,null,[i("div",{class:e.prizeTitle},[this.rankingMethod==="TOTAL_SCORE"?i("div",{class:e.prizeTitle_score},[n("\u603B\u8BC4\u6D4B\u5206\u6570\u8FBE\u5230 "),this.activeInfo.rankingScore||0,n("\u5206\u5373\u53EF\u83B7\u5956")]):i(p,null,[s===0&&i(d,{class:e.prizeLevel,src:u("icon_level.png")},null),s===1&&i(d,{class:e.prizeLevel,src:u("icon_level2.png")},null),s===2&&i(d,{class:e.prizeLevel,src:u("icon_level3.png")},null),n("\u7B2C"),++s,n("\u540D\u5956\u54C1")])]),i("div",{class:e.prizeSection},[t.map(o=>i("div",{class:[e.prize]},[i(d,{src:o.imgUrl},null),i("div",{class:e.prizeContainer},[i("div",{class:e.prizeName},[o.rewardName]),i("div",{class:e.prizeDesc},[o.rewardDescribe])])]))])]))]),i("div",{class:[e.section],style:{backgroundColor:"#fff"}},[i("h2",{class:e.title2},[i("span",null,[i("i",{class:e.titlePrefix},null),n("\u6D3B\u52A8"),this.rankingMethod==="TOTAL_SCORE"?"\u58F0\u90E8":"\u66F2\u76EE"]),this.rankingMethod==="TOTAL_SCORE"?i("span",{class:e.titleTips,onClick:()=>{this.$router.push({path:"/track-subject-song",query:{id:this.id}})}},[n("\u67E5\u770B\u66F2\u76EE")]):i("span",{class:e.titleTips},[n("\u5171"),this.activityMusic.length||0,n("\u9996\u66F2\u76EE")])]),this.activityMusic.map(t=>i(q,{class:e.musicItem,border:!1},{default:()=>[i(y,{center:!0,titleClass:[e.musicTitle,this.rankingMethod=="TOTAL_SCORE"&&e.musicTitleScore],isLink:this.rankingMethod==="TOTAL_SCORE"},{icon:()=>i(d,{src:u(this.rankingMethod!=="TOTAL_SCORE"?"icon_music.png":"icon_subject.png"),class:e.iconMusic},null),title:()=>i("span",{class:e.musicName},[this.rankingMethod==="TOTAL_SCORE"?t.subjectName:t.musicSheetName]),value:()=>i("span",{onClick:()=>{this.rankingMethod==="TOTAL_SCORE"&&this.$router.push({path:"/track-subject-song",query:{id:this.id,subjectId:t.subjectId}})}},[this.rankingMethod==="TOTAL_SCORE"?`\u5171${t.musicNums}\u9996\u6D3B\u52A8\u66F2\u76EE`:t.musicSubject])}),i(y,{center:!0,class:e.cellLevel},{icon:()=>i("div",{class:e.kingSection},[i(d,{src:u("icon_king.png"),class:e.iconKing},null),i("p",{class:e.score},[t.userId?t.score:"--",i("span",null,[n("\u5206")])])]),title:()=>i("div",{class:e.users},[i("div",{class:e.userInfo},[i("div",{class:e.userImg},[t.userId?i(p,null,[i(d,{src:t.userAvatar||J,class:e.userLogo,fit:"cover"},null),i("img",{src:u("icon_level.png"),class:e.iconLevel},null)]):i("div",{class:e.userLogo},[i("img",{class:e.img,src:u("icon_no_level.png")},null)])]),i("div",{class:e.userName},[t.userId?i(p,null,[i("p",{class:e.name},[t.username]),i("p",null,[i("span",{class:e.subjectName},[t.userSubject])])]):i("span",{class:e.noText},[n("\u865A\u4F4D\u4EE5\u5F85")])])]),i("div",{class:e.userBtn},[i(g,{round:!0,style:{padding:"0 8px",height:"32px"},color:"linear-gradient(180deg, #FFA200 0%, #FF6900 100%)",disabled:this.activeInfo.join===0||this.userSelectMusic&&t.join!=1,onClick:()=>{!this.checkActivityTime()||(this.selectMusic=t,t.join===1?this.rankingMethod==="TOTAL_SCORE"?this.$router.push({path:"/track-song",query:{id:this.id,subjectId:t.subjectId,subjectName:t.subjectName}}):this.onOpenMusic():this.popupStatus=!0)}},{default:()=>[n("\u7ACB\u523B\u6311\u6218")]})])])})]}))]),i("div",{class:[e.section]},[i("div",{class:e.title},[i("img",{src:u("icon_arrow_left.png")},null),i("span",null,[n("\u6D3B\u52A8\u89C4\u5219")]),i("img",{src:u("icon_arrow_right.png")},null)]),i("div",{class:e.tips},[this.activeInfo.ruleDescribe])])]),this.activeInfo.join!==1&&i($,{position:"bottom"},{default:()=>[i("div",{class:e.btnGroup},[i(g,{round:!0,class:e.submit,block:!0,onClick:this.onJoinActve},{default:()=>[n("\u62A5\u540D\u53C2\u4E0E")]})])]}),i(z,{show:this.popupStatus,"onUpdate:show":t=>this.popupStatus=t,round:!0,style:{width:"90%"},closeOnClickOverlay:!1},{default:()=>[i("div",{class:e.popupContainer},[i("div",{class:[e.popupTitle,"van-hairline--bottom"]},[i("i",{class:e.line},null),n("\u63D0\u793A"),i("img",{src:u("icon_close.png"),class:e.popupClose,onClick:()=>this.popupStatus=!1},null)]),i("div",{class:e.popupContent},[l().isApp?i(p,null,[this.rankingMethod==="TOTAL_SCORE"?i(p,null,[i("p",null,[n("\u786E\u5B9A\u8981\u53C2\u52A0 "),i("span",null,[this.selectMusic.subjectName]),n("\uFF08\u58F0\u90E8\uFF09\u7684\u6BD4\u62FC\u5417\uFF1F")]),i("p",{class:e.popupTips},[n("\u6BCF\u4F4D\u7528\u6237\u4EC5\u53EF\u9009\u62E9\u4E00\u4E2A\u58F0\u90E8\u53C2\u4E0E\u6311\u6218\u54E6\uFF01")])]):i(p,null,[i("p",null,[n("\u786E\u5B9A\u8981\u53C2\u52A0"),i("span",null,[this.selectMusic.musicSheetName]),n("\u8BC4\u6D4B"),i("span",null,[Y[this.activeInfo.evaluationDifficulty]]),n("\u7684\u6BD4\u62FC\u5417\uFF1F")]),i("p",{class:e.popupTips},[n("\u6BCF\u4F4D\u7528\u6237\u4EC5\u53EF\u9009\u62E9\u4E00\u9996\u66F2\u76EE\u7684\u4E00\u4E2A\u96BE\u5EA6\u54E6\uFF01")])])]):i("div",{class:e.appOut},[i("img",{src:V},null),i("p",null,[n("\u8BF7\u5728\u9177\u4E50\u79C0APP\u5185\u6253\u5F00\u6D3B\u52A8\u94FE\u63A5\uFF01")])])]),l().isApp?i("div",{class:["btnGroup, btnMore",e.popupBtn]},[i(g,{type:"primary",round:!0,plain:!0,onClick:()=>this.popupStatus=!1},{default:()=>[n("\u518D\u60F3\u60F3")]}),i(g,{type:"primary",round:!0,onClick:this.onOpenMusic},{default:()=>[n("\u5C31\u662F\u5B83\u4E86")]})]):i("div",{class:["btnGroup, btnMore",e.popupBtn]},[i(g,{type:"primary",round:!0,onClick:this.onOpenApp},{default:()=>[n("\u786E\u5B9A")]})])])]}),this.wxStatus&&i("div",{class:e.wxpopup,onClick:()=>{this.wxStatus=!1}},[i("img",{src:u("wx_bg.png"),alt:""},null)])])}});export{di as default,u as getAssetsHomeFile};
|