阶段性修改

This commit is contained in:
tianmo committed 2026-09-29 19:34:24 +08:00
1 parent 4833f7fa6a
commit 5a92bab835
65 files changed
+346 -178

No files matched your search

@@ -1 +1 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[971],{1910:(e,t,n)=>{"use strict";n.d(t,{L:()=>l,M3:()=>o,WG:()=>s,gf:()=>a});let r="yelay_admin_token";function a(){var e;return null!=(e=window.localStorage.getItem(r))?e:""}function s(e){window.localStorage.setItem(r,e)}function l(){window.localStorage.removeItem(r)}function o(){return""!==a()}},2787:(e,t,n)=>{"use strict";n.d(t,{$T:()=>c,$n:()=>a,Sv:()=>u,TM:()=>l,Zp:()=>d,aF:()=>i,l6:()=>o,pd:()=>s});var r=n(1333);function a(e){let{children:t,onClick:n,variant:a="primary",disabled:s,type:l="button"}=e;return(0,r.jsx)("button",{type:l,onClick:n,disabled:s,className:"rounded-md px-3 py-1.5 text-sm font-medium transition disabled:cursor-not-allowed disabled:opacity-50 ".concat({primary:"bg-blue-600 text-white hover:bg-blue-700",ghost:"bg-white text-gray-700 border border-gray-300 hover:bg-gray-50",danger:"bg-red-600 text-white hover:bg-red-700"}[a]),children:t})}function s(e){let{value:t,onChange:n,placeholder:a,type:s="text"}=e;return(0,r.jsx)("input",{type:s,value:t,placeholder:a,onChange:e=>n(e.target.value),className:"w-full rounded-md border border-gray-300 px-3 py-1.5 text-sm outline-none focus:border-blue-500"})}function l(e){let{value:t,onChange:n}=e;return(0,r.jsx)("textarea",{value:t,rows:6,onChange:e=>n(e.target.value),className:"w-full rounded-md border border-gray-300 px-3 py-1.5 font-mono text-xs outline-none focus:border-blue-500"})}function o(e){let{value:t,onChange:n,options:a}=e;return(0,r.jsx)("select",{value:t,onChange:e=>n(e.target.value),className:"w-full rounded-md border border-gray-300 px-3 py-1.5 text-sm outline-none focus:border-blue-500",children:a.map(e=>(0,r.jsx)("option",{value:String(e.value),children:e.label},e.value))})}function d(e){let{title:t,children:n,action:a}=e;return(0,r.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(t||a)&&(0,r.jsxs)("header",{className:"mb-4 flex items-center justify-between",children:[t&&(0,r.jsx)("h2",{className:"text-base font-semibold text-gray-900",children:t}),a]}),n]})}function i(e){let{open:t,title:n,onClose:a,children:s,footer:l}=e;return t?(0,r.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",children:(0,r.jsxs)("div",{className:"max-h-[85vh] w-full max-w-2xl overflow-auto rounded-lg bg-white shadow-xl",children:[(0,r.jsxs)("header",{className:"flex items-center justify-between border-b border-gray-200 px-5 py-3",children:[(0,r.jsx)("h3",{className:"text-base font-semibold",children:n}),(0,r.jsx)("button",{onClick:a,className:"text-gray-400 hover:text-gray-600","aria-label":"关闭",children:"✕"})]}),(0,r.jsx)("div",{className:"px-5 py-4",children:s}),l&&(0,r.jsx)("footer",{className:"flex justify-end gap-2 border-t border-gray-200 px-5 py-3",children:l})]})}):null}function c(e){let{message:t,kind:n="error"}=e;return t?(0,r.jsx)("div",{className:"mb-3 rounded-md border px-3 py-2 text-sm ".concat("error"===n?"bg-red-50 text-red-700 border-red-200":"bg-green-50 text-green-700 border-green-200"),children:t}):null}function u(e){let{text:t="暂无数据"}=e;return(0,r.jsx)("div",{className:"py-10 text-center text-sm text-gray-400",children:t})}},4978:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});var r=n(1333),a=n(4705),s=n(8312),l=n(2787);function o(){let[e,t]=(0,a.useState)(null),[n,o]=(0,a.useState)("");return(0,a.useEffect)(()=>{s.F.stats().then(t).catch(e=>o(e.message))},[]),(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("h1",{className:"text-lg font-semibold text-gray-900",children:"数据看板"}),(0,r.jsx)(l.$T,{message:n}),e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4 lg:grid-cols-4",children:[(0,r.jsx)(d,{label:"用户总数",value:String(e.users)}),(0,r.jsx)(d,{label:"在售课程",value:String(e.courses)}),(0,r.jsx)(d,{label:"累计订单",value:String(e.orders)}),(0,r.jsx)(d,{label:"已开通",value:String(e.delivered)}),(0,r.jsx)(d,{label:"已退款",value:String(e.refunded)}),(0,r.jsx)(d,{label:"成交金额(元)",value:(e.revenueFen/100).toFixed(2)}),(0,r.jsx)(d,{label:"支付能力",value:e.payEnabled?"已配置":"未配置"})]}),!e.payEnabled&&(0,r.jsx)(l.Zp,{title:"支付尚未启用",children:(0,r.jsx)("p",{className:"text-sm text-gray-600",children:"服务端未配置虚拟支付参数(WX_OFFER_ID / WX_PAY_APPKEY),用户暂时无法购买课程。 请在微信小程序后台开通虚拟支付后,将 OfferID 与现网 AppKey 写入服务端环境变量。"})})]}):(0,r.jsx)("div",{className:"text-sm text-gray-400",children:"加载中…"})]})}function d(e){let{label:t,value:n}=e;return(0,r.jsxs)("div",{className:"rounded-lg border border-gray-200 bg-white px-4 py-3 shadow-sm",children:[(0,r.jsx)("div",{className:"text-xs text-gray-500",children:t}),(0,r.jsx)("div",{className:"mt-1 text-2xl font-semibold text-gray-900",children:n})]})}},8312:(e,t,n)=>{"use strict";n.d(t,{F:()=>o});var r=n(1910);let a="Line truncated
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[971],{1910:(e,t,n)=>{"use strict";n.d(t,{L:()=>l,M3:()=>o,WG:()=>s,gf:()=>a});let r="yelay_admin_token";function a(){var e;return null!=(e=window.localStorage.getItem(r))?e:""}function s(e){window.localStorage.setItem(r,e)}function l(){window.localStorage.removeItem(r)}function o(){return""!==a()}},2787:(e,t,n)=>{"use strict";n.d(t,{$T:()=>c,$n:()=>a,Sv:()=>u,TM:()=>l,Zp:()=>d,aF:()=>i,l6:()=>o,pd:()=>s});var r=n(1333);function a(e){let{children:t,onClick:n,variant:a="primary",disabled:s,type:l="button"}=e;return(0,r.jsx)("button",{type:l,onClick:n,disabled:s,className:"rounded-md px-3 py-1.5 text-sm font-medium transition disabled:cursor-not-allowed disabled:opacity-50 ".concat({primary:"bg-blue-600 text-white hover:bg-blue-700",ghost:"bg-white text-gray-700 border border-gray-300 hover:bg-gray-50",danger:"bg-red-600 text-white hover:bg-red-700"}[a]),children:t})}function s(e){let{value:t,onChange:n,placeholder:a,type:s="text"}=e;return(0,r.jsx)("input",{type:s,value:t,placeholder:a,onChange:e=>n(e.target.value),className:"w-full rounded-md border border-gray-300 px-3 py-1.5 text-sm outline-none focus:border-blue-500"})}function l(e){let{value:t,onChange:n}=e;return(0,r.jsx)("textarea",{value:t,rows:6,onChange:e=>n(e.target.value),className:"w-full rounded-md border border-gray-300 px-3 py-1.5 font-mono text-xs outline-none focus:border-blue-500"})}function o(e){let{value:t,onChange:n,options:a}=e;return(0,r.jsx)("select",{value:t,onChange:e=>n(e.target.value),className:"w-full rounded-md border border-gray-300 px-3 py-1.5 text-sm outline-none focus:border-blue-500",children:a.map(e=>(0,r.jsx)("option",{value:String(e.value),children:e.label},e.value))})}function d(e){let{title:t,children:n,action:a}=e;return(0,r.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(t||a)&&(0,r.jsxs)("header",{className:"mb-4 flex items-center justify-between",children:[t&&(0,r.jsx)("h2",{className:"text-base font-semibold text-gray-900",children:t}),a]}),n]})}function i(e){let{open:t,title:n,onClose:a,children:s,footer:l}=e;return t?(0,r.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",children:(0,r.jsxs)("div",{className:"max-h-[85vh] w-full max-w-2xl overflow-auto rounded-lg bg-white shadow-xl",children:[(0,r.jsxs)("header",{className:"flex items-center justify-between border-b border-gray-200 px-5 py-3",children:[(0,r.jsx)("h3",{className:"text-base font-semibold",children:n}),(0,r.jsx)("button",{onClick:a,className:"text-gray-400 hover:text-gray-600","aria-label":"关闭",children:"✕"})]}),(0,r.jsx)("div",{className:"px-5 py-4",children:s}),l&&(0,r.jsx)("footer",{className:"flex justify-end gap-2 border-t border-gray-200 px-5 py-3",children:l})]})}):null}function c(e){let{message:t,kind:n="error"}=e;return t?(0,r.jsx)("div",{className:"mb-3 rounded-md border px-3 py-2 text-sm ".concat("error"===n?"bg-red-50 text-red-700 border-red-200":"bg-green-50 text-green-700 border-green-200"),children:t}):null}function u(e){let{text:t="暂无数据"}=e;return(0,r.jsx)("div",{className:"py-10 text-center text-sm text-gray-400",children:t})}},4978:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});var r=n(1333),a=n(4705),s=n(8312),l=n(2787);function o(){let[e,t]=(0,a.useState)(null),[n,o]=(0,a.useState)("");return(0,a.useEffect)(()=>{s.F.stats().then(t).catch(e=>o(e.message))},[]),(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("h1",{className:"text-lg font-semibold text-gray-900",children:"数据看板"}),(0,r.jsx)(l.$T,{message:n}),e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4 lg:grid-cols-4",children:[(0,r.jsx)(d,{label:"用户总数",value:String(e.users)}),(0,r.jsx)(d,{label:"在售课程",value:String(e.courses)}),(0,r.jsx)(d,{label:"累计订单",value:String(e.orders)}),(0,r.jsx)(d,{label:"已开通",value:String(e.delivered)}),(0,r.jsx)(d,{label:"已退款",value:String(e.refunded)}),(0,r.jsx)(d,{label:"成交金额(元)",value:(e.revenueFen/100).toFixed(2)}),(0,r.jsx)(d,{label:"支付能力",value:e.payEnabled?1===e.payEnv?"已配置 \xb7 沙箱":"已配置 \xb7 现网":"未配置"})]}),!e.payEnabled&&(0,r.jsx)(l.Zp,{title:"支付尚未启用",children:(0,r.jsx)("p",{className:"text-sm text-gray-600",children:"服务端未配置虚拟支付参数(WX_OFFER_ID / WX_PAY_APPKEY),用户暂时无法购买课程。 请在微信小程序后台开通虚拟支付后,将 OfferID 与现网 AppKey 写入服务端环境变量。"})}),e.payEnabled&&1===e.payEnv&&(0,r.jsx)(l.Zp,{title:"当前处于沙箱环境",children:(0,r.jsx)("p",{className:"text-sm text-gray-600",children:"支付走的是沙箱密钥,不会产生真实扣款,用户也不会真正获得课程。 正式收款前请把服务端的 WX_PAY_ENV 改回 0 并重启。"})})]}):(0,r.jsx)("div",{className:"text-sm text-gray-400",children:"加载中…"})]})}functLine truncated