@polyv/product-sdk 1.0.0-rc-20250612.3
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/index.cjs.js +1 -0
- package/index.es.d.ts +1520 -0
- package/index.es.js +1201 -0
- package/index.umd.js +1 -0
- package/package.json +25 -0
package/index.es.d.ts
ADDED
|
@@ -0,0 +1,1520 @@
|
|
|
1
|
+
import { ChannelProductPushingStatusInfo as ChannelProductPushingStatusInfo_2 } from '@polyv/iar-core-sdk';
|
|
2
|
+
import { CommonResult } from '@polyv/iar-core-sdk';
|
|
3
|
+
import { EventEmitter } from '@polyv/utils/es/event';
|
|
4
|
+
import { InteractionReceiveCore } from '@polyv/iar-core-sdk';
|
|
5
|
+
import { PageContent } from '@polyv/iar-core-sdk';
|
|
6
|
+
import { PageOptions } from '@polyv/iar-core-sdk';
|
|
7
|
+
|
|
8
|
+
export declare class Address {
|
|
9
|
+
iarCore: InteractionReceiveCore;
|
|
10
|
+
config: ProductSDKConfig;
|
|
11
|
+
constructor(iarCore: InteractionReceiveCore, config: ProductSDKConfig);
|
|
12
|
+
/**
|
|
13
|
+
* 获取地址列表
|
|
14
|
+
* @param params 分页参数
|
|
15
|
+
* @example
|
|
16
|
+
* ```js
|
|
17
|
+
* const data = await addressTarget.getAddressList({ pageNumber: 1, pageSize: 10 });
|
|
18
|
+
* console.log('地址列表', data.contents);
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
getAddressList(options?: PageOptions): Promise<PageContent<AddressData>>;
|
|
22
|
+
/**
|
|
23
|
+
* 获取默认地址
|
|
24
|
+
* @example
|
|
25
|
+
* ```js
|
|
26
|
+
* const data = await addressTarget.getDefaultAddress();
|
|
27
|
+
* console.log('默认地址', data);
|
|
28
|
+
*/
|
|
29
|
+
getDefaultAddress(): Promise<AddressData>;
|
|
30
|
+
/**
|
|
31
|
+
* 新增地址
|
|
32
|
+
* @param params 新增地址参数
|
|
33
|
+
* @example
|
|
34
|
+
* ```js
|
|
35
|
+
* const data = await addressTarget.addAddress({
|
|
36
|
+
* phone: '13800138000',
|
|
37
|
+
* name: '张三',
|
|
38
|
+
* area: '广东省/广州市/番禺区',
|
|
39
|
+
* address: '国家创新创业基地',
|
|
40
|
+
* });
|
|
41
|
+
* console.log('新增地址', data);
|
|
42
|
+
*/
|
|
43
|
+
addAddress(params: AddressBasicData): Promise<AddressData>;
|
|
44
|
+
/**
|
|
45
|
+
* 修改地址
|
|
46
|
+
* @param params 修改地址参数
|
|
47
|
+
* @example
|
|
48
|
+
* ```js
|
|
49
|
+
* await addressTarget.updateAddress({
|
|
50
|
+
* id: '123',
|
|
51
|
+
* address: '国家创新创业基地',
|
|
52
|
+
* area: '广东省/广州市/番禺区',
|
|
53
|
+
* phone: '13800138000',
|
|
54
|
+
* name: '张三',
|
|
55
|
+
* });
|
|
56
|
+
*/
|
|
57
|
+
updateAddress(params: EditAddressParams): Promise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* 删除地址
|
|
60
|
+
* @param id 地址 id
|
|
61
|
+
* @example
|
|
62
|
+
* ```js
|
|
63
|
+
* await addressTarget.deleteAddress('123');
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
deleteAddress(id: string): Promise<void>;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* 地址基础信息
|
|
71
|
+
*/
|
|
72
|
+
export declare interface AddressBasicData {
|
|
73
|
+
/**
|
|
74
|
+
* 地址
|
|
75
|
+
*/
|
|
76
|
+
address: string;
|
|
77
|
+
/**
|
|
78
|
+
* 所在地区
|
|
79
|
+
*/
|
|
80
|
+
area: string;
|
|
81
|
+
/**
|
|
82
|
+
* 手机号
|
|
83
|
+
*/
|
|
84
|
+
mobile: string;
|
|
85
|
+
/**
|
|
86
|
+
* 收货人姓名
|
|
87
|
+
*/
|
|
88
|
+
name: string;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* 地址信息
|
|
93
|
+
*/
|
|
94
|
+
export declare interface AddressData extends AddressBasicData {
|
|
95
|
+
/**
|
|
96
|
+
* 地址id
|
|
97
|
+
*/
|
|
98
|
+
id: string;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* 退款接口响应
|
|
103
|
+
*/
|
|
104
|
+
export declare interface ApplyOrderRefundResponse {
|
|
105
|
+
/**
|
|
106
|
+
* 退款状态
|
|
107
|
+
*/
|
|
108
|
+
refundStatus: RefundStatus;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* 部分观看条件类型
|
|
113
|
+
*/
|
|
114
|
+
export declare enum AuthType {
|
|
115
|
+
/**
|
|
116
|
+
* 无条件观看
|
|
117
|
+
*/
|
|
118
|
+
None = "none",
|
|
119
|
+
/**
|
|
120
|
+
* 自定义授权
|
|
121
|
+
*/
|
|
122
|
+
Custom = "custom",
|
|
123
|
+
/**
|
|
124
|
+
* 外部授权
|
|
125
|
+
*/
|
|
126
|
+
External = "external",
|
|
127
|
+
/**
|
|
128
|
+
* 独立授权
|
|
129
|
+
*/
|
|
130
|
+
Direct = "direct",
|
|
131
|
+
/**
|
|
132
|
+
* 企业微信授权
|
|
133
|
+
*/
|
|
134
|
+
EnterpriseWeChat = "enterpriseWeChat"
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* 频道商品热卖中文案
|
|
139
|
+
*/
|
|
140
|
+
export declare interface ChannelProductHotEffectTips {
|
|
141
|
+
/**
|
|
142
|
+
* 金融产品热卖中文案
|
|
143
|
+
*/
|
|
144
|
+
financeProductTips: string;
|
|
145
|
+
/**
|
|
146
|
+
* 职位产品热卖中文案
|
|
147
|
+
*/
|
|
148
|
+
jobProductTips: string;
|
|
149
|
+
/**
|
|
150
|
+
* 普通产品热卖中文案
|
|
151
|
+
*/
|
|
152
|
+
normalProductTips: string;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* 频道商品推送状态信息
|
|
157
|
+
*/
|
|
158
|
+
export declare interface ChannelProductPushingStatusInfo {
|
|
159
|
+
productId: number;
|
|
160
|
+
pushRule: ProductPushRule;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* 创建订单失败原因
|
|
165
|
+
*/
|
|
166
|
+
export declare enum CreateOrderFailReason {
|
|
167
|
+
Unknown = "unknown"
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* 创建订单参数
|
|
172
|
+
*/
|
|
173
|
+
export declare interface CreateOrderParams {
|
|
174
|
+
/**
|
|
175
|
+
* 物流信息
|
|
176
|
+
*/
|
|
177
|
+
address: AddressBasicData;
|
|
178
|
+
/**
|
|
179
|
+
* 购买商品
|
|
180
|
+
*/
|
|
181
|
+
products: CreateOrderProductItem[];
|
|
182
|
+
/**
|
|
183
|
+
* 支付方式
|
|
184
|
+
*/
|
|
185
|
+
payProvider: PaymentProvider;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export declare interface CreateOrderProductItem {
|
|
189
|
+
/**
|
|
190
|
+
* 商品 ID
|
|
191
|
+
*/
|
|
192
|
+
productId: number;
|
|
193
|
+
/**
|
|
194
|
+
* 购买数量
|
|
195
|
+
*/
|
|
196
|
+
quantity: number;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* 创建订单接口响应
|
|
201
|
+
*/
|
|
202
|
+
export declare interface CreateOrderResponse {
|
|
203
|
+
/**
|
|
204
|
+
* 支付类型
|
|
205
|
+
* 微信支付下 jsapi | native
|
|
206
|
+
* 支付宝支付下 qrCode
|
|
207
|
+
*/
|
|
208
|
+
type: string;
|
|
209
|
+
/**
|
|
210
|
+
* 支付宝支付链接
|
|
211
|
+
*/
|
|
212
|
+
aliPayLink: string;
|
|
213
|
+
/**
|
|
214
|
+
* 订单号
|
|
215
|
+
*/
|
|
216
|
+
orderNo: string;
|
|
217
|
+
/**
|
|
218
|
+
* 支付状态
|
|
219
|
+
*/
|
|
220
|
+
payStatus: PayStatus;
|
|
221
|
+
/**
|
|
222
|
+
* 微信支付 appId
|
|
223
|
+
*/
|
|
224
|
+
wxAppId: string;
|
|
225
|
+
/**
|
|
226
|
+
* 微信支付签名随机串
|
|
227
|
+
*/
|
|
228
|
+
nonceStr: string;
|
|
229
|
+
/**
|
|
230
|
+
* 微信支付参数
|
|
231
|
+
*/
|
|
232
|
+
package: string;
|
|
233
|
+
/**
|
|
234
|
+
* 微信支付签名
|
|
235
|
+
*/
|
|
236
|
+
paySign: string;
|
|
237
|
+
/**
|
|
238
|
+
* 微信支付签名方式
|
|
239
|
+
*/
|
|
240
|
+
signType: string;
|
|
241
|
+
/**
|
|
242
|
+
* 微信支付签名时间戳
|
|
243
|
+
*/
|
|
244
|
+
timeStamp: number;
|
|
245
|
+
/**
|
|
246
|
+
* 当前支付方式
|
|
247
|
+
*/
|
|
248
|
+
payProvider: PaymentProvider;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* 编辑地址传给接口的参数,其中 area 地区以 / 连接
|
|
253
|
+
*/
|
|
254
|
+
export declare interface EditAddressParams extends AddressBasicData {
|
|
255
|
+
/**
|
|
256
|
+
* 地址id
|
|
257
|
+
*/
|
|
258
|
+
id: string;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* 金融商品数据
|
|
263
|
+
*/
|
|
264
|
+
export declare interface FinanceProductData extends ProductBasicData, ProductLinkData, ProductExplainData {
|
|
265
|
+
/**
|
|
266
|
+
* 商品类型
|
|
267
|
+
*/
|
|
268
|
+
productType: ProductType.Finance;
|
|
269
|
+
/**
|
|
270
|
+
* 收益率
|
|
271
|
+
*/
|
|
272
|
+
yield: string;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* 获取订单详情参数
|
|
277
|
+
*/
|
|
278
|
+
export declare interface GetOrderDetailParams {
|
|
279
|
+
/**
|
|
280
|
+
* 订单号
|
|
281
|
+
*/
|
|
282
|
+
orderNo: string;
|
|
283
|
+
/**
|
|
284
|
+
* 是否同步订单最新状态
|
|
285
|
+
*/
|
|
286
|
+
syncPayStatus: boolean;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* 序号参数
|
|
291
|
+
*/
|
|
292
|
+
export declare interface GetProductListDisplayNumberParams {
|
|
293
|
+
/**
|
|
294
|
+
* 商品序号
|
|
295
|
+
*/
|
|
296
|
+
displayNumber?: number;
|
|
297
|
+
/**
|
|
298
|
+
* 获取数量
|
|
299
|
+
* @default 10
|
|
300
|
+
*/
|
|
301
|
+
count?: number;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
export declare interface GetProductListParams {
|
|
305
|
+
/**
|
|
306
|
+
* 获取数量
|
|
307
|
+
* @default 10
|
|
308
|
+
*/
|
|
309
|
+
count?: number;
|
|
310
|
+
/**
|
|
311
|
+
* 商品序号
|
|
312
|
+
*/
|
|
313
|
+
displayNumber?: number;
|
|
314
|
+
/**
|
|
315
|
+
* 标签 id
|
|
316
|
+
*/
|
|
317
|
+
tagId?: number;
|
|
318
|
+
/**
|
|
319
|
+
* 关键词
|
|
320
|
+
*/
|
|
321
|
+
keyword?: string;
|
|
322
|
+
/**
|
|
323
|
+
* 页数,仅传入 `tagId` 或 `keyword` 时生效
|
|
324
|
+
*/
|
|
325
|
+
page?: number;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
export declare type MaybePromise<R> = () => Promise<R> | R;
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* 普通商品数据
|
|
332
|
+
*/
|
|
333
|
+
export declare interface NormalProductData extends ProductBasicData, ProductLinkData, ProductExplainData {
|
|
334
|
+
/**
|
|
335
|
+
* 商品类型
|
|
336
|
+
*/
|
|
337
|
+
productType: ProductType.Normal;
|
|
338
|
+
/**
|
|
339
|
+
* 购买类型
|
|
340
|
+
*/
|
|
341
|
+
buyType: ProductBuyType;
|
|
342
|
+
/**
|
|
343
|
+
* 价格类型
|
|
344
|
+
*/
|
|
345
|
+
priceType: ProductPriceType;
|
|
346
|
+
/**
|
|
347
|
+
* 价格
|
|
348
|
+
*/
|
|
349
|
+
realPrice: number;
|
|
350
|
+
/**
|
|
351
|
+
* 原价
|
|
352
|
+
*/
|
|
353
|
+
originPrice: number;
|
|
354
|
+
/**
|
|
355
|
+
* 自定义价格
|
|
356
|
+
*/
|
|
357
|
+
customPrice: string;
|
|
358
|
+
/**
|
|
359
|
+
* 是否开价
|
|
360
|
+
*/
|
|
361
|
+
priceVisible: boolean;
|
|
362
|
+
/**
|
|
363
|
+
* 履约方式
|
|
364
|
+
*/
|
|
365
|
+
deliveryType: ProductDeliveryType;
|
|
366
|
+
/**
|
|
367
|
+
* 客服联系方式(二维码图片地址), 渠道码被删除则没有值
|
|
368
|
+
*/
|
|
369
|
+
customerServiceContact: string;
|
|
370
|
+
/**
|
|
371
|
+
* 客服方式
|
|
372
|
+
*/
|
|
373
|
+
customerServiceType: ProductServiceType;
|
|
374
|
+
/**
|
|
375
|
+
* 库存开关
|
|
376
|
+
*/
|
|
377
|
+
stockEnabled: boolean;
|
|
378
|
+
/**
|
|
379
|
+
* 库存
|
|
380
|
+
*/
|
|
381
|
+
stock: number;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
export declare class Order {
|
|
385
|
+
iarCore: InteractionReceiveCore;
|
|
386
|
+
config: ProductSDKConfig;
|
|
387
|
+
OrderStatus: typeof OrderStatus;
|
|
388
|
+
PayStatus: typeof PayStatus;
|
|
389
|
+
PaymentProvider: typeof PaymentProvider;
|
|
390
|
+
ProductBuyType: typeof ProductBuyType;
|
|
391
|
+
ProductType: typeof ProductType;
|
|
392
|
+
ProductDeliveryType: typeof ProductDeliveryType;
|
|
393
|
+
RefundStatus: typeof RefundStatus;
|
|
394
|
+
CreateOrderFailReason: typeof CreateOrderFailReason;
|
|
395
|
+
OrderRefundFailReason: typeof OrderRefundFailReason;
|
|
396
|
+
constructor(iarCore: InteractionReceiveCore, config: ProductSDKConfig);
|
|
397
|
+
/**
|
|
398
|
+
* 获取订单列表
|
|
399
|
+
* @param params 获取参数
|
|
400
|
+
* @example
|
|
401
|
+
* ```js
|
|
402
|
+
* const data = await orderTarget.getOrderList({ pageNumber: 1, pageSize: 10 });
|
|
403
|
+
* console.log('订单列表', data.contents);
|
|
404
|
+
* ```
|
|
405
|
+
*/
|
|
406
|
+
getOrderList(params?: PageOptions & {
|
|
407
|
+
orderStatus?: OrderStatus;
|
|
408
|
+
}): Promise<PageContent<OrderData>>;
|
|
409
|
+
/**
|
|
410
|
+
* 获取订单详情
|
|
411
|
+
* @param params 获取参数
|
|
412
|
+
* @example
|
|
413
|
+
* ```js
|
|
414
|
+
* const data = await orderTarget.getOrderDetail({ orderNo: '1234567890' });
|
|
415
|
+
* console.log('订单详情', data);
|
|
416
|
+
* ```
|
|
417
|
+
*/
|
|
418
|
+
getOrderDetail(params: GetOrderDetailParams): Promise<OrderData>;
|
|
419
|
+
/**
|
|
420
|
+
* 创建订单
|
|
421
|
+
* @param params 创建订单参数
|
|
422
|
+
* @example
|
|
423
|
+
* ```js
|
|
424
|
+
* const res = await orderTarget.createOrder({ address: { name: '张三', mobile: '13800138000', area: '广东省 广州市 天河区', address: '天河路1号' }, products: [{ productId: 1, quantity: 1 }], payProvider: PaymentProvider.Wechat });
|
|
425
|
+
* if (res.success) {
|
|
426
|
+
* console.log('创建订单成功', res.orderNo);
|
|
427
|
+
* } else {
|
|
428
|
+
* console.log('创建订单失败', res.failReason, res.failMessage);
|
|
429
|
+
* }
|
|
430
|
+
* ```
|
|
431
|
+
*/
|
|
432
|
+
createOrder(params: CreateOrderParams): Promise<CommonResult<CreateOrderFailReason, CreateOrderResponse>>;
|
|
433
|
+
/**
|
|
434
|
+
* 确认收货
|
|
435
|
+
* @param orderNo 订单号
|
|
436
|
+
* @example
|
|
437
|
+
* ```js
|
|
438
|
+
* await orderTarget.confirmOrder('1234567890');
|
|
439
|
+
* ```
|
|
440
|
+
*/
|
|
441
|
+
confirmOrder(orderNo: string): Promise<void>;
|
|
442
|
+
/**
|
|
443
|
+
* 申请退款
|
|
444
|
+
* @param orderNo 订单号
|
|
445
|
+
* @example
|
|
446
|
+
* ```js
|
|
447
|
+
* const res = await orderTarget.applyOrderRefund('1234567890');
|
|
448
|
+
* if (res.success) {
|
|
449
|
+
* console.log('退款成功', res);
|
|
450
|
+
* } else {
|
|
451
|
+
* console.log('退款失败', res.failReason, res.failMessage);
|
|
452
|
+
* }
|
|
453
|
+
* ```
|
|
454
|
+
*/
|
|
455
|
+
applyOrderRefund(orderNo: string): Promise<CommonResult<OrderRefundFailReason, ApplyOrderRefundResponse>>;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
/**
|
|
459
|
+
* 订单基础数据
|
|
460
|
+
*/
|
|
461
|
+
export declare interface OrderBasicData {
|
|
462
|
+
/**
|
|
463
|
+
* 订单金额
|
|
464
|
+
*/
|
|
465
|
+
amount: number;
|
|
466
|
+
/**
|
|
467
|
+
* 频道号
|
|
468
|
+
*/
|
|
469
|
+
channelId: number | null;
|
|
470
|
+
/**
|
|
471
|
+
* 购买商品
|
|
472
|
+
*/
|
|
473
|
+
products: OrderProductData[];
|
|
474
|
+
/**
|
|
475
|
+
* 订单号
|
|
476
|
+
*/
|
|
477
|
+
orderNo: string;
|
|
478
|
+
/**
|
|
479
|
+
* 创建时间(单位:毫秒)
|
|
480
|
+
*/
|
|
481
|
+
createAt?: number;
|
|
482
|
+
/**
|
|
483
|
+
* 交易ID
|
|
484
|
+
*/
|
|
485
|
+
transactionId?: string;
|
|
486
|
+
/**
|
|
487
|
+
* 是否开启物流
|
|
488
|
+
*/
|
|
489
|
+
expressEnabled?: boolean;
|
|
490
|
+
/**
|
|
491
|
+
* 物流信息
|
|
492
|
+
*/
|
|
493
|
+
expressInfo: AddressData;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
/**
|
|
497
|
+
* 已关闭订单数据 (通常由未支付订单关闭)
|
|
498
|
+
*/
|
|
499
|
+
export declare interface OrderCloseData extends OrderBasicData {
|
|
500
|
+
status: OrderStatus.Close;
|
|
501
|
+
expiredAt: number;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* 订单数据
|
|
506
|
+
*/
|
|
507
|
+
export declare type OrderData = OrderWaitPayData | OrderWaitDeliveryData | OrderDeliveringData | OrderFinishData | OrderCloseData | OrderRefundingData | OrderRefundedData;
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* 待收货订单数据
|
|
511
|
+
*/
|
|
512
|
+
export declare interface OrderDeliveringData extends OrderPaidData {
|
|
513
|
+
status: OrderStatus.Delivering;
|
|
514
|
+
/**
|
|
515
|
+
* 发货时间(单位:毫秒)
|
|
516
|
+
*/
|
|
517
|
+
deliveryAt: number;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* 已完成订单数据
|
|
522
|
+
*/
|
|
523
|
+
export declare interface OrderFinishData extends OrderPaidData {
|
|
524
|
+
status: OrderStatus.Finish;
|
|
525
|
+
/**
|
|
526
|
+
* 发货时间(单位:毫秒)
|
|
527
|
+
*/
|
|
528
|
+
deliveryAt: number;
|
|
529
|
+
/**
|
|
530
|
+
* 订单完成时间(单位:毫秒)
|
|
531
|
+
*/
|
|
532
|
+
finishAt: number;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
* 已支付订单数据 (待发货、发货中、已完成、退款中、已退款的共同基础)
|
|
537
|
+
*/
|
|
538
|
+
declare interface OrderPaidData extends OrderBasicData {
|
|
539
|
+
/**
|
|
540
|
+
* 支付时间(单位:毫秒)
|
|
541
|
+
*/
|
|
542
|
+
payAt: number;
|
|
543
|
+
transactionId: string;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
/**
|
|
547
|
+
* 订单购买商品数据
|
|
548
|
+
*/
|
|
549
|
+
export declare interface OrderProductData {
|
|
550
|
+
/**
|
|
551
|
+
* 客服联系方式(二维码图片地址), 渠道码被删除则没有值
|
|
552
|
+
*/
|
|
553
|
+
customerServiceContact: string;
|
|
554
|
+
/**
|
|
555
|
+
* 客服方式
|
|
556
|
+
*/
|
|
557
|
+
customerServiceType: ProductServiceType;
|
|
558
|
+
/**
|
|
559
|
+
* 履约方式
|
|
560
|
+
*/
|
|
561
|
+
deliveryType: ProductDeliveryType;
|
|
562
|
+
/**
|
|
563
|
+
* 商品封面
|
|
564
|
+
*/
|
|
565
|
+
cover: string;
|
|
566
|
+
/**
|
|
567
|
+
* 商品名称
|
|
568
|
+
*/
|
|
569
|
+
name: string;
|
|
570
|
+
/**
|
|
571
|
+
* 商品描述
|
|
572
|
+
*/
|
|
573
|
+
description?: string;
|
|
574
|
+
/**
|
|
575
|
+
* 特色标签
|
|
576
|
+
*/
|
|
577
|
+
featureTags?: string[];
|
|
578
|
+
/**
|
|
579
|
+
* 商品 ID
|
|
580
|
+
*/
|
|
581
|
+
productId: number;
|
|
582
|
+
/**
|
|
583
|
+
* 商品快照ID
|
|
584
|
+
*/
|
|
585
|
+
productSnapshotId: number;
|
|
586
|
+
/**
|
|
587
|
+
* 商品金额
|
|
588
|
+
*/
|
|
589
|
+
realPrice: number;
|
|
590
|
+
/**
|
|
591
|
+
* 购买数量
|
|
592
|
+
*/
|
|
593
|
+
quantity: number;
|
|
594
|
+
/**
|
|
595
|
+
* 商品总金额
|
|
596
|
+
*/
|
|
597
|
+
totalAmount: number;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
/**
|
|
601
|
+
* 已退款订单数据
|
|
602
|
+
*/
|
|
603
|
+
export declare interface OrderRefundedData extends OrderPaidData {
|
|
604
|
+
status: OrderStatus.Refunded;
|
|
605
|
+
/**
|
|
606
|
+
* 退款时间(单位:毫秒)
|
|
607
|
+
*/
|
|
608
|
+
refundAt: number;
|
|
609
|
+
/**
|
|
610
|
+
* 发货时间(单位:毫秒)
|
|
611
|
+
*/
|
|
612
|
+
deliveryAt?: number;
|
|
613
|
+
/**
|
|
614
|
+
* 订单过期时间(单位:毫秒)
|
|
615
|
+
*/
|
|
616
|
+
expiredAt?: number;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
/**
|
|
620
|
+
* 退款失败原因
|
|
621
|
+
*/
|
|
622
|
+
export declare enum OrderRefundFailReason {
|
|
623
|
+
Unknown = "unknown"
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
/**
|
|
627
|
+
* 退款中订单数据
|
|
628
|
+
*/
|
|
629
|
+
export declare interface OrderRefundingData extends OrderPaidData {
|
|
630
|
+
status: OrderStatus.Refunding;
|
|
631
|
+
/**
|
|
632
|
+
* 退款时间(单位:毫秒)
|
|
633
|
+
*/
|
|
634
|
+
refundAt: number;
|
|
635
|
+
deliveryAt?: number;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
/**
|
|
639
|
+
* 订单状态
|
|
640
|
+
*/
|
|
641
|
+
export declare enum OrderStatus {
|
|
642
|
+
/**
|
|
643
|
+
* 待支付
|
|
644
|
+
*/
|
|
645
|
+
WaitPay = "wait_pay",
|
|
646
|
+
/**
|
|
647
|
+
* 待发货
|
|
648
|
+
*/
|
|
649
|
+
WaitDelivery = "wait_delivery",
|
|
650
|
+
/**
|
|
651
|
+
* 待收货
|
|
652
|
+
*/
|
|
653
|
+
Delivering = "delivering",
|
|
654
|
+
/**
|
|
655
|
+
* 已完成
|
|
656
|
+
*/
|
|
657
|
+
Finish = "finish",
|
|
658
|
+
/**
|
|
659
|
+
* 已关闭
|
|
660
|
+
*/
|
|
661
|
+
Close = "close",
|
|
662
|
+
/**
|
|
663
|
+
* 退款中
|
|
664
|
+
*/
|
|
665
|
+
Refunding = "refunding",
|
|
666
|
+
/**
|
|
667
|
+
* 已退款
|
|
668
|
+
*/
|
|
669
|
+
Refunded = "refunded"
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
/**
|
|
673
|
+
* 待发货订单数据
|
|
674
|
+
*/
|
|
675
|
+
export declare interface OrderWaitDeliveryData extends OrderPaidData {
|
|
676
|
+
status: OrderStatus.WaitDelivery;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
/**
|
|
680
|
+
* 待支付订单数据
|
|
681
|
+
*/
|
|
682
|
+
export declare interface OrderWaitPayData extends OrderBasicData {
|
|
683
|
+
status: OrderStatus.WaitPay;
|
|
684
|
+
/**
|
|
685
|
+
* 订单过期时间(单位:毫秒)
|
|
686
|
+
*/
|
|
687
|
+
expiredAt: number;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
export declare class Payment {
|
|
691
|
+
iarCore: InteractionReceiveCore;
|
|
692
|
+
config: ProductSDKConfig;
|
|
693
|
+
PaymentProvider: typeof PaymentProvider;
|
|
694
|
+
constructor(iarCore: InteractionReceiveCore, config: ProductSDKConfig);
|
|
695
|
+
/**
|
|
696
|
+
* 获取微信/支付宝支付参数
|
|
697
|
+
* @param options 支付订单参数
|
|
698
|
+
* @example
|
|
699
|
+
* ```js
|
|
700
|
+
* const data = await paymentTarget.payOrder({ orderNo: '1234567890', payProvider: PaymentProvider.Wechat });
|
|
701
|
+
* console.log('支付参数', data);
|
|
702
|
+
* ```
|
|
703
|
+
*/
|
|
704
|
+
getPayOrderParams(options: PayOrderParams): Promise<CreateOrderResponse>;
|
|
705
|
+
/** 支付方式缓存 */
|
|
706
|
+
private __payProviderCache;
|
|
707
|
+
/**
|
|
708
|
+
* 获取支付方式
|
|
709
|
+
* @example
|
|
710
|
+
* ```js
|
|
711
|
+
* const data = await paymentTarget.getPayProviders();
|
|
712
|
+
* console.log('支付方式', data);
|
|
713
|
+
* ```
|
|
714
|
+
*/
|
|
715
|
+
getPayProviders(): Promise<PaymentProvider[]>;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
/**
|
|
719
|
+
* 支付方式
|
|
720
|
+
*/
|
|
721
|
+
export declare enum PaymentProvider {
|
|
722
|
+
/**
|
|
723
|
+
* 微信
|
|
724
|
+
*/
|
|
725
|
+
Wechat = "WECHAT",
|
|
726
|
+
/**
|
|
727
|
+
* 支付宝
|
|
728
|
+
*/
|
|
729
|
+
Alipay = "ALIPAY"
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
/**
|
|
733
|
+
* 请求参数
|
|
734
|
+
*/
|
|
735
|
+
declare interface PayOrderParams {
|
|
736
|
+
/**
|
|
737
|
+
* 订单号
|
|
738
|
+
*/
|
|
739
|
+
orderNo: string;
|
|
740
|
+
/**
|
|
741
|
+
* 支付方式
|
|
742
|
+
*/
|
|
743
|
+
payProvider: PaymentProvider;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
/**
|
|
747
|
+
* 支付状态
|
|
748
|
+
*/
|
|
749
|
+
export declare enum PayStatus {
|
|
750
|
+
/**
|
|
751
|
+
* 待支付
|
|
752
|
+
*/
|
|
753
|
+
WaitPay = "wait_pay",
|
|
754
|
+
/**
|
|
755
|
+
* 已支付
|
|
756
|
+
*/
|
|
757
|
+
Payed = "payed",
|
|
758
|
+
/**
|
|
759
|
+
* 免费
|
|
760
|
+
*/
|
|
761
|
+
Free = "free"
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
/**
|
|
765
|
+
* 职位商品数据
|
|
766
|
+
*/
|
|
767
|
+
export declare interface PositionProductData extends ProductBasicData, ProductLinkData, ProductExplainData {
|
|
768
|
+
/**
|
|
769
|
+
* 商品类型
|
|
770
|
+
*/
|
|
771
|
+
productType: ProductType.Position;
|
|
772
|
+
/**
|
|
773
|
+
* 薪资/待遇
|
|
774
|
+
*/
|
|
775
|
+
treatment: string;
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
/**
|
|
779
|
+
* 商品库 SDK 模块
|
|
780
|
+
*/
|
|
781
|
+
export declare class Product {
|
|
782
|
+
iarCore: InteractionReceiveCore;
|
|
783
|
+
config: ProductSDKConfig;
|
|
784
|
+
ProductType: typeof ProductType;
|
|
785
|
+
ProductLinkType: typeof ProductLinkType;
|
|
786
|
+
ProductLinkJumpWay: typeof ProductLinkJumpWay;
|
|
787
|
+
ProductBuyType: typeof ProductBuyType;
|
|
788
|
+
ProductStatus: typeof ProductStatus;
|
|
789
|
+
ProductEvents: typeof ProductEvents;
|
|
790
|
+
ProductPriceType: typeof ProductPriceType;
|
|
791
|
+
ProductExplainStatus: typeof ProductExplainStatus;
|
|
792
|
+
ProductMediaType: typeof ProductMediaType;
|
|
793
|
+
ProductDeliveryType: typeof ProductDeliveryType;
|
|
794
|
+
ProductServiceType: typeof ProductServiceType;
|
|
795
|
+
eventEmitter: EventEmitter<ProductEventsRelations, ProductEvents>;
|
|
796
|
+
constructor(iarCore: InteractionReceiveCore, config: ProductSDKConfig);
|
|
797
|
+
/**
|
|
798
|
+
* 获取商品标签列表
|
|
799
|
+
* @param params 获取参数
|
|
800
|
+
* @example
|
|
801
|
+
* ```js
|
|
802
|
+
* const data = await productTarget.getProductTagList({ pageNumber: 1 });
|
|
803
|
+
* console.log('标签列表', data.contents);
|
|
804
|
+
* ```
|
|
805
|
+
*/
|
|
806
|
+
getProductTagList(params?: PageOptions): Promise<PageContent<ProductTag>>;
|
|
807
|
+
/**
|
|
808
|
+
* 获取商品列表
|
|
809
|
+
*
|
|
810
|
+
* 该方法可通过 **商品序号**、**标签 id + 关键词** 两种方式获取商品列表,
|
|
811
|
+
* @param params 获取参数
|
|
812
|
+
* @example
|
|
813
|
+
* ```js
|
|
814
|
+
* // 通过商品序号获取:获取 12 号商品之后的商品列表
|
|
815
|
+
* const data = await productTarget.getProductList({ displayNumber: 12 });
|
|
816
|
+
*
|
|
817
|
+
* // 通过标签 id 或关键词获取:获取标签 id 为 8 的商品列表,并根据关键词 '水果' 进行搜索,页数为第 2 页
|
|
818
|
+
* const data = await productTarget.getProductList({ tagId: 8, keyword: '水果', page: 2 });
|
|
819
|
+
* ```
|
|
820
|
+
*/
|
|
821
|
+
getProductList(params?: GetProductListParams): Promise<ProductListResult>;
|
|
822
|
+
/**
|
|
823
|
+
* 获取商品数据
|
|
824
|
+
* @param productId 商品 id
|
|
825
|
+
*/
|
|
826
|
+
getProductData(productId: number): Promise<ProductData>;
|
|
827
|
+
/**
|
|
828
|
+
* 发送商品点击事件
|
|
829
|
+
*
|
|
830
|
+
* 当观众点击商品时,调用该方法发送商品点击事件
|
|
831
|
+
* @param params 发送参数
|
|
832
|
+
* @example
|
|
833
|
+
* ```js
|
|
834
|
+
* await productTarget.sendProductClickEvent({
|
|
835
|
+
* productId: 123,
|
|
836
|
+
* name: '商品名称',
|
|
837
|
+
* productType: 'normal',
|
|
838
|
+
* });
|
|
839
|
+
* ```
|
|
840
|
+
*/
|
|
841
|
+
sendProductClickEvent(params: SendProductClickParams): Promise<void>;
|
|
842
|
+
/**
|
|
843
|
+
* 关闭当前正在推送中的商品
|
|
844
|
+
*
|
|
845
|
+
* 当需要关闭 UI 层的推送节点时,调用该方法关闭当前正在推送中的商品
|
|
846
|
+
* @example
|
|
847
|
+
* ```js
|
|
848
|
+
* await productTarget.closeProductPush();
|
|
849
|
+
* ```
|
|
850
|
+
*/
|
|
851
|
+
closeProductPush(): void;
|
|
852
|
+
/**
|
|
853
|
+
* 获取商品讲解开关
|
|
854
|
+
*
|
|
855
|
+
* 获取当前频道是否开启商品讲解
|
|
856
|
+
* @example
|
|
857
|
+
* ```js
|
|
858
|
+
* const enabled = await productTarget.getProductExplainEnabled();
|
|
859
|
+
* console.log('商品讲解开关', enabled);
|
|
860
|
+
* ```
|
|
861
|
+
*/
|
|
862
|
+
getProductExplainEnabled(): Promise<boolean>;
|
|
863
|
+
/**
|
|
864
|
+
* 获取当前频道是否开启点击"外链购买"商品的封面/标题区域直接跳转外链
|
|
865
|
+
* @example
|
|
866
|
+
* ```js
|
|
867
|
+
* const enabled = await productTarget.getOutLinkProductRedirectEnabled();
|
|
868
|
+
* console.log('商品点击直接跳转外链开关', enabled);
|
|
869
|
+
* ```
|
|
870
|
+
*/
|
|
871
|
+
getOutLinkProductRedirectEnabled(): Promise<boolean>;
|
|
872
|
+
/**
|
|
873
|
+
* 生成商品讲解页面地址
|
|
874
|
+
* @param params url 携带参数
|
|
875
|
+
* @example
|
|
876
|
+
* ```js
|
|
877
|
+
* const url = await productTarget.generateProductExplainPageUrl({ productId: 123 });
|
|
878
|
+
* console.log('商品讲解页面地址', url);
|
|
879
|
+
* ```
|
|
880
|
+
*/
|
|
881
|
+
generateProductExplainPageUrl<T extends object = object>(params?: T): Promise<string | null>;
|
|
882
|
+
/**
|
|
883
|
+
* 获取商品支付订单是否开启
|
|
884
|
+
* @example
|
|
885
|
+
* ```js
|
|
886
|
+
* const enabled = await productTarget.getProductPayOrderEnabled();
|
|
887
|
+
* console.log('商品支付订单是否开启', enabled);
|
|
888
|
+
* ```
|
|
889
|
+
*/
|
|
890
|
+
getProductPayOrderEnabled(): Promise<boolean>;
|
|
891
|
+
getCurrentPushingProduct(): Promise<ChannelProductPushingStatusInfo_2 | undefined>;
|
|
892
|
+
/**
|
|
893
|
+
* 判断当前用户是否支持直接购买商品
|
|
894
|
+
* @example
|
|
895
|
+
* ```js
|
|
896
|
+
* const supported = await productTarget.getSupportToDirectBuy();
|
|
897
|
+
* console.log('是否支持直接购买', supported);
|
|
898
|
+
* ```
|
|
899
|
+
*/
|
|
900
|
+
getSupportToDirectBuy(): Promise<boolean>;
|
|
901
|
+
private __handleProductMessage;
|
|
902
|
+
private __handleRefreshProductList;
|
|
903
|
+
private __handleProductClickEvent;
|
|
904
|
+
private __handleProductClickTimes;
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
/**
|
|
908
|
+
* 商品基础数据
|
|
909
|
+
*/
|
|
910
|
+
export declare interface ProductBasicData {
|
|
911
|
+
/**
|
|
912
|
+
* 商品 id
|
|
913
|
+
*/
|
|
914
|
+
productId: number;
|
|
915
|
+
/**
|
|
916
|
+
* 商品封面
|
|
917
|
+
*/
|
|
918
|
+
cover: string;
|
|
919
|
+
/**
|
|
920
|
+
* 封面列表
|
|
921
|
+
*/
|
|
922
|
+
coverList: string[];
|
|
923
|
+
/**
|
|
924
|
+
* 素材库视频列表
|
|
925
|
+
*/
|
|
926
|
+
videoList: string[];
|
|
927
|
+
/**
|
|
928
|
+
* 商品媒体列表
|
|
929
|
+
*/
|
|
930
|
+
mediaList: ProductMediaData[];
|
|
931
|
+
/**
|
|
932
|
+
* 商品名称
|
|
933
|
+
*/
|
|
934
|
+
name: string;
|
|
935
|
+
/**
|
|
936
|
+
* 商品描述
|
|
937
|
+
*/
|
|
938
|
+
description: string;
|
|
939
|
+
/**
|
|
940
|
+
* 商品详情
|
|
941
|
+
*/
|
|
942
|
+
detail: string;
|
|
943
|
+
/**
|
|
944
|
+
* 商品状态
|
|
945
|
+
*/
|
|
946
|
+
status: ProductStatus;
|
|
947
|
+
/**
|
|
948
|
+
* 商品序号
|
|
949
|
+
*/
|
|
950
|
+
displayNumber: number;
|
|
951
|
+
/**
|
|
952
|
+
* 按钮文案
|
|
953
|
+
*/
|
|
954
|
+
buttonText: string;
|
|
955
|
+
/**
|
|
956
|
+
* 特色标签
|
|
957
|
+
*/
|
|
958
|
+
featureTags: string[];
|
|
959
|
+
/**
|
|
960
|
+
* 是否为置顶商品
|
|
961
|
+
*/
|
|
962
|
+
isTopping?: boolean;
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
/**
|
|
966
|
+
* 商品购买类型
|
|
967
|
+
*/
|
|
968
|
+
export declare enum ProductBuyType {
|
|
969
|
+
/**
|
|
970
|
+
* 直接购买
|
|
971
|
+
*/
|
|
972
|
+
DirectBuy = "inner",
|
|
973
|
+
/**
|
|
974
|
+
* 外链购买
|
|
975
|
+
*/
|
|
976
|
+
Link = "link"
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
/**
|
|
980
|
+
* 商品配置
|
|
981
|
+
*/
|
|
982
|
+
export declare interface ProductConfig {
|
|
983
|
+
/**
|
|
984
|
+
* 埋点上报总开关
|
|
985
|
+
*/
|
|
986
|
+
watchEventTrackEnabled: boolean;
|
|
987
|
+
/**
|
|
988
|
+
* 互动事件上报开关
|
|
989
|
+
*/
|
|
990
|
+
productTrackEnabled?: boolean;
|
|
991
|
+
/**
|
|
992
|
+
* 当前推送的商品信息
|
|
993
|
+
*/
|
|
994
|
+
channelProductPushingStatusVO?: ChannelProductPushingStatusInfo;
|
|
995
|
+
/**
|
|
996
|
+
* 商品讲解开关
|
|
997
|
+
*/
|
|
998
|
+
productExplainEnabled: boolean;
|
|
999
|
+
/**
|
|
1000
|
+
* 商品热卖中开关
|
|
1001
|
+
*/
|
|
1002
|
+
productHotEffectEnabled?: boolean;
|
|
1003
|
+
/**
|
|
1004
|
+
* 商品热卖中文案
|
|
1005
|
+
*/
|
|
1006
|
+
productHotEffectTips?: ChannelProductHotEffectTips;
|
|
1007
|
+
/**
|
|
1008
|
+
* 点击商品的封面/标题区域是否直接跳转外链
|
|
1009
|
+
*/
|
|
1010
|
+
outLinkProductRedirectEnabled: boolean;
|
|
1011
|
+
/**
|
|
1012
|
+
* 商品订单入口是否显示
|
|
1013
|
+
*/
|
|
1014
|
+
productPayOrderEnabled: boolean;
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
/**
|
|
1018
|
+
* 商品数据
|
|
1019
|
+
*/
|
|
1020
|
+
export declare type ProductData = NormalProductData | FinanceProductData | PositionProductData;
|
|
1021
|
+
|
|
1022
|
+
/**
|
|
1023
|
+
* 履约方式
|
|
1024
|
+
*/
|
|
1025
|
+
export declare enum ProductDeliveryType {
|
|
1026
|
+
/**
|
|
1027
|
+
* 物流
|
|
1028
|
+
*/
|
|
1029
|
+
Express = "express",
|
|
1030
|
+
/**
|
|
1031
|
+
* 无物流
|
|
1032
|
+
*/
|
|
1033
|
+
Virtual = "virtual"
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
export declare enum ProductEvents {
|
|
1037
|
+
/**
|
|
1038
|
+
* 上架商品
|
|
1039
|
+
*/
|
|
1040
|
+
OnSaleProduct = "OnSaleProduct",
|
|
1041
|
+
/**
|
|
1042
|
+
* 下架商品
|
|
1043
|
+
*/
|
|
1044
|
+
OffSaleProduct = "OffSaleProduct",
|
|
1045
|
+
/**
|
|
1046
|
+
* 添加商品
|
|
1047
|
+
*/
|
|
1048
|
+
AddProduct = "AddProduct",
|
|
1049
|
+
/**
|
|
1050
|
+
* 删除商品
|
|
1051
|
+
*/
|
|
1052
|
+
DeleteProduct = "DeleteProduct",
|
|
1053
|
+
/**
|
|
1054
|
+
* 修改商品
|
|
1055
|
+
*/
|
|
1056
|
+
ChangeProduct = "ChangeProduct",
|
|
1057
|
+
/**
|
|
1058
|
+
* 上移或下移商品
|
|
1059
|
+
*/
|
|
1060
|
+
MoveProduct = "MoveProduct",
|
|
1061
|
+
/**
|
|
1062
|
+
* 修改商品排序
|
|
1063
|
+
*/
|
|
1064
|
+
ChangeProductRank = "ChangeProductRank",
|
|
1065
|
+
/**
|
|
1066
|
+
* 商品售罄
|
|
1067
|
+
*/
|
|
1068
|
+
ProductSoldOut = "ProductSoldOut",
|
|
1069
|
+
/**
|
|
1070
|
+
* 推送商品
|
|
1071
|
+
*/
|
|
1072
|
+
PushProduct = "PushProduct",
|
|
1073
|
+
/**
|
|
1074
|
+
* 取消推送商品
|
|
1075
|
+
*/
|
|
1076
|
+
CancelPushProduct = "CancelPushProduct",
|
|
1077
|
+
/**
|
|
1078
|
+
* 商品库列表开关
|
|
1079
|
+
*/
|
|
1080
|
+
ProductListEnabled = "ProductListEnabled",
|
|
1081
|
+
/**
|
|
1082
|
+
* 刷新当前商品列表
|
|
1083
|
+
*/
|
|
1084
|
+
RefreshProductList = "RefreshProductList",
|
|
1085
|
+
/**
|
|
1086
|
+
* 商品点击事件
|
|
1087
|
+
*/
|
|
1088
|
+
ProductClick = "ProductClick",
|
|
1089
|
+
/**
|
|
1090
|
+
* 商品点击次数统计事件
|
|
1091
|
+
*/
|
|
1092
|
+
ProductClickTimes = "ProductClickTimes"
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
export declare type ProductEventsRelations = {
|
|
1096
|
+
[ProductEvents.OnSaleProduct]: {
|
|
1097
|
+
/**
|
|
1098
|
+
* 商品数据
|
|
1099
|
+
*/
|
|
1100
|
+
productData: ProductData;
|
|
1101
|
+
};
|
|
1102
|
+
[ProductEvents.OffSaleProduct]: {
|
|
1103
|
+
/**
|
|
1104
|
+
* 商品数据
|
|
1105
|
+
*/
|
|
1106
|
+
productData: ProductData;
|
|
1107
|
+
};
|
|
1108
|
+
[ProductEvents.AddProduct]: {
|
|
1109
|
+
/**
|
|
1110
|
+
* 商品数据
|
|
1111
|
+
*/
|
|
1112
|
+
productData: ProductData;
|
|
1113
|
+
};
|
|
1114
|
+
[ProductEvents.DeleteProduct]: {
|
|
1115
|
+
/**
|
|
1116
|
+
* 商品 id
|
|
1117
|
+
*/
|
|
1118
|
+
productId: number;
|
|
1119
|
+
};
|
|
1120
|
+
[ProductEvents.ChangeProduct]: {
|
|
1121
|
+
/**
|
|
1122
|
+
* 商品数据
|
|
1123
|
+
*/
|
|
1124
|
+
productData: ProductData;
|
|
1125
|
+
};
|
|
1126
|
+
[ProductEvents.MoveProduct]: {
|
|
1127
|
+
/**
|
|
1128
|
+
* 发生改变的两个商品
|
|
1129
|
+
*/
|
|
1130
|
+
targetProducts: [ProductData, ProductData];
|
|
1131
|
+
};
|
|
1132
|
+
[ProductEvents.ChangeProductRank]: {
|
|
1133
|
+
/**
|
|
1134
|
+
* 商品数据
|
|
1135
|
+
*/
|
|
1136
|
+
productData: ProductData;
|
|
1137
|
+
};
|
|
1138
|
+
[ProductEvents.ProductSoldOut]: {
|
|
1139
|
+
/**
|
|
1140
|
+
* 商品 id
|
|
1141
|
+
*/
|
|
1142
|
+
productId: number;
|
|
1143
|
+
};
|
|
1144
|
+
[ProductEvents.PushProduct]: {
|
|
1145
|
+
/**
|
|
1146
|
+
* 商品数据
|
|
1147
|
+
*/
|
|
1148
|
+
productData: ProductData;
|
|
1149
|
+
/**
|
|
1150
|
+
* 推送方式
|
|
1151
|
+
*/
|
|
1152
|
+
pushRule: ProductPushRule;
|
|
1153
|
+
};
|
|
1154
|
+
[ProductEvents.CancelPushProduct]: {
|
|
1155
|
+
/**
|
|
1156
|
+
* 商品 id
|
|
1157
|
+
*/
|
|
1158
|
+
productId?: number;
|
|
1159
|
+
};
|
|
1160
|
+
[ProductEvents.ProductListEnabled]: {
|
|
1161
|
+
/**
|
|
1162
|
+
* 开启或关闭
|
|
1163
|
+
*/
|
|
1164
|
+
enabled: boolean;
|
|
1165
|
+
};
|
|
1166
|
+
[ProductEvents.ProductClick]: {
|
|
1167
|
+
/**
|
|
1168
|
+
* 商品 id
|
|
1169
|
+
*/
|
|
1170
|
+
productId: number;
|
|
1171
|
+
/**
|
|
1172
|
+
* 商品名称
|
|
1173
|
+
*/
|
|
1174
|
+
name: string;
|
|
1175
|
+
/**
|
|
1176
|
+
* 商品类型
|
|
1177
|
+
*/
|
|
1178
|
+
productType: ProductType;
|
|
1179
|
+
};
|
|
1180
|
+
[ProductEvents.ProductClickTimes]: {
|
|
1181
|
+
/**
|
|
1182
|
+
* 商品 id
|
|
1183
|
+
*/
|
|
1184
|
+
productId: number;
|
|
1185
|
+
/**
|
|
1186
|
+
* 商品名称
|
|
1187
|
+
*/
|
|
1188
|
+
name: string;
|
|
1189
|
+
/**
|
|
1190
|
+
* 商品类型
|
|
1191
|
+
*/
|
|
1192
|
+
productType: ProductType;
|
|
1193
|
+
/**
|
|
1194
|
+
* 点击次数
|
|
1195
|
+
*/
|
|
1196
|
+
times: number;
|
|
1197
|
+
};
|
|
1198
|
+
};
|
|
1199
|
+
|
|
1200
|
+
/**
|
|
1201
|
+
* 商品讲解数据
|
|
1202
|
+
*/
|
|
1203
|
+
export declare interface ProductExplainData {
|
|
1204
|
+
/**
|
|
1205
|
+
* 讲解状态
|
|
1206
|
+
*/
|
|
1207
|
+
explainStatus?: ProductExplainStatus;
|
|
1208
|
+
/**
|
|
1209
|
+
* 讲解类型
|
|
1210
|
+
*/
|
|
1211
|
+
explainType?: ProductExplainType;
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
/**
|
|
1215
|
+
* 商品讲解状态
|
|
1216
|
+
*/
|
|
1217
|
+
export declare enum ProductExplainStatus {
|
|
1218
|
+
/**
|
|
1219
|
+
* 待讲解
|
|
1220
|
+
*/
|
|
1221
|
+
NotExplained = "notExplained",
|
|
1222
|
+
/**
|
|
1223
|
+
* 讲解中
|
|
1224
|
+
*/
|
|
1225
|
+
Explaining = "explaining",
|
|
1226
|
+
/**
|
|
1227
|
+
* 已讲解
|
|
1228
|
+
*/
|
|
1229
|
+
Explained = "explained"
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
/**
|
|
1233
|
+
* 商品讲解类型
|
|
1234
|
+
*/
|
|
1235
|
+
export declare enum ProductExplainType {
|
|
1236
|
+
/**
|
|
1237
|
+
* 直播中的讲解
|
|
1238
|
+
*/
|
|
1239
|
+
Live = "live",
|
|
1240
|
+
/**
|
|
1241
|
+
* 回放中的讲解
|
|
1242
|
+
*/
|
|
1243
|
+
Playback = "recordFile"
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
/**
|
|
1247
|
+
* 商品链接数据
|
|
1248
|
+
*/
|
|
1249
|
+
export declare interface ProductLinkData {
|
|
1250
|
+
/**
|
|
1251
|
+
* 链接类型
|
|
1252
|
+
*/
|
|
1253
|
+
linkType: ProductLinkType;
|
|
1254
|
+
/**
|
|
1255
|
+
* 跳转方式
|
|
1256
|
+
*/
|
|
1257
|
+
jumpWay: ProductLinkJumpWay;
|
|
1258
|
+
/**
|
|
1259
|
+
* 通用平台跳转链接
|
|
1260
|
+
*/
|
|
1261
|
+
link: string;
|
|
1262
|
+
/**
|
|
1263
|
+
* PC 端跳转链接
|
|
1264
|
+
*/
|
|
1265
|
+
pcLink: string;
|
|
1266
|
+
/**
|
|
1267
|
+
* 移动端跳转链接
|
|
1268
|
+
*/
|
|
1269
|
+
mobileLink: string;
|
|
1270
|
+
/**
|
|
1271
|
+
* App 链接
|
|
1272
|
+
*/
|
|
1273
|
+
mobileAppLink: string;
|
|
1274
|
+
/**
|
|
1275
|
+
* 安卓端 app 跳转链接
|
|
1276
|
+
*/
|
|
1277
|
+
androidLink: string;
|
|
1278
|
+
/**
|
|
1279
|
+
* iOS app 跳转链接
|
|
1280
|
+
*/
|
|
1281
|
+
iosLink: string;
|
|
1282
|
+
/**
|
|
1283
|
+
* 其他链接
|
|
1284
|
+
*/
|
|
1285
|
+
otherLink: string;
|
|
1286
|
+
/**
|
|
1287
|
+
* 微信小程序原始 id
|
|
1288
|
+
*/
|
|
1289
|
+
wxMiniprogramOriginalId: string;
|
|
1290
|
+
/**
|
|
1291
|
+
* 微信小程序应用 id
|
|
1292
|
+
*/
|
|
1293
|
+
wxMiniprogramAppId: string;
|
|
1294
|
+
/**
|
|
1295
|
+
* 微信小程序内页面路径及参数
|
|
1296
|
+
*/
|
|
1297
|
+
wxMiniprogramLink: string;
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
/**
|
|
1301
|
+
* 商品外链跳转方式
|
|
1302
|
+
*/
|
|
1303
|
+
export declare enum ProductLinkJumpWay {
|
|
1304
|
+
/**
|
|
1305
|
+
* iframe 弹框形式打开
|
|
1306
|
+
*/
|
|
1307
|
+
PopUp = "POP_UP",
|
|
1308
|
+
/**
|
|
1309
|
+
* 新窗口打开
|
|
1310
|
+
*/
|
|
1311
|
+
NewWindow = "NEW_WINDOW",
|
|
1312
|
+
/**
|
|
1313
|
+
* 当前窗口打开
|
|
1314
|
+
*/
|
|
1315
|
+
CurrentWindow = "CURRENT_WINDOW"
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
/**
|
|
1319
|
+
* 商品链接类型
|
|
1320
|
+
*/
|
|
1321
|
+
export declare enum ProductLinkType {
|
|
1322
|
+
/**
|
|
1323
|
+
* 通用链接
|
|
1324
|
+
*/
|
|
1325
|
+
Normal = 10,
|
|
1326
|
+
/**
|
|
1327
|
+
* 多平台链接
|
|
1328
|
+
*/
|
|
1329
|
+
MultiPlatform = 11,
|
|
1330
|
+
/**
|
|
1331
|
+
* 原生方法跳转
|
|
1332
|
+
*/
|
|
1333
|
+
Native = 12
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
export declare interface ProductListResult {
|
|
1337
|
+
/**
|
|
1338
|
+
* 商品列表
|
|
1339
|
+
*/
|
|
1340
|
+
contents: ProductData[];
|
|
1341
|
+
/**
|
|
1342
|
+
* 总数
|
|
1343
|
+
*/
|
|
1344
|
+
total: number;
|
|
1345
|
+
/**
|
|
1346
|
+
* 置顶商品
|
|
1347
|
+
*/
|
|
1348
|
+
toppingProduct?: ProductData;
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
/**
|
|
1352
|
+
* 媒体数据
|
|
1353
|
+
*/
|
|
1354
|
+
export declare type ProductMediaData = ProductMediaImageData | ProductMediaMaterialVideoData;
|
|
1355
|
+
|
|
1356
|
+
export declare interface ProductMediaImageData {
|
|
1357
|
+
/**
|
|
1358
|
+
* 媒体类型
|
|
1359
|
+
*/
|
|
1360
|
+
type: ProductMediaType.Image;
|
|
1361
|
+
/**
|
|
1362
|
+
* 图片链接
|
|
1363
|
+
*/
|
|
1364
|
+
url: string;
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1367
|
+
export declare interface ProductMediaMaterialVideoData {
|
|
1368
|
+
/**
|
|
1369
|
+
* 媒体类型
|
|
1370
|
+
*/
|
|
1371
|
+
type: ProductMediaType.MaterialVideo;
|
|
1372
|
+
/**
|
|
1373
|
+
* 素材库 id
|
|
1374
|
+
*/
|
|
1375
|
+
materialId: string;
|
|
1376
|
+
}
|
|
1377
|
+
|
|
1378
|
+
/**
|
|
1379
|
+
* 商品媒体类型
|
|
1380
|
+
*/
|
|
1381
|
+
export declare enum ProductMediaType {
|
|
1382
|
+
/**
|
|
1383
|
+
* 图片
|
|
1384
|
+
*/
|
|
1385
|
+
Image = "image",
|
|
1386
|
+
/**
|
|
1387
|
+
* 素材库视频
|
|
1388
|
+
*/
|
|
1389
|
+
MaterialVideo = "material-video"
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1392
|
+
/**
|
|
1393
|
+
* 商品价格类型
|
|
1394
|
+
*/
|
|
1395
|
+
export declare enum ProductPriceType {
|
|
1396
|
+
/**
|
|
1397
|
+
* 金额
|
|
1398
|
+
*/
|
|
1399
|
+
Amount = "AMOUNT",
|
|
1400
|
+
/**
|
|
1401
|
+
* 自定义
|
|
1402
|
+
*/
|
|
1403
|
+
Custom = "CUSTOM"
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
/**
|
|
1407
|
+
* 商品推送规则
|
|
1408
|
+
*/
|
|
1409
|
+
export declare enum ProductPushRule {
|
|
1410
|
+
/**
|
|
1411
|
+
* 大卡片
|
|
1412
|
+
*/
|
|
1413
|
+
BigCard = "bigCard",
|
|
1414
|
+
/**
|
|
1415
|
+
* 小卡片
|
|
1416
|
+
*/
|
|
1417
|
+
SmallCard = "smallCard"
|
|
1418
|
+
}
|
|
1419
|
+
|
|
1420
|
+
export declare interface ProductSDKConfig {
|
|
1421
|
+
/**
|
|
1422
|
+
* 传入的商品配置
|
|
1423
|
+
*/
|
|
1424
|
+
getProductConfig: MaybePromise<ProductConfig>;
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1427
|
+
/**
|
|
1428
|
+
* 客服方式
|
|
1429
|
+
*/
|
|
1430
|
+
export declare enum ProductServiceType {
|
|
1431
|
+
/**
|
|
1432
|
+
* 渠道码
|
|
1433
|
+
*/
|
|
1434
|
+
WxWorkCode = "wxWorkCode",
|
|
1435
|
+
/**
|
|
1436
|
+
* 自定义
|
|
1437
|
+
*/
|
|
1438
|
+
Custom = "custom"
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1441
|
+
/**
|
|
1442
|
+
* 商品状态
|
|
1443
|
+
*/
|
|
1444
|
+
export declare enum ProductStatus {
|
|
1445
|
+
/**
|
|
1446
|
+
* 上架
|
|
1447
|
+
*/
|
|
1448
|
+
OnSale = 1,
|
|
1449
|
+
/**
|
|
1450
|
+
* 下架
|
|
1451
|
+
*/
|
|
1452
|
+
OffSale = 0
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1455
|
+
/**
|
|
1456
|
+
* 商品标签
|
|
1457
|
+
*/
|
|
1458
|
+
export declare interface ProductTag {
|
|
1459
|
+
/**
|
|
1460
|
+
* 标签 id
|
|
1461
|
+
*/
|
|
1462
|
+
id: number;
|
|
1463
|
+
/**
|
|
1464
|
+
* 标签名
|
|
1465
|
+
*/
|
|
1466
|
+
name: string;
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
/**
|
|
1470
|
+
* 商品类型
|
|
1471
|
+
*/
|
|
1472
|
+
export declare enum ProductType {
|
|
1473
|
+
/**
|
|
1474
|
+
* 普通产品
|
|
1475
|
+
*/
|
|
1476
|
+
Normal = "normal",
|
|
1477
|
+
/**
|
|
1478
|
+
* 金融产品
|
|
1479
|
+
*/
|
|
1480
|
+
Finance = "finance",
|
|
1481
|
+
/**
|
|
1482
|
+
* 职位产品
|
|
1483
|
+
*/
|
|
1484
|
+
Position = "position"
|
|
1485
|
+
}
|
|
1486
|
+
|
|
1487
|
+
/**
|
|
1488
|
+
* 退款状态
|
|
1489
|
+
*/
|
|
1490
|
+
export declare enum RefundStatus {
|
|
1491
|
+
/**
|
|
1492
|
+
* 成功
|
|
1493
|
+
*/
|
|
1494
|
+
Success = "SUCCESS",
|
|
1495
|
+
/**
|
|
1496
|
+
* 失败
|
|
1497
|
+
*/
|
|
1498
|
+
Fail = "FAIL",
|
|
1499
|
+
/**
|
|
1500
|
+
* 处理中
|
|
1501
|
+
*/
|
|
1502
|
+
Processing = "PROCESSING"
|
|
1503
|
+
}
|
|
1504
|
+
|
|
1505
|
+
export declare interface SendProductClickParams {
|
|
1506
|
+
/**
|
|
1507
|
+
* 商品 id
|
|
1508
|
+
*/
|
|
1509
|
+
productId: number;
|
|
1510
|
+
/**
|
|
1511
|
+
* 商品名称
|
|
1512
|
+
*/
|
|
1513
|
+
name: string;
|
|
1514
|
+
/**
|
|
1515
|
+
* 商品类型
|
|
1516
|
+
*/
|
|
1517
|
+
productType: ProductType;
|
|
1518
|
+
}
|
|
1519
|
+
|
|
1520
|
+
export { }
|