1 |
- import{d as j,q as $,P as W,r as Y,x as J,y as K,D as x,e as X,w as y,R as Z,a as t,A as a,F as P,U as f,z as ee,M as I,N as r}from"./index-b80927fb.js";import{O as oe}from"./index-10d460ed.js";import{M as te}from"./index-215f040f.js";import{M as ue}from"./index-28950e57.js";import{c as se}from"./api-18add4f4.js";import{u as ne}from"./index-b27ccbd4.js";import{F as w}from"./index-a60cffc2.js";import{C as ae}from"./index-f02eb2f7.js";import{A as le}from"./index-655a05cc.js";import{P as S}from"./index-7398c64f.js";import"./index-d13f6534.js";import"./index-e09ea940.js";import"./index-47101498.js";const re="_formBox_1wkfv_16",ce="_formItem_1wkfv_23",ie="_valDot_1wkfv_37",pe="_valDone_1wkfv_57",de="_vdArea_1wkfv_78",me="_vdSchool_1wkfv_87",he="_openVal_1wkfv_96",fe="_valDone2_1wkfv_99",ge="_grayText_1wkfv_102",Ce="_codeItem_1wkfv_105",Fe="_selectItem_1wkfv_108",ve="_selectedIcon_1wkfv_129",xe="_bottomBtn_1wkfv_139",Ie="_successPop_1wkfv_147",we="_successBox_1wkfv_157",Se="_sTitle_1wkfv_173",Be="_sDone_1wkfv_177",Ae="_codeText_1wkfv_186",Ee="_countDown_1wkfv_189",ye="_columnsContent_1wkfv_192",u={"intention-page":"_intention-page_1wkfv_1",formBox:re,formItem:ce,valDot:ie,valDone:pe,vdArea:de,vdSchool:me,openVal:he,valDone2:fe,grayText:ge,codeItem:Ce,selectItem:Fe,selectedIcon:ve,bottomBtn:xe,successPop:Ie,successBox:we,sTitle:Se,sDone:Be,codeText:Ae,countDown:Ee,columnsContent:ye},Pe=""+new URL("submit_icon-2ccf16bd.png",import.meta.url).href,_e=""+new URL("signup_icon-489ffde6.png",import.meta.url).href,De=""+new URL("sign_icon-5045b62b.png",import.meta.url).href,Te=""+new URL("subsus_icon-40ccf9b3.png",import.meta.url).href,ke=""+new URL("done_icon-009d7614.png",import.meta.url).href,$e=j({name:"fill-questionnaire",setup(){const _=$(),l=W(),D=ne(),i=[];for(let o=1;o<=40;o++)i.push({text:o+"班",value:o});const d=l.query.meetingType==="primarySchoolNo"||l.query.meetingType==="primarySchoolYes"?[{text:"一年级",value:1},{text:"二年级",value:2},{text:"三年级",value:3},{text:"四年级",value:4},{text:"五年级",value:5},{text:"六年级",value:6}]:[{text:"六年级",value:6},{text:"七年级",value:7},{text:"八年级",value:8},{text:"九年级",value:9}],g=Y(),e=J({isPageHide:!1,currentClassText:"",supportList:[{title:"支持学校开展",val:!0},{title:"不支持开展",val:!1}],willingList:[{title:"愿意参加并意向报名",val:!0},{title:"不愿意参加",val:!1}],username:"",openId:null,participationFlag:null,supportFlag:null,currentGrade:null,currentClass:null,provinceCode:"",cityCode:"",districtCode:"",phone:"",prePhone:"",smsCode:"",selectArea:"",selectSchool:"",selectClass:"",countDownStatus:!0,countDownTime:1e3*120,imgCodeStatus:!1,successPopShow:!1,schoolStatus:!1,schoolPopupShow:!1,schoolLoading:!1,schoolPopupIndex:[],schoolAreaList:[],schoolAreaId:null,schoolInstrumentSetType:null,gradeList:[],classList:[],schoolName:"",gradeNumText:"",areaName:"",gradeStatus:!1,classStatus:!1,gradePopupShow:!1,gradePopupIndex:[],classPopupShow:!1,classPopupIndex:[],areaList:[],showPicker:!1,gradeAndClass:[d,i],gradeAndClassIndex:[],gradeOptions:d,classOptions:i,gradeOptionIndex:[],classOptionIndex:[],submitLoading:!1,id:null,code:null,areaPopupIndex:null,customSearchText:"",tenantId:null,customQuestionE:null});K(async()=>{e.tenantId=l.query.tenantId,sessionStorage.getItem("customQuestionE")&&(e.customQuestionE=sessionStorage.getItem("customQuestionE"));const{data:o}=await se(e.tenantId);o&&o.length&&(e.provinceCode=o[0].provinceCode,e.cityCode=o[0].cityCode,e.districtCode=o[0].regionCode,e.areaName="学校名称"),console.log(333,e.provinceCode),T()}),e.openId=D.onWeChatCatchOpenId("GET"),e.openId||_.push({path:"/intention-questionnaire",query:{type:l.query.meetingType,id:l.query.tenantId}});const B=()=>{console.log(e.isPageHide,"showInfo"),e.isPageHide&&window.location.reload()};window.addEventListener("pageshow",B);const A=()=>{console.log(e.isPageHide,"showInfo"),e.isPageHide=!0};window.addEventListener("pagehide",A);const T=async()=>{var o,n;try{if(!e.openId)return;const{data:s}=await x.get("/edu-app/open/schoolMeetingQuestion/detail?openId="+e.openId);if(!s)return;e.areaPopupIndex=s.districtCode||s.cityCode||s.provinceCode,e.areaPopupIndex=e.areaPopupIndex?String(e.areaPopupIndex):null;const m=["一年级","二年级","三年级","四年级","五年级","六年级"],C=["六年级","七年级","八年级","九年级"];m.includes(s.currentGrade)&&(l.query.meetingType==="primarySchoolNo"||l.query.meetingType==="primarySchoolYes")&&(e.currentClass=s.currentClass,e.currentGrade=s.currentGrade),C.includes(s.currentGrade)&&(l.query.meetingType==="juniorSchoolNo"||l.query.meetingType==="juniorSchool")&&(e.currentClass=s.currentClass,e.currentGrade=s.currentGrade),e.phone=s.phone,e.prePhone=s.phone,e.username=s.username,e.schoolAreaId=s.schoolAreaId,e.schoolPopupIndex=s.schoolAreaId?[s.schoolAreaId]:[],e.schoolName=s.schoolName,e.supportFlag=s.supportFlag,e.participationFlag=s.participationFlag,e.areaName=s.provinceName+" "+s.cityName+" "+(s.districtName||"");const F=((o=d.find(p=>p.text===s.currentGrade))==null?void 0:o.value)||1,v=((n=i.find(p=>p.text===s.currentClass))==null?void 0:n.value)||1;e.gradeOptionIndex=[F],e.classOptionIndex=[v],c()}catch(s){}},k=()=>{e.countDownStatus=!1,ee(()=>{g.value.start()})},L=()=>{if(!I(e.phone))return r("请输入正确的手机号码");e.imgCodeStatus=!0},b=X(()=>!!I(e.phone)),N=()=>{e.countDownStatus=!0,g.value.reset()},O=(o=!0)=>{const n=/^[\u4e00-\u9fa5]{2,14}$/;if(!e.schoolAreaId)return r("请选择学校"),!1;if(!e.username)return r("请输入姓名"),!1;if(!n.test(e.username))return r("请输入正确的中文姓名"),!1;if(!e.currentGrade)return r("请选择年级"),!1;if(!e.currentClass)return r("请选择班级"),!1;if(e.supportFlag===null)return r("请勾选是否支持学校数字化转型"),!1;if(e.participationFlag===null)return r("请勾选是否愿意学生参加数字化转型"),!1;if(e.participationFlag)if(I(e.phone)){if(!e.smsCode)return o&&r("请输入验证码"),!1}else return o&&r("请输入正确的手机号码"),!1;return!0},V=async()=>{if(O())try{e.submitLoading=!0;const{currentClass:o,districtCode:n,currentGrade:s,participationFlag:m,cityCode:C,openId:F,provinceCode:v,smsCode:p,phone:z,schoolAreaId:R,supportFlag:M,username:H,id:E,tenantId:Q}=e;let h={currentClass:o,districtCode:n,currentGrade:s,participationFlag:m,cityCode:C,openId:F,provinceCode:v,schoolAreaId:R,supportFlag:M,username:H,tenantId:Q};E&&(h.id=E),m&&(h.phone=z,h.smsCode=p),(await x.post("/edu-app/open/schoolMeetingQuestion/save",{data:h})).code===200&&(e.successPopShow=!0,e.prePhone=e.phone),e.submitLoading=!1,e.countDownStatus=!0}catch(o){e.submitLoading=!1,e.countDownStatus=!0}},U=()=>{console.log(11111),e.areaName?(e.schoolStatus=!0,c()):e.showPicker=!0},G=o=>{if(!e.customSearchText)return o;const n=new RegExp(`(${e.customSearchText})`,"gi");return o.replace(n,'<span class="highLight">$1</span>')},c=async o=>{e.schoolLoading=!0;try{const{data:n}=await x.post("/edu-app/open/schoolArea/list",{data:{name:o,testFlag:!0,provinceCode:e.provinceCode,cityCode:e.cityCode,regionCode:e.districtCode}});e.customSearchText=o||"",e.schoolAreaList=n}catch(n){}e.schoolLoading=!1},q=o=>{e.participationFlag=o,e.participationFlag||(e.phone="",e.smsCode="",e.countDownStatus=!0),e.participationFlag&&(e.phone=e.prePhone)};return y(()=>e.showPicker,()=>{e.showPicker&&(e.areaPopupIndex=e.districtCode||e.cityCode||e.provinceCode,e.areaPopupIndex=e.areaPopupIndex?String(e.areaPopupIndex):null)}),y(()=>e.schoolStatus,()=>{e.schoolStatus&&(e.schoolPopupIndex=e.schoolAreaId?[e.schoolAreaId]:[])}),Z(()=>{window.removeEventListener("pageshow",B),window.removeEventListener("pagehide",A)}),()=>t("div",{class:u["intention-page"]},[t("div",{class:u.formBox},[t("div",{class:u.formItem},[t("p",{style:"font-size:15px;"},[t("strong",null,[a("1. 学校")])]),e.schoolName?t("div",{class:[u.valDone,(e.schoolStatus||e.showPicker)&&u.openVal],onClick:()=>{e.schoolStatus=!0,c()}},[e.schoolName&&t("span",{class:u.vdSchool},[e.schoolName]),t("i",null,null)]):t("div",{class:[u.valDot,u.grayText,(e.schoolStatus||e.showPicker)&&u.openVal],onClick:U},[a("请选择学校"),t("i",null,null)]),t("div",null,null)]),t("div",{class:u.formItem},[t("p",{style:"font-size:15px;"},[t("strong",null,[a("2. 学生姓名")])]),t(w,{class:u.valDot,clearable:!1,inputAlign:"left",placeholder:"请输入学生姓名",autocomplete:"off",maxlength:14,modelValue:e.username,"onUpdate:modelValue":o=>e.username=o},null)]),t("div",{class:u.formItem},[t("p",{style:"font-size:15px;"},[t("strong",null,[a("3. 年级")])]),t("div",{class:[u.valDot,!e.currentGrade&&u.grayText,e.gradeStatus&&u.openVal],onClick:()=>{var n;const o=((n=d.find(s=>s.text===e.currentGrade))==null?void 0:n.value)||1;e.gradeOptionIndex=[o],e.gradeStatus=!0}},[e.currentGrade?e.currentGrade:"请选择年级",t("i",null,null)])]),t("div",{class:u.formItem},[t("p",{style:"font-size:15px;"},[t("strong",null,[a("4. 班级")])]),t("div",{class:[u.valDot,!e.currentClass&&u.grayText,e.classStatus&&u.openVal],onClick:()=>{var n;const o=((n=i.find(s=>s.text===e.currentClass))==null?void 0:n.value)||1;e.classOptionIndex=[o],e.classStatus=!0}},[e.currentClass?e.currentClass:"请选择班级",t("i",null,null)])]),t("div",{class:u.formItem},[t("p",{style:"font-size:15px;"},[t("strong",null,[a("5. 在您了解以上数字化转型事项后,您是否支持学校开展音乐(器乐)课堂数字化转型")])]),t("div",{class:u.selectItem},[e.supportList.map(o=>t("div",{onClick:()=>e.supportFlag=o.val},[t("i",{class:e.supportFlag===o.val&&u.selectedIcon},null),t("span",null,[o.title])]))])]),t("div",{class:u.formItem},[e.customQuestionE?t(P,null,[t("div",{innerHTML:e.customQuestionE},null)]):t(P,null,[l.query.meetingType==="primarySchoolNo"||l.query.meetingType==="juniorSchoolNo"?t("p",{style:"font-size:15px;"},[t("strong",null,[a("6. 您是否愿意学生参加数字化转型")]),t("span",{style:"font-size:15px;"},[a("(注:以学生及家长自愿参加为原则。如愿意参加,家长需自行为学生准备好乐器和“器乐数字Ai”应用软件两项学习工具,市面上均有提供,大约300多元一年。学校不涉及任何收费行为。如不参加,学生按原有方式进行音乐课学习。)")])]):t("p",{style:"font-size:15px;"},[t("strong",null,[a("6. 您是否愿意学生参加数字化转型")]),t("span",{style:"font-size:15px;"},[a("(注:以学生及家长自愿参加为原则。如愿意参加,家长需自行为学生准备好“器乐数字Ai”应用软件,市面上均有提供,大约300多元一年,学校不涉及任何收费行为。如不参加,学生按原有方式进行器乐课程学习。)")])])]),t("div",{class:u.selectItem},[e.willingList.map(o=>t("div",{onClick:()=>q(o.val)},[t("i",{class:e.participationFlag===o.val&&u.selectedIcon},null),t("span",null,[o.title])]))])]),e.participationFlag&&t("div",{class:u.formItem},[t("p",{style:"font-size:15px;"},[a("联系方式")]),t(w,{class:u.valDot,clearable:!1,placeholder:"请输入手机号码",type:"digit",autocomplete:"off",inputAlign:"left",modelValue:e.phone,"onUpdate:modelValue":[o=>e.phone=o,o=>{}],maxlength:11},null),t(w,{class:[u.valDot,u.codeItem],center:!0,clearable:!1,inputAlign:"left",placeholder:"请输入验证码",autocomplete:"off",type:"number",modelValue:e.smsCode,"onUpdate:modelValue":o=>e.smsCode=o,maxlength:6},{button:()=>e.countDownStatus?t("span",{class:[u.codeText,b.value?"":u.codeTextDisabled],onClick:L},[a("获取验证码")]):t(ae,{ref:o=>g.value=o,"auto-start":!1,class:u.countDown,time:e.countDownTime,onFinish:N,format:"ss秒后重试"},null)})]),e.participationFlag!==null&&t("img",{class:u.bottomBtn,src:e.participationFlag?_e:Pe,onClick:()=>{e.submitLoading||V()}},null)]),t(oe,null,null),e.imgCodeStatus?t(te,{value:e.imgCodeStatus,"onUpdate:value":o=>e.imgCodeStatus=o,phone:e.phone,type:"MEETING_QUESTION",onClose:()=>{e.imgCodeStatus=!1},onSendCode:k},null):null,e.successPopShow&&t("div",{class:u.successPop},[t("div",{class:u.successBox},[t("img",{class:u.sTitle,src:e.participationFlag?De:Te},null),t("p",null,[e.participationFlag?"感谢您的参与":"感谢您的宝贵意见"]),t("img",{class:u.sDone,src:ke,onClick:()=>{e.successPopShow=!1}},null)])]),t(f,{zIndex:2010,show:e.showPicker,"onUpdate:show":o=>e.showPicker=o,position:"bottom",round:!0,class:"popupBottomSearch"},{default:()=>[t(le,{optionHeight:46,areaList:e.areaList,modelValue:e.areaPopupIndex,"onUpdate:modelValue":o=>e.areaPopupIndex=o,onCancel:()=>{e.showPicker=!1},onConfirm:({selectedOptions:o})=>{var n;e.provinceCode=o[0].value,e.cityCode=o[1].value,e.districtCode=((n=o[2])==null?void 0:n.value)||null,e.areaPopupIndex=e.districtCode||e.cityCode||e.provinceCode,e.areaPopupIndex=e.areaPopupIndex?String(e.areaPopupIndex):null,e.areaName=o.map(s=>s==null?void 0:s.text).join(" "),e.showPicker=!1,e.schoolAreaId=null,e.schoolName="",e.gradeNumText="",e.currentGrade=null,e.currentClass=null,e.currentClassText="",c(),e.schoolStatus=!0}},null)]}),t(f,{zIndex:2001,show:e.schoolStatus,"onUpdate:show":o=>e.schoolStatus=o,position:"bottom",round:!0,safeAreaInsetBottom:!0,lazyRender:!1,class:"popupBottomSearch",onOpen:()=>{e.schoolPopupShow=!0},onClosed:()=>{e.schoolPopupShow=!1}},{default:()=>[e.schoolPopupShow&&t("div",null,[t(S,{class:"cityPopBox",showToolbar:!0,modelValue:e.schoolPopupIndex,"onUpdate:modelValue":o=>e.schoolPopupIndex=o,columns:e.schoolAreaList,loading:e.schoolLoading,columnsFieldNames:{text:"name",value:"id"},onCancel:()=>e.schoolStatus=!1,onConfirm:o=>{const n=o.selectedOptions[0];e.schoolAreaId=n.id||null,e.schoolPopupIndex=e.schoolAreaId?[e.schoolAreaId]:[],e.schoolName=n.name,e.schoolStatus=!1,e.currentGrade=null,e.currentClass=null}},{"columns-top":t("div",{class:u.columnsTop},[t(ue,{placeholder:"请输入学校名称",onSearch:o=>{c(o)},onSearchUpdate:o=>{c(o)}},null)]),option:(o,n)=>t("div",{class:u.columnsContent,innerHTML:G(o.name),key:n},null)})])]}),t(f,{show:e.gradeStatus,"onUpdate:show":o=>e.gradeStatus=o,position:"bottom",round:!0,safeAreaInsetBottom:!0,lazyRender:!1,class:"popupBottomSearch",onOpen:()=>{e.gradePopupShow=!0},onClosed:()=>{e.gradePopupShow=!1}},{default:()=>[e.gradePopupShow&&t(S,{showToolbar:!0,modelValue:e.gradeOptionIndex,"onUpdate:modelValue":o=>e.gradeOptionIndex=o,columns:e.gradeOptions,onCancel:()=>e.gradeStatus=!1,onConfirm:o=>{console.log("选择1111",o),e.currentGrade=o.selectedOptions[0].text,e.gradeOptionIndex=[o.selectedOptions[0].value],e.gradeStatus=!1}},null)]}),t(f,{show:e.classStatus,"onUpdate:show":o=>e.classStatus=o,position:"bottom",round:!0,safeAreaInsetBottom:!0,lazyRender:!1,class:"popupBottomSearch",onOpen:()=>{e.gradePopupShow=!0},onClosed:()=>{e.gradePopupShow=!1}},{default:()=>[e.gradePopupShow&&t(S,{showToolbar:!0,modelValue:e.classOptionIndex,"onUpdate:modelValue":o=>e.classOptionIndex=o,columns:e.classOptions,onCancel:()=>e.classStatus=!1,onConfirm:o=>{console.log("选择1111",o),e.currentClass=o.selectedOptions[0].text,e.classOptionIndex=[o.selectedOptions[0].value],e.classStatus=!1}},null)]})])}});export{$e as default};
|