1 |
- import{a0 as Ve,bi as xe,a1 as C,bk as pe,aW as j,aB as W,aX as D,ae as me,aE as Ie,af as Ee,r as g,c as se,bp as ke,a4 as X,ao as R,bl as Se,aF as Pe,a6 as Z,o as fe,cE as Ce,e as k,f as Y,m as J,i as a,v as ne,aG as U,g as M,w as T,y as $,bC as Ae,dx as Fe,p as ae,l as Q,dy as Be,I as Me,ag as q,E as Oe,al as Te,W as Ye,a5 as $e,aP as oe,ap as ze,_ as ve,h as b,ai as re,G as ie,a as Xe,u as De,F as He,k as We,x as ue,j as G,bn as ce,q as Le,s as Ke,dz as Re,dA as Ue,b1 as qe,B as Ge,C as je}from"./index.f884e450.js";import{i as ee,a as _e,n as Je,b as Qe,c as Ze}from"./index.2af44d90.js";import{d as et,c as tt}from"./jifen.d24a0efa.js";import{v as de}from"./index.a400ccf3.js";const nt=Ve({id:{type:String,default:void 0},step:{type:Number,default:1},stepStrictly:Boolean,max:{type:Number,default:Number.POSITIVE_INFINITY},min:{type:Number,default:Number.NEGATIVE_INFINITY},modelValue:Number,readonly:Boolean,disabled:Boolean,size:xe,controls:{type:Boolean,default:!0},controlsPosition:{type:String,default:"",values:["","right"]},valueOnClear:{type:[String,Number,null],validator:n=>n===null||C(n)||["min","max"].includes(n),default:null},name:String,label:String,placeholder:String,precision:{type:Number,validator:n=>n>=0&&n===Number.parseInt(`${n}`,10)},validateEvent:{type:Boolean,default:!0}}),st={[pe]:(n,p)=>p!==n,blur:n=>n instanceof FocusEvent,focus:n=>n instanceof FocusEvent,[j]:n=>C(n)||W(n),[D]:n=>C(n)||W(n)},at=["aria-label","onKeydown"],lt=["aria-label","onKeydown"],ot=me({name:"ElInputNumber"}),rt=me({...ot,props:nt,emits:st,setup(n,{expose:p,emit:o}){const t=n,{t:r}=Ie(),i=Ee("input-number"),_=g(),l=se({currentValue:t.modelValue,userInput:null}),{formItem:v}=ke(),V=X(()=>C(t.modelValue)&&t.modelValue<=t.min),f=X(()=>C(t.modelValue)&&t.modelValue>=t.max),m=X(()=>{const e=y(t.step);return R(t.precision)?Math.max(y(t.modelValue),e):(e>t.precision,t.precision)}),d=X(()=>t.controls&&t.controlsPosition==="right"),x=Se(),h=Pe(),E=X(()=>{if(l.userInput!==null)return l.userInput;let e=l.currentValue;if(W(e))return"";if(C(e)){if(Number.isNaN(e))return"";R(t.precision)||(e=e.toFixed(t.precision))}return e}),P=(e,s)=>{if(R(s)&&(s=m.value),s===0)return Math.round(e);let c=String(e);const N=c.indexOf(".");if(N===-1||!c.replace(".","").split("")[N+s])return e;const L=c.length;return c.charAt(L-1)==="5"&&(c=`${c.slice(0,Math.max(0,L-1))}6`),Number.parseFloat(Number(c).toFixed(s))},y=e=>{if(W(e))return 0;const s=e.toString(),c=s.indexOf(".");let N=0;return c!==-1&&(N=s.length-c-1),N},A=(e,s=1)=>C(e)?P(e+t.step*s):l.currentValue,O=()=>{if(t.readonly||h.value||f.value)return;const e=Number(E.value)||0,s=A(e);I(s),o(j,l.currentValue)},F=()=>{if(t.readonly||h.value||V.value)return;const e=Number(E.value)||0,s=A(e,-1);I(s),o(j,l.currentValue)},u=(e,s)=>{const{max:c,min:N,step:w,precision:B,stepStrictly:L,valueOnClear:K}=t;c<N&&Ye("InputNumber","min should not be greater than max.");let S=Number(e);if(W(e)||Number.isNaN(S))return null;if(e===""){if(K===null)return null;S=$e(K)?{min:N,max:c}[K]:K}return L&&(S=P(Math.round(S/w)*w,B)),R(B)||(S=P(S,B)),(S>c||S<N)&&(S=S>c?c:N,s&&o(D,S)),S},I=(e,s=!0)=>{var c;const N=l.currentValue,w=u(e);if(!s){o(D,w);return}N!==w&&(l.userInput=null,o(D,w),o(pe,w,N),t.validateEvent&&((c=v?.validate)==null||c.call(v,"change").catch(B=>oe())),l.currentValue=w)},z=e=>{l.userInput=e;const s=e===""?null:Number(e);o(j,s),I(s,!1)},ge=e=>{const s=e!==""?Number(e):"";(C(s)&&!Number.isNaN(s)||e==="")&&I(s),l.userInput=null},he=()=>{var e,s;(s=(e=_.value)==null?void 0:e.focus)==null||s.call(e)},ye=()=>{var e,s;(s=(e=_.value)==null?void 0:e.blur)==null||s.call(e)},Ne=e=>{o("focus",e)},we=e=>{var s;o("blur",e),t.validateEvent&&((s=v?.validate)==null||s.call(v,"blur").catch(c=>oe()))};return Z(()=>t.modelValue,e=>{const s=u(l.userInput),c=u(e,!0);!C(s)&&(!s||s!==c)&&(l.currentValue=c,l.userInput=null)},{immediate:!0}),fe(()=>{var e;const{min:s,max:c,modelValue:N}=t,w=(e=_.value)==null?void 0:e.input;if(w.setAttribute("role","spinbutton"),Number.isFinite(c)?w.setAttribute("aria-valuemax",String(c)):w.removeAttribute("aria-valuemax"),Number.isFinite(s)?w.setAttribute("aria-valuemin",String(s)):w.removeAttribute("aria-valuemin"),w.setAttribute("aria-valuenow",l.currentValue||l.currentValue===0?String(l.currentValue):""),w.setAttribute("aria-disabled",String(h.value)),!C(N)&&N!=null){let B=Number(N);Number.isNaN(B)&&(B=null),o(D,B)}}),Ce(()=>{var e,s;const c=(e=_.value)==null?void 0:e.input;c?.setAttribute("aria-valuenow",`${(s=l.currentValue)!=null?s:""}`)}),p({focus:he,blur:ye}),(e,s)=>(k(),Y("div",{class:ne([a(i).b(),a(i).m(a(x)),a(i).is("disabled",a(h)),a(i).is("without-controls",!e.controls),a(i).is("controls-right",a(d))]),onDragstart:s[1]||(s[1]=q(()=>{},["prevent"]))},[e.controls?J((k(),Y("span",{key:0,role:"button","aria-label":a(r)("el.inputNumber.decrease"),class:ne([a(i).e("decrease"),a(i).is("disabled",a(V))]),onKeydown:U(F,["enter"])},[M(a(ae),null,{default:T(()=>[a(d)?(k(),$(a(Ae),{key:0})):(k(),$(a(Fe),{key:1}))]),_:1})],42,at)),[[a(de),F]]):Q("v-if",!0),e.controls?J((k(),Y("span",{key:1,role:"button","aria-label":a(r)("el.inputNumber.increase"),class:ne([a(i).e("increase"),a(i).is("disabled",a(f))]),onKeydown:U(O,["enter"])},[M(a(ae),null,{default:T(()=>[a(d)?(k(),$(a(Be),{key:0})):(k(),$(a(Me),{key:1}))]),_:1})],42,lt)),[[a(de),O]]):Q("v-if",!0),M(a(Oe),{id:e.id,ref_key:"input",ref:_,type:"number",step:e.step,"model-value":a(E),placeholder:e.placeholder,readonly:e.readonly,disabled:a(h),size:a(x),max:e.max,min:e.min,name:e.name,label:e.label,"validate-event":!1,onWheel:s[0]||(s[0]=q(()=>{},["prevent"])),onKeydown:[U(q(O,["prevent"]),["up"]),U(q(F,["prevent"]),["down"])],onBlur:we,onFocus:Ne,onInput:z,onChange:ge},null,8,["id","step","model-value","placeholder","readonly","disabled","size","max","min","name","label","onKeydown"])],34))}});var it=Te(rt,[["__file","/home/runner/work/element-plus/element-plus/packages/components/input-number/src/input-number.vue"]]);const ut=ze(it);function be(n){var p;const o=_e(n);return(p=o?.$el)!=null?p:o}const le=ee?window:void 0;ee&&window.document;ee&&window.navigator;ee&&window.location;function H(...n){let p,o,t,r;if(typeof n[0]=="string"||Array.isArray(n[0])?([o,t,r]=n,p=le):[p,o,t,r]=n,!p)return Je;Array.isArray(o)||(o=[o]),Array.isArray(t)||(t=[t]);const i=[],_=()=>{i.forEach(f=>f()),i.length=0},l=(f,m,d,x)=>(f.addEventListener(m,d,x),()=>f.removeEventListener(m,d,x)),v=Z(()=>[be(p),_e(r)],([f,m])=>{if(_(),!f)return;const d=Qe(m)?{...m}:m;i.push(...o.flatMap(x=>t.map(h=>l(f,x,h,d))))},{immediate:!0,flush:"post"}),V=()=>{v(),_()};return Ze(V),V}const ct={page:n=>[n.pageX,n.pageY],client:n=>[n.clientX,n.clientY],screen:n=>[n.screenX,n.screenY],movement:n=>n instanceof Touch?null:[n.movementX,n.movementY]};function dt(n={}){const{type:p="page",touch:o=!0,resetOnTouchEnds:t=!1,initialValue:r={x:0,y:0},window:i=le,target:_=i,scroll:l=!0,eventFilter:v}=n;let V=null;const f=g(r.x),m=g(r.y),d=g(null),x=typeof p=="function"?p:ct[p],h=u=>{const I=x(u);V=u,I&&([f.value,m.value]=I,d.value="mouse")},E=u=>{if(u.touches.length>0){const I=x(u.touches[0]);I&&([f.value,m.value]=I,d.value="touch")}},P=()=>{if(!V||!i)return;const u=x(V);V instanceof MouseEvent&&u&&(f.value=u[0]+i.scrollX,m.value=u[1]+i.scrollY)},y=()=>{f.value=r.x,m.value=r.y},A=v?u=>v(()=>h(u),{}):u=>h(u),O=v?u=>v(()=>E(u),{}):u=>E(u),F=v?()=>v(()=>P(),{}):()=>P();if(_){const u={passive:!0};H(_,["mousemove","dragover"],A,u),o&&p!=="movement"&&(H(_,["touchstart","touchmove"],O,u),t&&H(_,"touchend",y,u)),l&&p==="page"&&H(i,"scroll",F,{passive:!0})}return{x:f,y:m,sourceType:d}}function pt(n,p={}){const{handleOutside:o=!0,window:t=le}=p,r=p.type||"page",{x:i,y:_,sourceType:l}=dt(p),v=g(n??t?.document.body),V=g(0),f=g(0),m=g(0),d=g(0),x=g(0),h=g(0),E=g(!0);let P=()=>{};return t&&(P=Z([v,i,_],()=>{const y=be(v);if(!y)return;const{left:A,top:O,width:F,height:u}=y.getBoundingClientRect();m.value=A+(r==="page"?t.pageXOffset:0),d.value=O+(r==="page"?t.pageYOffset:0),x.value=u,h.value=F;const I=i.value-m.value,z=_.value-d.value;E.value=F===0||u===0||I<0||z<0||I>F||z>u,(o||!E.value)&&(V.value=I,f.value=z)},{immediate:!0}),H(document,"mouseleave",()=>{E.value=!0})),{x:i,y:_,sourceType:l,elementX:V,elementY:f,elementPositionX:m,elementPositionY:d,elementHeight:x,elementWidth:h,isOutside:E,stop:P}}const mt={class:"image-magnify-container"},ft=["src"],vt={__name:"index",props:{imagePath:{type:String,default:""}},setup(n){const p=n,o=g(null),t=g(!1),r=se({left:0,top:0}),i=se({backgroundPositionX:0,backgroundPositionY:0}),{elementX:_,elementY:l,isOutside:v}=pt(o);return Z([_,l,v],()=>{t.value=!v.value,!v.value&&(_.value<100?r.left=0:_.value>300?r.left=200:r.left=_.value-100,l.value<100?r.top=0:l.value>300?r.top=200:r.top=l.value-100,i.backgroundPositionX=-r.left*2+"px",i.backgroundPositionY=-r.top*2+"px",r.left+="px",r.top+="px")}),(V,f)=>(k(),Y("div",mt,[b("div",{class:"imgbox",ref_key:"target",ref:o},[b("img",{src:p.imagePath,alt:""},null,8,ft),J(b("div",{class:"layer",style:ie([r])},null,4),[[re,t.value]])],512),J(b("div",{class:"large",style:ie([{backgroundImage:`url(${p.imagePath})`},i])},null,4),[[re,t.value]])]))}};var _t=ve(vt,[["__scopeId","data-v-7113eedc"]]);const te=n=>(Ge("data-v-a9ff0e9a"),n=n(),je(),n),bt={class:"goods-container",style:{padding:"24px"}},gt={class:"goods-header flex-row"},ht={class:"imgbox"},yt={class:"flex-row"},Nt=["onClick"],wt=["src"],Vt={class:"infobox",style:{display:"flex","flex-direction":"column","justify-content":"space-between",height:"400px"}},xt={class:"title"},It={class:"price flex-row flex-aic"},Et=te(()=>b("span",{class:"label"},"\u5546\u54C1\u4EF7\u683C\xA0",-1)),kt={class:"pir"},St={class:"counts flex-row flex-aic"},Pt=te(()=>b("span",{class:"label"},"\u6570\u91CF",-1)),Ct={class:"counts__main"},At={class:"btns"},Ft={class:"goods-mains"},Bt=te(()=>b("div",{class:"goods-mains__header"},"\u5546\u54C1\u8BE6\u60C5",-1)),Mt=["innerHTML"],Ot=te(()=>b("p",null,"\u6210\u529F\u52A0\u5165\u6536\u85CF\u5939",-1)),Tt={__name:"details",setup(n){const p=Xe(),o=De();let t=g({}),r=g();const i=async()=>{try{const{data:m}=await et({id:p.query.id});t.value=m,r.value=m.image}catch{}};fe(i);const _=m=>{r.value=t.value.images[m]};let l=g();const v=async m=>{try{const{msg:d}=await tt({id:m});i(),d=="\u6536\u85CF\u6210\u529F"?l.value=!0:l.value=!1}catch{}},V=()=>{o.push({name:"PlaceOrder",query:{id:p.query.id,count:f.value}})};let f=g(1);return(m,d)=>{const x=ut,h=Le,E=ae,P=Ke;return k(),Y("div",bt,[b("div",gt,[b("div",ht,[b("div",null,[M(_t,{"image-path":a(r),style:{width:"400px",height:"400px"}},null,8,["image-path"])]),b("ul",yt,[(k(!0),Y(He,null,We(a(t).images,(y,A)=>(k(),Y("li",{onClick:O=>_(A),key:A},[b("img",{src:y,alt:"",style:{width:"60px",height:"60px"}},null,8,wt)],8,Nt))),128))])]),b("div",Vt,[b("div",null,[b("h3",xt,ue(a(t).name),1),b("div",It,[Et,b("div",kt,[b("span",null,ue(a(t).price),1),G("\u4EF7\u683C ")])]),b("div",St,[Pt,b("div",Ct,[M(x,{modelValue:a(f),"onUpdate:modelValue":d[0]||(d[0]=y=>ce(f)?f.value=y:f=y),min:1},null,8,["modelValue"])])])]),b("div",At,[M(h,{size:"large",type:"primary",onClick:V},{default:T(()=>[G("\u7ACB\u5373\u5151\u6362")]),_:1}),a(t).is_collect==0?(k(),$(h,{key:0,icon:a(Re),size:"large",onClick:d[1]||(d[1]=y=>v(a(t).id))},{default:T(()=>[G("\u6536\u85CF")]),_:1},8,["icon"])):Q("",!0),a(t).is_collect==1?(k(),$(h,{key:1,icon:a(Ue),size:"large",onClick:d[2]||(d[2]=y=>v(a(t).id))},{default:T(()=>[G("\u5DF2\u6536\u85CF")]),_:1},8,["icon"])):Q("",!0)])])]),b("div",Ft,[Bt,b("div",{innerHTML:a(t).detail},null,8,Mt)]),M(P,{modelValue:a(l),"onUpdate:modelValue":d[3]||(d[3]=y=>ce(l)?l.value=y:l=y),width:"300",align:"center"},{default:T(()=>[M(E,{size:26,color:"rgba(65, 179, 64, 1)"},{default:T(()=>[M(a(qe))]),_:1}),Ot]),_:1},8,["modelValue"])])}}};var Dt=ve(Tt,[["__scopeId","data-v-a9ff0e9a"]]);export{Dt as default};
|