@yeez-tech/user-my-order 0.1.7 → 0.1.10
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 +13 -0
- package/dist/user-my-order.cjs +1 -1
- package/dist/user-my-order.css +1 -1
- package/dist/user-my-order.js +464 -234
- package/package.json +8 -5
- package/typings/index.d.ts +93 -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.10",
|
|
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",
|
|
@@ -22,14 +22,16 @@
|
|
|
22
22
|
],
|
|
23
23
|
"sideEffects": [
|
|
24
24
|
"**/*.css",
|
|
25
|
-
"dist/*.js"
|
|
25
|
+
"dist/*.js",
|
|
26
|
+
"dist/*.cjs"
|
|
26
27
|
],
|
|
27
28
|
"scripts": {
|
|
28
29
|
"dev": "vite --port 5176",
|
|
29
30
|
"build": "vite build",
|
|
30
31
|
"build:lib": "vite build --config vite.lib.config.ts",
|
|
31
32
|
"preview": "vite preview",
|
|
32
|
-
"prepublishOnly": "npm run build:lib"
|
|
33
|
+
"prepublishOnly": "npm run build:lib",
|
|
34
|
+
"pack:check": "npm run build:lib && npm pack --dry-run"
|
|
33
35
|
},
|
|
34
36
|
"peerDependencies": {
|
|
35
37
|
"@arco-design/web-vue": "^2.50.0",
|
|
@@ -46,6 +48,7 @@
|
|
|
46
48
|
"vue": "^3.5.30"
|
|
47
49
|
},
|
|
48
50
|
"publishConfig": {
|
|
49
|
-
"access": "public"
|
|
51
|
+
"access": "public",
|
|
52
|
+
"registry": "https://registry.npmjs.org/"
|
|
50
53
|
}
|
|
51
54
|
}
|
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,43 @@ 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
|
+
|
|
105
|
+
/** 评价记录状态:0 待审核 / 1 审核通过 / 2 审核不通过 / 3 已删除 */
|
|
106
|
+
export type ReviewRecordStatus = 0 | 1 | 2 | 3
|
|
107
|
+
|
|
108
|
+
export declare const REVIEW_UI_STATUS: {
|
|
109
|
+
readonly PENDING: 0
|
|
110
|
+
readonly PASSED: 1
|
|
111
|
+
readonly REJECTED: 2
|
|
112
|
+
readonly DELETED: 3
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface OrderReviewUiState {
|
|
116
|
+
canReview: boolean
|
|
117
|
+
status: ReviewRecordStatus | null
|
|
118
|
+
loaded?: boolean
|
|
119
|
+
canAppend?: boolean
|
|
120
|
+
reviewed?: boolean
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export type ReviewStatesMap = Record<string, OrderReviewUiState>
|
|
124
|
+
|
|
125
|
+
export interface ReviewActionPayload {
|
|
126
|
+
productId: string
|
|
127
|
+
orderId: string
|
|
128
|
+
productName: string
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export declare const EMPTY_REVIEW_UI_STATE: OrderReviewUiState
|
|
132
|
+
|
|
133
|
+
export declare function pickReviewUiState(
|
|
134
|
+
states: ReviewStatesMap | null | undefined,
|
|
135
|
+
orderId: string,
|
|
136
|
+
productId: string,
|
|
137
|
+
): OrderReviewUiState
|
|
138
|
+
|
|
66
139
|
export interface OrderManagementProps {
|
|
67
140
|
orders: Order[]
|
|
68
141
|
currentOrderPage?: number
|
|
@@ -75,6 +148,7 @@ export interface OrderManagementProps {
|
|
|
75
148
|
onDownload?: (productId: string) => void
|
|
76
149
|
onPauseDownload?: (productId: string) => void
|
|
77
150
|
onResumeDownload?: (productId: string) => void
|
|
151
|
+
onCancelDownload?: (productId: string) => void
|
|
78
152
|
onOpenFile?: (productId: string) => void
|
|
79
153
|
onContactSeller?: (productId: string) => void
|
|
80
154
|
onRequestRefund?: (productId: string) => void
|
|
@@ -83,7 +157,17 @@ export interface OrderManagementProps {
|
|
|
83
157
|
downloadStatusText?: DownloadStatusTextMap
|
|
84
158
|
downloadButtonVisible?: DownloadButtonVisibleMap
|
|
85
159
|
contactSellerButtonVisible?: ContactSellerButtonVisibleMap
|
|
160
|
+
cancelDownloadButtonVisible?: CancelDownloadButtonVisibleMap
|
|
86
161
|
refundStates?: RefundStatesMap
|
|
162
|
+
controllableDeliveryTag?: ControllableDeliveryTagOptions | null
|
|
163
|
+
/** 是否展示「联系售后」;默认 true */
|
|
164
|
+
afterSalesEnabled?: boolean
|
|
165
|
+
/** 是否展示评价入口;默认 false */
|
|
166
|
+
reviewEnabled?: boolean
|
|
167
|
+
reviewStates?: ReviewStatesMap | null
|
|
168
|
+
onReview?: (payload: ReviewActionPayload) => void
|
|
169
|
+
onViewReview?: (payload: ReviewActionPayload) => void
|
|
170
|
+
onAppendReview?: (payload: ReviewActionPayload) => void
|
|
87
171
|
}
|
|
88
172
|
|
|
89
173
|
export interface OrderDetailPanelProps {
|
|
@@ -94,6 +178,15 @@ export interface OrderDetailPanelProps {
|
|
|
94
178
|
onViewProduct?: (order: Order, product: Product) => void
|
|
95
179
|
onRequestRefund?: (productId: string) => void
|
|
96
180
|
onRequestAfterSales?: (productId: string) => void
|
|
181
|
+
controllableDeliveryTag?: ControllableDeliveryTagOptions | null
|
|
182
|
+
/** 是否展示「联系售后」;默认 true */
|
|
183
|
+
afterSalesEnabled?: boolean
|
|
184
|
+
/** 是否展示评价入口;默认 false */
|
|
185
|
+
reviewEnabled?: boolean
|
|
186
|
+
reviewStates?: ReviewStatesMap | null
|
|
187
|
+
onReview?: (payload: ReviewActionPayload) => void
|
|
188
|
+
onViewReview?: (payload: ReviewActionPayload) => void
|
|
189
|
+
onAppendReview?: (payload: ReviewActionPayload) => void
|
|
97
190
|
}
|
|
98
191
|
|
|
99
192
|
export declare const OrderManagement: DefineComponent<OrderManagementProps>
|