import{d as e,u as a,r as s,q as l,o as t,g as c,y as n,c as o,w as u,i,b as r,e as d,f,h as _,j as m,F as v,k as y,t as b,z as p,l as k,m as g,J as h,p as w,K as x,L as C,H as j,M as N,N as I}from"./index-Co9nPWLO.js";import{_ as L}from"./_plugin-vue_export-helper.BCo6x5W8.js";const M=L(e({__name:"index",setup(e){const L=a(),M=s([]),q=s(["无限次生成音频","无字数限制","10+ 优质音色","优先处理队列","专属客服支持"]),z=s(1),F=s(!1),H=l(()=>{const e=M.value.find(e=>e.level===z.value);return(null==e?void 0:e.price)||0});function J(){h()}async function K(){if(!L.isLoggedIn)return void w({url:"/pages/login/index"});const e=2===z.value?"yearly":"monthly";try{const a=await x("/member/order",{productType:e}),s=C().platform;!1||"devtools"===s?j({title:"模拟支付",content:`确认支付 ¥${a.amount}？\n（开发环境模拟支付）`,success:async e=>{e.confirm&&await async function(e){try{N({title:"支付中..."}),await x("/member/pay/mock",{orderNo:e}),I(),await L.fetchMemberStatus(),j({title:"支付成功",content:"恭喜您成为会员！",showCancel:!1,success:()=>{h()}})}catch(a){I(),console.error("支付失败:",a)}}(a.orderNo)}}):n({title:"请使用真实支付",icon:"none",duration:3e3})}catch(a){console.error("创建订单失败:",a),n({title:a.message||"创建订单失败",icon:"none"})}}return t(async()=>{await async function(){F.value=!0;try{const e=await c("/member/benefits");M.value=e.levels}catch(e){console.error("获取权益失败:",e),n({title:"加载失败",icon:"none"})}finally{F.value=!1}}()}),(e,a)=>{const s=f,l=i,t=g;return r(),o(l,{class:"page"},{default:u(()=>[d(l,{class:"nav-bar"},{default:u(()=>[d(l,{class:"nav-btn",onClick:J},{default:u(()=>[d(s,{class:"nav-icon"},{default:u(()=>[_("←")]),_:1})]),_:1}),d(s,{class:"nav-title"},{default:u(()=>[_("会员中心")]),_:1}),d(l,{class:"nav-btn"})]),_:1}),F.value?(r(),o(l,{key:1,class:"loading-container"},{default:u(()=>[d(s,{class:"loading-text"},{default:u(()=>[_("加载中...")]),_:1})]),_:1})):(r(),o(l,{key:0,class:"benefits-section"},{default:u(()=>[d(s,{class:"section-title"},{default:u(()=>[_("会员权益")]),_:1}),(r(!0),m(v,null,y(q.value,(e,a)=>(r(),o(l,{class:"benefit-item",key:a},{default:u(()=>[d(s,{class:"benefit-icon"},{default:u(()=>[_("✓")]),_:1}),d(s,{class:"benefit-text"},{default:u(()=>[_(b(e),1)]),_:2},1024)]),_:2},1024))),128))]),_:1})),d(l,{class:"cards-section"},{default:u(()=>[(r(!0),m(v,null,y(M.value,(e,a)=>(r(),o(l,{key:e.level,class:p(["member-card",{active:z.value===e.level,recommend:1===e.level}]),onClick:a=>z.value=e.level},{default:u(()=>[1===e.level?(r(),o(l,{key:0,class:"recommend-badge"},{default:u(()=>[d(s,null,{default:u(()=>[_("推荐")]),_:1})]),_:1})):k("",!0),d(s,{class:"card-name"},{default:u(()=>[_(b(e.name),1)]),_:2},1024),d(l,{class:"card-price"},{default:u(()=>[d(s,{class:"price-symbol"},{default:u(()=>[_("¥")]),_:1}),d(s,{class:"price-value"},{default:u(()=>[_(b(e.price),1)]),_:2},1024),d(s,{class:"price-unit"},{default:u(()=>[_("/"+b(2===e.level?"年":"月"),1)]),_:2},1024)]),_:2},1024),d(l,{class:"card-features"},{default:u(()=>[(r(!0),m(v,null,y(e.features,(e,a)=>(r(),o(s,{key:a,class:"feature-item"},{default:u(()=>[_(b(e),1)]),_:2},1024))),128))]),_:2},1024)]),_:2},1032,["class","onClick"]))),128))]),_:1}),d(l,{class:"bottom-section"},{default:u(()=>[d(t,{class:"subscribe-btn",onClick:K},{default:u(()=>[d(s,{class:"btn-text"},{default:u(()=>[_("立即开通 ¥"+b(H.value),1)]),_:1})]),_:1}),d(s,{class:"terms"},{default:u(()=>[_("开通即表示同意《会员服务协议》")]),_:1})]),_:1})]),_:1})}}}),[["__scopeId","data-v-5f51dd90"]]);export{M as default};
