index.3c5991d7.js 7.2 KB

1
  1. import{s as n,a as x}from"./signin-tips.6542f4eb.js";import{d as v,R as k,$ as P,f as y,c as u,P as w,F as D,ag as S,ah as G,r as R,o as l,m as p,bd as T,b3 as _,q as s,B as L,be as q,bf as U}from"./index.d1dca38b.js";import{q as H}from"./index.339fc024.js";import{u as V,b as O}from"./index.c88930a5.js";import{C as N}from"./index.1383acec.js";import{F as f}from"./index.a5f38096.js";import{P as E}from"./index.dae33edc.js";import"./index.2f930c00.js";import"./Picker.7620f03c.js";import"./index.06e8d826.js";import"./use-tab-status.03ea8dd0.js";import"./index.c324c166.js";import"./index.3b296605.js";const $="_wxPopupDialog_1sfd3_1",W="_popupContainer_1sfd3_16",Y="_title1_1sfd3_22",j="_popupTips_1sfd3_29";var m={wxPopupDialog:$,popupContainer:W,title1:Y,popupTips:j},M=v({name:"o-wx-tip",props:{show:{type:Boolean,default:!0},title:{type:String,default:"\u6E29\u99A8\u63D0\u793A"},message:{type:String,default:"\u8BF7\u4F7F\u7528\u5FAE\u4FE1\u6253\u5F00"}},setup(a){const i=k(!1);return P(()=>{if(!y().weixin&&a.show){i.value=!0;return}}),()=>u(D,null,[u(w,{show:i.value,"onUpdate:show":d=>i.value=d,round:!0,style:{width:"88%"},closeOnClickOverlay:!1,class:m.wxPopupDialog},{default:()=>[u("div",{class:m.popupContainer},[u("p",{class:m.title1},[a.title]),u("p",{class:m.popupTips},[a.message])])]})])}});const B=[];for(let a=1;a<=40;a++)B.push({text:a+"\u73ED",value:a});var ne=v({name:"pre-register",setup(){const a=V(1e3,{controls:!0});a.pause();const i=S(),d=G(),e=R({loading:!0,orchestraId:d.query.id,code:null,currentGradeList:[{text:"\u4E00\u5E74\u7EA7",value:1},{text:"\u4E8C\u5E74\u7EA7",value:2},{text:"\u4E09\u5E74\u7EA7",value:3},{text:"\u56DB\u5E74\u7EA7",value:4},{text:"\u4E94\u5E74\u7EA7",value:5}],showPicker:!1,classPicker:!1,nameReg:/^[\u4E00-\u9FA5]+$/,openId:"",id:null,videoBrowseData:null,videoBrowsePoint:null,username:"",currentGrade:"",currentClass:"",intervalFnRef:null,applyStatus:!1,isPageHide:!1}),h=t=>{if(t)if(e.nameReg.test(t)){if(t.length<2||t.length>15)return"\u5B66\u5458\u59D3\u540D\u5FC5\u987B\u4E3A2~15\u4E2A\u5B57"}else return"\u5B66\u5458\u59D3\u540D\u5FC5\u987B\u4E3A\u4E2D\u6587";else return"\u8BF7\u586B\u5199\u5B66\u751F\u771F\u5B9E\u59D3\u540D"},b=async()=>{var t,o;try{if(e.applyStatus){l("\u5BB6\u957F\u4F1A\u8C03\u67E5\u95EE\u5377\u5DF2\u7ED3\u675F");return}if(h(e.username)){l(h(e.username));return}if(!e.currentGrade){l("\u8BF7\u9009\u62E9\u5E74\u7EA7");return}if(!e.currentClass){l("\u8BF7\u9009\u62E9\u73ED\u7EA7");return}(t=e.intervalFnRef)==null||t.pause(),a.pause(),await p.post("/api-student/open/studentBrowseRecord/updateStat",{data:{id:e.id,pageBrowseTime:a.counter.value,username:e.username,currentGrade:e.currentGrade,currentClass:e.currentClass?Number(e.currentClass):null}}),i.push({path:"/pre-register-video",query:{saveId:e.id,id:e.orchestraId,openId:e.openId}})}catch{(o=e.intervalFnRef)==null||o.resume(),a.resume()}},g=(t,o)=>{let c="";return o.forEach(r=>{r.value==t&&(c=r.text)}),c},A=async(t=10)=>{try{await p.post("/api-student/open/studentBrowseRecord/updateStat",{data:{id:e.id,pageBrowseTime:t}})}catch{}};P(async()=>{try{e.orchestraId||l("\u4FE1\u606F\u83B7\u53D6\u5931\u8D25\uFF0C\u8BF7\u8054\u7CFB\u8001\u5E08");const{data:t}=await p.get("/api-student/open/orchestra/detail/"+e.orchestraId);if((t.schoolSystem||"sixYearSystem")==="sixYearSystem"&&e.currentGradeList.push({text:"\u516D\u5E74\u7EA7",value:6}),!e.code)return;if(t.status!=="PRE_REGISTER"){l("\u5BB6\u957F\u4F1A\u8C03\u67E5\u95EE\u5377\u5DF2\u7ED3\u675F"),e.applyStatus=!0;return}const r=(await p.post("/api-student/open/studentBrowseRecord/add",{data:{orchestraId:e.orchestraId,code:e.code,openId:e.openId}})).data;e.currentClass=r.currentClass,e.currentGrade=r.currentGrade,e.openId=r.openId,e.username=r.username,e.videoBrowseData=r.videoBrowseData,e.videoBrowsePoint=r.videoBrowsePoint,e.id=r.id,sessionStorage.setItem("active-open-id",r.openId),a.resume(),e.intervalFnRef=O(()=>{a.counter.value=0,a.resume(),A()},1e4)}catch{}});const I=async t=>{try{const{data:o}=await p.get("/api-school/open/paramConfig/wechatAppId");o&&(q(),U(o,t))}catch{}};if(y().weixin){const t=sessionStorage.getItem("active-open-id");e.openId=t;const o=T();if(o)e.code=o;else{const c=window.location.origin+window.location.pathname+"#"+d.path+"?"+H.stringify({...d.query});return I(c),""}}const C=()=>{console.log(e.isPageHide,"showInfo"),e.isPageHide&&window.location.reload()};window.addEventListener("pageshow",C);const F=()=>{console.log(e.isPageHide,"showInfo"),e.isPageHide=!0};return window.addEventListener("pagehide",F),_(()=>{window.removeEventListener("pageshow",C),window.removeEventListener("pagehide",F)}),()=>u("div",{class:n["per-register-active"]},[u("div",{class:n.flowPath},[u("i",{class:n.flowPathTitle},null),u("div",{class:n.flowPathContent},[s("\u4E00\u3001\u8BF7\u6240\u6709\u5BB6\u957F\u8FDB\u884C"),u("span",null,[s("\u7B7E\u5230")]),u("br",null,null),s("\u4E8C\u3001"),u("span",null,[s("\u89C2\u770B")]),s("\u7BA1\u4E50\u56E2\u5BB6\u957F\u4F1A\u8BAE"),u("br",null,null),s("1\u3001\u5B66\u6821\u9886\u5BFC\u8BB2\u8BDD\uFF085\u5206\u949F\uFF09"),u("br",null,null),s("2\u3001\u57FA\u91D1\u4F1A\u8001\u5E08\u4ECB\u7ECD\u4E50\u56E2\u4E8B\u9879\uFF0820\u5206\u949F\uFF09"),u("br",null,null),u("p",{style:{"padding-left":"1em"}},[s("*\u4E50\u56E2\u7EC4\u5EFA\u80CC\u666F\u53CA\u653F\u7B56"),u("br",null,null),s("*\u4E50\u56E2\u53D1\u5C55\u89C4\u5212\u4E0E\u4E50\u5668\u77E5\u8BC6\u8BB2\u89E3"),u("br",null,null),s("*\u5B66\u6821/\u57FA\u91D1\u4F1A/\u5BB6\u957F\u5404\u65B9\u804C\u8D23\u4E0E\u6295\u5165"),u("br",null,null),s("*\u5165\u56E2\u6D41\u7A0B\u8BB2\u89E3")]),s("\u4E09\u3001\u8BF7"),u("span",null,[s("\u201C\u6709\u610F\u5411\u201D")]),s("\u8BA9\u5B69\u5B50\u52A0\u5165\u4E50\u56E2\u7684\u5BB6\u957F\u70B9\u51FB"),u("span",null,[s("\u201C\u4E50\u56E2\u62A5\u540D\u201D")]),s("\u5B8C\u6210\u4FE1\u606F\u586B\u62A5")])]),u("div",{class:n.signin},[u("div",{class:n.tips},[u("img",{src:x,class:n.signinTips},null),u("p",null,[s("\u8BF7\u5148\u8FDB\u884C"),u("span",null,[s("\u7B7E\u5230")]),s("\uFF0C\u518D\u89C2\u770B"),u("span",null,[s("\u7BA1\u4E50\u56E2\u5BB6\u957F\u4F1A\u89C6\u9891")])])]),u(N,{class:n.cellGroup,border:!1},{default:()=>[u(f,{label:"\u5B66\u751F\u59D3\u540D",labelAlign:"top",placeholder:"\u8BF7\u8F93\u5165\u5B66\u751F\u59D3\u540D",autocomplete:"off",modelValue:e.username,"onUpdate:modelValue":t=>e.username=t},null),u(f,{label:"\u5E74\u7EA7",labelAlign:"top",placeholder:"\u8BF7\u9009\u62E9\u5E74\u7EA7",isLink:!0,readonly:!0,modelValue:g(e.currentGrade,e.currentGradeList),clickable:!1,onClick:()=>e.showPicker=!0},null),u(f,{label:"\u73ED\u7EA7",labelAlign:"top",placeholder:"\u8BF7\u9009\u62E9\u73ED\u7EA7",isLink:!0,readonly:!0,modelValue:g(e.currentClass,B),clickable:!1,onClick:()=>e.classPicker=!0},null),u(L,{class:n.submitBtn,onClick:b},null)]})]),u(M,null,null),u(w,{show:e.showPicker,"onUpdate:show":t=>e.showPicker=t,position:"bottom",round:!0},{default:()=>[u(E,{columns:e.currentGradeList,onCancel:()=>e.showPicker=!1,onConfirm:({selectedValues:t})=>{e.currentGrade=t[0],e.showPicker=!1}},null)]}),u(w,{show:e.classPicker,"onUpdate:show":t=>e.classPicker=t,position:"bottom",round:!0},{default:()=>[u(E,{columns:B,onCancel:()=>e.classPicker=!1,onConfirm:({selectedValues:t})=>{e.currentClass=t[0],e.classPicker=!1}},null)]})])}});export{ne as default};