@yeez-tech/user-my-order 0.1.5 → 0.1.9

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.
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@yeez-tech/user-my-order",
3
3
  "private": false,
4
- "version": "0.1.5",
5
- "description": "我的订单页面(Vue 3):数据总览 + 订单列表/详情;受控数据 + 回调接入业务。",
4
+ "version": "0.1.9",
5
+ "description": "\u6211\u7684\u8ba2\u5355\u9875\u9762\uff08Vue 3\uff09\uff1a\u6570\u636e\u603b\u89c8 + \u8ba2\u5355\u5217\u8868/\u8be6\u60c5\uff1b\u53d7\u63a7\u6570\u636e + \u56de\u8c03\u63a5\u5165\u4e1a\u52a1\u3002",
6
6
  "type": "module",
7
7
  "main": "./dist/user-my-order.cjs",
8
8
  "module": "./dist/user-my-order.js",
@@ -8,10 +8,27 @@ export interface Product {
8
8
  fileSuffix: string
9
9
  dataId: string
10
10
  fileSize: string
11
+ securityLevel?: string
12
+ isControllableDelivery?: boolean
13
+ [key: string]: unknown
11
14
  }
12
15
  image: string
13
16
  }
14
17
 
18
+ export interface ControllableDeliveryTagOptions {
19
+ enabled?: boolean
20
+ /** 标签图片 URL,由宿主传入;启用标签时必须提供 */
21
+ src?: string
22
+ alt?: string
23
+ isControllable?: (product: Product) => boolean
24
+ }
25
+
26
+ export declare function isProductControllableDelivery(product: Product): boolean
27
+ export declare function shouldShowControllableDeliveryTag(
28
+ product: Product,
29
+ options?: ControllableDeliveryTagOptions | null,
30
+ ): boolean
31
+
15
32
  export interface Order {
16
33
  id: string
17
34
  orderNumber: string
@@ -47,10 +64,29 @@ export type DownloadStatus =
47
64
 
48
65
  export interface DownloadState {
49
66
  status: DownloadStatus;
67
+ /** 进度条百分比 0~100;宿主可按阶段填(下载字节比 / 哈希进度 / 解密进度) */
50
68
  progress: number;
51
69
  estimatedTime: string;
52
70
  speed: string;
71
+ /** 总大小(MB 字符串),仅在 showBytes !== false 时用于右上角文案 */
53
72
  fileSize: string;
73
+ /**
74
+ * 按行覆盖状态文案(优先于全局 downloadStatusText / 内置默认)。
75
+ * 例:计算哈希中... / 等待链上确认... / 资源加载中...(百分比只在进度条)
76
+ */
77
+ statusText?: string;
78
+ /**
79
+ * 是否显示右上角「已下载 MB / 总 MB」。
80
+ * 默认 true;校验 / 取钥 / 资源加载等阶段建议关。
81
+ */
82
+ showBytes?: boolean;
83
+ /** 是否显示「预计剩余」,默认 true */
84
+ showEta?: boolean;
85
+ /**
86
+ * 是否显示下载速度。
87
+ * 省略时沿用旧逻辑:仅 downloading / paused 显示;显式 true/false 可覆盖。
88
+ */
89
+ showSpeed?: boolean;
54
90
  }
55
91
 
56
92
  export type DownloadStatusTextMap = Partial<Record<DownloadStatus, string>>
@@ -59,6 +95,13 @@ export type RefundAction = 'refundable' | 'after_sales'
59
95
 
60
96
  export type RefundStatesMap = Record<string, RefundAction>
61
97
 
98
+ export type DownloadButtonVisibleMap = Record<string, boolean>
99
+
100
+ export type ContactSellerButtonVisibleMap = Record<string, boolean>
101
+
102
+ /** 仅显式 `true` 时展示「取消下载」,默认不展示 */
103
+ export type CancelDownloadButtonVisibleMap = Record<string, boolean>
104
+
62
105
  export interface OrderManagementProps {
63
106
  orders: Order[]
64
107
  currentOrderPage?: number
@@ -71,19 +114,29 @@ export interface OrderManagementProps {
71
114
  onDownload?: (productId: string) => void
72
115
  onPauseDownload?: (productId: string) => void
73
116
  onResumeDownload?: (productId: string) => void
117
+ onCancelDownload?: (productId: string) => void
74
118
  onOpenFile?: (productId: string) => void
75
119
  onContactSeller?: (productId: string) => void
76
120
  onRequestRefund?: (productId: string) => void
77
121
  onRequestAfterSales?: (productId: string) => void
78
122
  downloadStates?: Record<string, DownloadState>
79
123
  downloadStatusText?: DownloadStatusTextMap
124
+ downloadButtonVisible?: DownloadButtonVisibleMap
125
+ contactSellerButtonVisible?: ContactSellerButtonVisibleMap
126
+ cancelDownloadButtonVisible?: CancelDownloadButtonVisibleMap
80
127
  refundStates?: RefundStatesMap
128
+ controllableDeliveryTag?: ControllableDeliveryTagOptions | null
81
129
  }
82
130
 
83
131
  export interface OrderDetailPanelProps {
84
132
  order: Order
133
+ refundStates?: RefundStatesMap
134
+ contactSellerButtonVisible?: ContactSellerButtonVisibleMap
85
135
  onContactSeller?: (productId: string) => void
86
136
  onViewProduct?: (order: Order, product: Product) => void
137
+ onRequestRefund?: (productId: string) => void
138
+ onRequestAfterSales?: (productId: string) => void
139
+ controllableDeliveryTag?: ControllableDeliveryTagOptions | null
87
140
  }
88
141
 
89
142
  export declare const OrderManagement: DefineComponent<OrderManagementProps>