syttunnel 0.1.4-0 → 0.1.5-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.
@@ -63,6 +63,9 @@ interface ISaveImageToLocalResponse {
63
63
  errCode?: string;
64
64
  errMessage?: string;
65
65
  }
66
+ export interface ISFAddressParams {
67
+ encryptKey: string;
68
+ }
66
69
  export declare class AppCommon {
67
70
  openScan(params: IOpenCodeScanParams): Promise<string>;
68
71
  shareMsgToWXAPI(params: IShareMsgToWXParams): Promise<IShareMsgToWXResponse>;
@@ -71,5 +74,10 @@ export declare class AppCommon {
71
74
  onSelectContacts(): Promise<IOnSelectContactResponse>;
72
75
  onSaveImageToLocal(params: ISaveImageToLocalParams): Promise<ISaveImageToLocalResponse>;
73
76
  getEnvironment(): Promise<string>;
77
+ /**
78
+ * 获取顺丰地址列表
79
+ * @returns 返回为json string加密的字符串,需密钥解密
80
+ */
81
+ getSFAddress(params: ISFAddressParams): Promise<string>;
74
82
  }
75
83
  export {};
@@ -9,6 +9,9 @@ interface IPayByWeChatParams {
9
9
  interface IPayByAliParams {
10
10
  orderStr: string;
11
11
  }
12
+ export interface INativePayResult {
13
+ result: IPayResult;
14
+ }
12
15
  export interface IPayResult {
13
16
  channelType: string;
14
17
  status: string | number;
@@ -16,7 +19,7 @@ export interface IPayResult {
16
19
  channelResult: object;
17
20
  }
18
21
  export declare class AppPay {
19
- payByWeChat(params: IPayByWeChatParams): Promise<IPayResult>;
20
- payByAli(params: IPayByAliParams): Promise<IPayResult>;
22
+ payByWeChat(params: IPayByWeChatParams): Promise<INativePayResult>;
23
+ payByAli(params: IPayByAliParams): Promise<INativePayResult>;
21
24
  }
22
25
  export {};
@@ -2,7 +2,7 @@
2
2
  * 基本的调用事件
3
3
  */
4
4
  import { IPostParams } from "./bridge";
5
- export declare type CommonEvents = "getUserInfo" | "sytFetch" | "authorize" | "backToBefore" | "setTitle" | "setStyle" | "getNavigationFrame" | "loadUrl" | "payByWeChat" | "payByAli" | "startScanCode" | "shareMessageToWXReq" | "currentLocation" | "appVersion" | "selectContacts" | "saveImageToLocal" | "getEnvironment" | "goBack";
5
+ export declare type CommonEvents = "getUserInfo" | "sytFetch" | "authorize" | "backToBefore" | "setTitle" | "setStyle" | "getNavigationFrame" | "loadUrl" | "payByWeChat" | "payByAli" | "startScanCode" | "shareMessageToWXReq" | "currentLocation" | "appVersion" | "selectContacts" | "saveImageToLocal" | "getEnvironment" | "goBack" | "selectAddress";
6
6
  export interface IPostBasicParams extends IPostParams {
7
7
  method: CommonEvents;
8
8
  }
@@ -33,8 +33,11 @@ interface IWxAutoPaySignResponse {
33
33
  interface IOnDigiCnyPayResultParams {
34
34
  status: 0 | 1 | 2 | 3;
35
35
  }
36
- interface IPayWaybillByPayIdParams {
37
- payId: string;
36
+ interface IPayByWXMiniProgram {
37
+ payToken: string;
38
+ }
39
+ export interface IPayByWXMiniProgramResult {
40
+ result: boolean;
38
41
  }
39
42
  declare class PayParams {
40
43
  amt: string;
@@ -56,11 +59,15 @@ interface IPayResponse {
56
59
  result: IPayResult;
57
60
  payParams?: PayParams;
58
61
  }
62
+ interface IPayWaybillByPayIdParams {
63
+ payId: string;
64
+ }
59
65
  export declare class SFAppPay extends AppPay {
60
66
  payBySVIP(params: IPayBySVIPParams): Promise<IPayResponse>;
61
67
  payBySDK(params: IPayBySDKParams): Promise<IPayResult>;
62
68
  wxAutoPaySignReq(params: IWxAutoPaySignParams): Promise<IWxAutoPaySignResponse>;
63
69
  onDigiCnyPayResult(params: IOnDigiCnyPayResultParams): void;
64
70
  payWaybillByPayId(params: IPayWaybillByPayIdParams): void;
71
+ payByWXMiniProgram(params: IPayByWXMiniProgram): Promise<IPayByWXMiniProgramResult>;
65
72
  }
66
73
  export {};
@@ -3,7 +3,7 @@ import { CommonEvents } from "../basic/eventsName";
3
3
  /**
4
4
  * 顺丰内部使用的事件
5
5
  */
6
- export declare type SFEvents = CommonEvents | "getUserAvatar" | "getUserBaseInfo" | "payBySVIP" | "payBySDK" | "wxAutoPaySignReq" | "payWaybillByPayId" | "digiCnyPayResult" | "startGetIMEICode" | "getReducerData" | "getDeviceId" | "syncCookie" | "getPushAuthStatus" | "setStateToPush" | "setStateToPushNoTimeLimit" | "getLocalWebSource" | "navigate" | "setCanBack";
6
+ export declare type SFEvents = CommonEvents | "getUserAvatar" | "getUserBaseInfo" | "payBySVIP" | "payBySDK" | "wxAutoPaySignReq" | "payWaybillByPayId" | "digiCnyPayResult" | "startGetIMEICode" | "getReducerData" | "getDeviceId" | "syncCookie" | "getPushAuthStatus" | "setStateToPush" | "setStateToPushNoTimeLimit" | "getLocalWebSource" | "navigate" | "setCanBack" | "payByWXMiniProgram";
7
7
  export interface IPostSFParams extends IPostParams {
8
8
  method: SFEvents;
9
9
  }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "syttunnel",
3
- "version": "0.1.4-0",
3
+ "version": "0.1.5-3",
4
4
  "description": "",
5
- "main": "syttunel.js",
5
+ "main": "syttunnel.js",
6
6
  "types": "index.d.ts",
7
7
  "scripts": {
8
8
  "test": "echo \"Error: no test specified\" && exit 1"
package/syttunnel.js CHANGED
@@ -463,7 +463,7 @@ var Bridge = /** @class */ (function () {
463
463
  Bridge.prototype.postMessage = function (params) {
464
464
  return new Promise(function (resolve, reject) {
465
465
  bridge.dealPostMessage(params, function (result) {
466
- if (result) {
466
+ if (result !== null && result !== undefined) {
467
467
  resolve(result);
468
468
  }
469
469
  else {
@@ -665,6 +665,17 @@ var AppCommon = /** @class */ (function () {
665
665
  };
666
666
  return bridge_1.default.postMessage(appFunc);
667
667
  };
668
+ /**
669
+ * 获取顺丰地址列表
670
+ * @returns 返回为json string加密的字符串,需密钥解密
671
+ */
672
+ AppCommon.prototype.getSFAddress = function (params) {
673
+ var appFunc = {
674
+ method: "selectAddress",
675
+ params: params,
676
+ };
677
+ return bridge_1.default.postMessage(appFunc);
678
+ };
668
679
  return AppCommon;
669
680
  }());
670
681
  exports.AppCommon = AppCommon;