Files
CardAuth/backend/public/assets/Shop-DlHLSPes.js
T

2 lines
31 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{_ as lt,G as le,m as Ae,o as s,c as a,b as M,w as D,T as L,b4 as De,a as e,C as o,A as re,H as x,V as P,S as E,b5 as te,I as ue,l as r,j as Le,D as de,b6 as K,M as d,B as q,a4 as at,i as S,ad as w,b7 as C,g as Pe,a5 as Q,b8 as ot,k as O}from"./index-DBFWYkvK.js";import T from"./index-CAUpYf8g.js";const nt={class:"shop-app"},it={key:0,class:"page-loader"},rt={class:"shop-header"},ut={class:"header-bar"},dt={class:"brand-text"},ct={class:"brand-name"},vt=["onClick"],pt={class:"shop-main"},yt={key:0},ft={class:"hero"},bt={class:"hero-text"},mt={class:"hero-stat"},kt={class:"stat-num"},_t=["onClick"],ht={key:1,class:"product-grid"},gt={key:2,class:"empty-state"},wt={key:0,class:"card-badge"},xt={class:"card-header"},qt={class:"card-name"},Ct={class:"card-duration"},Qt={class:"card-features"},Bt={key:0},jt={key:1},Rt={key:2},$t={class:"card-price"},Vt={class:"price-amount"},Mt={key:0,class:"price-discount"},St={key:1,class:"price-original"},Tt=["onClick"],zt={key:1},Ft={class:"center-card"},It={key:0,class:"form-area"},Ht={class:"form-field"},Ut={class:"form-field"},At={class:"form-field"},Dt={class:"form-field"},Lt=["disabled"],Pt={key:0,class:"spinner"},Nt={key:1},Xt=["onClick"],Et={key:0,class:"center-card"},Kt={class:"form-field"},Ot=["disabled"],Gt=["disabled"],Yt={key:0,class:"spinner"},Jt={key:1},Wt={key:1,class:"center-card"},Zt={class:"form-field"},es=["disabled"],ts=["disabled"],ss={key:0,class:"spinner"},ls={key:1},as={class:"cr-status-text"},os={class:"cr-body"},ns={class:"cr-row"},is={class:"mono"},rs={class:"cr-row"},us={class:"cr-row"},ds={class:"cr-row"},cs={class:"cr-row"},vs={class:"mono"},ps={class:"cr-row"},ys={class:"mono"},fs={key:0,class:"cr-row"},bs={class:"mono"},ms={key:1,class:"cr-row"},ks={class:"modal-footer"},_s={class:"act-success-title"},hs={class:"act-success-sub"},gs={class:"act-success-body"},ws={class:"act-row"},xs={class:"act-row"},qs={class:"mono"},Cs={class:"act-row"},Qs={class:"mono"},Bs={class:"act-row"},js={class:"mono"},Rs={key:0,class:"act-row"},$s={key:1,class:"act-row"},Vs={class:"act-error-body"},Ms={class:"modal-footer"},Ss={class:"qr-summary"},Ts={class:"qr-icon"},zs={class:"qr-text"},Fs={class:"qr-grid"},Is={class:"qr-cell"},Hs={class:"qr-num"},Us={class:"qr-cell"},As={class:"qr-num ok"},Ds={class:"qr-cell"},Ls={class:"qr-num warn"},Ps={key:0,class:"qr-list"},Ns={class:"qr-item-head"},Xs={class:"qr-qq"},Es={class:"qr-item-body"},Ks={class:"qr-row"},Os={class:"qr-row"},Gs={class:"qr-row"},Ys={class:"modal-footer"},Js={class:"shop-footer"},Ws={class:"modal-product-header"},Zs={class:"modal-product-icon"},el={class:"modal-product-info"},tl={class:"modal-product-title"},sl={class:"modal-product-meta"},ll={class:"modal-product-price"},al={class:"mp-amount"},ol={class:"modal-body"},nl={class:"form-field modal-field"},il={class:"form-field modal-field"},rl={class:"form-field modal-field"},ul={key:0,class:"form-field modal-field"},dl={class:"coupon-row"},cl=["disabled"],vl={key:0,class:"spinner sm"},pl={key:1},yl={key:1,class:"form-field modal-field"},fl={class:"pay-opts"},bl=["value"],ml=["innerHTML"],kl={class:"pay-label"},_l={class:"m-total"},hl={class:"total-line"},gl={class:"total-label"},wl={key:0,class:"m-old-price"},xl={class:"modal-footer"},ql=["disabled"],Cl={key:0,class:"spinner"},Ql={key:1},Bl={key:1,class:"success-block"},jl={class:"success-rows"},Rl={class:"s-row"},$l={class:"mono"},Vl={class:"s-row"},Ml={class:"s-row"},Sl={class:"mono"},Tl={class:"s-row"},zl={class:"mono"},Fl={key:0,class:"s-row"},Il={key:1,class:"s-row"},Hl={class:"modal-footer"},Ul={__name:"Shop",setup(Al){const ce=()=>K("svg",{viewBox:"0 0 16 16",width:16,height:16,fill:"currentColor"},[K("path",{d:"M0 1.5A.5.5 0 0 1 .5 1H2a.5.5 0 0 1 .485.379L2.89 3H14.5a.5.5 0 0 1 .491.592l-1.5 8A.5.5 0 0 1 13 12H4a.5.5 0 0 1-.491-.408L2.01 3.607 1.61 2H.5a.5.5 0 0 1-.5-.5zM3.102 4l1.313 7h8.17l1.313-7H3.102zM5 12a2 2 0 1 0 0 4 2 2 0 0 0 0-4zm7 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4zm-7 1a1 1 0 1 1 0 2 1 1 0 0 1 0-2zm7 0a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"})]),Ne=()=>K("svg",{viewBox:"0 0 16 16",width:16,height:16,fill:"currentColor"},[K("path",{d:"M8 1a2 2 0 0 1 2 2v4H6V3a2 2 0 0 1 2-2zm3 6V3a3 3 0 0 0-6 0v4a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2z"})]),Xe=()=>K("svg",{viewBox:"0 0 16 16",width:16,height:16,fill:"currentColor"},[K("path",{d:"M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"})]),m=r("buy"),ve=[{key:"buy",label:"购买授权",icon:ce},{key:"activate",label:"在线授权",icon:Ne},{key:"query",label:"授权查询",icon:Xe}],pe=r(null),ye=r([]),fe=r({width:"0px",transform:"translateX(0px)",opacity:0});function be(){ue(()=>{const i=pe.value,t=ye.value;if(!i||!t||!t.length)return;const c=ve.findIndex(V=>V.key===m.value),n=t[c];if(!n)return;const l=i.getBoundingClientRect(),b=n.getBoundingClientRect();fe.value={width:`${b.width}px`,transform:`translateX(${b.left-l.left}px)`,opacity:1}})}le(m,be),Ae(be);const me=r(null),ke=r([]),_e=r({width:"0px",transform:"translateX(0px)",opacity:0});function he(){ue(()=>{const i=me.value,t=ke.value;if(!i||!t||!t.length)return;const c=qe.findIndex(V=>V.key===X.value),n=t[c];if(!n)return;const l=i.getBoundingClientRect(),b=n.getBoundingClientRect();_e.value={width:`${b.width}px`,transform:`translateX(${b.left-l.left}px)`,opacity:1}})}const u=Le({projects:!1,products:!1,query:!1,authQuery:!1,pay:!1,buyCoupon:!1,activate:!1,submit:!1}),ae=r(!0),Ee=r(!1),z=r([]),j=r(0),G=r([]),se=de(()=>z.value.find(i=>i.id===j.value)),ge=r(null),we=r([]),xe=r({width:"0px",transform:"translateX(0px)",opacity:0});function oe(){ue(()=>{const i=ge.value,t=we.value;if(!i||!t||!t.length)return;const c=z.value.findIndex(V=>V.id===j.value),n=t[c];if(!n)return;const l=i.getBoundingClientRect(),b=n.getBoundingClientRect();xe.value={width:`${b.width}px`,transform:`translateX(${b.left-l.left}px)`,opacity:1}})}le(j,oe);const N=r(!1),Y=r("confirm"),_=r(null),J=r("alipay"),F=r(""),R=r(""),W=r(""),B=r(null),I=r(""),y=r(null),Ke=de(()=>{var i,t;return(i=y.value)!=null&&i.valid?y.value.final_amount:parseFloat(((t=_.value)==null?void 0:t.price)||0)}),H=de(()=>{var i;return parseFloat(((i=_.value)==null?void 0:i.price)||0)===0}),Oe=[{value:"alipay",label:"支付宝",icon:'<svg viewBox="0 0 24 24" width="18" height="18" fill="#1677ff"><circle cx="12" cy="12" r="10"/></svg>'},{value:"wxpay",label:"微信",icon:'<svg viewBox="0 0 24 24" width="18" height="18" fill="#07c160"><circle cx="12" cy="12" r="10"/></svg>'},{value:"qqpay",label:"QQ钱包",icon:'<svg viewBox="0 0 24 24" width="18" height="18" fill="#12b7f5"><circle cx="12" cy="12" r="10"/></svg>'}],X=r("card"),qe=[{key:"card",label:"卡密查询"},{key:"bot",label:"机器人QQ查询"}],Z=r("");le(X,he),le(m,()=>{m.value==="query"&&he()});const p=r(null),U=r(!1),ee=r(""),k=r(null),A=r(!1),Ce=r("form"),f=Le({card_key:"",bot_qq:"",contact_qq:"",contact_name:""}),h=r(null),ne=r(!1),g=r(!1),$=r("");Ae(async()=>{ae.value=!0,u.projects=!0;try{const i=await T.get("/public/projects");z.value=i.data||[],z.value.length>0&&await Qe(z.value[0])}catch{}finally{u.projects=!1,oe()}Ee.value=!0,ae.value=!1});async function Qe(i){j.value=i.id,await Ge(i.id),oe()}async function Ge(i){u.products=!0;try{const t=await T.get(`/public/projects/${i}/card-types`);G.value=(t.data||[]).map(c=>({...c,original_price:c.original_price?parseFloat(c.original_price):0}))}catch{G.value=[]}finally{u.products=!1}}function Ye(i){_.value=i,Y.value="confirm",J.value="alipay",F.value="",R.value="",W.value="",I.value="",y.value=null,B.value=null,N.value=!0}async function Je(){var i;if(I.value.trim()){u.buyCoupon=!0,y.value=null;try{const t=await T.post("/public/coupons/validate",{code:I.value.trim(),project_id:j.value,amount:parseFloat(((i=_.value)==null?void 0:i.price)||0)});y.value=t.data}catch{y.value=null}finally{u.buyCoupon=!1}}}async function We(){var i;if(!F.value.trim()){O.error("请输入机器人QQ");return}if(!/^\d{5,15}$/.test(F.value.trim())){O.error("机器人QQ格式不正确(5-15位数字)");return}if(!R.value.trim()){O.error("请输入联系人QQ");return}if(!/^\d{5,15}$/.test(R.value.trim())){O.error("联系人QQ格式不正确(5-15位数字)");return}u.pay=!0;try{const t=await T.post("/public/orders",{project_id:j.value,card_type_id:_.value.id,pay_type:J.value,contact_info:`${R.value.trim()}${W.value.trim()?" ("+W.value.trim()+")":""}`,coupon_code:(i=y.value)!=null&&i.valid?I.value.trim():"",bot_qq:F.value.trim(),contact_qq:R.value.trim()}),c=t.data.order_no;if(H.value){B.value=t.data,Y.value="success",O.success("领取成功!"),u.pay=!1;return}t.data.pay_url&&window.open(t.data.pay_url,"_blank"),Ze(c)}catch{}finally{u.pay=!1}}function Ze(i){const t=setInterval(async()=>{try{const c=await T.get("/public/orders/query",{params:{order_no:i}});c.data.status==="paid"&&(clearInterval(t),B.value=c.data,Y.value="success",O.success("支付成功!"))}catch{clearInterval(t)}},3e3);setTimeout(()=>clearInterval(t),18e4)}async function et(){const{card_key:i,bot_qq:t,contact_qq:c}=f;if(!i.trim()){$.value="请输入卡密",g.value=!0;return}if(!t.trim()){$.value="请输入机器人QQ",g.value=!0;return}if(!/^\d{5,15}$/.test(t.trim())){$.value="机器人QQ格式不正确",g.value=!0;return}if(!c.trim()){$.value="请输入联系人QQ",g.value=!0;return}if(!/^\d{5,15}$/.test(c.trim())){$.value="联系人QQ格式不正确",g.value=!0;return}u.activate=!0;try{const n=await T.post("/public/authorizations/activate",{card_key:i.trim(),bot_qq:t.trim(),contact_qq:c.trim(),contact_name:f.contact_name.trim()},{_noMessage:!0});h.value=n.data,ne.value=!0}catch(n){$.value=(n==null?void 0:n.message)||"授权失败,请检查卡密和QQ格式",g.value=!0}finally{u.activate=!1}}function ie(){Ce.value="form",f.card_key="",f.bot_qq="",f.contact_qq="",f.contact_name="",h.value=null,ne.value=!1,g.value=!1,$.value=""}async function Be(){if(Z.value.trim()){u.query=!0,p.value=null,U.value=!1;try{const i=await T.get("/public/cards/query",{params:{card_key:Z.value.trim()}});p.value=i.data,U.value=!0}catch{}finally{u.query=!1}}}async function je(){if(ee.value.trim()){u.authQuery=!0,k.value=null,A.value=!1;try{const i=await T.get("/public/authorizations/query",{params:{bot_qq:ee.value.trim()}});k.value=i.data,A.value=!0}catch{}finally{u.authQuery=!1}}}function tt(){p.value=null,U.value=!1,k.value=null,A.value=!1}return(i,t)=>{var c;return s(),a("div",nt,[M(L,{name:"loader-fade"},{default:D(()=>[ae.value?(s(),a("div",it,[...t[30]||(t[30]=[e("div",{class:"loader-ring"},[e("svg",{viewBox:"0 0 40 40",width:"40",height:"40"},[e("circle",{cx:"20",cy:"20",r:"17",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-dasharray":"80 200"})])],-1),e("span",{class:"loader-text"},"加载中...",-1)])])):d("",!0)]),_:1}),t[103]||(t[103]=De('<div class="bg-canvas" data-v-ee96eedf><div class="bg-grid" data-v-ee96eedf></div><div class="bg-orb orb-a" data-v-ee96eedf></div><div class="bg-orb orb-b" data-v-ee96eedf></div><div class="bg-orb orb-c" data-v-ee96eedf></div></div>',1)),e("header",rt,[e("div",ut,[e("div",{class:"brand",onClick:t[0]||(t[0]=n=>m.value="buy")},[t[32]||(t[32]=De('<div class="brand-logo" data-v-ee96eedf><svg viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" data-v-ee96eedf><path d="M12 2L2 7l10 5 10-5-10-5z" data-v-ee96eedf></path><path d="M2 17l10 5 10-5" data-v-ee96eedf></path><path d="M2 12l10 5 10-5" data-v-ee96eedf></path></svg></div>',1)),e("div",dt,[e("span",ct,o(((c=se.value)==null?void 0:c.name)||"授权管理系统"),1),t[31]||(t[31]=e("span",{class:"brand-sub"},"专业软件授权平台",-1))])]),e("nav",{class:"nav-tabs",ref_key:"navTabsRef",ref:pe},[e("div",{class:"nav-slider",style:re(fe.value)},null,4),(s(),a(x,null,P(ve,n=>e("button",{key:n.key,ref_for:!0,ref_key:"navTabRefs",ref:ye,class:q(["nav-tab",{active:m.value===n.key}]),onClick:l=>m.value=n.key,type:"button"},[(s(),E(at(n.icon),{class:"tab-icon"})),e("span",null,o(n.label),1)],10,vt)),64))],512)])]),e("main",pt,[M(L,{name:"panel",mode:"out-in"},{default:D(()=>{var n;return[(s(),a("section",{key:m.value,class:"panel"},[m.value==="buy"?(s(),a("div",yt,[e("div",ft,[e("div",bt,[e("h2",null,o(((n=se.value)==null?void 0:n.name)||"全部商品"),1),t[33]||(t[33]=e("p",null,"精选方案 · 在线下单 · 自动交付",-1))]),e("div",mt,[e("span",kt,o(G.value.length),1),t[34]||(t[34]=e("span",{class:"stat-unit"},"项商品",-1))])]),z.value.length>1?(s(),a("div",{key:0,class:"project-switcher",ref_key:"projectSwitcherRef",ref:ge},[e("div",{class:"project-slider",style:re(xe.value)},null,4),(s(!0),a(x,null,P(z.value,l=>(s(),a("button",{key:l.id,ref_for:!0,ref_key:"projectChipRefs",ref:we,class:q(["project-chip",{active:j.value===l.id}]),onClick:b=>Qe(l),type:"button"},o(l.name),11,_t))),128))],512)):d("",!0),u.projects||u.products?(s(),a("div",ht,[(s(),a(x,null,P(3,l=>e("div",{key:l,class:"skeleton-card"},[...t[35]||(t[35]=[e("div",{class:"sk-bar sk-w60"},null,-1),e("div",{class:"sk-bar sk-w30"},null,-1),e("div",{class:"sk-bar sk-wfull"},null,-1),e("div",{class:"sk-bar sk-wfull"},null,-1),e("div",{class:"sk-bar sk-w80"},null,-1),e("div",{class:"sk-price-bar"},null,-1),e("div",{class:"sk-btn-bar"},null,-1)])])),64))])):G.value.length?(s(),a("div",{key:j.value,class:"product-grid"},[(s(!0),a(x,null,P(G.value,l=>(s(),a("article",{key:l.id,class:q(["product-card",{featured:l.sort===1}])},[l.sort===1?(s(),a("div",wt,"热门")):d("",!0),e("div",xt,[e("h3",qt,o(l.name),1),e("span",Ct,o(l.duration_days==0?"永久":l.duration_days+"天"),1)]),e("ul",Qt,[l.description?(s(),a("li",Bt,o(l.description),1)):l.duration_days==0?(s(),a("li",jt,"永久有效,一次付费终身使用")):(s(),a("li",Rt,"有效期 "+o(l.duration_days)+" 天,自动交付卡密",1))]),e("div",$t,[t[37]||(t[37]=e("span",{class:"price-cur"},"¥",-1)),e("span",Vt,o(parseFloat(l.price).toFixed(0)),1),l.original_price&&l.original_price>l.price?(s(),a("span",Mt," -"+o(Math.round((1-l.price/l.original_price)*100))+"% ",1)):d("",!0),l.original_price&&l.original_price>l.price?(s(),a("span",St,"¥"+o(parseFloat(l.original_price).toFixed(0)),1)):d("",!0)]),e("button",{class:"card-buy-btn",onClick:b=>Ye(l),type:"button"},[...t[38]||(t[38]=[e("svg",{viewBox:"0 0 24 24",width:"18",height:"18",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("circle",{cx:"9",cy:"21",r:"1"}),e("circle",{cx:"20",cy:"21",r:"1"}),e("path",{d:"M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"})],-1),S(" 立即购买 ",-1)])],8,Tt)],2))),128))])):(s(),a("div",gt,[...t[36]||(t[36]=[e("div",{class:"empty-icon"},[e("svg",{viewBox:"0 0 24 24",width:"40",height:"40",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},[e("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"}),e("line",{x1:"3.27",y1:"6.96",x2:"12",y2:"12.01"}),e("line",{x1:"12",y1:"22.08",x2:"12",y2:"12"})])],-1),e("p",{class:"empty-title"},"暂无可用商品",-1),e("p",{class:"empty-desc"},"请联系管理员上架商品",-1)])]))])):m.value==="activate"?(s(),a("div",zt,[e("div",Ft,[t[43]||(t[43]=e("div",{class:"center-icon icon-purple"},[e("svg",{viewBox:"0 0 24 24",width:"32",height:"32",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),e("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})])],-1)),t[44]||(t[44]=e("h2",{class:"center-title"},"在线授权",-1)),t[45]||(t[45]=e("p",{class:"center-desc"},"使用已有卡密完成机器人授权绑定",-1)),Ce.value==="form"?(s(),a("div",It,[e("div",Ht,[t[39]||(t[39]=e("label",null,[S("卡密 "),e("em",null,"*")],-1)),w(e("input",{"onUpdate:modelValue":t[1]||(t[1]=l=>f.card_key=l),class:"form-input",placeholder:"请输入卡密"},null,512),[[C,f.card_key]])]),e("div",Ut,[t[40]||(t[40]=e("label",null,[S("机器人QQ "),e("em",null,"*")],-1)),w(e("input",{"onUpdate:modelValue":t[2]||(t[2]=l=>f.bot_qq=l),class:"form-input",placeholder:"5-15位数字",maxlength:"15"},null,512),[[C,f.bot_qq]])]),e("div",At,[t[41]||(t[41]=e("label",null,[S("联系人QQ "),e("em",null,"*")],-1)),w(e("input",{"onUpdate:modelValue":t[3]||(t[3]=l=>f.contact_qq=l),class:"form-input",placeholder:"5-15位数字",maxlength:"15"},null,512),[[C,f.contact_qq]])]),e("div",Dt,[t[42]||(t[42]=e("label",null,"联系人名称",-1)),w(e("input",{"onUpdate:modelValue":t[4]||(t[4]=l=>f.contact_name=l),class:"form-input",placeholder:"选填",maxlength:"50"},null,512),[[C,f.contact_name]])]),e("button",{class:"btn-submit btn-purple",disabled:u.activate,onClick:et,type:"button"},[u.activate?(s(),a("span",Pt)):(s(),a("span",Nt,"确认授权"))],8,Lt)])):d("",!0)])])):d("",!0),m.value==="query"?(s(),a(x,{key:2},[e("div",{class:"query-tabs",ref_key:"queryTabsRef",ref:me},[e("div",{class:"query-slider",style:re(_e.value)},null,4),(s(),a(x,null,P(qe,l=>e("button",{key:l.key,ref_for:!0,ref_key:"queryTabRefs",ref:ke,class:q(["query-tab",{active:X.value===l.key}]),onClick:b=>{X.value=l.key,tt()},type:"button"},o(l.label),11,Xt)),64))],512),X.value==="card"?(s(),a("div",Et,[t[47]||(t[47]=e("div",{class:"center-icon icon-green"},[e("svg",{viewBox:"0 0 24 24",width:"32",height:"32",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("circle",{cx:"11",cy:"11",r:"8"}),e("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})])],-1)),t[48]||(t[48]=e("h2",{class:"center-title"},"卡密查询",-1)),t[49]||(t[49]=e("p",{class:"center-desc"},"查询卡密的授权状态、绑定信息及有效期",-1)),e("div",Kt,[t[46]||(t[46]=e("label",null,"卡密",-1)),w(e("input",{"onUpdate:modelValue":t[5]||(t[5]=l=>Z.value=l),class:"form-input",placeholder:"请输入卡密",onKeyup:Pe(Be,["enter"]),disabled:u.query},null,40,Ot),[[C,Z.value]])]),e("button",{class:"btn-submit btn-green full",disabled:!Z.value.trim()||u.query,onClick:Be,type:"button"},[u.query?(s(),a("span",Yt)):(s(),a("span",Jt,"立即查询"))],8,Gt)])):d("",!0),X.value==="bot"?(s(),a("div",Wt,[t[51]||(t[51]=e("div",{class:"center-icon icon-orange"},[e("svg",{viewBox:"0 0 24 24",width:"32",height:"32",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),e("circle",{cx:"12",cy:"7",r:"4"})])],-1)),t[52]||(t[52]=e("h2",{class:"center-title"},"授权查询",-1)),t[53]||(t[53]=e("p",{class:"center-desc"},"按机器人QQ号查询授权绑定状态",-1)),e("div",Zt,[t[50]||(t[50]=e("label",null,"机器人QQ",-1)),w(e("input",{"onUpdate:modelValue":t[6]||(t[6]=l=>ee.value=l),class:"form-input",placeholder:"请输入机器人QQ号",onKeyup:Pe(je,["enter"]),disabled:u.authQuery},null,40,es),[[C,ee.value]])]),e("button",{class:"btn-submit btn-warn full",disabled:!ee.value.trim()||u.authQuery,onClick:je,type:"button"},[u.authQuery?(s(),a("span",ss)):(s(),a("span",ls,"查询授权"))],8,ts)])):d("",!0)],64)):d("",!0)]))]}),_:1}),(s(),E(te,{to:"body"},[M(L,{name:"modal"},{default:D(()=>{var n;return[U.value&&p.value?(s(),a("div",{key:0,class:"modal-overlay",onClick:t[10]||(t[10]=Q(l=>U.value=!1,["self"]))},[e("div",{class:"modal-box card-result-modal",onClick:t[9]||(t[9]=Q(()=>{},["stop"]))},[e("button",{class:"modal-close",onClick:t[7]||(t[7]=l=>U.value=!1),type:"button","aria-label":"关闭"},[...t[54]||(t[54]=[e("svg",{viewBox:"0 0 24 24",width:"18",height:"18",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])]),t[65]||(t[65]=e("div",{class:"modal-title"},"卡密查询结果",-1)),e("div",{class:q(["cr-status",p.value.status])},[t[55]||(t[55]=e("span",{class:"cr-status-dot"},null,-1)),e("span",as,o(p.value.status_text),1)],2),e("div",os,[e("div",ns,[t[56]||(t[56]=e("span",null,"卡密",-1)),e("code",is,o(p.value.card_key),1)]),e("div",rs,[t[57]||(t[57]=e("span",null,"项目",-1)),e("span",null,o(p.value.project_name),1)]),e("div",us,[t[58]||(t[58]=e("span",null,"类型",-1)),e("span",null,o(p.value.type),1)]),e("div",ds,[t[59]||(t[59]=e("span",null,"有效期",-1)),e("span",null,o(p.value.expire_time||"永久有效"),1)]),t[64]||(t[64]=e("div",{class:"cr-divider"},null,-1)),e("div",cs,[t[60]||(t[60]=e("span",null,"机器人QQ",-1)),e("span",vs,o(p.value.bot_qq||"-"),1)]),e("div",ps,[t[61]||(t[61]=e("span",null,"联系人QQ",-1)),e("span",ys,o(p.value.contact_qq||"-"),1)]),(n=p.value.bind_info)!=null&&n.machine_id?(s(),a("div",fs,[t[62]||(t[62]=e("span",null,"绑定设备",-1)),e("span",bs,o(p.value.bind_info.machine_id),1)])):d("",!0),p.value.bound_at?(s(),a("div",ms,[t[63]||(t[63]=e("span",null,"绑定时间",-1)),e("span",null,o(p.value.bound_at),1)])):d("",!0)]),e("div",ks,[e("button",{class:"btn-submit btn-blue full",onClick:t[8]||(t[8]=l=>U.value=!1),type:"button"},"知道了")])])])):d("",!0)]}),_:1})])),(s(),E(te,{to:"body"},[M(L,{name:"modal"},{default:D(()=>{var n,l;return[ne.value&&h.value?(s(),a("div",{key:0,class:"modal-overlay",onClick:Q(ie,["self"])},[e("div",{class:"modal-box activate-success-modal",onClick:t[11]||(t[11]=Q(()=>{},["stop"]))},[e("button",{class:"modal-close",onClick:ie,type:"button","aria-label":"关闭"},[...t[66]||(t[66]=[e("svg",{viewBox:"0 0 24 24",width:"18",height:"18",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])]),t[73]||(t[73]=e("div",{class:"act-success-anim"},[e("div",{class:"act-success-ring"},[e("svg",{class:"act-check",viewBox:"0 0 24 24",width:"44",height:"44",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},[e("polyline",{points:"20 6 9 17 4 12"})])])],-1)),e("h3",_s,o((n=h.value)!=null&&n.is_renew?"续费成功":"授权成功"),1),e("p",hs,o((l=h.value)!=null&&l.is_renew?"授权有效期已延长":"卡密已成功绑定到以下机器人"),1),e("div",gs,[e("div",ws,[t[67]||(t[67]=e("span",null,"所属项目",-1)),e("strong",null,o(h.value.project_name),1)]),e("div",xs,[t[68]||(t[68]=e("span",null,"机器人QQ",-1)),e("strong",qs,o(h.value.bot_qq),1)]),e("div",Cs,[t[69]||(t[69]=e("span",null,"联系人QQ",-1)),e("strong",Qs,o(h.value.contact_qq),1)]),e("div",Bs,[t[70]||(t[70]=e("span",null,"卡密",-1)),e("strong",js,o(h.value.card_key),1)]),h.value.expire_time?(s(),a("div",Rs,[t[71]||(t[71]=e("span",null,"到期时间",-1)),e("strong",null,o(h.value.expire_time),1)])):(s(),a("div",$s,[...t[72]||(t[72]=[e("span",null,"有效期",-1),e("strong",null,"永久有效",-1)])]))]),e("div",{class:"modal-footer"},[e("button",{class:"btn-submit btn-blue full",onClick:ie,type:"button"},"继续授权")])])])):d("",!0)]}),_:1})])),(s(),E(te,{to:"body"},[M(L,{name:"modal"},{default:D(()=>[g.value?(s(),a("div",{key:0,class:"modal-overlay",onClick:t[15]||(t[15]=Q(n=>g.value=!1,["self"]))},[e("div",{class:"modal-box activate-error-modal",onClick:t[14]||(t[14]=Q(()=>{},["stop"]))},[e("button",{class:"modal-close",onClick:t[12]||(t[12]=n=>g.value=!1),type:"button","aria-label":"关闭"},[...t[74]||(t[74]=[e("svg",{viewBox:"0 0 24 24",width:"18",height:"18",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])]),t[75]||(t[75]=e("div",{class:"act-error-anim"},[e("div",{class:"act-error-ring"},[e("svg",{class:"act-cross",viewBox:"0 0 24 24",width:"40",height:"40",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},[e("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e("line",{x1:"6",y1:"6",x2:"18",y2:"18"})])])],-1)),t[76]||(t[76]=e("h3",{class:"act-error-title"},"授权失败",-1)),t[77]||(t[77]=e("p",{class:"act-error-sub"},"请核对信息后重试",-1)),e("div",Vs,[e("p",null,o($.value),1)]),e("div",Ms,[e("button",{class:"btn-submit btn-gray full",onClick:t[13]||(t[13]=n=>g.value=!1),type:"button"},"知道了")])])])):d("",!0)]),_:1})])),(s(),E(te,{to:"body"},[M(L,{name:"modal"},{default:D(()=>[A.value&&k.value?(s(),a("div",{key:0,class:"modal-overlay",onClick:t[19]||(t[19]=Q(n=>A.value=!1,["self"]))},[e("div",{class:"modal-box query-result-modal",onClick:t[18]||(t[18]=Q(()=>{},["stop"]))},[e("button",{class:"modal-close",onClick:t[16]||(t[16]=n=>A.value=!1),type:"button"},"×"),t[84]||(t[84]=e("div",{class:"modal-title"},"查询结果",-1)),e("div",Ss,[e("div",{class:q(["qr-stat",{ok:k.value.has_valid_auth}])},[e("span",Ts,o(k.value.has_valid_auth?"✓":"✗"),1),e("span",zs,o(k.value.has_valid_auth?"有有效授权":"无有效授权"),1)],2),e("div",Fs,[e("div",Is,[e("span",Hs,o(k.value.total),1),t[78]||(t[78]=e("span",{class:"qr-label"},"总记录",-1))]),e("div",Us,[e("span",As,o(k.value.active_count),1),t[79]||(t[79]=e("span",{class:"qr-label"},"有效",-1))]),e("div",Ds,[e("span",Ls,o(k.value.expired_count),1),t[80]||(t[80]=e("span",{class:"qr-label"},"已过期",-1))])])]),k.value.list.length?(s(),a("div",Ps,[(s(!0),a(x,null,P(k.value.list,n=>(s(),a("div",{key:n.id,class:"qr-item"},[e("div",Ns,[e("span",Xs,o(n.bot_qq),1),e("span",{class:q(["qr-badge",n.is_expired?"expired":n.status==="revoked"?"revoked":"active"])},o(n.is_expired?"已过期":n.status==="revoked"?"已撤销":"有效"),3)]),e("div",Es,[e("div",Ks,[t[81]||(t[81]=e("span",null,"所属项目",-1)),e("span",null,o(n.project_name_full||n.project_name),1)]),e("div",Os,[t[82]||(t[82]=e("span",null,"首次授权",-1)),e("span",null,o(n.authorized_at||"-"),1)]),e("div",Gs,[t[83]||(t[83]=e("span",null,"到期时间",-1)),e("span",null,o(n.expire_time||"永久有效"),1)])])]))),128))])):d("",!0),e("div",Ys,[e("button",{class:"btn-submit btn-blue full",onClick:t[17]||(t[17]=n=>A.value=!1),type:"button"},"知道了")])])])):d("",!0)]),_:1})]))]),e("footer",Js,[e("p",null,"CardAuth 授权管理系统 © "+o(new Date().getFullYear()),1),t[85]||(t[85]=e("p",{class:"footer-sub"},"Powered by Vue3 + Element Plus",-1))]),(s(),E(te,{to:"body"},[M(L,{name:"modal"},{default:D(()=>{var n,l,b,V,Re,$e,Ve,Me,Se,Te,ze,Fe,Ie,He,Ue;return[N.value?(s(),a("div",{key:0,class:"modal-overlay",onClick:t[29]||(t[29]=Q(v=>N.value=!1,["self"]))},[e("div",{class:"modal-box",onClick:t[28]||(t[28]=Q(()=>{},["stop"]))},[e("button",{class:"modal-close",onClick:t[20]||(t[20]=v=>N.value=!1),type:"button","aria-label":"关闭"},[...t[86]||(t[86]=[e("svg",{viewBox:"0 0 24 24",width:"18",height:"18",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])]),Y.value==="confirm"?(s(),a(x,{key:0},[e("div",Ws,[e("div",Zs,[M(ce)]),e("div",el,[e("div",tl,o((n=se.value)==null?void 0:n.name)+" - "+o((l=_.value)==null?void 0:l.name),1),e("div",sl,o(((b=_.value)==null?void 0:b.duration_days)==0?"永久授权":((V=_.value)==null?void 0:V.duration_days)+"天授权"),1)]),e("div",ll,[t[87]||(t[87]=e("span",{class:"mp-cur"},"¥",-1)),e("span",al,o(parseFloat(((Re=_.value)==null?void 0:Re.price)||0).toFixed(0)),1)])]),e("div",ol,[e("div",nl,[t[88]||(t[88]=e("label",null,[S("机器人QQ "),e("em",null,"*")],-1)),w(e("input",{"onUpdate:modelValue":t[21]||(t[21]=v=>F.value=v),class:"form-input",placeholder:"5-15位数字",maxlength:"15"},null,512),[[C,F.value]])]),e("div",il,[t[89]||(t[89]=e("label",null,[S("联系人QQ "),e("em",null,"*")],-1)),w(e("input",{"onUpdate:modelValue":t[22]||(t[22]=v=>R.value=v),class:"form-input",placeholder:"5-15位数字",maxlength:"15"},null,512),[[C,R.value]])]),e("div",rl,[t[90]||(t[90]=e("label",null,"联系人名称",-1)),w(e("input",{"onUpdate:modelValue":t[23]||(t[23]=v=>W.value=v),class:"form-input",placeholder:"选填",maxlength:"50"},null,512),[[C,W.value]])]),H.value?d("",!0):(s(),a("div",ul,[t[91]||(t[91]=e("label",null,"优惠码",-1)),e("div",dl,[w(e("input",{"onUpdate:modelValue":t[24]||(t[24]=v=>I.value=v),class:"form-input flex-1",placeholder:"选填"},null,512),[[C,I.value]]),e("button",{class:"btn-sm btn-green",disabled:!I.value.trim()||u.buyCoupon,onClick:Je,type:"button"},[u.buyCoupon?(s(),a("span",vl)):(s(),a("span",pl,"验证"))],8,cl)]),y.value?(s(),a("span",{key:0,class:q(["coupon-hint",{ok:y.value.valid,fail:!y.value.valid}])},[S(o(y.value.message),1),y.value.valid?(s(),a(x,{key:0},[S(" -¥"+o(y.value.discount_amount),1)],64)):d("",!0)],2)):d("",!0)])),H.value?d("",!0):(s(),a("div",yl,[t[93]||(t[93]=e("label",null,"支付方式",-1)),e("div",fl,[(s(),a(x,null,P(Oe,v=>e("label",{key:v.value,class:q(["pay-opt",{active:J.value===v.value}])},[w(e("input",{type:"radio","onUpdate:modelValue":t[25]||(t[25]=st=>J.value=st),value:v.value,hidden:""},null,8,bl),[[ot,J.value]]),e("span",{class:"pay-icon",innerHTML:v.icon},null,8,ml),e("span",kl,o(v.label),1),t[92]||(t[92]=e("span",{class:"pay-check"},[e("svg",{viewBox:"0 0 16 16",width:"12",height:"12",fill:"currentColor"},[e("path",{d:"M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z"})])],-1))],2)),64))])])),e("div",_l,[e("div",hl,[e("span",gl,o(H.value?"免费商品":"应付金额"),1),($e=y.value)!=null&&$e.valid?(s(),a("span",wl,"¥"+o(parseFloat(((Ve=_.value)==null?void 0:Ve.price)||0).toFixed(2)),1)):d("",!0),e("span",{class:q(["m-total-price",{"free-text":H.value}])},o(H.value?"免费":"¥"+Ke.value.toFixed(2)),3)])])]),e("div",xl,[e("button",{class:"btn-ghost",onClick:t[26]||(t[26]=v=>N.value=!1),type:"button"},"取消"),e("button",{class:"btn-submit btn-blue",disabled:u.pay,onClick:We,type:"button"},[u.pay?(s(),a("span",Cl)):(s(),a("span",Ql,o(H.value?"免费获取":"立即支付"),1))],8,ql)])],64)):Y.value==="success"?(s(),a("div",Bl,[t[100]||(t[100]=e("div",{class:"success-ring"},[e("svg",{class:"check-svg",viewBox:"0 0 24 24",width:"44",height:"44",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},[e("polyline",{points:"20 6 9 17 4 12"})])],-1)),t[101]||(t[101]=e("h3",{class:"modal-title"},"授权成功",-1)),t[102]||(t[102]=e("p",{class:"success-sub"},"机器人QQ已自动完成授权绑定",-1)),e("div",jl,[e("div",Rl,[t[94]||(t[94]=e("span",null,"订单号",-1)),e("span",$l,o((Me=B.value)==null?void 0:Me.order_no),1)]),e("div",Vl,[t[95]||(t[95]=e("span",null,"项目",-1)),e("span",null,o(((Se=B.value)==null?void 0:Se.project_name)||((Te=se.value)==null?void 0:Te.name)+" "+((ze=_.value)==null?void 0:ze.name)),1)]),e("div",Ml,[t[96]||(t[96]=e("span",null,"机器人QQ",-1)),e("strong",Sl,o(((Fe=B.value)==null?void 0:Fe.bot_qq)||F.value),1)]),e("div",Tl,[t[97]||(t[97]=e("span",null,"联系人QQ",-1)),e("strong",zl,o(((Ie=B.value)==null?void 0:Ie.contact_qq)||R.value),1)]),(He=B.value)!=null&&He.expire_time?(s(),a("div",Fl,[t[98]||(t[98]=e("span",null,"到期时间",-1)),e("strong",null,o((Ue=B.value)==null?void 0:Ue.expire_time),1)])):(s(),a("div",Il,[...t[99]||(t[99]=[e("span",null,"有效期",-1),e("strong",null,"永久有效",-1)])]))]),e("div",Hl,[e("button",{class:"btn-submit btn-blue full",onClick:t[27]||(t[27]=v=>{N.value=!1,m.value="query"}),type:"button"},"去查询授权")])])):d("",!0)])])):d("",!0)]}),_:1})]))])}}},Pl=lt(Ul,[["__scopeId","data-v-ee96eedf"]]);export{Pl as default};