record-2de6c58f.js 28 KB

12345
  1. <<<<<<<< HEAD:dist/assets/record-2de6c58f.js
  2. import{c as K,d as L,bb as G,aB as we,e as R,a as o,bk as be,r as $,bl as Te,o as ke,a3 as ge,n as ne,a5 as oe,bm as Se,al as Q,m as de,t as F,b as Me,bn as ie,w as te,bo as xe,U as Be,aD as ae,bp as Ce,h as Re,N as fe,C as Ae,k as pe,as as Ye,ap as Pe,ad as H,q as Oe,x as me,y as Fe,W as Ee,V as he,Q as Ie,A as q,a8 as He,D as Ne}from"./index-ec1086fa.js";import{s as v}from"./index.module-2571c8dc.js";import{M as We}from"./index-ded61d08.js";import{M as _e}from"./index-5872f562.js";import{u as $e}from"./use-refs-d1b93d2a.js";import{g as Le}from"./utils-c1a8b5c1.js";import{L as Ve}from"./index-093fb0c6.js";import"./index-d91abb02.js";import"./index-c5383b3e.js";import"./index-1452dcc2.js";import"./index-e7aa4079.js";import"./Picker-df0a0c58.js";const[je,D,E]=K("calendar"),Ue=e=>E("monthTitle",e.getFullYear(),e.getMonth()+1);function re(e,n){const r=e.getFullYear(),d=n.getFullYear();if(r===d){const s=e.getMonth(),g=n.getMonth();return s===g?0:s>g?1:-1}return r>d?1:-1}function A(e,n){const r=re(e,n);if(r===0){const d=e.getDate(),s=n.getDate();return d===s?0:d>s?1:-1}return r}const J=e=>new Date(e),ve=e=>Array.isArray(e)?e.map(J):J(e);function ce(e,n){const r=J(e);return r.setDate(r.getDate()+n),r}const se=e=>ce(e,-1),ye=e=>ce(e,1),le=()=>{const e=new Date;return e.setHours(0,0,0,0),e};function ze(e){const n=e[0].getTime();return(e[1].getTime()-n)/(1e3*60*60*24)+1}const[qe]=K("calendar-day");var Ge=L({name:qe,props:{item:G(Object),color:String,index:Number,offset:we(0),rowHeight:String},emits:["click"],setup(e,{emit:n,slots:r}){const d=R(()=>{var i;const{item:m,index:T,color:B,offset:x,rowHeight:I}=e,Y={height:I};if(m.type==="placeholder")return Y.width="100%",Y;if(T===0&&(Y.marginLeft=`${100*x/7}%`),B)switch(m.type){case"end":case"start":case"start-end":case"multiple-middle":case"multiple-selected":Y.background=B;break;case"middle":Y.color=B;break}return x+(((i=m.date)==null?void 0:i.getDate())||1)>28&&(Y.marginBottom=0),Y}),s=()=>{e.item.type!=="disabled"&&n("click",e.item)},g=()=>{const{topInfo:i}=e.item;if(i||r["top-info"])return o("div",{class:D("top-info")},[r["top-info"]?r["top-info"](e.item):i])},h=()=>{const{bottomInfo:i}=e.item;if(i||r["bottom-info"])return o("div",{class:D("bottom-info")},[r["bottom-info"]?r["bottom-info"](e.item):i])},f=()=>{const{item:i,color:m,rowHeight:T}=e,{type:B,text:x}=i,I=[g(),x,h()];return B==="selected"?o("div",{class:D("selected-day"),style:{width:T,height:T,background:m}},[I]):I};return()=>{const{type:i,className:m}=e.item;return i==="placeholder"?o("div",{class:D("day"),style:d.value},null):o("div",{role:"gridcell",style:d.value,class:[D("day",i),m],tabindex:i==="disabled"?void 0:-1,onClick:s},[f()])}}});const[Qe]=K("calendar-month"),Je={date:G(Date),type:String,color:String,minDate:G(Date),maxDate:G(Date),showMark:Boolean,rowHeight:ne,formatter:Function,lazyRender:Boolean,currentDate:[Date,Array],allowSameDay:Boolean,showSubtitle:Boolean,showMonthTitle:Boolean,firstDayOfWeek:Number};var Ke=L({name:Qe,props:Je,emits:["click"],setup(e,{emit:n,slots:r}){const[d,s]=be(),g=$(),h=$(),f=Te(h),i=R(()=>Ue(e.date)),m=R(()=>ke(e.rowHeight)),T=R(()=>{const l=e.date.getDay();return e.firstDayOfWeek?(l+7-e.firstDayOfWeek)%7:l}),B=R(()=>Le(e.date.getFullYear(),e.date.getMonth()+1)),x=R(()=>d.value||!e.lazyRender),I=()=>i.value,Y=l=>{const w=k=>e.currentDate.some(y=>A(y,k)===0);if(w(l)){const k=se(l),y=ye(l),S=w(k),t=w(y);return S&&t?"multiple-middle":S?"end":t?"start":"multiple-selected"}return""},N=l=>{const[w,k]=e.currentDate;if(!w)return"";const y=A(l,w);if(!k)return y===0?"start":"";const S=A(l,k);return e.allowSameDay&&y===0&&S===0?"start-end":y===0?"start":S===0?"end":y>0&&S<0?"middle":""},V=l=>{const{type:w,minDate:k,maxDate:y,currentDate:S}=e;if(A(l,k)<0||A(l,y)>0)return"disabled";if(S===null)return"";if(Array.isArray(S)){if(w==="multiple")return Y(l);if(w==="range")return N(l)}else if(w==="single")return A(l,S)===0?"selected":"";return""},W=l=>{if(e.type==="range"){if(l==="start"||l==="end")return E(l);if(l==="start-end")return`${E("start")}/${E("end")}`}},j=()=>{if(e.showMonthTitle)return o("div",{class:D("month-title")},[r["month-title"]?r["month-title"]({date:e.date,text:i.value}):i.value])},U=()=>{if(e.showMark&&x.value)return o("div",{class:D("month-mark")},[e.date.getMonth()+1])},z=R(()=>{const l=Math.ceil((B.value+T.value)/7);return Array(l).fill({type:"placeholder"})}),_=R(()=>{const l=[],w=e.date.getFullYear(),k=e.date.getMonth();for(let y=1;y<=B.value;y++){const S=new Date(w,k,y),t=V(S);let a={date:S,type:t,text:y,bottomInfo:W(t)};e.formatter&&(a=e.formatter(a)),l.push(a)}return l}),p=R(()=>_.value.filter(l=>l.type==="disabled")),X=(l,w)=>{if(g.value){const k=oe(g.value),y=z.value.length,t=(Math.ceil((w.getDate()+T.value)/7)-1)*k.height/y;Se(l,k.top+t+l.scrollTop-oe(l).top)}},Z=(l,w)=>o(Ge,{item:l,index:w,color:e.color,offset:T.value,rowHeight:m.value,onClick:k=>n("click",k)},Q(r,["top-info","bottom-info"])),ee=()=>o("div",{ref:g,role:"grid",class:D("days")},[U(),(x.value?_:z).value.map(Z)]);return ge({getTitle:I,getHeight:()=>f.value,setVisible:s,scrollToDate:X,disabledDays:p}),()=>o("div",{class:D("month"),ref:h},[j(),ee()])}});const[Xe]=K("calendar-header");var Ze=L({name:Xe,props:{date:Date,title:String,subtitle:String,showTitle:Boolean,showSubtitle:Boolean,firstDayOfWeek:Number},emits:["clickSubtitle"],setup(e,{slots:n,emit:r}){const d=()=>{if(e.showTitle){const f=e.title||E("title"),i=n.title?n.title():f;return o("div",{class:D("header-title")},[i])}},s=f=>r("clickSubtitle",f),g=()=>{if(e.showSubtitle){const f=n.subtitle?n.subtitle({date:e.date,text:e.subtitle}):e.subtitle;return o("div",{class:D("header-subtitle"),onClick:s},[f])}},h=()=>{const{firstDayOfWeek:f}=e,i=E("weekdays"),m=[...i.slice(f,7),...i.slice(0,f)];return o("div",{class:D("weekdays")},[m.map(T=>o("span",{class:D("weekday")},[T]))])};return()=>o("div",{class:D("header")},[d(),g(),h()])}});const et={show:Boolean,type:de("single"),title:String,color:String,round:F,readonly:Boolean,poppable:F,maxRange:Me(null),position:de("bottom"),teleport:[String,Object],showMark:F,showTitle:F,formatter:Function,rowHeight:ne,confirmText:String,rangePrompt:String,lazyRender:F,showConfirm:F,defaultDate:[Date,Array],allowSameDay:Boolean,showSubtitle:F,closeOnPopstate:F,showRangePrompt:F,confirmDisabledText:String,closeOnClickOverlay:F,safeAreaInsetTop:Boolean,safeAreaInsetBottom:F,minDate:{type:Date,validator:ie,default:le},maxDate:{type:Date,validator:ie,default:()=>{const e=le();return new Date(e.getFullYear(),e.getMonth()+6,e.getDate())}},firstDayOfWeek:{type:ne,default:0,validator:e=>e>=0&&e<=6}};var tt=L({name:je,props:et,emits:["select","confirm","unselect","monthShow","overRange","update:show","clickSubtitle"],setup(e,{emit:n,slots:r}){const d=(t,a=e.minDate,c=e.maxDate)=>A(t,a)===-1?a:A(t,c)===1?c:t,s=(t=e.defaultDate)=>{const{type:a,minDate:c,maxDate:u,allowSameDay:C}=e;if(t===null)return t;const M=le();if(a==="range"){Array.isArray(t)||(t=[]);const P=d(t[0]||M,c,C?u:se(u)),b=d(t[1]||M,C?c:ye(c));return[P,b]}return a==="multiple"?Array.isArray(t)?t.map(P=>d(P)):[d(M)]:((!t||Array.isArray(t))&&(t=M),d(t))};let g;const h=$(),f=$({text:"",date:void 0}),i=$(s()),[m,T]=$e(),B=R(()=>e.firstDayOfWeek?+e.firstDayOfWeek%7:0),x=R(()=>{const t=[],a=new Date(e.minDate);a.setDate(1);do t.push(new Date(a)),a.setMonth(a.getMonth()+1);while(re(a,e.maxDate)!==1);return t}),I=R(()=>{if(i.value){if(e.type==="range")return!i.value[0]||!i.value[1];if(e.type==="multiple")return!i.value.length}return!i.value}),Y=()=>i.value,N=()=>{const t=Ce(h.value),a=t+g,c=x.value.map((b,O)=>m.value[O].getHeight()),u=c.reduce((b,O)=>b+O,0);if(a>u&&t>0)return;let C=0,M;const P=[-1,-1];for(let b=0;b<x.value.length;b++){const O=m.value[b];C<=a&&C+c[b]>=t&&(P[1]=b,M||(M=O,P[0]=b),m.value[b].showed||(m.value[b].showed=!0,n("monthShow",{date:O.date,title:O.getTitle()}))),C+=c[b]}x.value.forEach((b,O)=>{const ue=O>=P[0]-1&&O<=P[1]+1;m.value[O].setVisible(ue)}),M&&(f.value={text:M.getTitle(),date:M.date})},V=t=>{ae(()=>{x.value.some((a,c)=>re(a,t)===0?(h.value&&m.value[c].scrollToDate(h.value,t),!0):!1),N()})},W=()=>{if(!(e.poppable&&!e.show))if(i.value){const t=e.type==="single"?i.value:i.value[0];ie(t)&&V(t)}else ae(N)},j=()=>{e.poppable&&!e.show||(ae(()=>{g=Math.floor(oe(h).height)}),W())},U=(t=s())=>{i.value=t,W()},z=t=>{const{maxRange:a,rangePrompt:c,showRangePrompt:u}=e;return a&&ze(t)>+a?(u&&fe(c||E("rangePrompt",a)),n("overRange"),!1):!0},_=()=>{var t;return n("confirm",(t=i.value)!=null?t:ve(i.value))},p=(t,a)=>{const c=u=>{i.value=u,n("select",ve(u))};if(a&&e.type==="range"&&!z(t)){c([t[0],ce(t[0],+e.maxRange-1)]);return}c(t),a&&!e.showConfirm&&_()},X=(t,a,c)=>{var u;return(u=t.find(C=>A(a,C.date)===-1&&A(C.date,c)===-1))==null?void 0:u.date},Z=R(()=>m.value.reduce((t,a)=>{var c,u;return t.push(...(u=(c=a.disabledDays)==null?void 0:c.value)!=null?u:[]),t},[])),ee=t=>{if(e.readonly||!t.date)return;const{date:a}=t,{type:c}=e;if(c==="range"){if(!i.value){p([a]);return}const[u,C]=i.value;if(u&&!C){const M=A(a,u);if(M===1){const P=X(Z.value,u,a);if(P){const b=se(P);A(u,b)===-1?p([u,b]):p([a])}else p([u,a],!0)}else M===-1?p([a]):e.allowSameDay&&p([a,a],!0)}else p([a])}else if(c==="multiple"){if(!i.value){p([a]);return}const u=i.value,C=u.findIndex(M=>A(M,a)===0);if(C!==-1){const[M]=u.splice(C,1);n("unselect",J(M))}else e.maxRange&&u.length>=+e.maxRange?fe(e.rangePrompt||E("rangePrompt",e.maxRange)):p([...u,a])}else p(a,!0)},l=t=>n("update:show",t),w=(t,a)=>{const c=a!==0||!e.showSubtitle;return o(Ke,Re({ref:T(a),date:t,currentDate:i.value,showMonthTitle:c,firstDayOfWeek:B.value},Q(e,["type","color","minDate","maxDate","showMark","formatter","rowHeight","lazyRender","showSubtitle","allowSameDay"]),{onClick:ee}),Q(r,["top-info","bottom-info","month-title"]))},k=()=>{if(r.footer)return r.footer();if(e.showConfirm){const t=r["confirm-text"],a=I.value,c=a?e.confirmDisabledText:e.confirmText;return o(Ae,{round:!0,block:!0,type:"primary",color:e.color,class:D("confirm"),disabled:a,nativeType:"button",onClick:_},{default:()=>[t?t({disabled:a}):c||E("confirm")]})}},y=()=>o("div",{class:[D("footer"),{"van-safe-area-bottom":e.safeAreaInsetBottom}]},[k()]),S=()=>o("div",{class:D()},[o(Ze,{date:f.value.date,title:e.title,subtitle:f.value.text,showTitle:e.showTitle,showSubtitle:e.showSubtitle,firstDayOfWeek:B.value,onClickSubtitle:t=>n("clickSubtitle",t)},Q(r,["title","subtitle"])),o("div",{ref:h,class:D("body"),onScroll:N},[x.value.map(w)]),y()]);return te(()=>e.show,j),te(()=>[e.type,e.minDate,e.maxDate],()=>U(s(i.value))),te(()=>e.defaultDate,(t=null)=>{i.value=t,W()}),ge({reset:U,scrollToDate:V,getSelectedDate:Y}),xe(j),()=>e.poppable?o(Be,{show:e.show,class:D("popup"),round:e.round,position:e.position,closeable:e.showTitle||e.showSubtitle,teleport:e.teleport,closeOnPopstate:e.closeOnPopstate,safeAreaInsetTop:e.safeAreaInsetTop,closeOnClickOverlay:e.closeOnClickOverlay,"onUpdate:show":l},{default:S}):S()}});const at=pe(tt);var De={exports:{}};(function(e,n){(function(r,d){e.exports=d()})(Ye,function(){return function(r,d,s){d.prototype.isBetween=function(g,h,f,i){var m=s(g),T=s(h),B=(i=i||"()")[0]==="(",x=i[1]===")";return(B?this.isAfter(m,f):!this.isBefore(m,f))&&(x?this.isBefore(T,f):!this.isAfter(T,f))||(B?this.isBefore(m,f):!this.isAfter(m,f))&&(x?this.isAfter(T,f):!this.isBefore(T,f))}}})})(De);var nt=De.exports;const ot=Pe(nt),it=""+new URL("record-item-bg-b36445ed.png",import.meta.url).href;H.extend(ot);const rt={DAY:"天",MONTH:"个月",YEAR:"年"},wt=L({name:"activationCode",setup(){const e=Oe(),n=me({showPopoverTime:!1,background:"transparent",loading:!1,finished:!1,list:[]}),r=me({page:1,rows:20,status:"ACTIVATED",code:null,activateStartTime:H().subtract(1,"months").format("YYYY-MM-DD"),activateEndTime:H().format("YYYY-MM-DD")}),d=async()=>{var s;n.loading=!0;try{const g={...r};r.activateEndTime&&r.activateStartTime&&(g.activateEndTime=r.activateEndTime+" 23:59:59",g.activateStartTime=r.activateStartTime+" 00:00:00");const h=await Ne.post("/edu-app/activationCodeRecord/page",{data:g});h.code===200&&Array.isArray((s=h==null?void 0:h.data)==null?void 0:s.rows)?(n.list=[...n.list,...h.data.rows],n.finished=!h.data.next,r.page=h.data.current+1):n.finished=!0}catch(g){n.finished=!0}n.loading=!1};return Fe(()=>{d()}),()=>o("div",{class:[v.hotMusicMore,he().isTablet?v.hotMusicMoreTablet:""]},[o(We,{position:"top"},{default:()=>[o(Ee,{border:!1,background:"transparent"},{content:()=>o("div",{class:v.woringHeader},[o("div",null,[o("i",{onClick:()=>{he().isApp?Ie({api:"goBack"}):e.back()},class:["van-badge__wrapper van-icon van-icon-arrow-left van-nav-bar__arrow",v.leftArrow]},null),o("span",{class:v.title2},[o("i",null,null)])])])}),o("div",{class:[v.activationContainer,v.recordContainer]},[o("i",{class:v.iconBrid},null),o("div",{class:v.section},[o(_e,{inputBackground:"white",shape:"round",placeholder:"请输入激活码",onSearch:s=>{r.code=s,r.page=1,n.list=[],n.finished=!1,d()}},null),o("div",{class:v.prodSection},[o("div",{class:v.title},[q("周期选择")]),o("div",{class:[v.times,n.showPopoverTime?v.active:""],onClick:()=>{n.showPopoverTime=!0}},[H(r.activateStartTime).format("YYYY-MM-DD"),q("至"),r.activateEndTime])])])])]}),o("div",{class:v.sectionList},[o(Ve,{loading:n.loading,finished:n.finished,finishedText:" ",onLoad:d,immediateCheck:!1},{default:()=>[n.list.length>0&&n.list.map(s=>o("div",{class:v.sectionItem},[o("div",{class:v.itemTop},[o("div",{class:v.itemTitle},[o("img",{src:it,class:v.recordItemBg},null),o("div",{class:v.text},[q("乐器AI学练工具"),s.times>=99&&s.type==="YEAR"?"永久":s.times+rt[s.type]])]),o("div",{class:v.itemCode},[s.code])]),o("div",{class:v.itemTime},[q("生效时间:"),o("span",null,[s.efficientTime])])]))]}),!n.loading&&n.list.length===0&&o("div",{style:{height:"100%"}},[o(He,{description:"暂无激活记录~"},null)])]),o(at,{show:n.showPopoverTime,"onUpdate:show":s=>n.showPopoverTime=s,firstDayOfWeek:1,safeAreaInsetBottom:!0,type:"range",title:"周期选择",minDate:new Date("2023-02-27"),defaultDate:[H(r.activateStartTime).toDate(),H(r.activateEndTime).toDate()],style:{height:"70%"},onConfirm:s=>{r.activateStartTime=H(s[0]).format("YYYY-MM-DD"),r.activateEndTime=H(s[1]).format("YYYY-MM-DD"),n.showPopoverTime=!1,r.page=1,n.list=[],n.finished=!1,d()}},null)])}});export{wt as default};
  3. ========
  4. import{c as K,d as L,bb as G,aB as we,e as R,a as o,bk as be,r as $,bl as Te,o as ke,a3 as ge,n as ne,a5 as oe,bm as Se,al as Q,m as de,t as F,b as Me,bn as ie,w as te,bo as xe,U as Be,aD as ae,bp as Ce,h as Re,N as fe,C as Ae,k as pe,as as Ye,ap as Pe,ad as H,q as Oe,x as me,y as Fe,W as Ee,V as he,Q as Ie,A as q,a8 as He,D as Ne}from"./index-010a77d0.js";import{s as v}from"./index.module-2571c8dc.js";import{M as We}from"./index-bfe5a329.js";import{M as _e}from"./index-05ae48b7.js";import{u as $e}from"./use-refs-0d3d47c2.js";import{g as Le}from"./utils-194c4a83.js";import{L as Ve}from"./index-ed76276f.js";import"./index-6f99626a.js";import"./index-6635b977.js";import"./index-2a71d1e6.js";import"./index-3b95ca36.js";import"./Picker-1e6edbf9.js";const[je,D,E]=K("calendar"),Ue=e=>E("monthTitle",e.getFullYear(),e.getMonth()+1);function re(e,n){const r=e.getFullYear(),d=n.getFullYear();if(r===d){const s=e.getMonth(),g=n.getMonth();return s===g?0:s>g?1:-1}return r>d?1:-1}function A(e,n){const r=re(e,n);if(r===0){const d=e.getDate(),s=n.getDate();return d===s?0:d>s?1:-1}return r}const J=e=>new Date(e),ve=e=>Array.isArray(e)?e.map(J):J(e);function ce(e,n){const r=J(e);return r.setDate(r.getDate()+n),r}const se=e=>ce(e,-1),ye=e=>ce(e,1),le=()=>{const e=new Date;return e.setHours(0,0,0,0),e};function ze(e){const n=e[0].getTime();return(e[1].getTime()-n)/(1e3*60*60*24)+1}const[qe]=K("calendar-day");var Ge=L({name:qe,props:{item:G(Object),color:String,index:Number,offset:we(0),rowHeight:String},emits:["click"],setup(e,{emit:n,slots:r}){const d=R(()=>{var i;const{item:m,index:T,color:B,offset:x,rowHeight:I}=e,Y={height:I};if(m.type==="placeholder")return Y.width="100%",Y;if(T===0&&(Y.marginLeft=`${100*x/7}%`),B)switch(m.type){case"end":case"start":case"start-end":case"multiple-middle":case"multiple-selected":Y.background=B;break;case"middle":Y.color=B;break}return x+(((i=m.date)==null?void 0:i.getDate())||1)>28&&(Y.marginBottom=0),Y}),s=()=>{e.item.type!=="disabled"&&n("click",e.item)},g=()=>{const{topInfo:i}=e.item;if(i||r["top-info"])return o("div",{class:D("top-info")},[r["top-info"]?r["top-info"](e.item):i])},h=()=>{const{bottomInfo:i}=e.item;if(i||r["bottom-info"])return o("div",{class:D("bottom-info")},[r["bottom-info"]?r["bottom-info"](e.item):i])},f=()=>{const{item:i,color:m,rowHeight:T}=e,{type:B,text:x}=i,I=[g(),x,h()];return B==="selected"?o("div",{class:D("selected-day"),style:{width:T,height:T,background:m}},[I]):I};return()=>{const{type:i,className:m}=e.item;return i==="placeholder"?o("div",{class:D("day"),style:d.value},null):o("div",{role:"gridcell",style:d.value,class:[D("day",i),m],tabindex:i==="disabled"?void 0:-1,onClick:s},[f()])}}});const[Qe]=K("calendar-month"),Je={date:G(Date),type:String,color:String,minDate:G(Date),maxDate:G(Date),showMark:Boolean,rowHeight:ne,formatter:Function,lazyRender:Boolean,currentDate:[Date,Array],allowSameDay:Boolean,showSubtitle:Boolean,showMonthTitle:Boolean,firstDayOfWeek:Number};var Ke=L({name:Qe,props:Je,emits:["click"],setup(e,{emit:n,slots:r}){const[d,s]=be(),g=$(),h=$(),f=Te(h),i=R(()=>Ue(e.date)),m=R(()=>ke(e.rowHeight)),T=R(()=>{const l=e.date.getDay();return e.firstDayOfWeek?(l+7-e.firstDayOfWeek)%7:l}),B=R(()=>Le(e.date.getFullYear(),e.date.getMonth()+1)),x=R(()=>d.value||!e.lazyRender),I=()=>i.value,Y=l=>{const w=k=>e.currentDate.some(y=>A(y,k)===0);if(w(l)){const k=se(l),y=ye(l),S=w(k),t=w(y);return S&&t?"multiple-middle":S?"end":t?"start":"multiple-selected"}return""},N=l=>{const[w,k]=e.currentDate;if(!w)return"";const y=A(l,w);if(!k)return y===0?"start":"";const S=A(l,k);return e.allowSameDay&&y===0&&S===0?"start-end":y===0?"start":S===0?"end":y>0&&S<0?"middle":""},V=l=>{const{type:w,minDate:k,maxDate:y,currentDate:S}=e;if(A(l,k)<0||A(l,y)>0)return"disabled";if(S===null)return"";if(Array.isArray(S)){if(w==="multiple")return Y(l);if(w==="range")return N(l)}else if(w==="single")return A(l,S)===0?"selected":"";return""},W=l=>{if(e.type==="range"){if(l==="start"||l==="end")return E(l);if(l==="start-end")return`${E("start")}/${E("end")}`}},j=()=>{if(e.showMonthTitle)return o("div",{class:D("month-title")},[r["month-title"]?r["month-title"]({date:e.date,text:i.value}):i.value])},U=()=>{if(e.showMark&&x.value)return o("div",{class:D("month-mark")},[e.date.getMonth()+1])},z=R(()=>{const l=Math.ceil((B.value+T.value)/7);return Array(l).fill({type:"placeholder"})}),_=R(()=>{const l=[],w=e.date.getFullYear(),k=e.date.getMonth();for(let y=1;y<=B.value;y++){const S=new Date(w,k,y),t=V(S);let a={date:S,type:t,text:y,bottomInfo:W(t)};e.formatter&&(a=e.formatter(a)),l.push(a)}return l}),p=R(()=>_.value.filter(l=>l.type==="disabled")),X=(l,w)=>{if(g.value){const k=oe(g.value),y=z.value.length,t=(Math.ceil((w.getDate()+T.value)/7)-1)*k.height/y;Se(l,k.top+t+l.scrollTop-oe(l).top)}},Z=(l,w)=>o(Ge,{item:l,index:w,color:e.color,offset:T.value,rowHeight:m.value,onClick:k=>n("click",k)},Q(r,["top-info","bottom-info"])),ee=()=>o("div",{ref:g,role:"grid",class:D("days")},[U(),(x.value?_:z).value.map(Z)]);return ge({getTitle:I,getHeight:()=>f.value,setVisible:s,scrollToDate:X,disabledDays:p}),()=>o("div",{class:D("month"),ref:h},[j(),ee()])}});const[Xe]=K("calendar-header");var Ze=L({name:Xe,props:{date:Date,title:String,subtitle:String,showTitle:Boolean,showSubtitle:Boolean,firstDayOfWeek:Number},emits:["clickSubtitle"],setup(e,{slots:n,emit:r}){const d=()=>{if(e.showTitle){const f=e.title||E("title"),i=n.title?n.title():f;return o("div",{class:D("header-title")},[i])}},s=f=>r("clickSubtitle",f),g=()=>{if(e.showSubtitle){const f=n.subtitle?n.subtitle({date:e.date,text:e.subtitle}):e.subtitle;return o("div",{class:D("header-subtitle"),onClick:s},[f])}},h=()=>{const{firstDayOfWeek:f}=e,i=E("weekdays"),m=[...i.slice(f,7),...i.slice(0,f)];return o("div",{class:D("weekdays")},[m.map(T=>o("span",{class:D("weekday")},[T]))])};return()=>o("div",{class:D("header")},[d(),g(),h()])}});const et={show:Boolean,type:de("single"),title:String,color:String,round:F,readonly:Boolean,poppable:F,maxRange:Me(null),position:de("bottom"),teleport:[String,Object],showMark:F,showTitle:F,formatter:Function,rowHeight:ne,confirmText:String,rangePrompt:String,lazyRender:F,showConfirm:F,defaultDate:[Date,Array],allowSameDay:Boolean,showSubtitle:F,closeOnPopstate:F,showRangePrompt:F,confirmDisabledText:String,closeOnClickOverlay:F,safeAreaInsetTop:Boolean,safeAreaInsetBottom:F,minDate:{type:Date,validator:ie,default:le},maxDate:{type:Date,validator:ie,default:()=>{const e=le();return new Date(e.getFullYear(),e.getMonth()+6,e.getDate())}},firstDayOfWeek:{type:ne,default:0,validator:e=>e>=0&&e<=6}};var tt=L({name:je,props:et,emits:["select","confirm","unselect","monthShow","overRange","update:show","clickSubtitle"],setup(e,{emit:n,slots:r}){const d=(t,a=e.minDate,c=e.maxDate)=>A(t,a)===-1?a:A(t,c)===1?c:t,s=(t=e.defaultDate)=>{const{type:a,minDate:c,maxDate:u,allowSameDay:C}=e;if(t===null)return t;const M=le();if(a==="range"){Array.isArray(t)||(t=[]);const P=d(t[0]||M,c,C?u:se(u)),b=d(t[1]||M,C?c:ye(c));return[P,b]}return a==="multiple"?Array.isArray(t)?t.map(P=>d(P)):[d(M)]:((!t||Array.isArray(t))&&(t=M),d(t))};let g;const h=$(),f=$({text:"",date:void 0}),i=$(s()),[m,T]=$e(),B=R(()=>e.firstDayOfWeek?+e.firstDayOfWeek%7:0),x=R(()=>{const t=[],a=new Date(e.minDate);a.setDate(1);do t.push(new Date(a)),a.setMonth(a.getMonth()+1);while(re(a,e.maxDate)!==1);return t}),I=R(()=>{if(i.value){if(e.type==="range")return!i.value[0]||!i.value[1];if(e.type==="multiple")return!i.value.length}return!i.value}),Y=()=>i.value,N=()=>{const t=Ce(h.value),a=t+g,c=x.value.map((b,O)=>m.value[O].getHeight()),u=c.reduce((b,O)=>b+O,0);if(a>u&&t>0)return;let C=0,M;const P=[-1,-1];for(let b=0;b<x.value.length;b++){const O=m.value[b];C<=a&&C+c[b]>=t&&(P[1]=b,M||(M=O,P[0]=b),m.value[b].showed||(m.value[b].showed=!0,n("monthShow",{date:O.date,title:O.getTitle()}))),C+=c[b]}x.value.forEach((b,O)=>{const ue=O>=P[0]-1&&O<=P[1]+1;m.value[O].setVisible(ue)}),M&&(f.value={text:M.getTitle(),date:M.date})},V=t=>{ae(()=>{x.value.some((a,c)=>re(a,t)===0?(h.value&&m.value[c].scrollToDate(h.value,t),!0):!1),N()})},W=()=>{if(!(e.poppable&&!e.show))if(i.value){const t=e.type==="single"?i.value:i.value[0];ie(t)&&V(t)}else ae(N)},j=()=>{e.poppable&&!e.show||(ae(()=>{g=Math.floor(oe(h).height)}),W())},U=(t=s())=>{i.value=t,W()},z=t=>{const{maxRange:a,rangePrompt:c,showRangePrompt:u}=e;return a&&ze(t)>+a?(u&&fe(c||E("rangePrompt",a)),n("overRange"),!1):!0},_=()=>{var t;return n("confirm",(t=i.value)!=null?t:ve(i.value))},p=(t,a)=>{const c=u=>{i.value=u,n("select",ve(u))};if(a&&e.type==="range"&&!z(t)){c([t[0],ce(t[0],+e.maxRange-1)]);return}c(t),a&&!e.showConfirm&&_()},X=(t,a,c)=>{var u;return(u=t.find(C=>A(a,C.date)===-1&&A(C.date,c)===-1))==null?void 0:u.date},Z=R(()=>m.value.reduce((t,a)=>{var c,u;return t.push(...(u=(c=a.disabledDays)==null?void 0:c.value)!=null?u:[]),t},[])),ee=t=>{if(e.readonly||!t.date)return;const{date:a}=t,{type:c}=e;if(c==="range"){if(!i.value){p([a]);return}const[u,C]=i.value;if(u&&!C){const M=A(a,u);if(M===1){const P=X(Z.value,u,a);if(P){const b=se(P);A(u,b)===-1?p([u,b]):p([a])}else p([u,a],!0)}else M===-1?p([a]):e.allowSameDay&&p([a,a],!0)}else p([a])}else if(c==="multiple"){if(!i.value){p([a]);return}const u=i.value,C=u.findIndex(M=>A(M,a)===0);if(C!==-1){const[M]=u.splice(C,1);n("unselect",J(M))}else e.maxRange&&u.length>=+e.maxRange?fe(e.rangePrompt||E("rangePrompt",e.maxRange)):p([...u,a])}else p(a,!0)},l=t=>n("update:show",t),w=(t,a)=>{const c=a!==0||!e.showSubtitle;return o(Ke,Re({ref:T(a),date:t,currentDate:i.value,showMonthTitle:c,firstDayOfWeek:B.value},Q(e,["type","color","minDate","maxDate","showMark","formatter","rowHeight","lazyRender","showSubtitle","allowSameDay"]),{onClick:ee}),Q(r,["top-info","bottom-info","month-title"]))},k=()=>{if(r.footer)return r.footer();if(e.showConfirm){const t=r["confirm-text"],a=I.value,c=a?e.confirmDisabledText:e.confirmText;return o(Ae,{round:!0,block:!0,type:"primary",color:e.color,class:D("confirm"),disabled:a,nativeType:"button",onClick:_},{default:()=>[t?t({disabled:a}):c||E("confirm")]})}},y=()=>o("div",{class:[D("footer"),{"van-safe-area-bottom":e.safeAreaInsetBottom}]},[k()]),S=()=>o("div",{class:D()},[o(Ze,{date:f.value.date,title:e.title,subtitle:f.value.text,showTitle:e.showTitle,showSubtitle:e.showSubtitle,firstDayOfWeek:B.value,onClickSubtitle:t=>n("clickSubtitle",t)},Q(r,["title","subtitle"])),o("div",{ref:h,class:D("body"),onScroll:N},[x.value.map(w)]),y()]);return te(()=>e.show,j),te(()=>[e.type,e.minDate,e.maxDate],()=>U(s(i.value))),te(()=>e.defaultDate,(t=null)=>{i.value=t,W()}),ge({reset:U,scrollToDate:V,getSelectedDate:Y}),xe(j),()=>e.poppable?o(Be,{show:e.show,class:D("popup"),round:e.round,position:e.position,closeable:e.showTitle||e.showSubtitle,teleport:e.teleport,closeOnPopstate:e.closeOnPopstate,safeAreaInsetTop:e.safeAreaInsetTop,closeOnClickOverlay:e.closeOnClickOverlay,"onUpdate:show":l},{default:S}):S()}});const at=pe(tt);var De={exports:{}};(function(e,n){(function(r,d){e.exports=d()})(Ye,function(){return function(r,d,s){d.prototype.isBetween=function(g,h,f,i){var m=s(g),T=s(h),B=(i=i||"()")[0]==="(",x=i[1]===")";return(B?this.isAfter(m,f):!this.isBefore(m,f))&&(x?this.isBefore(T,f):!this.isAfter(T,f))||(B?this.isBefore(m,f):!this.isAfter(m,f))&&(x?this.isAfter(T,f):!this.isBefore(T,f))}}})})(De);var nt=De.exports;const ot=Pe(nt),it=""+new URL("record-item-bg-b36445ed.png",import.meta.url).href;H.extend(ot);const rt={DAY:"天",MONTH:"个月",YEAR:"年"},wt=L({name:"activationCode",setup(){const e=Oe(),n=me({showPopoverTime:!1,background:"transparent",loading:!1,finished:!1,list:[]}),r=me({page:1,rows:20,status:"ACTIVATED",code:null,activateStartTime:H().subtract(1,"months").format("YYYY-MM-DD"),activateEndTime:H().format("YYYY-MM-DD")}),d=async()=>{var s;n.loading=!0;try{const g={...r};r.activateEndTime&&r.activateStartTime&&(g.activateEndTime=r.activateEndTime+" 23:59:59",g.activateStartTime=r.activateStartTime+" 00:00:00");const h=await Ne.post("/edu-app/activationCodeRecord/page",{data:g});h.code===200&&Array.isArray((s=h==null?void 0:h.data)==null?void 0:s.rows)?(n.list=[...n.list,...h.data.rows],n.finished=!h.data.next,r.page=h.data.current+1):n.finished=!0}catch(g){n.finished=!0}n.loading=!1};return Fe(()=>{d()}),()=>o("div",{class:[v.hotMusicMore,he().isTablet?v.hotMusicMoreTablet:""]},[o(We,{position:"top"},{default:()=>[o(Ee,{border:!1,background:"transparent"},{content:()=>o("div",{class:v.woringHeader},[o("div",null,[o("i",{onClick:()=>{he().isApp?Ie({api:"goBack"}):e.back()},class:["van-badge__wrapper van-icon van-icon-arrow-left van-nav-bar__arrow",v.leftArrow]},null),o("span",{class:v.title2},[o("i",null,null)])])])}),o("div",{class:[v.activationContainer,v.recordContainer]},[o("i",{class:v.iconBrid},null),o("div",{class:v.section},[o(_e,{inputBackground:"white",shape:"round",placeholder:"请输入激活码",onSearch:s=>{r.code=s,r.page=1,n.list=[],n.finished=!1,d()}},null),o("div",{class:v.prodSection},[o("div",{class:v.title},[q("周期选择")]),o("div",{class:[v.times,n.showPopoverTime?v.active:""],onClick:()=>{n.showPopoverTime=!0}},[H(r.activateStartTime).format("YYYY-MM-DD"),q("至"),r.activateEndTime])])])])]}),o("div",{class:v.sectionList},[o(Ve,{loading:n.loading,finished:n.finished,finishedText:" ",onLoad:d,immediateCheck:!1},{default:()=>[n.list.length>0&&n.list.map(s=>o("div",{class:v.sectionItem},[o("div",{class:v.itemTop},[o("div",{class:v.itemTitle},[o("img",{src:it,class:v.recordItemBg},null),o("div",{class:v.text},[q("乐器AI学练工具"),s.times>=99&&s.type==="YEAR"?"永久":s.times+rt[s.type]])]),o("div",{class:v.itemCode},[s.code])]),o("div",{class:v.itemTime},[q("生效时间:"),o("span",null,[s.efficientTime])])]))]}),!n.loading&&n.list.length===0&&o("div",{style:{height:"100%"}},[o(He,{description:"暂无激活记录~"},null)])]),o(at,{show:n.showPopoverTime,"onUpdate:show":s=>n.showPopoverTime=s,firstDayOfWeek:1,safeAreaInsetBottom:!0,type:"range",title:"周期选择",minDate:new Date("2023-02-27"),defaultDate:[H(r.activateStartTime).toDate(),H(r.activateEndTime).toDate()],style:{height:"70%"},onConfirm:s=>{r.activateStartTime=H(s[0]).format("YYYY-MM-DD"),r.activateEndTime=H(s[1]).format("YYYY-MM-DD"),n.showPopoverTime=!1,r.page=1,n.list=[],n.finished=!1,d()}},null)])}});export{wt as default};
  5. >>>>>>>> iteration-20250327-light:dist/assets/record-fd5b55b4.js