preview-index.1554ec09.js 9.5 KB

1
  1. import{d as A,ah as j,r as f,R as I,$ as w,_ as T,b3 as G,c as e,q as r,o as q,b6 as b,F as N,m as x}from"./index.332c7f08.js";import{h as R,s,a as D,b as L,i as M,c as Y,d as O,e as _,f as z}from"./icon-checkbox-active.56a5cf15.js";import{C as $}from"./index.2e331ab5.js";import{F as H}from"./index.f74c7b35.js";import{C as d}from"./index.324108a5.js";import{F as c}from"./index.1ed6273e.js";import{R as S,a as p}from"./index.a4155be3.js";import{T as g}from"./index.98482791.js";import{C as h}from"./index.91135ff9.js";import{I as C}from"./index.96a8db5e.js";import"./Checker.1af5496e.js";const P=[];for(let i=1;i<=40;i++)P.push({text:i+"\u73ED",value:i});var oe=A({name:"pre-goods-apply",setup(){const i=j(),t=f({code:"",detail:{},toolImgStatus:!1,currentGrade:[{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},{text:"\u516D\u5E74\u7EA7",value:6},{text:"\u4E03\u5E74\u7EA7",value:7},{text:"\u516B\u5E74\u7EA7",value:8},{text:"\u4E5D\u5E74\u7EA7",value:9}],classList:P,subjectList:[],instrumentsInspectionDescribe:"",inspectPopupStatus:!1,gradeStatus:!1,classStatus:!1,subjectStatus:!1,registerInfo:{},goodsInfo:{},textBookInfo:{},inspectInfo:{},vipYearInfo:{},inspectStatus:!0,testIsWeixin:!1,details:[],pattern:/^1(3|4|5|6|7|8|9)\d{9}$/,nameReg:/^[\u4E00-\u9FA5]+$/,paymentType:"",musicPaymentType:"",studentReadStatus:!1,dialogStatus:!1,dialogMessage:"",dialogOrchestraStatus:!1,dialogConfig:{},orderInfo:{needPrice:0,originalPrice:0},submitStatus:!1}),a=f({username:null,sex:null,currentGrade:null,currentGradeTxt:null,currentClass:"",currentClassTxt:null,registerSubjectId:"",registerSubjectTxt:null,parentName:null,groupBuyType:"",phone:null,learningTools:null,instrumentsBrand:null}),u=f({toolPlan:{title:"",groupTitle:"",groupDesc:"",selfTitle:"",selfDesc:""},leBao:{show:1,selected:1}}),B=l=>t.nameReg.test(l)&&l.length>=2&&l.length<=15,E=l=>l?t.nameReg.test(l)?l.length<2||l.length>15?"\u5B66\u5458\u59D3\u540D\u5FC5\u987B\u4E3A2~15\u4E2A\u5B57":"":"\u5B66\u5458\u59D3\u540D\u5FC5\u987B\u4E3A\u4E2D\u6587":"\u8BF7\u586B\u5199\u5B66\u5458\u771F\u5B9E\u59D3\u540D",U=async()=>{},v=I(""),k=I(i.query.orchestraName||""),y=l=>{if(l.data.api==="payment-notes"){const n=l.data.data?JSON.parse(l.data.data):{};console.log(n,"result"),v.value=n.notice,u.toolPlan=n.toolPlan,u.leBao=n.leBao}},F=async()=>{try{const n=(await x.post("/api-student/open/orchestraSubjectConfig/pageByOrchestraId",{data:{orchestraId:i.query.id,page:1,rows:100}})).data.rows||[];n.forEach(o=>{t.subjectList.push({text:o.name,value:o.subjectId})}),n.length>0&&(a.registerSubjectId=n[0].subjectId,a.registerSubjectTxt=n[0].name,V())}catch{}},V=async()=>{try{const{data:l}=await x.get("/api-student/open/orchestraRegister/registerGoods/"+i.query.id,{params:{subjectId:a.registerSubjectId}});t.musicPaymentType=l.paymentServiceProvider||"";const n=l.details||[];n.forEach(o=>{if(o.goodsType==="INSTRUMENTS"){const m=o.goodsUrl?o.goodsUrl.split(",")[0]:"";t.goodsInfo={...o,goodsUrl:m},t.instrumentsInspectionDescribe=o.instrumentsInspectionDescribe}else if(o.goodsType==="TEXTBOOK"){const m=o.goodsUrl?o.goodsUrl.split(",")[0]:"";t.textBookInfo={...o,goodsUrl:m}}else o.goodsType==="INSTRUMENT_INSPECT"?t.inspectInfo={...o}:o.goodsType==="VIP_YEAR"&&(t.vipYearInfo={...o});t.details=n})}catch{}};return w(async()=>{await F(),T(()=>{window.parent&&window.parent.postMessage({api:"onLoad",status:!0},"*")}),window.addEventListener("message",y)}),G(()=>{window.removeEventListener("message",y)}),()=>e("div",{class:s.goodsApply},[e("img",{src:R,class:s.headBg},null),e("div",{class:s.goodsHeader},[e("div",{class:s.orchestraTitle},[e("img",{class:s.headTitle,src:D},null),e("p",{class:[s.name,"van-multi-ellipsis--l3"]},[k.value])]),e("img",{src:L,class:s.headPhone},null)]),e(H,{validateFirst:!0,errorMessageAlign:"right",scrollToError:!0,onSubmit:U,onFailed:l=>{T(()=>{var o;(o=document.getElementsByClassName("van-field__error-message")[0])==null||o.scrollIntoView({block:"center",behavior:"smooth"})})},ref:"form",class:s.form},{default:()=>[e(d,{class:s.applyCellGroup,border:!1},{default:()=>[e("div",{class:[s.title,s.titleApply]},null),e(c,{required:!0,label:"\u5B66\u5458\u4FE1\u606F",placeholder:"\u8BF7\u586B\u5199\u5B66\u5458\u771F\u5B9E\u59D3\u540D",inputAlign:"right",modelValue:a.username,"onUpdate:modelValue":l=>a.username=l,maxlength:15,rules:[{validator:B,message:E}]},null),e(c,{required:!0,label:"\u6027\u522B",inputAlign:"right",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u6027\u522B"}]},{input:()=>e(S,{modelValue:a.sex,"onUpdate:modelValue":l=>a.sex=l},{default:()=>[e(g,{size:"large",type:"primary",class:[s.radioSection,a.sex===1?s.active:""]},{default:()=>[e(p,{class:s.radioItem,name:1},null),r("\u7537\u751F")]}),e(g,{size:"large",type:"primary",class:[s.radioSection,a.sex===0?s.active:""]},{default:()=>[e(p,{class:s.radioItem,name:0},null),r("\u5973\u751F")]})]})}),e(c,{required:!0,label:"\u5E74\u7EA7",inputAlign:"right",readonly:!0,isLink:!0,clickable:!1,placeholder:"\u8BF7\u9009\u62E9\u5E74\u7EA7",modelValue:a.currentGradeTxt,"onUpdate:modelValue":l=>a.currentGradeTxt=l,onClick:()=>t.gradeStatus=!0,rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u5E74\u7EA7"}]},null),e(c,{required:!0,label:"\u73ED\u7EA7",inputAlign:"right",readonly:!0,isLink:!0,clickable:!1,placeholder:"\u8BF7\u9009\u62E9\u73ED\u7EA7",modelValue:a.currentClassTxt,"onUpdate:modelValue":l=>a.currentClassTxt=l,onClick:()=>t.classStatus=!0,rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u73ED\u7EA7"}]},null),e(c,{required:!0,label:"\u9009\u62A5\u58F0\u90E8",inputAlign:"right",readonly:!0,isLink:!0,clickable:!1,placeholder:"\u8BF7\u9009\u62E9\u9009\u62A5\u58F0\u90E8",modelValue:a.registerSubjectTxt,"onUpdate:modelValue":l=>a.registerSubjectTxt=l,onClick:()=>{if(t.subjectList.length<=0){q("\u6682\u65E0\u62A5\u540D\u9009\u62A5\u58F0\u90E8");return}t.subjectStatus=!0},rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u9009\u62A5\u58F0\u90E8"}]},null)]}),e(d,{class:s.applyCellGroup,border:!1},{default:()=>[e("div",{class:[s.title,s.titleParent]},null),e(c,{required:!0,label:"\u5BB6\u957F\u59D3\u540D",inputAlign:"right",placeholder:"\u8BF7\u586B\u5199\u5BB6\u957F\u771F\u5B9E\u59D3\u540D",modelValue:a.parentName,"onUpdate:modelValue":l=>a.parentName=l,maxlength:15},null),e(c,{required:!0,label:"\u624B\u673A\u53F7",inputAlign:"right",placeholder:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7",modelValue:a.phone,"onUpdate:modelValue":l=>a.phone=l,maxlength:11,type:"tel"},null)]}),e(d,{class:s.applyCellGroup,border:!1},{default:()=>[e("div",{class:[s.title,s.titleTips]},null),e("div",{class:s.tipsContainer,innerHTML:v.value},null)]}),e(d,{class:s.applyCellGroup,border:!1},{default:()=>[e("div",{class:[s.title,s.titleTool]},null),e(c,{required:!0,label:u.toolPlan.title,labelAlign:"top",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u8BAD\u7EC3\u5DE5\u5177\u7684\u51C6\u5907\u65B9\u5F0F"}]},{input:()=>e(S,{modelValue:a.groupBuyType,"onUpdate:modelValue":l=>a.groupBuyType=l,class:s.toolRadioGroup},{default:()=>[e(g,{size:"large",type:"primary",class:[s.radioSectionTag,s.radioSection,a.groupBuyType==="GROUP_BUY"?s.active:""]},{default:()=>[e(p,{class:s.radioItem,name:"GROUP_BUY",disabled:!0,onClick:()=>{}},null),u.toolPlan.groupTitle,e("p",{class:s.radioTip},[u.toolPlan.groupDesc])]}),e(g,{size:"large",type:"primary",class:[s.radioSectionTag,s.radioSection,a.groupBuyType==="SELF"?s.active:""]},{default:()=>[e(p,{class:s.radioItem,name:"SELF",disabled:!0},null),u.toolPlan.selfTitle,e("p",{class:s.radioTip},[u.toolPlan.selfDesc])]})]})})]}),e(d,{class:[s.applyCellGroup,s.groupBuy],border:!1},{default:()=>[e("div",{class:[s.title,s.titleIntrumentTool]},null),e(h,{border:!1},{icon:()=>e(C,{src:t.vipYearInfo.goodsUrl,class:s.goodsImg},null),value:()=>e("div",{class:s.vipYearInfo},[e("div",{class:s.goodsTitle},[t.vipYearInfo.goodsName,r(" "),e("img",{src:M},null)]),e("p",{class:s.goodsTips},[r("\u4E50\u56E2\u9996\u6B21\u8BAD\u7EC3\u4E4B\u65E5\u8D77\u751F\u6548")]),e("p",{class:[s.goodsMemo,"van-multi-ellipsis--l2"]},[t.vipYearInfo.description]),e("div",{class:s.goodsPrice},[e("div",{class:s.priceGroup},[r("\u56E2\u8D2D\u4EF7:"),e("p",null,[e("span",null,[r("\xA5")]),r(" "),b(t.vipYearInfo.currentPrice)])])])])}),e(h,{border:!1},{icon:()=>e(C,{src:t.goodsInfo.goodsUrl,class:s.goodsImg},null),value:()=>e("div",{class:s.goodsInfo},[e("div",{class:s.goodsTitle},[t.goodsInfo.goodsName,t.goodsInfo.currentPrice<=0?e("img",{src:Y},null):""]),e("p",{class:[s.goodsMemo,"van-multi-ellipsis--l2"]},[t.goodsInfo.description]),e("div",{class:s.goodsPrice},[e("div",{class:s.priceGroup},[r("\u56E2\u8D2D\u4EF7:"),e("p",null,[t.goodsInfo.currentPrice<=0?e("del",null,[e("span",null,[r("\xA5")]),r(" "),b(t.goodsInfo.groupPrice)]):e(N,null,[e("span",null,[r("\xA5")]),r(" "),b(t.goodsInfo.currentPrice)])])])])])}),u.leBao.show?e(h,{class:s.inspectCell,style:{backgroundColor:t.inspectStatus?"#FFF3EA":"#f4f4f4"}},{icon:()=>e("img",{src:O,class:s.iconBao,onClick:()=>{t.instrumentsInspectionDescribe&&(t.inspectPopupStatus=!0)}},null),value:()=>e("div",{class:s.baoContainer},[e("div",{class:s.baoTitle,onClick:()=>{t.instrumentsInspectionDescribe&&(t.inspectPopupStatus=!0)}},[r("\u4E0B\u6821\u68C0\u67E5\u4E50\u5668 1-2\u6B21/\u5B66\u671F")]),e("div",{class:s.baoPrice},[e("p",null,[e("span",{class:s.prefix},[r("\xA5")]),r(" "),t.inspectInfo.currentPrice,e("span",{class:s.suffix},[r("/\u5E74")])]),e($,{modelValue:u.leBao.selected,"onUpdate:modelValue":l=>u.leBao.selected=l},{icon:l=>e("img",{class:s.checkboxImg,src:l.checked?_:z},null)})])])}):""]})]})])}});export{oe as default};