| 12345 |
- <<<<<<<< HEAD:dist/assets/record-28b00103.js
- import{c as K,d as L,b7 as G,ax as we,e as C,a as o,bg as be,r as $,bh as Te,o as ke,a2 as ge,n as ne,a4 as oe,bi as Se,ak as Q,m as de,t as E,b as Me,bj as ie,w as te,bk as xe,U as Be,az as ae,bl as Ae,h as Ce,N as fe,C as Re,k as pe,ar as Pe,ao as Ye,ac as H,q as Oe,x as me,y as Ee,W as Fe,V as he,Q as Ie,A as q,a7 as He,D as Ne}from"./index-e7e536ee.js";import{s as v}from"./index.module-e950f874.js";import{M as We}from"./index-3a706a8a.js";import{M as _e}from"./index-3a68cb10.js";import{u as $e}from"./use-refs-ba807064.js";import{g as Le}from"./utils-e7cba632.js";import{L as je}from"./index-8be66847.js";import"./index-73de6e9d.js";import"./index-4dc10a68.js";import"./index-1df8dec2.js";import"./Picker-f500bc0b.js";import"./use-tab-status-199d8c01.js";const[Ve,D,F]=K("calendar"),ze=e=>F("monthTitle",e.getFullYear(),e.getMonth()+1);function re(e,n){const r=e.getFullYear(),d=n.getFullYear();if(r===d){const l=e.getMonth(),g=n.getMonth();return l===g?0:l>g?1:-1}return r>d?1:-1}function R(e,n){const r=re(e,n);if(r===0){const d=e.getDate(),l=n.getDate();return d===l?0:d>l?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 Ue(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=C(()=>{var i;const{item:m,index:T,color:B,offset:x,rowHeight:I}=e,P={height:I};if(m.type==="placeholder")return P.width="100%",P;if(T===0&&(P.marginLeft=`${100*x/7}%`),B)switch(m.type){case"end":case"start":case"start-end":case"multiple-middle":case"multiple-selected":P.background=B;break;case"middle":P.color=B;break}return x+(((i=m.date)==null?void 0:i.getDate())||1)>28&&(P.marginBottom=0),P}),l=()=>{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:l},[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,l]=be(),g=$(),h=$(),f=Te(h),i=C(()=>ze(e.date)),m=C(()=>ke(e.rowHeight)),T=C(()=>{const s=e.date.getDay();return e.firstDayOfWeek?(s+7-e.firstDayOfWeek)%7:s}),B=C(()=>Le(e.date.getFullYear(),e.date.getMonth()+1)),x=C(()=>d.value||!e.lazyRender),I=()=>i.value,P=s=>{const w=k=>e.currentDate.some(y=>R(y,k)===0);if(w(s)){const k=se(s),y=ye(s),S=w(k),t=w(y);return S&&t?"multiple-middle":S?"end":t?"start":"multiple-selected"}return""},N=s=>{const[w,k]=e.currentDate;if(!w)return"";const y=R(s,w);if(!k)return y===0?"start":"";const S=R(s,k);return e.allowSameDay&&y===0&&S===0?"start-end":y===0?"start":S===0?"end":y>0&&S<0?"middle":""},j=s=>{const{type:w,minDate:k,maxDate:y,currentDate:S}=e;if(R(s,k)<0||R(s,y)>0)return"disabled";if(S===null)return"";if(Array.isArray(S)){if(w==="multiple")return P(s);if(w==="range")return N(s)}else if(w==="single")return R(s,S)===0?"selected":"";return""},W=s=>{if(e.type==="range"){if(s==="start"||s==="end")return F(s);if(s==="start-end")return`${F("start")}/${F("end")}`}},V=()=>{if(e.showMonthTitle)return o("div",{class:D("month-title")},[r["month-title"]?r["month-title"]({date:e.date,text:i.value}):i.value])},z=()=>{if(e.showMark&&x.value)return o("div",{class:D("month-mark")},[e.date.getMonth()+1])},U=C(()=>{const s=Math.ceil((B.value+T.value)/7);return Array(s).fill({type:"placeholder"})}),_=C(()=>{const s=[],w=e.date.getFullYear(),k=e.date.getMonth();for(let y=1;y<=B.value;y++){const S=new Date(w,k,y),t=j(S);let a={date:S,type:t,text:y,bottomInfo:W(t)};e.formatter&&(a=e.formatter(a)),s.push(a)}return s}),p=C(()=>_.value.filter(s=>s.type==="disabled")),X=(s,w)=>{if(g.value){const k=oe(g.value),y=U.value.length,t=(Math.ceil((w.getDate()+T.value)/7)-1)*k.height/y;Se(s,k.top+t+s.scrollTop-oe(s).top)}},Z=(s,w)=>o(Ge,{item:s,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")},[z(),(x.value?_:U).value.map(Z)]);return ge({getTitle:I,getHeight:()=>f.value,setVisible:l,scrollToDate:X,disabledDays:p}),()=>o("div",{class:D("month"),ref:h},[V(),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||F("title"),i=n.title?n.title():f;return o("div",{class:D("header-title")},[i])}},l=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:l},[f])}},h=()=>{const{firstDayOfWeek:f}=e,i=F("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:E,readonly:Boolean,poppable:E,maxRange:Me(null),position:de("bottom"),teleport:[String,Object],showMark:E,showTitle:E,formatter:Function,rowHeight:ne,confirmText:String,rangePrompt:String,lazyRender:E,showConfirm:E,defaultDate:[Date,Array],allowSameDay:Boolean,showSubtitle:E,closeOnPopstate:E,showRangePrompt:E,confirmDisabledText:String,closeOnClickOverlay:E,safeAreaInsetTop:Boolean,safeAreaInsetBottom:E,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:Ve,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)=>R(t,a)===-1?a:R(t,c)===1?c:t,l=(t=e.defaultDate)=>{const{type:a,minDate:c,maxDate:u,allowSameDay:A}=e;if(t===null)return t;const M=le();if(a==="range"){Array.isArray(t)||(t=[]);const Y=d(t[0]||M,c,A?u:se(u)),b=d(t[1]||M,A?c:ye(c));return[Y,b]}return a==="multiple"?Array.isArray(t)?t.map(Y=>d(Y)):[d(M)]:((!t||Array.isArray(t))&&(t=M),d(t))};let g;const h=$(),f=$({text:"",date:void 0}),i=$(l()),[m,T]=$e(),B=C(()=>e.firstDayOfWeek?+e.firstDayOfWeek%7:0),x=C(()=>{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=C(()=>{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}),P=()=>i.value,N=()=>{const t=Ae(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 A=0,M;const Y=[-1,-1];for(let b=0;b<x.value.length;b++){const O=m.value[b];A<=a&&A+c[b]>=t&&(Y[1]=b,M||(M=O,Y[0]=b),m.value[b].showed||(m.value[b].showed=!0,n("monthShow",{date:O.date,title:O.getTitle()}))),A+=c[b]}x.value.forEach((b,O)=>{const ue=O>=Y[0]-1&&O<=Y[1]+1;m.value[O].setVisible(ue)}),M&&(f.value={text:M.getTitle(),date:M.date})},j=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)&&j(t)}else ae(N)},V=()=>{e.poppable&&!e.show||(ae(()=>{g=Math.floor(oe(h).height)}),W())},z=(t=l())=>{i.value=t,W()},U=t=>{const{maxRange:a,rangePrompt:c,showRangePrompt:u}=e;return a&&Ue(t)>+a?(u&&fe(c||F("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"&&!U(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(A=>R(a,A.date)===-1&&R(A.date,c)===-1))==null?void 0:u.date},Z=C(()=>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,A]=i.value;if(u&&!A){const M=R(a,u);if(M===1){const Y=X(Z.value,u,a);if(Y){const b=se(Y);R(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,A=u.findIndex(M=>R(M,a)===0);if(A!==-1){const[M]=u.splice(A,1);n("unselect",J(M))}else e.maxRange&&u.length>=+e.maxRange?fe(e.rangePrompt||F("rangePrompt",e.maxRange)):p([...u,a])}else p(a,!0)},s=t=>n("update:show",t),w=(t,a)=>{const c=a!==0||!e.showSubtitle;return o(Ke,Ce({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(Re,{round:!0,block:!0,type:"primary",color:e.color,class:D("confirm"),disabled:a,nativeType:"button",onClick:_},{default:()=>[t?t({disabled:a}):c||F("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,V),te(()=>[e.type,e.minDate,e.maxDate],()=>z(l(i.value))),te(()=>e.defaultDate,(t=null)=>{i.value=t,W()}),ge({reset:z,scrollToDate:j,getSelectedDate:P}),xe(V),()=>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":s},{default:S}):S()}});const at=pe(tt);var De={exports:{}};(function(e,n){(function(r,d){e.exports=d()})(Pe,function(){return function(r,d,l){d.prototype.isBetween=function(g,h,f,i){var m=l(g),T=l(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=Ye(nt),it=""+new URL("record-item-bg-b541fcc7.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 l;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((l=h==null?void 0:h.data)==null?void 0:l.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 Ee(()=>{d()}),()=>o("div",{class:[v.hotMusicMore,he().isTablet?v.hotMusicMoreTablet:""]},[o(We,{position:"top"},{default:()=>[o(Fe,{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:l=>{r.code=l,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(je,{loading:n.loading,finished:n.finished,finishedText:" ",onLoad:d,immediateCheck:!1},{default:()=>[n.list.length>0&&n.list.map(l=>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学练工具"),l.times,rt[l.type]])]),o("div",{class:v.itemCode},[l.code])]),o("div",{class:v.itemTime},[q("生效时间:"),o("span",null,[l.efficientTime])])]))]}),!n.loading&&n.list.length===0&&o("div",{style:{height:"100%"}},[o(He,{description:"暂无激活记录~"},null)])]),o(at,{show:n.showPopoverTime,"onUpdate:show":l=>n.showPopoverTime=l,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:l=>{r.activateStartTime=H(l[0]).format("YYYY-MM-DD"),r.activateEndTime=H(l[1]).format("YYYY-MM-DD"),n.showPopoverTime=!1,r.page=1,n.list=[],n.finished=!1,d()}},null)])}});export{wt as default};
- ========
- import{c as K,d as L,b8 as G,ax as we,e as C,a as o,bf as be,r as $,bg as Te,o as ke,a2 as ge,n as ne,a4 as oe,bh as Se,ak as Q,m as de,t as E,b as Me,bi as ie,w as te,bj as xe,U as Be,az as ae,bk as Ae,h as Ce,N as fe,C as Re,k as pe,ar as Pe,ao as Ye,ac as H,q as Oe,x as me,y as Ee,W as Fe,V as he,Q as Ie,A as q,a7 as He,D as Ne}from"./index-1a6ecb3d.js";import{s as v}from"./index.module-e950f874.js";import{M as We}from"./index-dc18d212.js";import{M as _e}from"./index-69894580.js";import{u as $e}from"./use-refs-5ee62f63.js";import{g as Le}from"./utils-99ffb83c.js";import{L as je}from"./index-e5bb5690.js";import"./index-fa957c94.js";import"./index-9bd905b4.js";import"./index-c4e670b5.js";import"./Picker-3590fe3b.js";import"./use-tab-status-43751de8.js";const[Ve,D,F]=K("calendar"),ze=e=>F("monthTitle",e.getFullYear(),e.getMonth()+1);function re(e,n){const r=e.getFullYear(),d=n.getFullYear();if(r===d){const l=e.getMonth(),g=n.getMonth();return l===g?0:l>g?1:-1}return r>d?1:-1}function R(e,n){const r=re(e,n);if(r===0){const d=e.getDate(),l=n.getDate();return d===l?0:d>l?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 Ue(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=C(()=>{var i;const{item:m,index:T,color:B,offset:x,rowHeight:I}=e,P={height:I};if(m.type==="placeholder")return P.width="100%",P;if(T===0&&(P.marginLeft=`${100*x/7}%`),B)switch(m.type){case"end":case"start":case"start-end":case"multiple-middle":case"multiple-selected":P.background=B;break;case"middle":P.color=B;break}return x+(((i=m.date)==null?void 0:i.getDate())||1)>28&&(P.marginBottom=0),P}),l=()=>{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:l},[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,l]=be(),g=$(),h=$(),f=Te(h),i=C(()=>ze(e.date)),m=C(()=>ke(e.rowHeight)),T=C(()=>{const s=e.date.getDay();return e.firstDayOfWeek?(s+7-e.firstDayOfWeek)%7:s}),B=C(()=>Le(e.date.getFullYear(),e.date.getMonth()+1)),x=C(()=>d.value||!e.lazyRender),I=()=>i.value,P=s=>{const w=k=>e.currentDate.some(y=>R(y,k)===0);if(w(s)){const k=se(s),y=ye(s),S=w(k),t=w(y);return S&&t?"multiple-middle":S?"end":t?"start":"multiple-selected"}return""},N=s=>{const[w,k]=e.currentDate;if(!w)return"";const y=R(s,w);if(!k)return y===0?"start":"";const S=R(s,k);return e.allowSameDay&&y===0&&S===0?"start-end":y===0?"start":S===0?"end":y>0&&S<0?"middle":""},j=s=>{const{type:w,minDate:k,maxDate:y,currentDate:S}=e;if(R(s,k)<0||R(s,y)>0)return"disabled";if(S===null)return"";if(Array.isArray(S)){if(w==="multiple")return P(s);if(w==="range")return N(s)}else if(w==="single")return R(s,S)===0?"selected":"";return""},W=s=>{if(e.type==="range"){if(s==="start"||s==="end")return F(s);if(s==="start-end")return`${F("start")}/${F("end")}`}},V=()=>{if(e.showMonthTitle)return o("div",{class:D("month-title")},[r["month-title"]?r["month-title"]({date:e.date,text:i.value}):i.value])},z=()=>{if(e.showMark&&x.value)return o("div",{class:D("month-mark")},[e.date.getMonth()+1])},U=C(()=>{const s=Math.ceil((B.value+T.value)/7);return Array(s).fill({type:"placeholder"})}),_=C(()=>{const s=[],w=e.date.getFullYear(),k=e.date.getMonth();for(let y=1;y<=B.value;y++){const S=new Date(w,k,y),t=j(S);let a={date:S,type:t,text:y,bottomInfo:W(t)};e.formatter&&(a=e.formatter(a)),s.push(a)}return s}),p=C(()=>_.value.filter(s=>s.type==="disabled")),X=(s,w)=>{if(g.value){const k=oe(g.value),y=U.value.length,t=(Math.ceil((w.getDate()+T.value)/7)-1)*k.height/y;Se(s,k.top+t+s.scrollTop-oe(s).top)}},Z=(s,w)=>o(Ge,{item:s,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")},[z(),(x.value?_:U).value.map(Z)]);return ge({getTitle:I,getHeight:()=>f.value,setVisible:l,scrollToDate:X,disabledDays:p}),()=>o("div",{class:D("month"),ref:h},[V(),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||F("title"),i=n.title?n.title():f;return o("div",{class:D("header-title")},[i])}},l=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:l},[f])}},h=()=>{const{firstDayOfWeek:f}=e,i=F("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:E,readonly:Boolean,poppable:E,maxRange:Me(null),position:de("bottom"),teleport:[String,Object],showMark:E,showTitle:E,formatter:Function,rowHeight:ne,confirmText:String,rangePrompt:String,lazyRender:E,showConfirm:E,defaultDate:[Date,Array],allowSameDay:Boolean,showSubtitle:E,closeOnPopstate:E,showRangePrompt:E,confirmDisabledText:String,closeOnClickOverlay:E,safeAreaInsetTop:Boolean,safeAreaInsetBottom:E,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:Ve,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)=>R(t,a)===-1?a:R(t,c)===1?c:t,l=(t=e.defaultDate)=>{const{type:a,minDate:c,maxDate:u,allowSameDay:A}=e;if(t===null)return t;const M=le();if(a==="range"){Array.isArray(t)||(t=[]);const Y=d(t[0]||M,c,A?u:se(u)),b=d(t[1]||M,A?c:ye(c));return[Y,b]}return a==="multiple"?Array.isArray(t)?t.map(Y=>d(Y)):[d(M)]:((!t||Array.isArray(t))&&(t=M),d(t))};let g;const h=$(),f=$({text:"",date:void 0}),i=$(l()),[m,T]=$e(),B=C(()=>e.firstDayOfWeek?+e.firstDayOfWeek%7:0),x=C(()=>{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=C(()=>{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}),P=()=>i.value,N=()=>{const t=Ae(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 A=0,M;const Y=[-1,-1];for(let b=0;b<x.value.length;b++){const O=m.value[b];A<=a&&A+c[b]>=t&&(Y[1]=b,M||(M=O,Y[0]=b),m.value[b].showed||(m.value[b].showed=!0,n("monthShow",{date:O.date,title:O.getTitle()}))),A+=c[b]}x.value.forEach((b,O)=>{const ue=O>=Y[0]-1&&O<=Y[1]+1;m.value[O].setVisible(ue)}),M&&(f.value={text:M.getTitle(),date:M.date})},j=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)&&j(t)}else ae(N)},V=()=>{e.poppable&&!e.show||(ae(()=>{g=Math.floor(oe(h).height)}),W())},z=(t=l())=>{i.value=t,W()},U=t=>{const{maxRange:a,rangePrompt:c,showRangePrompt:u}=e;return a&&Ue(t)>+a?(u&&fe(c||F("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"&&!U(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(A=>R(a,A.date)===-1&&R(A.date,c)===-1))==null?void 0:u.date},Z=C(()=>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,A]=i.value;if(u&&!A){const M=R(a,u);if(M===1){const Y=X(Z.value,u,a);if(Y){const b=se(Y);R(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,A=u.findIndex(M=>R(M,a)===0);if(A!==-1){const[M]=u.splice(A,1);n("unselect",J(M))}else e.maxRange&&u.length>=+e.maxRange?fe(e.rangePrompt||F("rangePrompt",e.maxRange)):p([...u,a])}else p(a,!0)},s=t=>n("update:show",t),w=(t,a)=>{const c=a!==0||!e.showSubtitle;return o(Ke,Ce({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(Re,{round:!0,block:!0,type:"primary",color:e.color,class:D("confirm"),disabled:a,nativeType:"button",onClick:_},{default:()=>[t?t({disabled:a}):c||F("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,V),te(()=>[e.type,e.minDate,e.maxDate],()=>z(l(i.value))),te(()=>e.defaultDate,(t=null)=>{i.value=t,W()}),ge({reset:z,scrollToDate:j,getSelectedDate:P}),xe(V),()=>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":s},{default:S}):S()}});const at=pe(tt);var De={exports:{}};(function(e,n){(function(r,d){e.exports=d()})(Pe,function(){return function(r,d,l){d.prototype.isBetween=function(g,h,f,i){var m=l(g),T=l(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=Ye(nt),it=""+new URL("record-item-bg-b541fcc7.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 l;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((l=h==null?void 0:h.data)==null?void 0:l.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 Ee(()=>{d()}),()=>o("div",{class:[v.hotMusicMore,he().isTablet?v.hotMusicMoreTablet:""]},[o(We,{position:"top"},{default:()=>[o(Fe,{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:l=>{r.code=l,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(je,{loading:n.loading,finished:n.finished,finishedText:" ",onLoad:d,immediateCheck:!1},{default:()=>[n.list.length>0&&n.list.map(l=>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学练工具"),l.times,rt[l.type]])]),o("div",{class:v.itemCode},[l.code])]),o("div",{class:v.itemTime},[q("生效时间:"),o("span",null,[l.efficientTime])])]))]}),!n.loading&&n.list.length===0&&o("div",{style:{height:"100%"}},[o(He,{description:"暂无激活记录~"},null)])]),o(at,{show:n.showPopoverTime,"onUpdate:show":l=>n.showPopoverTime=l,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:l=>{r.activateStartTime=H(l[0]).format("YYYY-MM-DD"),r.activateEndTime=H(l[1]).format("YYYY-MM-DD"),n.showPopoverTime=!1,r.page=1,n.list=[],n.finished=!1,d()}},null)])}});export{wt as default};
- >>>>>>>> iteration-20240820:dist/assets/record-12aaa03c.js
|