Files
wordpress-theme-aksrt/assets/admin/build/ResourceDownload.DvRILKEZ.js
T
kate522 a3dde3874a feat(admin): strip SPA ops menus; redirect old hashes to native WP (Phase 4)
SPA shop/forum/payment/users sections now keep configuration pages only.
Operational workbenches were removed from the sidebar and loaders; legacy
hash routes open NativeOpsRedirect into the matching WP native admin page.
Admin SPA production build refreshed accordingly.
2026-07-15 02:10:05 +08:00

2 lines
8.2 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{o as z,X as L,a4 as t,a3 as o,r as f,a1 as s,e as W,_ as E,W as R,f as r,Y as _,Z as m,a2 as H,a5 as I,c as V}from"./vendor-vue.Bykizn0M.js";import{a as c}from"./shared-api.D5_fnN32.js";import{P as O}from"./PageHeader.Di3JTPjc.js";import{u as X}from"./vendor-naive.BuHWlEgf.js";import"./index.js";import"./vendor-misc.1adHN6i_.js";const Y={class:"aksrt-page-container"},Z={class:"aksrt-form-actions"},ae={__name:"ResourceDownload",setup(j){const B=E(),k=X(),b=f(!0),x=f(!1),C=f({}),v=f({}),P=f({}),a=W({download_login:!0,download_credit:!0,download_captcha:!1,download_default_cost:0,payment_paid_post_types:"post",payment_vip_free_download:!1,payment_vip_exempt_roles:"",payment_paid_catalog_note:"",payment_manual_delivery_note:"付费或人工确认内容请在订单备注中记录交付方式。"}),S=V(()=>P.value.currency_name||v.value.currency_name||"积分"),T=V(()=>{var e;const l=((e=P.value.gateway)==null?void 0:e.mode)||"manual_review";return l==="test_gateway"?"测试网关":l==="adapter_ready"?"适配器就绪":"人工确认"});function N(l){B.push(l)}function U(l){return(l==null?void 0:l.data)??l??{}}async function h(){var l;b.value=!0;try{const[e,y,w,u]=await Promise.all([c.getCmsFeatures(),c.getCreditSettings(),c.getSchemaPage("payment","paid"),c.getPaymentOverview()]),p=(e==null?void 0:e.cms_features)??((l=e==null?void 0:e.data)==null?void 0:l.cms_features)??{},i=U(y),d=U(w);C.value=p,v.value=i,P.value=U(u),a.download_login=p.download_login!==!1,a.download_credit=p.download_credit!==!1,a.download_captcha=!!p.download_captcha,a.download_default_cost=Number(i.download_default_cost||0),a.payment_paid_post_types=d.payment_paid_post_types||"post",a.payment_vip_free_download=!!d.payment_vip_free_download,a.payment_vip_exempt_roles=d.payment_vip_exempt_roles||"",a.payment_paid_catalog_note=d.payment_paid_catalog_note||"",a.payment_manual_delivery_note=d.payment_manual_delivery_note||"付费或人工确认内容请在订单备注中记录交付方式。"}catch(e){k.error(e.message||"加载下载/付费内容中心失败")}finally{b.value=!1}}async function F(){x.value=!0;try{const l={...C.value,download_login:a.download_login,download_credit:a.download_credit,download_captcha:a.download_captcha},e={...v.value,download_default_cost:Number(a.download_default_cost||0)};await Promise.all([c.saveCmsFeatures(l),c.saveCreditSettings(e),c.saveSchemaPage("payment","paid",{payment_paid_post_types:a.payment_paid_post_types,payment_vip_free_download:a.payment_vip_free_download,payment_vip_exempt_roles:a.payment_vip_exempt_roles,payment_paid_catalog_note:a.payment_paid_catalog_note,payment_manual_delivery_note:a.payment_manual_delivery_note})]),C.value=l,v.value=e,k.success("下载/付费内容中心已保存")}catch(l){k.error(l.message||"保存失败")}finally{x.value=!1}}return z(h),(l,e)=>{const y=s("n-button"),w=s("n-space"),u=s("n-tag"),p=s("n-card"),i=s("n-switch"),d=s("n-form-item"),M=s("n-input-number"),D=s("n-form"),g=s("n-input"),$=s("n-alert"),q=s("n-spin");return R(),L("div",Y,[t(O,{title:"下载/付费内容中心",desc:"统一管理资源下载门槛、积分购买模式开关、角色免扣和人工交付说明。付费解锁走收银台订单,下载 token 不再按次扣费。"},{actions:o(()=>[t(w,null,{default:o(()=>[t(y,{quaternary:"",onClick:e[0]||(e[0]=n=>N("/permissions/download"))},{default:o(()=>[...e[11]||(e[11]=[r("下载权限",-1)])]),_:1}),t(y,{quaternary:"",onClick:e[1]||(e[1]=n=>N("/payment/gateway"))},{default:o(()=>[...e[12]||(e[12]=[r("收款接口",-1)])]),_:1})]),_:1})]),_:1}),t(q,{show:b.value,style:{width:"100%","min-height":"200px"}},{default:o(()=>[t(p,{class:"aksrt-section-card"},{default:o(()=>[e[14]||(e[14]=_("div",{class:"aksrt-section-header"},[_("h3",null,"当前联动摘要")],-1)),t(w,null,{default:o(()=>[t(u,{round:"",type:a.download_login?"warning":"default"},{default:o(()=>[r(" 登录门槛:"+m(a.download_login?"已启用":"已关闭"),1)]),_:1},8,["type"]),t(u,{round:"",type:a.download_credit?"warning":"default"},{default:o(()=>[r(" 积分购买模式:"+m(a.download_credit?"已启用":"已关闭"),1)]),_:1},8,["type"]),t(u,{round:"",type:a.download_captcha?"warning":"default"},{default:o(()=>[r(" 下载验证码:"+m(a.download_captcha?"已启用":"已关闭"),1)]),_:1},8,["type"]),t(u,{round:"",type:"info"},{default:o(()=>[r(" 默认积分价:"+m(a.download_default_cost)+" "+m(S.value),1)]),_:1}),t(u,{round:"",type:a.payment_vip_free_download?"success":"default"},{default:o(()=>[r(" 角色白名单免费:"+m(a.payment_vip_free_download?"已启用":"未启用"),1)]),_:1},8,["type"]),t(u,{round:"",type:"info"},{default:o(()=>[...e[13]||(e[13]=[r(" Token TTL:10 分钟 ",-1)])]),_:1})]),_:1})]),_:1}),t(p,{class:"aksrt-section-card"},{default:o(()=>[e[17]||(e[17]=_("div",{class:"aksrt-section-header"},[_("h3",null,"下载门槛")],-1)),t(D,{model:a,"label-placement":"left","label-width":"180",class:"aksrt-form"},{default:o(()=>[t(d,{label:"下载需要登录"},{default:o(()=>[t(i,{value:a.download_login,"onUpdate:value":e[2]||(e[2]=n=>a.download_login=n)},null,8,["value"])]),_:1}),t(d,{label:"允许积分购买模式"},{feedback:o(()=>[...e[15]||(e[15]=[_("span",{class:"aksrt-hint-text"},"开启后,文章 pay_modo=积分 可走收银台一次购买解锁;下载 token 不再按次扣积分。关闭时积分模式资源按免费/需登录策略处理。",-1)])]),default:o(()=>[t(i,{value:a.download_credit,"onUpdate:value":e[3]||(e[3]=n=>a.download_credit=n)},null,8,["value"])]),_:1}),t(d,{label:"下载启用验证码"},{default:o(()=>[t(i,{value:a.download_captcha,"onUpdate:value":e[4]||(e[4]=n=>a.download_captcha=n)},null,8,["value"])]),_:1}),t(d,{label:`默认积分价(${S.value})`},{feedback:o(()=>[...e[16]||(e[16]=[_("span",{class:"aksrt-hint-text"},"仅作运营参考/兼容字段;实际价格以文章 _aksrt_pay 的积分价/现金价为准。角色白名单命中时免费下载。",-1)])]),default:o(()=>[t(M,{value:a.download_default_cost,"onUpdate:value":e[5]||(e[5]=n=>a.download_default_cost=n),min:0,max:1e5,style:{width:"180px"}},null,8,["value"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),t(p,{class:"aksrt-section-card"},{default:o(()=>[e[20]||(e[20]=_("div",{class:"aksrt-section-header"},[_("h3",null,"付费内容策略")],-1)),t(D,{model:a,"label-placement":"left","label-width":"180",class:"aksrt-form"},{default:o(()=>[t(d,{label:"受管内容类型"},{feedback:o(()=>[...e[18]||(e[18]=[_("span",{class:"aksrt-hint-text"},"逗号分隔,标记纳入统一付费策略的内容类型。",-1)])]),default:o(()=>[t(g,{value:a.payment_paid_post_types,"onUpdate:value":e[6]||(e[6]=n=>a.payment_paid_post_types=n),placeholder:"post,course,doc"},null,8,["value"])]),_:1}),t(d,{label:"角色白名单免扣下载"},{default:o(()=>[t(i,{value:a.payment_vip_free_download,"onUpdate:value":e[7]||(e[7]=n=>a.payment_vip_free_download=n)},null,8,["value"])]),_:1}),a.payment_vip_free_download?(R(),H(d,{key:0,label:"免扣角色列表"},{feedback:o(()=>[...e[19]||(e[19]=[_("span",{class:"aksrt-hint-text"},"命中这些 WordPress role 的用户可免费下载(无需购买)。",-1)])]),default:o(()=>[t(g,{value:a.payment_vip_exempt_roles,"onUpdate:value":e[8]||(e[8]=n=>a.payment_vip_exempt_roles=n),placeholder:"administrator,editor,vip"},null,8,["value"])]),_:1})):I("",!0),t(d,{label:"前台付费提示"},{default:o(()=>[t(g,{value:a.payment_paid_catalog_note,"onUpdate:value":e[9]||(e[9]=n=>a.payment_paid_catalog_note=n),type:"textarea",autosize:{minRows:3,maxRows:6},placeholder:"可填写资源购买须知、交付说明或人工确认提示。"},null,8,["value"])]),_:1}),t(d,{label:"人工交付备注"},{default:o(()=>[t(g,{value:a.payment_manual_delivery_note,"onUpdate:value":e[10]||(e[10]=n=>a.payment_manual_delivery_note=n),type:"textarea",autosize:{minRows:3,maxRows:6}},null,8,["value"])]),_:1})]),_:1},8,["model"])]),_:1}),t(p,{class:"aksrt-section-card"},{default:o(()=>[t($,{type:"info","show-icon":!1},{default:o(()=>[r(" 当前收款模式:"+m(T.value)+"。充值、VIP、返佣和分成页均已提供稳定结构,订单和结算台账直接衔接这些字段。 ",1)]),_:1})]),_:1}),_("div",Z,[t(y,{type:"primary",loading:x.value,onClick:F},{default:o(()=>[...e[21]||(e[21]=[r("保存配置",-1)])]),_:1},8,["loading"])])]),_:1},8,["show"])])}}};export{ae as default};