@ftvs/jssdk 1.3.0 → 1.4.0
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/lib/index.d.ts +153 -0
- package/lib/index.es.js +1 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -180,6 +180,46 @@ interface DefaultAddressResult {
|
|
|
180
180
|
*/
|
|
181
181
|
declare function defaultAddress(): Promise<DefaultAddressResult>;
|
|
182
182
|
|
|
183
|
+
interface GetAppInfoResult {
|
|
184
|
+
/**
|
|
185
|
+
* 设备Id
|
|
186
|
+
*/
|
|
187
|
+
deviceId: string;
|
|
188
|
+
/**
|
|
189
|
+
* 维度
|
|
190
|
+
*/
|
|
191
|
+
latitude: string;
|
|
192
|
+
/**
|
|
193
|
+
* 经度
|
|
194
|
+
*/
|
|
195
|
+
longitude: string;
|
|
196
|
+
/**
|
|
197
|
+
* 网络类型
|
|
198
|
+
*/
|
|
199
|
+
netType: string;
|
|
200
|
+
/**
|
|
201
|
+
* 是否已经登录
|
|
202
|
+
*/
|
|
203
|
+
isLogin: boolean;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* 获取App信息。
|
|
207
|
+
* @category 基础
|
|
208
|
+
* @example
|
|
209
|
+
* ```javascript
|
|
210
|
+
* const res = await ftv.getAppInfo();
|
|
211
|
+
* // 结果类似:
|
|
212
|
+
* //{
|
|
213
|
+
* // "deviceId": "9afe0aab4be06ce5",
|
|
214
|
+
* // "isLogin": true,
|
|
215
|
+
* // "latitude": "26.61858",
|
|
216
|
+
* // "longitude": "106.64360",
|
|
217
|
+
* // "netType": "WIFI"
|
|
218
|
+
* }
|
|
219
|
+
* ```
|
|
220
|
+
*/
|
|
221
|
+
declare function getAppInfo(): Promise<GetAppInfoResult>;
|
|
222
|
+
|
|
183
223
|
interface GetAuthCodePayload {
|
|
184
224
|
/**
|
|
185
225
|
* 应用id
|
|
@@ -296,6 +336,7 @@ declare function getEnvSync(): Environment;
|
|
|
296
336
|
*/
|
|
297
337
|
declare function getEnv(): Promise<Environment>;
|
|
298
338
|
|
|
339
|
+
declare type OneOrMany<T> = T | T[];
|
|
299
340
|
declare type OneData<T> = {
|
|
300
341
|
[K in keyof T]: any;
|
|
301
342
|
};
|
|
@@ -400,6 +441,16 @@ interface NavigateToPayLoad {
|
|
|
400
441
|
*/
|
|
401
442
|
declare function navigateTo(payload: NavigateToPayLoad): Promise<void>;
|
|
402
443
|
|
|
444
|
+
/**
|
|
445
|
+
* 去登录页。
|
|
446
|
+
* @category 基础
|
|
447
|
+
* @example
|
|
448
|
+
* ```javascript
|
|
449
|
+
* await ftv.openLoginPage();
|
|
450
|
+
* ```
|
|
451
|
+
*/
|
|
452
|
+
declare function openLoginPage(): Promise<void>;
|
|
453
|
+
|
|
403
454
|
interface RequestFaceAuthenticationPayload {
|
|
404
455
|
/**
|
|
405
456
|
* 内部认证`0` 属于多彩未来电视的服务使用
|
|
@@ -431,6 +482,96 @@ interface RequestFaceAuthenticationResult {
|
|
|
431
482
|
*/
|
|
432
483
|
declare function requestFaceAuthentication(payload: RequestFaceAuthenticationPayload): Promise<RequestFaceAuthenticationResult>;
|
|
433
484
|
|
|
485
|
+
interface paramsData {
|
|
486
|
+
/**
|
|
487
|
+
* 标题
|
|
488
|
+
*/
|
|
489
|
+
title: string;
|
|
490
|
+
/**
|
|
491
|
+
* 内容
|
|
492
|
+
*/
|
|
493
|
+
content: string;
|
|
494
|
+
}
|
|
495
|
+
interface RequestPaymentPayload {
|
|
496
|
+
/**
|
|
497
|
+
* 业务名称
|
|
498
|
+
*/
|
|
499
|
+
orgName: string;
|
|
500
|
+
/**
|
|
501
|
+
* 订单号
|
|
502
|
+
*/
|
|
503
|
+
orderNo: string;
|
|
504
|
+
/**
|
|
505
|
+
* 金额
|
|
506
|
+
*/
|
|
507
|
+
orderAmt: number;
|
|
508
|
+
/**
|
|
509
|
+
* 支付状态标签
|
|
510
|
+
* `0 不展示`
|
|
511
|
+
*
|
|
512
|
+
*/
|
|
513
|
+
amtType?: string;
|
|
514
|
+
/**
|
|
515
|
+
* 开放平台APPID
|
|
516
|
+
*/
|
|
517
|
+
openAppId?: string;
|
|
518
|
+
/**
|
|
519
|
+
* 支付二维码生成参数
|
|
520
|
+
*/
|
|
521
|
+
qrCode: string;
|
|
522
|
+
/**
|
|
523
|
+
* 支付类型
|
|
524
|
+
* number `1 微信 2 支付宝`
|
|
525
|
+
*/
|
|
526
|
+
qrType: 1 | 2;
|
|
527
|
+
/**
|
|
528
|
+
* `paramsData:{content: string;title: string}`;
|
|
529
|
+
*
|
|
530
|
+
* 
|
|
531
|
+
*/
|
|
532
|
+
params: OneOrMany<paramsData>;
|
|
533
|
+
}
|
|
534
|
+
interface RequestPaymentResult {
|
|
535
|
+
/**
|
|
536
|
+
* 支付状态
|
|
537
|
+
*/
|
|
538
|
+
status: boolean;
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* 支付。
|
|
542
|
+
*
|
|
543
|
+
* @category 开放接口 > 支付
|
|
544
|
+
* @example
|
|
545
|
+
* ```javascript
|
|
546
|
+
* const res = await ftv.requestPayment({
|
|
547
|
+
* "orgName": "静脉采血",
|
|
548
|
+
* "orderNo": "2024121029777035859353601",
|
|
549
|
+
* "orderAmt": 0.01,
|
|
550
|
+
* "qrCode": "weixin://wxpay/bizpayurl?pr=rr0QIYVz1",
|
|
551
|
+
* "qrType": 1,
|
|
552
|
+
* "params": [
|
|
553
|
+
* {
|
|
554
|
+
* "title": "订单名称",
|
|
555
|
+
* "content": "静脉采血"
|
|
556
|
+
* },
|
|
557
|
+
* {
|
|
558
|
+
* "title": "订单编号",
|
|
559
|
+
* "content": "2024121029777035859353601"
|
|
560
|
+
* },
|
|
561
|
+
* {
|
|
562
|
+
* "title": "创建时间",
|
|
563
|
+
* "content": "2024-08-12 15:26:18"
|
|
564
|
+
* }
|
|
565
|
+
* ]
|
|
566
|
+
* });
|
|
567
|
+
* // 结果类似:
|
|
568
|
+
* // {
|
|
569
|
+
* // status: true
|
|
570
|
+
* // }
|
|
571
|
+
* ```
|
|
572
|
+
*/
|
|
573
|
+
declare function requestPayment(payload: RequestPaymentPayload): Promise<RequestPaymentResult>;
|
|
574
|
+
|
|
434
575
|
interface ReturnToControlPayload {
|
|
435
576
|
/**
|
|
436
577
|
* 是否管控
|
|
@@ -493,6 +634,8 @@ type _ftv_ConfigPayload = ConfigPayload;
|
|
|
493
634
|
declare const _ftv_config: typeof config;
|
|
494
635
|
type _ftv_DefaultAddressResult = DefaultAddressResult;
|
|
495
636
|
declare const _ftv_defaultAddress: typeof defaultAddress;
|
|
637
|
+
type _ftv_GetAppInfoResult = GetAppInfoResult;
|
|
638
|
+
declare const _ftv_getAppInfo: typeof getAppInfo;
|
|
496
639
|
type _ftv_GetAuthCodePayload = GetAuthCodePayload;
|
|
497
640
|
type _ftv_GetAuthCodeResult = GetAuthCodeResult;
|
|
498
641
|
declare const _ftv_getAuthCode: typeof getAuthCode;
|
|
@@ -507,9 +650,13 @@ declare const _ftv_getUserInfo: typeof getUserInfo;
|
|
|
507
650
|
declare const _ftv_navigateBack: typeof navigateBack;
|
|
508
651
|
type _ftv_NavigateToPayLoad = NavigateToPayLoad;
|
|
509
652
|
declare const _ftv_navigateTo: typeof navigateTo;
|
|
653
|
+
declare const _ftv_openLoginPage: typeof openLoginPage;
|
|
510
654
|
type _ftv_RequestFaceAuthenticationPayload = RequestFaceAuthenticationPayload;
|
|
511
655
|
type _ftv_RequestFaceAuthenticationResult = RequestFaceAuthenticationResult;
|
|
512
656
|
declare const _ftv_requestFaceAuthentication: typeof requestFaceAuthentication;
|
|
657
|
+
type _ftv_RequestPaymentPayload = RequestPaymentPayload;
|
|
658
|
+
type _ftv_RequestPaymentResult = RequestPaymentResult;
|
|
659
|
+
declare const _ftv_requestPayment: typeof requestPayment;
|
|
513
660
|
type _ftv_ReturnToControlPayload = ReturnToControlPayload;
|
|
514
661
|
declare const _ftv_returnToControl: typeof returnToControl;
|
|
515
662
|
type _ftv_SelectFamilyResult = SelectFamilyResult;
|
|
@@ -526,6 +673,8 @@ declare namespace _ftv {
|
|
|
526
673
|
_ftv_config as config,
|
|
527
674
|
_ftv_DefaultAddressResult as DefaultAddressResult,
|
|
528
675
|
_ftv_defaultAddress as defaultAddress,
|
|
676
|
+
_ftv_GetAppInfoResult as GetAppInfoResult,
|
|
677
|
+
_ftv_getAppInfo as getAppInfo,
|
|
529
678
|
_ftv_GetAuthCodePayload as GetAuthCodePayload,
|
|
530
679
|
_ftv_GetAuthCodeResult as GetAuthCodeResult,
|
|
531
680
|
_ftv_getAuthCode as getAuthCode,
|
|
@@ -540,9 +689,13 @@ declare namespace _ftv {
|
|
|
540
689
|
_ftv_navigateBack as navigateBack,
|
|
541
690
|
_ftv_NavigateToPayLoad as NavigateToPayLoad,
|
|
542
691
|
_ftv_navigateTo as navigateTo,
|
|
692
|
+
_ftv_openLoginPage as openLoginPage,
|
|
543
693
|
_ftv_RequestFaceAuthenticationPayload as RequestFaceAuthenticationPayload,
|
|
544
694
|
_ftv_RequestFaceAuthenticationResult as RequestFaceAuthenticationResult,
|
|
545
695
|
_ftv_requestFaceAuthentication as requestFaceAuthentication,
|
|
696
|
+
_ftv_RequestPaymentPayload as RequestPaymentPayload,
|
|
697
|
+
_ftv_RequestPaymentResult as RequestPaymentResult,
|
|
698
|
+
_ftv_requestPayment as requestPayment,
|
|
546
699
|
_ftv_ReturnToControlPayload as ReturnToControlPayload,
|
|
547
700
|
_ftv_returnToControl as returnToControl,
|
|
548
701
|
_ftv_SelectFamilyResult as SelectFamilyResult,
|