@yeez-tech/user-my-order 0.1.7 → 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/README.md +9 -0
- package/dist/user-my-order.cjs +1 -1
- package/dist/user-my-order.css +1 -1
- package/dist/user-my-order.js +320 -216
- package/package.json +2 -2
- package/typings/index.d.ts +43 -0
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
|
-
"description": "
|
|
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",
|
package/typings/index.d.ts
CHANGED
|
@@ -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>>
|
|
@@ -63,6 +99,9 @@ export type DownloadButtonVisibleMap = Record<string, boolean>
|
|
|
63
99
|
|
|
64
100
|
export type ContactSellerButtonVisibleMap = Record<string, boolean>
|
|
65
101
|
|
|
102
|
+
/** 仅显式 `true` 时展示「取消下载」,默认不展示 */
|
|
103
|
+
export type CancelDownloadButtonVisibleMap = Record<string, boolean>
|
|
104
|
+
|
|
66
105
|
export interface OrderManagementProps {
|
|
67
106
|
orders: Order[]
|
|
68
107
|
currentOrderPage?: number
|
|
@@ -75,6 +114,7 @@ export interface OrderManagementProps {
|
|
|
75
114
|
onDownload?: (productId: string) => void
|
|
76
115
|
onPauseDownload?: (productId: string) => void
|
|
77
116
|
onResumeDownload?: (productId: string) => void
|
|
117
|
+
onCancelDownload?: (productId: string) => void
|
|
78
118
|
onOpenFile?: (productId: string) => void
|
|
79
119
|
onContactSeller?: (productId: string) => void
|
|
80
120
|
onRequestRefund?: (productId: string) => void
|
|
@@ -83,7 +123,9 @@ export interface OrderManagementProps {
|
|
|
83
123
|
downloadStatusText?: DownloadStatusTextMap
|
|
84
124
|
downloadButtonVisible?: DownloadButtonVisibleMap
|
|
85
125
|
contactSellerButtonVisible?: ContactSellerButtonVisibleMap
|
|
126
|
+
cancelDownloadButtonVisible?: CancelDownloadButtonVisibleMap
|
|
86
127
|
refundStates?: RefundStatesMap
|
|
128
|
+
controllableDeliveryTag?: ControllableDeliveryTagOptions | null
|
|
87
129
|
}
|
|
88
130
|
|
|
89
131
|
export interface OrderDetailPanelProps {
|
|
@@ -94,6 +136,7 @@ export interface OrderDetailPanelProps {
|
|
|
94
136
|
onViewProduct?: (order: Order, product: Product) => void
|
|
95
137
|
onRequestRefund?: (productId: string) => void
|
|
96
138
|
onRequestAfterSales?: (productId: string) => void
|
|
139
|
+
controllableDeliveryTag?: ControllableDeliveryTagOptions | null
|
|
97
140
|
}
|
|
98
141
|
|
|
99
142
|
export declare const OrderManagement: DefineComponent<OrderManagementProps>
|