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