@tbox.cn/app-module-ai-payment 0.1.7 → 1.0.0-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,3 @@
1
- // src/client/index.ts
2
- import "../ai-payment-T4BAVWU6.css";
3
-
4
1
  // src/client/cards/payment-order/index.tsx
5
2
  import { useEffect, useRef, useState } from "react";
6
3
  import { callJsapi, createClientLogger, isInAlipayShell, mapPaymentResultCode, markSelfRendering, sendCardAction } from "@tbox.cn/app-agent-sdk-client";
@@ -79,55 +76,55 @@ function PaymentOrderCard(props) {
79
76
  }
80
77
  };
81
78
  const completed = paid || data.payState === "paid";
82
- return /* @__PURE__ */ jsxs("div", { className: "ap-card", "data-ap-pay-state": paid ? "paid" : data.payState, children: [
83
- /* @__PURE__ */ jsxs("div", { className: "ap-order-heading", children: [
79
+ return /* @__PURE__ */ jsxs("div", { className: "ap-card bg-card p-3.5 text-foreground", "data-ap-pay-state": paid ? "paid" : data.payState, children: [
80
+ /* @__PURE__ */ jsxs("div", { className: "ap-order-heading flex items-center justify-between gap-3 text-base font-bold leading-5.5", children: [
84
81
  /* @__PURE__ */ jsx("span", { children: "\u5F85\u652F\u4ED8\u8BA2\u5355" }),
85
- /* @__PURE__ */ jsx("span", { className: "ap-order-status", children: completed ? "\u5DF2\u652F\u4ED8" : "\u5F85\u4ED8\u6B3E" })
82
+ /* @__PURE__ */ jsx("span", { className: "ap-order-status whitespace-nowrap text-xs leading-4 text-secondary-foreground", children: completed ? "\u5DF2\u652F\u4ED8" : "\u5F85\u4ED8\u6B3E" })
86
83
  ] }),
87
- /* @__PURE__ */ jsx("ul", { className: "ap-order-list", "aria-label": "\u652F\u4ED8\u8BA2\u5355", children: /* @__PURE__ */ jsxs("li", { className: "ap-order-item", children: [
88
- /* @__PURE__ */ jsx("span", { className: "ap-order-icon", "aria-hidden": "true", children: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 32 32", fill: "none", children: [
84
+ /* @__PURE__ */ jsx("ul", { className: "ap-order-list m-0 mt-3 list-none p-0", "aria-label": "\u652F\u4ED8\u8BA2\u5355", children: /* @__PURE__ */ jsxs("li", { className: "ap-order-item flex items-center gap-2.5", children: [
85
+ /* @__PURE__ */ jsx("span", { className: "ap-order-icon grid size-11 shrink-0 place-items-center rounded-md bg-primary-soft text-primary", "aria-hidden": "true", children: /* @__PURE__ */ jsxs("svg", { className: "size-8", viewBox: "0 0 32 32", fill: "none", children: [
89
86
  /* @__PURE__ */ jsx("path", { d: "M8 11h16l2 16H6l2-16Z", fill: "currentColor", opacity: ".2" }),
90
87
  /* @__PURE__ */ jsx("path", { d: "M12 12V9a4 4 0 0 1 8 0v3M8 11h16l2 16H6l2-16Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
91
88
  ] }) }),
92
- /* @__PURE__ */ jsxs("div", { className: "ap-order-details", children: [
93
- /* @__PURE__ */ jsx("div", { className: "ap-card__title", children: data.subject }),
94
- /* @__PURE__ */ jsx("p", { className: "ap-order-description", children: "\u6807\u51C6\u6B3E \xB7 1 \u4EF6" })
89
+ /* @__PURE__ */ jsxs("div", { className: "ap-order-details min-w-0 flex-1", children: [
90
+ /* @__PURE__ */ jsx("div", { className: "ap-card__title text-sm font-semibold leading-5 [overflow-wrap:anywhere]", children: data.subject }),
91
+ /* @__PURE__ */ jsx("p", { className: "ap-order-description mt-1 text-xs leading-4.5 text-secondary-foreground", children: "\u6807\u51C6\u6B3E \xB7 1 \u4EF6" })
95
92
  ] }),
96
- /* @__PURE__ */ jsxs("span", { className: "ap-order-amount", children: [
93
+ /* @__PURE__ */ jsxs("span", { className: "ap-order-amount shrink-0 text-base font-semibold leading-5.5 tabular-nums", children: [
97
94
  "\xA5",
98
95
  data.totalAmountText
99
96
  ] })
100
97
  ] }) }),
101
- /* @__PURE__ */ jsx("button", { type: "button", className: "ap-card__btn ap-order-pay", disabled, onClick: () => void pay(), children: completed ? "\u5DF2\u652F\u4ED8" : pending ? "\u652F\u4ED8\u5904\u7406\u4E2D\u2026" : "\u53BB\u652F\u4ED8" }),
102
- message && /* @__PURE__ */ jsx("p", { role: "status", className: "ap-card__hint", children: message }),
103
- cashier && /* @__PURE__ */ jsxs("dialog", { ref: cashierRef, className: "ap-cashier", "aria-label": "\u6A21\u62DF\u652F\u4ED8\u5B9D\u6536\u94F6\u53F0", onCancel: () => setCashier(false), children: [
104
- /* @__PURE__ */ jsxs("p", { className: "ap-cashier-notice", children: [
105
- /* @__PURE__ */ jsx("img", { className: "ap-cashier-avatar", src: "https://mdn.alipayobjects.com/agt_content/afts/img/rK3vQJFsoeEAAAAAAAAAAAAADhe3AQBr/original", alt: "" }),
98
+ /* @__PURE__ */ jsx("button", { type: "button", className: "ap-card__btn ap-order-pay mt-3 min-h-9 w-full cursor-pointer rounded-full border-0 bg-primary px-3 py-1.5 text-sm font-semibold leading-5 text-white disabled:cursor-not-allowed disabled:bg-muted disabled:text-muted-foreground", disabled, onClick: () => void pay(), children: completed ? "\u5DF2\u652F\u4ED8" : pending ? "\u652F\u4ED8\u5904\u7406\u4E2D\u2026" : "\u53BB\u652F\u4ED8" }),
99
+ message && /* @__PURE__ */ jsx("p", { role: "status", className: "ap-card__hint mt-2 break-words text-xs leading-4.5 text-secondary-foreground", children: message }),
100
+ cashier && /* @__PURE__ */ jsxs("dialog", { ref: cashierRef, className: "ap-cashier m-auto max-h-[85dvh] w-full max-w-240 overflow-y-auto rounded-t-3xl border-0 bg-transparent p-0 text-center text-foreground backdrop:bg-scrim animate-[tbox-cashier-enter_180ms_ease-out] motion-reduce:animate-none", "aria-label": "\u6A21\u62DF\u652F\u4ED8\u5B9D\u6536\u94F6\u53F0", onCancel: () => setCashier(false), children: [
101
+ /* @__PURE__ */ jsxs("p", { className: "ap-cashier-notice mb-2 flex items-center gap-1.5 rounded-full bg-card px-3 py-2 text-left text-xs leading-normal text-secondary-foreground", children: [
102
+ /* @__PURE__ */ jsx("img", { className: "ap-cashier-avatar size-5 shrink-0 rounded-full object-cover", src: "https://mdn.alipayobjects.com/agt_content/afts/img/rK3vQJFsoeEAAAAAAAAAAAAADhe3AQBr/original", alt: "" }),
106
103
  /* @__PURE__ */ jsx("span", { children: "\u4F53\u9A8C\u667A\u80FD\u4F53\u6B63\u5728\u4E3A\u60A8\u4E0B\u5355\uFF0C\u8BF7\u786E\u8BA4" })
107
104
  ] }),
108
- /* @__PURE__ */ jsxs("div", { className: "ap-cashier-panel", children: [
109
- /* @__PURE__ */ jsxs("header", { className: "ap-cashier-header", children: [
110
- /* @__PURE__ */ jsx("button", { type: "button", className: "ap-cashier-close", "aria-label": "\u5173\u95ED\u6536\u94F6\u53F0", onClick: () => setCashier(false), children: "\xD7" }),
111
- /* @__PURE__ */ jsx("span", { className: "ap-cashier-brand", children: "\u652F AI\u4ED8" })
105
+ /* @__PURE__ */ jsxs("div", { className: "ap-cashier-panel min-h-[min(50dvh,840px)] rounded-t-3xl bg-card px-5 pb-[calc(20px+env(safe-area-inset-bottom))] pt-4", children: [
106
+ /* @__PURE__ */ jsxs("header", { className: "ap-cashier-header relative flex min-h-7 items-center justify-center", children: [
107
+ /* @__PURE__ */ jsx("button", { type: "button", className: "ap-cashier-close absolute -left-1 -top-1 size-9 cursor-pointer rounded-md border-0 bg-transparent text-2xl text-secondary-foreground", "aria-label": "\u5173\u95ED\u6536\u94F6\u53F0", onClick: () => setCashier(false), children: "\xD7" }),
108
+ /* @__PURE__ */ jsx("span", { className: "ap-cashier-brand text-lg font-semibold text-primary", children: "\u652F AI\u4ED8" })
112
109
  ] }),
113
- /* @__PURE__ */ jsxs("div", { className: "ap-cashier-summary", children: [
114
- /* @__PURE__ */ jsx("p", { className: "ap-cashier-merchant", children: "\u793A\u4F8B\u5546\u5BB6" }),
115
- /* @__PURE__ */ jsxs("div", { className: "ap-cashier-amount", children: [
110
+ /* @__PURE__ */ jsxs("div", { className: "ap-cashier-summary my-4.5 mb-6", children: [
111
+ /* @__PURE__ */ jsx("p", { className: "ap-cashier-merchant mb-1.5 text-xs leading-4.5 text-secondary-foreground", children: "\u793A\u4F8B\u5546\u5BB6" }),
112
+ /* @__PURE__ */ jsxs("div", { className: "ap-cashier-amount text-3xl font-bold leading-tight tabular-nums", children: [
116
113
  "\xA5 ",
117
114
  data.totalAmountText
118
115
  ] }),
119
- /* @__PURE__ */ jsx("p", { className: "ap-cashier-product", children: data.subject })
116
+ /* @__PURE__ */ jsx("p", { className: "ap-cashier-product mt-1.5 text-xs leading-4.5 text-secondary-foreground", children: data.subject })
120
117
  ] }),
121
- /* @__PURE__ */ jsxs("div", { className: "ap-cashier-method", children: [
122
- /* @__PURE__ */ jsx("span", { className: "ap-cashier-method-icon", "aria-hidden": "true", children: "\u652F" }),
118
+ /* @__PURE__ */ jsxs("div", { className: "ap-cashier-method flex items-center gap-2.5 rounded-xl bg-muted p-3 text-left text-sm", children: [
119
+ /* @__PURE__ */ jsx("span", { className: "ap-cashier-method-icon grid size-7.5 place-items-center rounded-full bg-primary font-semibold text-white", "aria-hidden": "true", children: "\u652F" }),
123
120
  /* @__PURE__ */ jsx("span", { children: "\u652F\u4ED8\u5B9D\u4F59\u989D\uFF08\u6A21\u62DF\uFF09" })
124
121
  ] }),
125
- /* @__PURE__ */ jsx("button", { type: "button", className: "ap-card__btn ap-cashier-pay", "data-ap-confirm": true, disabled, onClick: () => {
122
+ /* @__PURE__ */ jsx("button", { type: "button", className: "ap-card__btn ap-cashier-pay mt-5 min-h-9 w-full cursor-pointer rounded-full border-0 bg-primary px-3 py-1.5 text-sm font-semibold leading-5 text-white disabled:cursor-not-allowed disabled:bg-muted disabled:text-muted-foreground", "data-ap-confirm": true, disabled, onClick: () => {
126
123
  setCashier(false);
127
124
  setMessage("\u6A21\u62DF\u652F\u4ED8\u6210\u529F");
128
125
  report("success");
129
126
  }, children: "\u4ED8\u6B3E" }),
130
- /* @__PURE__ */ jsx("p", { className: "ap-cashier-disclaimer", children: "\u6A21\u62DF\u6536\u94F6\u53F0\uFF0C\u4EC5\u4F53\u9A8C\uFF0C\u4E0D\u4F1A\u5B9E\u9645\u6263\u6B3E" })
127
+ /* @__PURE__ */ jsx("p", { className: "ap-cashier-disclaimer mt-3 text-xs leading-4.5 text-secondary-foreground", children: "\u6A21\u62DF\u6536\u94F6\u53F0\uFF0C\u4EC5\u4F53\u9A8C\uFF0C\u4E0D\u4F1A\u5B9E\u9645\u6263\u6B3E" })
131
128
  ] })
132
129
  ] })
133
130
  ] });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tbox.cn/app-module-ai-payment",
3
- "version": "0.1.7",
3
+ "version": "1.0.0-alpha.6",
4
4
  "type": "module",
5
5
  "description": "AI 支付体验:Web 模拟收银台与端内云容器创单",
6
6
  "exports": {
@@ -19,10 +19,10 @@
19
19
  "./package.json": "./package.json"
20
20
  },
21
21
  "dependencies": {
22
- "@tbox.cn/app-agent-sdk-client": "0.2.1",
23
- "@tbox.cn/app-agent-sdk-server": "0.3.3",
24
- "@tbox.cn/app-contracts": "0.13.3",
25
- "@tbox.cn/app-contracts-mall": "0.14.0"
22
+ "@tbox.cn/app-agent-sdk-server": "1.0.0-alpha.6",
23
+ "@tbox.cn/app-contracts": "1.0.0-alpha.6",
24
+ "@tbox.cn/app-contracts-mall": "1.0.0-alpha.6",
25
+ "@tbox.cn/app-agent-sdk-client": "1.0.0-alpha.6"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "zod": "3.25.76",
@@ -58,9 +58,6 @@
58
58
  "access": "public"
59
59
  },
60
60
  "license": "MIT",
61
- "sideEffects": [
62
- "**/*.css"
63
- ],
64
61
  "scripts": {
65
62
  "typecheck": "tsc --noEmit",
66
63
  "test": "vitest run",
@@ -55,56 +55,56 @@ export function PaymentOrderCard(props: { data: PaymentOrderCardData; cardId: st
55
55
  };
56
56
  const completed = paid || data.payState === 'paid';
57
57
  return (
58
- <div className="ap-card" data-ap-pay-state={paid ? 'paid' : data.payState}>
59
- <div className="ap-order-heading">
58
+ <div className="ap-card bg-card p-3.5 text-foreground" data-ap-pay-state={paid ? 'paid' : data.payState}>
59
+ <div className="ap-order-heading flex items-center justify-between gap-3 text-base font-bold leading-5.5">
60
60
  <span>待支付订单</span>
61
- <span className="ap-order-status">{completed ? '已支付' : '待付款'}</span>
61
+ <span className="ap-order-status whitespace-nowrap text-xs leading-4 text-secondary-foreground">{completed ? '已支付' : '待付款'}</span>
62
62
  </div>
63
- <ul className="ap-order-list" aria-label="支付订单">
64
- <li className="ap-order-item">
65
- <span className="ap-order-icon" aria-hidden="true">
66
- <svg viewBox="0 0 32 32" fill="none">
63
+ <ul className="ap-order-list m-0 mt-3 list-none p-0" aria-label="支付订单">
64
+ <li className="ap-order-item flex items-center gap-2.5">
65
+ <span className="ap-order-icon grid size-11 shrink-0 place-items-center rounded-md bg-primary-soft text-primary" aria-hidden="true">
66
+ <svg className="size-8" viewBox="0 0 32 32" fill="none">
67
67
  <path d="M8 11h16l2 16H6l2-16Z" fill="currentColor" opacity=".2" />
68
68
  <path d="M12 12V9a4 4 0 0 1 8 0v3M8 11h16l2 16H6l2-16Z" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" />
69
69
  </svg>
70
70
  </span>
71
- <div className="ap-order-details">
72
- <div className="ap-card__title">{data.subject}</div>
73
- <p className="ap-order-description">标准款 · 1 件</p>
71
+ <div className="ap-order-details min-w-0 flex-1">
72
+ <div className="ap-card__title text-sm font-semibold leading-5 [overflow-wrap:anywhere]">{data.subject}</div>
73
+ <p className="ap-order-description mt-1 text-xs leading-4.5 text-secondary-foreground">标准款 · 1 件</p>
74
74
  </div>
75
- <span className="ap-order-amount">¥{data.totalAmountText}</span>
75
+ <span className="ap-order-amount shrink-0 text-base font-semibold leading-5.5 tabular-nums">¥{data.totalAmountText}</span>
76
76
  </li>
77
77
  </ul>
78
- <button type="button" className="ap-card__btn ap-order-pay" disabled={disabled} onClick={() => void pay()}>
78
+ <button type="button" className="ap-card__btn ap-order-pay mt-3 min-h-9 w-full cursor-pointer rounded-full border-0 bg-primary px-3 py-1.5 text-sm font-semibold leading-5 text-white disabled:cursor-not-allowed disabled:bg-muted disabled:text-muted-foreground" disabled={disabled} onClick={() => void pay()}>
79
79
  {completed ? '已支付' : pending ? '支付处理中…' : '去支付'}
80
80
  </button>
81
- {message && <p role="status" className="ap-card__hint">{message}</p>}
81
+ {message && <p role="status" className="ap-card__hint mt-2 break-words text-xs leading-4.5 text-secondary-foreground">{message}</p>}
82
82
  {cashier && (
83
- <dialog ref={cashierRef} className="ap-cashier" aria-label="模拟支付宝收银台" onCancel={() => setCashier(false)}>
84
- <p className="ap-cashier-notice">
85
- <img className="ap-cashier-avatar" src="https://mdn.alipayobjects.com/agt_content/afts/img/rK3vQJFsoeEAAAAAAAAAAAAADhe3AQBr/original" alt="" />
83
+ <dialog ref={cashierRef} className="ap-cashier m-auto max-h-[85dvh] w-full max-w-240 overflow-y-auto rounded-t-3xl border-0 bg-transparent p-0 text-center text-foreground backdrop:bg-scrim animate-[tbox-cashier-enter_180ms_ease-out] motion-reduce:animate-none" aria-label="模拟支付宝收银台" onCancel={() => setCashier(false)}>
84
+ <p className="ap-cashier-notice mb-2 flex items-center gap-1.5 rounded-full bg-card px-3 py-2 text-left text-xs leading-normal text-secondary-foreground">
85
+ <img className="ap-cashier-avatar size-5 shrink-0 rounded-full object-cover" src="https://mdn.alipayobjects.com/agt_content/afts/img/rK3vQJFsoeEAAAAAAAAAAAAADhe3AQBr/original" alt="" />
86
86
  <span>体验智能体正在为您下单,请确认</span>
87
87
  </p>
88
- <div className="ap-cashier-panel">
89
- <header className="ap-cashier-header">
90
- <button type="button" className="ap-cashier-close" aria-label="关闭收银台" onClick={() => setCashier(false)}>×</button>
91
- <span className="ap-cashier-brand">支 AI付</span>
88
+ <div className="ap-cashier-panel min-h-[min(50dvh,840px)] rounded-t-3xl bg-card px-5 pb-[calc(20px+env(safe-area-inset-bottom))] pt-4">
89
+ <header className="ap-cashier-header relative flex min-h-7 items-center justify-center">
90
+ <button type="button" className="ap-cashier-close absolute -left-1 -top-1 size-9 cursor-pointer rounded-md border-0 bg-transparent text-2xl text-secondary-foreground" aria-label="关闭收银台" onClick={() => setCashier(false)}>×</button>
91
+ <span className="ap-cashier-brand text-lg font-semibold text-primary">支 AI付</span>
92
92
  </header>
93
- <div className="ap-cashier-summary">
94
- <p className="ap-cashier-merchant">示例商家</p>
95
- <div className="ap-cashier-amount">¥ {data.totalAmountText}</div>
96
- <p className="ap-cashier-product">{data.subject}</p>
93
+ <div className="ap-cashier-summary my-4.5 mb-6">
94
+ <p className="ap-cashier-merchant mb-1.5 text-xs leading-4.5 text-secondary-foreground">示例商家</p>
95
+ <div className="ap-cashier-amount text-3xl font-bold leading-tight tabular-nums">¥ {data.totalAmountText}</div>
96
+ <p className="ap-cashier-product mt-1.5 text-xs leading-4.5 text-secondary-foreground">{data.subject}</p>
97
97
  </div>
98
- <div className="ap-cashier-method">
99
- <span className="ap-cashier-method-icon" aria-hidden="true">支</span>
98
+ <div className="ap-cashier-method flex items-center gap-2.5 rounded-xl bg-muted p-3 text-left text-sm">
99
+ <span className="ap-cashier-method-icon grid size-7.5 place-items-center rounded-full bg-primary font-semibold text-white" aria-hidden="true">支</span>
100
100
  <span>支付宝余额(模拟)</span>
101
101
  </div>
102
- <button type="button" className="ap-card__btn ap-cashier-pay" data-ap-confirm disabled={disabled} onClick={() => {
102
+ <button type="button" className="ap-card__btn ap-cashier-pay mt-5 min-h-9 w-full cursor-pointer rounded-full border-0 bg-primary px-3 py-1.5 text-sm font-semibold leading-5 text-white disabled:cursor-not-allowed disabled:bg-muted disabled:text-muted-foreground" data-ap-confirm disabled={disabled} onClick={() => {
103
103
  setCashier(false);
104
104
  setMessage('模拟支付成功');
105
105
  report('success');
106
106
  }}>付款</button>
107
- <p className="ap-cashier-disclaimer">模拟收银台,仅体验,不会实际扣款</p>
107
+ <p className="ap-cashier-disclaimer mt-3 text-xs leading-4.5 text-secondary-foreground">模拟收银台,仅体验,不会实际扣款</p>
108
108
  </div>
109
109
  </dialog>
110
110
  )}
@@ -1,8 +1,6 @@
1
1
  /**
2
2
  * module-ai-payment 客户端入口(与服务端 serverModule 对称)。
3
3
  */
4
- import './styles/ai-payment.css'; // 模块自持 CSS(副作用 import,首行保证先行加载)
5
-
6
4
  import type { CardComponent } from '@tbox.cn/app-contracts';
7
5
  import type { ClientContext, ClientModule } from '@tbox.cn/app-agent-sdk-client';
8
6
  import { PaymentOrderCard } from './cards';
package/tbox.module.json CHANGED
@@ -3,7 +3,6 @@
3
3
  "id": "module-ai-payment",
4
4
  "name": "AI 支付",
5
5
  "description": "0.01 元测试商品,Web 模拟支付与端内云容器创单支付",
6
- "version": "0.1.3",
7
6
  "kind": "business",
8
7
  "risk": {
9
8
  "level": "medium",
package/tsup.config.ts CHANGED
@@ -27,9 +27,6 @@ export default defineConfig({
27
27
  'express',
28
28
  '@phosphor-icons/react',
29
29
  ],
30
- loader: {
31
- '.css': 'copy',
32
- },
33
30
  esbuildOptions(options) {
34
31
  options.jsx = 'automatic';
35
32
  },
@@ -1,166 +0,0 @@
1
- /*
2
- * module-ai-payment 域样式(ap- 前缀,模块自持零跨模块共享)。
3
- * 尺寸按仓库 750 设计稿 2x px 编写,经 pxtorem 转换;卡框描边和圆角由 SDK 统一。
4
- * 机械规则:禁 color-mix / !important;--tbox-* 语义变量恒带 fallback(消费形态);
5
- * 不声明元素级 --tbox-asset-*(品牌 IP 素材唯一归宿 = 主题包,guard-asset-cascade 拦截)。
6
- */
7
- .ap-card {
8
- --ap-accent: #096bfa;
9
- --ap-text: var(--tbox-text-primary, #182235);
10
- --ap-text-2: var(--tbox-text-secondary, #6f7c8f);
11
- --ap-surface: var(--tbox-bg-card, #fff);
12
-
13
- box-sizing: border-box;
14
- width: 100%;
15
- padding: 28px;
16
- background: var(--ap-surface);
17
- color: var(--ap-text);
18
- font: inherit;
19
- }
20
- .ap-card *,
21
- .ap-card *::before,
22
- .ap-card *::after {
23
- box-sizing: border-box;
24
- }
25
- .ap-card__title {
26
- font-size: 28px;
27
- line-height: 40px;
28
- font-weight: 600;
29
- color: var(--ap-text);
30
- }
31
- .ap-card__btn {
32
- margin-top: 24px;
33
- width: 100%;
34
- min-height: 72px;
35
- padding: 12px 24px;
36
- border: 0;
37
- border-radius: 999px;
38
- font-family: inherit;
39
- font-size: 27px;
40
- font-weight: 600;
41
- line-height: 40px;
42
- color: #fff;
43
- background: var(--ap-accent);
44
- cursor: pointer;
45
- }
46
- .ap-card__btn:disabled {
47
- background: var(--tbox-bg-subtle, #f2f4f8);
48
- color: var(--tbox-text-muted, #9aa4b4);
49
- cursor: not-allowed;
50
- }
51
- .ap-card__btn:focus-visible,
52
- .ap-cashier-close:focus-visible {
53
- outline: 4px solid var(--ap-accent);
54
- outline-offset: 4px;
55
- }
56
- .ap-card__hint {
57
- margin: 16px 0 0;
58
- font-size: 24px;
59
- line-height: 36px;
60
- overflow-wrap: anywhere;
61
- color: var(--ap-text-2);
62
- }
63
-
64
- .ap-order-heading {
65
- display: flex;
66
- align-items: center;
67
- justify-content: space-between;
68
- gap: 24px;
69
- font-size: 30px;
70
- line-height: 44px;
71
- font-weight: 700;
72
- }
73
- .ap-order-status {
74
- color: var(--tbox-text-secondary, #6f7c8f);
75
- font-size: 22px;
76
- line-height: 32px;
77
- font-weight: 400;
78
- white-space: nowrap;
79
- }
80
- .ap-order-list { list-style: none; margin: 24px 0 0; padding: 0; }
81
- .ap-order-item { display: flex; align-items: center; gap: 20px; }
82
- .ap-order-icon {
83
- display: grid;
84
- place-items: center;
85
- flex: 0 0 88px;
86
- height: 88px;
87
- border-radius: 16px;
88
- background: #eef4fc;
89
- color: var(--ap-accent);
90
- }
91
- .ap-order-icon svg { width: 64px; height: 64px; }
92
- .ap-order-details { flex: 1; min-width: 0; }
93
- .ap-order-details .ap-card__title { overflow-wrap: anywhere; }
94
- .ap-order-description { margin: 8px 0 0; color: var(--tbox-text-secondary, #6f7c8f); font-size: 24px; line-height: 36px; }
95
- .ap-order-amount { flex-shrink: 0; color: var(--ap-text); font-size: 32px; line-height: 44px; font-weight: 600; font-variant-numeric: tabular-nums; }
96
- .ap-order-pay { border-radius: 28px; }
97
- .ap-cashier {
98
- position: fixed;
99
- inset: auto 0 0;
100
- margin: 0 auto;
101
- width: min(100%, 960px);
102
- max-width: 100%;
103
- max-height: 85dvh;
104
- box-sizing: border-box;
105
- padding: 0;
106
- border: 0;
107
- background: transparent;
108
- color: var(--tbox-text-primary, #182235);
109
- font: inherit;
110
- text-align: center;
111
- overflow-y: auto;
112
- animation: ap-cashier-enter 180ms ease-out;
113
- }
114
- .ap-cashier-notice {
115
- display: flex;
116
- align-items: center;
117
- gap: 12px;
118
- margin: 0 0 16px;
119
- padding: 18px 24px;
120
- border-radius: 999px;
121
- background: var(--tbox-bg-card, #fff);
122
- color: var(--tbox-text-secondary, #6f7c8f);
123
- font-size: 24px;
124
- line-height: 1.5;
125
- text-align: left;
126
- }
127
- .ap-cashier-avatar {
128
- width: 40px;
129
- height: 40px;
130
- flex-shrink: 0;
131
- border-radius: 50%;
132
- object-fit: cover;
133
- }
134
- .ap-cashier-panel {
135
- min-height: min(50dvh, 840px);
136
- box-sizing: border-box;
137
- padding: 32px 40px calc(40px + env(safe-area-inset-bottom, 0px));
138
- border-radius: 40px 40px 0 0;
139
- background: var(--tbox-bg-card, #fff);
140
- }
141
- .ap-cashier::backdrop { background: rgba(0, 0, 0, 0.35); }
142
- .ap-cashier-header { position: relative; display: flex; align-items: center; justify-content: center; min-height: 56px; }
143
- .ap-cashier-close {
144
- position: absolute;
145
- left: -8px;
146
- top: -8px;
147
- width: 72px;
148
- height: 72px;
149
- border: 0;
150
- border-radius: 16px;
151
- background: transparent;
152
- color: var(--tbox-text-secondary, #6f7c8f);
153
- font-size: 52px;
154
- cursor: pointer;
155
- }
156
- .ap-cashier-brand { color: var(--ap-accent); font-size: 36px; font-weight: 600; }
157
- .ap-cashier-summary { margin: 36px 0 48px; }
158
- .ap-cashier-merchant { margin: 0 0 12px; color: var(--tbox-text-secondary, #6f7c8f); font-size: 24px; line-height: 36px; }
159
- .ap-cashier-amount { font-size: 64px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
160
- .ap-cashier-product { margin: 12px 0 0; color: var(--tbox-text-secondary, #6f7c8f); font-size: 24px; line-height: 36px; }
161
- .ap-cashier-method { display: flex; align-items: center; gap: 20px; padding: 24px; border-radius: 24px; background: var(--tbox-bg-subtle, #f7f9fc); text-align: left; font-size: 28px; }
162
- .ap-cashier-method-icon { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: var(--ap-accent); color: #fff; font-weight: 600; }
163
- .ap-cashier-pay { margin-top: 40px; }
164
- .ap-cashier-disclaimer { margin: 24px 0 0; color: var(--tbox-text-secondary, #6f7c8f); font-size: 24px; line-height: 36px; }
165
- @keyframes ap-cashier-enter { from { transform: translateY(100%); } to { transform: translateY(0); } }
166
- @media (prefers-reduced-motion: reduce) { .ap-cashier { animation: none; } }
@@ -1,166 +0,0 @@
1
- /*
2
- * module-ai-payment 域样式(ap- 前缀,模块自持零跨模块共享)。
3
- * 尺寸按仓库 750 设计稿 2x px 编写,经 pxtorem 转换;卡框描边和圆角由 SDK 统一。
4
- * 机械规则:禁 color-mix / !important;--tbox-* 语义变量恒带 fallback(消费形态);
5
- * 不声明元素级 --tbox-asset-*(品牌 IP 素材唯一归宿 = 主题包,guard-asset-cascade 拦截)。
6
- */
7
- .ap-card {
8
- --ap-accent: #096bfa;
9
- --ap-text: var(--tbox-text-primary, #182235);
10
- --ap-text-2: var(--tbox-text-secondary, #6f7c8f);
11
- --ap-surface: var(--tbox-bg-card, #fff);
12
-
13
- box-sizing: border-box;
14
- width: 100%;
15
- padding: 28px;
16
- background: var(--ap-surface);
17
- color: var(--ap-text);
18
- font: inherit;
19
- }
20
- .ap-card *,
21
- .ap-card *::before,
22
- .ap-card *::after {
23
- box-sizing: border-box;
24
- }
25
- .ap-card__title {
26
- font-size: 28px;
27
- line-height: 40px;
28
- font-weight: 600;
29
- color: var(--ap-text);
30
- }
31
- .ap-card__btn {
32
- margin-top: 24px;
33
- width: 100%;
34
- min-height: 72px;
35
- padding: 12px 24px;
36
- border: 0;
37
- border-radius: 999px;
38
- font-family: inherit;
39
- font-size: 27px;
40
- font-weight: 600;
41
- line-height: 40px;
42
- color: #fff;
43
- background: var(--ap-accent);
44
- cursor: pointer;
45
- }
46
- .ap-card__btn:disabled {
47
- background: var(--tbox-bg-subtle, #f2f4f8);
48
- color: var(--tbox-text-muted, #9aa4b4);
49
- cursor: not-allowed;
50
- }
51
- .ap-card__btn:focus-visible,
52
- .ap-cashier-close:focus-visible {
53
- outline: 4px solid var(--ap-accent);
54
- outline-offset: 4px;
55
- }
56
- .ap-card__hint {
57
- margin: 16px 0 0;
58
- font-size: 24px;
59
- line-height: 36px;
60
- overflow-wrap: anywhere;
61
- color: var(--ap-text-2);
62
- }
63
-
64
- .ap-order-heading {
65
- display: flex;
66
- align-items: center;
67
- justify-content: space-between;
68
- gap: 24px;
69
- font-size: 30px;
70
- line-height: 44px;
71
- font-weight: 700;
72
- }
73
- .ap-order-status {
74
- color: var(--tbox-text-secondary, #6f7c8f);
75
- font-size: 22px;
76
- line-height: 32px;
77
- font-weight: 400;
78
- white-space: nowrap;
79
- }
80
- .ap-order-list { list-style: none; margin: 24px 0 0; padding: 0; }
81
- .ap-order-item { display: flex; align-items: center; gap: 20px; }
82
- .ap-order-icon {
83
- display: grid;
84
- place-items: center;
85
- flex: 0 0 88px;
86
- height: 88px;
87
- border-radius: 16px;
88
- background: #eef4fc;
89
- color: var(--ap-accent);
90
- }
91
- .ap-order-icon svg { width: 64px; height: 64px; }
92
- .ap-order-details { flex: 1; min-width: 0; }
93
- .ap-order-details .ap-card__title { overflow-wrap: anywhere; }
94
- .ap-order-description { margin: 8px 0 0; color: var(--tbox-text-secondary, #6f7c8f); font-size: 24px; line-height: 36px; }
95
- .ap-order-amount { flex-shrink: 0; color: var(--ap-text); font-size: 32px; line-height: 44px; font-weight: 600; font-variant-numeric: tabular-nums; }
96
- .ap-order-pay { border-radius: 28px; }
97
- .ap-cashier {
98
- position: fixed;
99
- inset: auto 0 0;
100
- margin: 0 auto;
101
- width: min(100%, 960px);
102
- max-width: 100%;
103
- max-height: 85dvh;
104
- box-sizing: border-box;
105
- padding: 0;
106
- border: 0;
107
- background: transparent;
108
- color: var(--tbox-text-primary, #182235);
109
- font: inherit;
110
- text-align: center;
111
- overflow-y: auto;
112
- animation: ap-cashier-enter 180ms ease-out;
113
- }
114
- .ap-cashier-notice {
115
- display: flex;
116
- align-items: center;
117
- gap: 12px;
118
- margin: 0 0 16px;
119
- padding: 18px 24px;
120
- border-radius: 999px;
121
- background: var(--tbox-bg-card, #fff);
122
- color: var(--tbox-text-secondary, #6f7c8f);
123
- font-size: 24px;
124
- line-height: 1.5;
125
- text-align: left;
126
- }
127
- .ap-cashier-avatar {
128
- width: 40px;
129
- height: 40px;
130
- flex-shrink: 0;
131
- border-radius: 50%;
132
- object-fit: cover;
133
- }
134
- .ap-cashier-panel {
135
- min-height: min(50dvh, 840px);
136
- box-sizing: border-box;
137
- padding: 32px 40px calc(40px + env(safe-area-inset-bottom, 0px));
138
- border-radius: 40px 40px 0 0;
139
- background: var(--tbox-bg-card, #fff);
140
- }
141
- .ap-cashier::backdrop { background: rgba(0, 0, 0, 0.35); }
142
- .ap-cashier-header { position: relative; display: flex; align-items: center; justify-content: center; min-height: 56px; }
143
- .ap-cashier-close {
144
- position: absolute;
145
- left: -8px;
146
- top: -8px;
147
- width: 72px;
148
- height: 72px;
149
- border: 0;
150
- border-radius: 16px;
151
- background: transparent;
152
- color: var(--tbox-text-secondary, #6f7c8f);
153
- font-size: 52px;
154
- cursor: pointer;
155
- }
156
- .ap-cashier-brand { color: var(--ap-accent); font-size: 36px; font-weight: 600; }
157
- .ap-cashier-summary { margin: 36px 0 48px; }
158
- .ap-cashier-merchant { margin: 0 0 12px; color: var(--tbox-text-secondary, #6f7c8f); font-size: 24px; line-height: 36px; }
159
- .ap-cashier-amount { font-size: 64px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
160
- .ap-cashier-product { margin: 12px 0 0; color: var(--tbox-text-secondary, #6f7c8f); font-size: 24px; line-height: 36px; }
161
- .ap-cashier-method { display: flex; align-items: center; gap: 20px; padding: 24px; border-radius: 24px; background: var(--tbox-bg-subtle, #f7f9fc); text-align: left; font-size: 28px; }
162
- .ap-cashier-method-icon { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: var(--ap-accent); color: #fff; font-weight: 600; }
163
- .ap-cashier-pay { margin-top: 40px; }
164
- .ap-cashier-disclaimer { margin: 24px 0 0; color: var(--tbox-text-secondary, #6f7c8f); font-size: 24px; line-height: 36px; }
165
- @keyframes ap-cashier-enter { from { transform: translateY(100%); } to { transform: translateY(0); } }
166
- @media (prefers-reduced-motion: reduce) { .ap-cashier { animation: none; } }
@@ -1,2 +0,0 @@
1
- /** 模块自持 CSS(经 tsup loader: { '.css': 'copy' } 出货,样式在应用侧生效) */
2
- declare module '*.css';