index.b4f24fdd.js 5.5 KB

1
  1. import{d as T,ag as k,$ as F,c as t,q as r,ai as m,o as l,B as g,P as y,a_ as C,R as d,aj as w,m as I,g as v}from"./index.332c7f08.js";import{O as A}from"./index.d7c1b6ac.js";import{f as e,w as D,a as f}from"./create.c8105ce9.js";import{C as B}from"./index.324108a5.js";import{C as E}from"./index.91135ff9.js";import{C as b}from"./index.4b720f43.js";import{T as i}from"./index.98482791.js";import{C as p}from"./index.2e331ab5.js";import{F as S}from"./index.1ed6273e.js";import{R as L,a as h}from"./index.a4155be3.js";import{P as N}from"./index.656e257f.js";import{D as x}from"./index.1361b221.js";import"./Checker.1af5496e.js";import"./Picker.e56f94bd.js";import"./index.7c580591.js";import"./use-tab-status.9d769af8.js";import"./index.1e2dfe6e.js";import"./index.4aa8e076.js";import"./utils.4b86e8c9.js";const V="_tips_172qd_1",G="_icon_172qd_11",H="_informationBottom_172qd_15",M="_cellGroup_172qd_18",R="_classType_172qd_23",U="_radioSection_172qd_37",P="_radioItem_172qd_42";var o={tips:V,icon:G,informationBottom:H,cellGroup:M,classType:R,radioSection:U,radioItem:P},q=T({name:"practice",props:{address:{type:String,default:""}},setup(c){const n=k(),u=()=>{if(e.classList.length>0){e.status=!0;return}if(e.classType.length<=0){l("\u8BF7\u9009\u62E9\u8BFE\u7A0B\u7C7B\u578B");return}if(!e.trainStartDate){l("\u8BF7\u9009\u62E9\u8BFE\u7A0B\u5F00\u59CB\u65E5\u671F");return}if(!e.week){l("\u8BF7\u9009\u62E9\u5468\u6B21");return}if(!c.address){l("\u60A8\u6240\u5728\u7684\u5B66\u6821\u6682\u672A\u8BBE\u7F6E\u5730\u5740");return}const a=[];e.classType.forEach(s=>{a.push({classType:s,startTime:null,endTime:null,trainTimer:null,times:null,classIdList:[]})}),e.classPracticeList=a,n.push("/practice-detail")};return F(()=>{}),()=>t("div",{class:o.practice,style:{minHeight:"calc(100vh - var(--header-height) - var(--van-tabs-line-height))",overflow:"hidden"}},[t(B,{inset:!0,class:o.cellGroup},{default:()=>[t(E,{title:"\u8BFE\u7A0B\u7C7B\u578B",titleClass:o.classType},{value:()=>t(b,{"checked-color":"#FF8057",modelValue:e.classType,"onUpdate:modelValue":a=>e.classType=a,direction:"horizontal"},{default:()=>[t(i,{size:"large",type:"primary",color:e.classType.includes("SINGLE")?"#FF8057":"#EAEAEA",textColor:e.classType.includes("SINGLE")?"#FFF":"#AAA",class:o.radioSection},{default:()=>[t(p,{class:o.radioItem,name:"SINGLE"},null),r("\u58F0\u90E8\u8BFE")]}),t(i,{size:"large",type:"primary",color:e.classType.includes("MUSIC_THEORY")?"#FF8057":"#EAEAEA",textColor:e.classType.includes("MUSIC_THEORY")?"#FFF":"#AAA",class:o.radioSection},{default:()=>[t(p,{class:o.radioItem,name:"MUSIC_THEORY"},null),r("\u4E50\u7406\u8BFE")]}),t(i,{size:"large",type:"primary",color:e.classType.includes("INSTRUMENTAL_ENSEMBLE")?"#FF8057":"#EAEAEA",textColor:e.classType.includes("INSTRUMENTAL_ENSEMBLE")?"#FFF":"#AAA",class:o.radioSection},{default:()=>[t(p,{class:o.radioItem,name:"INSTRUMENTAL_ENSEMBLE"},null),r("\u5408\u594F\u8BFE")]})]})}),t(S,{label:"\u8BFE\u7A0B\u5F00\u59CB\u65E5\u671F",inputAlign:"right",placeholder:"\u8BF7\u9009\u62E9\u8BFE\u7A0B\u5F00\u59CB\u65E5\u671F",readonly:!0,isLink:!0,modelValue:e.trainStartDate?m(e.trainStartDate).format("YYYY\u5E74MM\u6708DD\u65E5"):"",onClick:()=>e.calendarTimeStatus=!0},null),t(S,{label:"\u8BFE\u7A0B\u5468\u6B21",inputAlign:"right",placeholder:"\u8BF7\u9009\u62E9\u8BFE\u7A0B\u5468\u6B21",readonly:!0,modelValue:D(e.week),onClick:()=>{if(!e.trainStartDate){l("\u8BF7\u9009\u62E9\u8BFE\u7A0B\u5F00\u59CB\u65E5\u671F");return}}},null),t(E,{title:"\u8DF3\u8FC7\u8282\u5047\u65E5"},{value:()=>t(L,{"checked-color":"#FF8057",modelValue:e.skipHoliday,"onUpdate:modelValue":a=>e.skipHoliday=a,direction:"horizontal"},{default:()=>[t(i,{size:"large",type:"primary",color:e.skipHoliday!==1?"#EAEAEA":"#FF8057",textColor:e.skipHoliday!==1?"#AAA":"#FFF",class:o.radioSection,round:!0},{default:()=>[t(h,{class:o.radioItem,name:1},null),r("\u662F")]}),t(i,{size:"large",type:"primary",color:e.skipHoliday!==0?"#EAEAEA":"#FF8057",textColor:e.skipHoliday!==0?"#AAA":"#FFF",class:o.radioSection,round:!0},{default:()=>[t(h,{class:o.radioItem,name:0},null),r("\u5426")]})]})})]}),t(A,{position:"bottom",class:o.informationBottom},{default:()=>[t("div",{class:"btnGroup",style:{marginTop:"24px"}},[t(g,{type:"primary",block:!0,round:!0,onClick:u},{default:()=>[r("\u4E0B\u4E00\u6B65")]})])]}),t(y,{show:e.weekStatus,"onUpdate:show":a=>e.weekStatus=a,position:"bottom",round:!0,class:"popupBottomSearch",teleport:"body"},{default:()=>[t(N,{columns:f,onCancel:()=>e.weekStatus=!1,onConfirm:a=>{e.week=a.selectedValues[0],e.weekStatus=!1}},null)]}),t(y,{show:e.calendarTimeStatus,"onUpdate:show":a=>e.calendarTimeStatus=a,position:"bottom",round:!0,class:"popupBottomSearch",teleport:"body"},{default:()=>[t(x,{minDate:new Date,modelValue:e.classDate,"onUpdate:modelValue":a=>e.classDate=a,formatter:C,onCancel:()=>e.calendarTimeStatus=!1,onConfirm:a=>{e.calendarTimeStatus=!1,e.trainStartDate=a.selectedValues.join("-");const s=m(e.trainStartDate).day(),_=f[s===0?6:s-1];e.week=_.value}},null)]})])}});const z="_train_r2wxa_1";var Y={train:z},ue=T({name:"train-planning",setup(){const c=sessionStorage.getItem("trainType");d(c||"standard");const n=d(""),u=async()=>{try{const{data:s}=await I.get(`/api-school/school/detail/${v.user.data.school.id}`);n.value=s.address||""}catch{}},a=d(0);return F(()=>{u()}),()=>t("div",{class:Y.train},[t(A,{position:"top",onGetHeight:s=>{console.log(s,"height"),a.value=s,document.documentElement.style.setProperty("--header-height",s+"px")}},{default:()=>[t(w,{border:!1},null)]}),t(q,{address:n.value},null)])}});export{ue as default};