yach.open.jssdk 4.3.3 → 4.3.5
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/dist/yach_jssdk_4.3.5.js +1 -0
- package/es/api/app/custom/talYoungFilesUpload.js +0 -2
- package/es/api/biz/chat/chooseConversationByCorpId.js +0 -2
- package/es/api/biz/chat/openSingleChat.js +0 -2
- package/es/api/biz/chat/openSquad.js +0 -2
- package/es/api/biz/chat/openTeamChat.js +0 -2
- package/es/api/biz/chat/pickConversation.js +0 -2
- package/es/api/biz/chat/sendP2PMsg.js +0 -2
- package/es/api/biz/contact/complexPicker.js +0 -2
- package/es/api/biz/contact/departmentsPicker.js +0 -2
- package/es/api/biz/group/groupComplexPicker.js +0 -2
- package/es/api/biz/map/multipointView.js +0 -2
- package/es/api/biz/map/view.js +0 -2
- package/es/api/biz/navigation/close.js +0 -2
- package/es/api/biz/navigation/goBack.js +0 -2
- package/es/api/biz/navigation/quit.js +0 -2
- package/es/api/biz/navigation/replace.js +0 -2
- package/es/api/biz/navigation/setIcon.js +0 -2
- package/es/api/biz/navigation/setLeft.js +0 -2
- package/es/api/biz/navigation/setMenu.js +0 -2
- package/es/api/biz/navigation/setPanGestureEnable.js +0 -2
- package/es/api/biz/navigation/setRight.js +0 -2
- package/es/api/biz/navigation/setTitle.js +0 -2
- package/es/api/biz/navigation/setTitleExpandIcon.js +0 -2
- package/es/api/biz/navigation/setWindowBig.js +0 -2
- package/es/api/biz/navigation/tencentMeeting.js +0 -2
- package/es/api/biz/navigation/tencentMeetingBegin.js +0 -2
- package/es/api/biz/navigation/updateExpandTitle.js +0 -2
- package/es/api/biz/telephone/call.js +0 -2
- package/es/api/biz/telephone/showCallMenu.js +0 -2
- package/es/api/biz/util/assistantCreate.js +0 -2
- package/es/api/biz/util/authFinish.js +0 -2
- package/es/api/biz/util/authStart.js +0 -2
- package/es/api/biz/util/chosen.js +0 -2
- package/es/api/biz/util/clipboardFileUpload.js +0 -2
- package/es/api/biz/util/closeWindow.js +0 -2
- package/es/api/biz/util/complain.js +0 -2
- package/es/api/biz/util/createModifySchedule.js +0 -2
- package/es/api/biz/util/datepicker.js +0 -2
- package/es/api/biz/util/datetimepicker.js +0 -2
- package/es/api/biz/util/disableScreenCapture.js +0 -2
- package/es/api/biz/util/downloadFile.js +0 -2
- package/es/api/biz/util/entergroupCheck.js +0 -2
- package/es/api/biz/util/externalLinkPreviewFile.js +0 -2
- package/es/api/biz/util/feedback.js +0 -2
- package/es/api/biz/util/getSingleWebviewData.js +0 -2
- package/es/api/biz/util/getTogetherConfig.js +0 -2
- package/es/api/biz/util/getToken.js +0 -2
- package/es/api/biz/util/injectScript.js +0 -2
- package/es/api/biz/util/invoice.js +0 -2
- package/es/api/biz/util/mediaFileUpload.js +0 -2
- package/es/api/biz/util/onlineDocmentOpenTeamChat.js +0 -2
- package/es/api/biz/util/open.js +0 -2
- package/es/api/biz/util/openLink.js +0 -2
- package/es/api/biz/util/openMediaFileDialog.js +0 -2
- package/es/api/biz/util/openSingleWebview.js +0 -2
- package/es/api/biz/util/openSlidePanel.js +0 -2
- package/es/api/biz/util/openTalYoungToTopic.js +0 -2
- package/es/api/biz/util/openTogetherEyeWebview.js +0 -2
- package/es/api/biz/util/openUserSchedule.js +0 -2
- package/es/api/biz/util/openVideoPlayer.js +0 -2
- package/es/api/biz/util/previewFile.js +0 -2
- package/es/api/biz/util/previewImage.js +0 -2
- package/es/api/biz/util/proxy.js +0 -2
- package/es/api/biz/util/pushWorkMsg.js +0 -2
- package/es/api/biz/util/remind.js +0 -2
- package/es/api/biz/util/resetSessionUnread.js +0 -2
- package/es/api/biz/util/rouseApp.js +0 -2
- package/es/api/biz/util/savePic.js +0 -2
- package/es/api/biz/util/scan.js +0 -2
- package/es/api/biz/util/selectDepartment.js +0 -2
- package/es/api/biz/util/share.js +0 -2
- package/es/api/biz/util/takePicture.js +0 -2
- package/es/api/biz/util/uploadAttachment.js +0 -2
- package/es/api/biz/util/yachEvent.js +0 -2
- package/es/api/biz/util/zfbAuth.js +0 -2
- package/es/api/biz/webViewMessage/send.js +0 -2
- package/es/api/device/audio/download.js +0 -2
- package/es/api/device/audio/onPlayEnd.js +0 -2
- package/es/api/device/audio/onRecordEnd.js +0 -2
- package/es/api/device/audio/onRecordEnd_v2.js +0 -2
- package/es/api/device/audio/pause.js +0 -2
- package/es/api/device/audio/play.js +0 -2
- package/es/api/device/audio/resume.js +0 -2
- package/es/api/device/audio/startRecord.js +0 -2
- package/es/api/device/audio/startRecord_v2.js +0 -2
- package/es/api/device/audio/stop.js +0 -2
- package/es/api/device/audio/stopRecord.js +0 -2
- package/es/api/device/audio/stopRecord_v2.js +0 -2
- package/es/api/device/base/checkStepPermission.js +0 -2
- package/es/api/device/base/getPhoneInfo.js +0 -2
- package/es/api/device/base/getUUID.js +0 -2
- package/es/api/device/connection/getNetworkType.js +0 -2
- package/es/api/device/connection/isAtTal.js +2 -4
- package/es/api/device/geolocation/get.js +0 -2
- package/es/api/device/geolocation/getSwitch.js +0 -2
- package/es/api/device/notification/actionSheet.js +0 -2
- package/es/api/device/notification/alert.js +0 -2
- package/es/api/device/notification/confirm.js +0 -2
- package/es/api/device/notification/hidePreloader.js +0 -2
- package/es/api/device/notification/showPreloader.js +0 -2
- package/es/api/device/notification/toast.js +0 -2
- package/es/api/device/notification/vibrate.js +0 -2
- package/es/api/device/system/getLang.js +0 -2
- package/es/api/device/system/setLight.js +0 -2
- package/es/api/initAPI.js +3 -5
- package/es/api/primary/createTab.js +0 -2
- package/es/api/primary/exitFullScreen.js +0 -2
- package/es/api/primary/fullScreen.js +0 -2
- package/es/api/primary/weeklyShare.js +0 -2
- package/es/api/runtime/permission/requestAuthCode.js +0 -2
- package/es/api/ui/pullToRefresh/disable.js +0 -2
- package/es/api/ui/pullToRefresh/enable.js +0 -2
- package/es/api/ui/pullToRefresh/stop.js +0 -2
- package/es/api/ui/webViewBounce/disable.js +0 -2
- package/es/api/util/domainStorage/getItem.js +0 -2
- package/es/api/util/domainStorage/removeItem.js +0 -2
- package/es/api/util/domainStorage/setItem.js +0 -2
- package/es/api/util/tool/flushLog.js +0 -2
- package/es/api/util/tool/log.js +0 -2
- package/es/index.js +14 -25
- package/es/lib/bridge/mobile.js +56 -39
- package/es/lib/bridge/pc.js +47 -19
- package/es/lib/helper/apiHelper.js +0 -2
- package/es/lib/helper/codeMap.js +0 -2
- package/es/lib/helper/event.js +7 -19
- package/es/lib/helper/pcIframe.js +20 -50
- package/es/lib/index.js +7 -21
- package/es/lib/sdk/index.js +31 -40
- package/es/lib/sdk/sdk.typings.d.ts +1 -0
- package/es/lib/sdk/sdk.typings.js +0 -1
- package/es/utils/bpitLog.js +4 -13
- package/es/utils/compareVersions.js +26 -53
- package/es/utils/console.js +1 -17
- package/es/utils/env.js +14 -19
- package/es/utils/index.js +2 -7
- package/libs/api/app/custom/talYoungFilesUpload.js +2 -7
- package/libs/api/biz/chat/chooseConversationByCorpId.js +1 -7
- package/libs/api/biz/chat/openSingleChat.js +1 -7
- package/libs/api/biz/chat/openSquad.js +1 -7
- package/libs/api/biz/chat/openTeamChat.js +1 -7
- package/libs/api/biz/chat/pickConversation.js +1 -7
- package/libs/api/biz/chat/sendP2PMsg.js +1 -7
- package/libs/api/biz/contact/complexPicker.js +1 -7
- package/libs/api/biz/contact/departmentsPicker.js +1 -7
- package/libs/api/biz/group/groupComplexPicker.js +1 -7
- package/libs/api/biz/map/multipointView.js +1 -7
- package/libs/api/biz/map/view.js +1 -7
- package/libs/api/biz/navigation/close.js +1 -7
- package/libs/api/biz/navigation/goBack.js +1 -7
- package/libs/api/biz/navigation/quit.js +1 -7
- package/libs/api/biz/navigation/replace.js +1 -7
- package/libs/api/biz/navigation/setIcon.js +1 -8
- package/libs/api/biz/navigation/setLeft.js +1 -8
- package/libs/api/biz/navigation/setMenu.js +1 -8
- package/libs/api/biz/navigation/setPanGestureEnable.js +1 -8
- package/libs/api/biz/navigation/setRight.js +1 -8
- package/libs/api/biz/navigation/setTitle.js +1 -7
- package/libs/api/biz/navigation/setTitleExpandIcon.js +1 -8
- package/libs/api/biz/navigation/setWindowBig.js +2 -7
- package/libs/api/biz/navigation/tencentMeeting.js +1 -7
- package/libs/api/biz/navigation/tencentMeetingBegin.js +1 -7
- package/libs/api/biz/navigation/updateExpandTitle.js +1 -7
- package/libs/api/biz/telephone/call.js +1 -7
- package/libs/api/biz/telephone/showCallMenu.js +1 -7
- package/libs/api/biz/util/assistantCreate.js +1 -7
- package/libs/api/biz/util/authFinish.js +1 -7
- package/libs/api/biz/util/authStart.js +1 -7
- package/libs/api/biz/util/chosen.js +1 -7
- package/libs/api/biz/util/clipboardFileUpload.js +1 -7
- package/libs/api/biz/util/closeWindow.js +1 -7
- package/libs/api/biz/util/complain.js +1 -7
- package/libs/api/biz/util/createModifySchedule.js +1 -7
- package/libs/api/biz/util/datepicker.js +1 -7
- package/libs/api/biz/util/datetimepicker.js +1 -7
- package/libs/api/biz/util/disableScreenCapture.js +1 -7
- package/libs/api/biz/util/downloadFile.js +1 -7
- package/libs/api/biz/util/entergroupCheck.js +1 -7
- package/libs/api/biz/util/externalLinkPreviewFile.js +1 -7
- package/libs/api/biz/util/feedback.js +1 -7
- package/libs/api/biz/util/getSingleWebviewData.js +1 -7
- package/libs/api/biz/util/getTogetherConfig.js +1 -7
- package/libs/api/biz/util/getToken.js +1 -7
- package/libs/api/biz/util/injectScript.js +1 -7
- package/libs/api/biz/util/invoice.js +2 -7
- package/libs/api/biz/util/mediaFileUpload.js +2 -7
- package/libs/api/biz/util/onlineDocmentOpenTeamChat.js +1 -7
- package/libs/api/biz/util/open.js +1 -7
- package/libs/api/biz/util/openLink.js +1 -7
- package/libs/api/biz/util/openMediaFileDialog.js +2 -7
- package/libs/api/biz/util/openSingleWebview.js +1 -7
- package/libs/api/biz/util/openSlidePanel.js +1 -7
- package/libs/api/biz/util/openTalYoungToTopic.js +2 -7
- package/libs/api/biz/util/openTogetherEyeWebview.js +1 -7
- package/libs/api/biz/util/openUserSchedule.js +1 -7
- package/libs/api/biz/util/openVideoPlayer.js +1 -7
- package/libs/api/biz/util/previewFile.js +1 -7
- package/libs/api/biz/util/previewImage.js +1 -7
- package/libs/api/biz/util/proxy.js +1 -7
- package/libs/api/biz/util/pushWorkMsg.js +2 -7
- package/libs/api/biz/util/remind.js +1 -7
- package/libs/api/biz/util/resetSessionUnread.js +1 -7
- package/libs/api/biz/util/rouseApp.js +2 -7
- package/libs/api/biz/util/savePic.js +1 -7
- package/libs/api/biz/util/scan.js +1 -7
- package/libs/api/biz/util/selectDepartment.js +1 -7
- package/libs/api/biz/util/share.js +1 -7
- package/libs/api/biz/util/takePicture.js +1 -7
- package/libs/api/biz/util/uploadAttachment.js +1 -7
- package/libs/api/biz/util/yachEvent.js +1 -7
- package/libs/api/biz/util/zfbAuth.js +1 -7
- package/libs/api/biz/webViewMessage/send.js +1 -7
- package/libs/api/device/audio/download.js +1 -7
- package/libs/api/device/audio/onPlayEnd.js +1 -7
- package/libs/api/device/audio/onRecordEnd.js +1 -7
- package/libs/api/device/audio/onRecordEnd_v2.js +1 -7
- package/libs/api/device/audio/pause.js +1 -7
- package/libs/api/device/audio/play.js +1 -7
- package/libs/api/device/audio/resume.js +1 -7
- package/libs/api/device/audio/startRecord.js +1 -7
- package/libs/api/device/audio/startRecord_v2.js +1 -7
- package/libs/api/device/audio/stop.js +1 -7
- package/libs/api/device/audio/stopRecord.js +1 -7
- package/libs/api/device/audio/stopRecord_v2.js +1 -7
- package/libs/api/device/base/checkStepPermission.js +1 -7
- package/libs/api/device/base/getPhoneInfo.js +1 -7
- package/libs/api/device/base/getUUID.js +1 -7
- package/libs/api/device/connection/getNetworkType.js +1 -7
- package/libs/api/device/connection/isAtTal.js +3 -9
- package/libs/api/device/geolocation/get.js +1 -7
- package/libs/api/device/geolocation/getSwitch.js +1 -7
- package/libs/api/device/notification/actionSheet.js +1 -7
- package/libs/api/device/notification/alert.js +1 -7
- package/libs/api/device/notification/confirm.js +1 -7
- package/libs/api/device/notification/hidePreloader.js +1 -7
- package/libs/api/device/notification/showPreloader.js +1 -7
- package/libs/api/device/notification/toast.js +1 -7
- package/libs/api/device/notification/vibrate.js +1 -7
- package/libs/api/device/system/getLang.js +1 -7
- package/libs/api/device/system/setLight.js +1 -7
- package/libs/api/initAPI.js +4 -13
- package/libs/api/primary/createTab.js +1 -7
- package/libs/api/primary/exitFullScreen.js +1 -7
- package/libs/api/primary/fullScreen.js +1 -7
- package/libs/api/primary/weeklyShare.js +1 -7
- package/libs/api/runtime/permission/requestAuthCode.js +1 -7
- package/libs/api/ui/pullToRefresh/disable.js +1 -7
- package/libs/api/ui/pullToRefresh/enable.js +1 -7
- package/libs/api/ui/pullToRefresh/stop.js +1 -7
- package/libs/api/ui/webViewBounce/disable.js +1 -7
- package/libs/api/util/domainStorage/getItem.js +1 -7
- package/libs/api/util/domainStorage/removeItem.js +1 -7
- package/libs/api/util/domainStorage/setItem.js +1 -7
- package/libs/api/util/tool/flushLog.js +1 -7
- package/libs/api/util/tool/log.js +1 -7
- package/libs/index.js +253 -507
- package/libs/lib/bridge/index.js +6 -13
- package/libs/lib/bridge/mobile.js +60 -61
- package/libs/lib/bridge/pc.js +52 -36
- package/libs/lib/helper/apiHelper.js +1 -7
- package/libs/lib/helper/codeMap.js +1 -7
- package/libs/lib/helper/event.js +8 -28
- package/libs/lib/helper/pcIframe.js +19 -57
- package/libs/lib/index.js +9 -33
- package/libs/lib/sdk/index.js +31 -49
- package/libs/lib/sdk/sdk.typings.d.ts +1 -0
- package/libs/lib/sdk/sdk.typings.js +0 -4
- package/libs/utils/bpitLog.js +4 -16
- package/libs/utils/compareVersions.js +32 -77
- package/libs/utils/console.js +2 -18
- package/libs/utils/env.js +14 -21
- package/libs/utils/index.js +9 -22
- package/package.json +1 -1
- package/dist/yach_jssdk_4.3.3.js +0 -1
package/libs/lib/bridge/index.js
CHANGED
|
@@ -1,39 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
|
|
4
|
-
|
|
5
4
|
_Object$defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
|
-
|
|
7
|
+
_Object$defineProperty(exports, "PcBridgeInit", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function get() {
|
|
10
|
+
return _pc.PcBridgeInit;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
9
13
|
_Object$defineProperty(exports, "mobileBridge", {
|
|
10
14
|
enumerable: true,
|
|
11
15
|
get: function get() {
|
|
12
16
|
return _mobile.mobileBridge;
|
|
13
17
|
}
|
|
14
18
|
});
|
|
15
|
-
|
|
16
19
|
_Object$defineProperty(exports, "mobileBridgeInit", {
|
|
17
20
|
enumerable: true,
|
|
18
21
|
get: function get() {
|
|
19
22
|
return _mobile.mobileBridgeInit;
|
|
20
23
|
}
|
|
21
24
|
});
|
|
22
|
-
|
|
23
25
|
_Object$defineProperty(exports, "pcBridge", {
|
|
24
26
|
enumerable: true,
|
|
25
27
|
get: function get() {
|
|
26
28
|
return _pc.pcBridge;
|
|
27
29
|
}
|
|
28
30
|
});
|
|
29
|
-
|
|
30
|
-
_Object$defineProperty(exports, "PcBridgeInit", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function get() {
|
|
33
|
-
return _pc.PcBridgeInit;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
|
|
37
31
|
var _mobile = require("./mobile");
|
|
38
|
-
|
|
39
32
|
var _pc = require("./pc");
|
|
@@ -1,42 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
|
|
6
|
-
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
7
5
|
_Object$defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
|
-
|
|
11
8
|
exports.mobileBridgeInit = exports.mobileBridge = void 0;
|
|
12
|
-
|
|
13
|
-
var _parseInt2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/parse-int"));
|
|
14
|
-
|
|
15
|
-
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/object/assign"));
|
|
16
|
-
|
|
17
|
-
var _promise = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/promise"));
|
|
18
|
-
|
|
19
9
|
var _setTimeout2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/set-timeout"));
|
|
20
|
-
|
|
10
|
+
var _promise = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/promise"));
|
|
11
|
+
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/object/assign"));
|
|
12
|
+
var _parseInt2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/parse-int"));
|
|
13
|
+
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/json/stringify"));
|
|
21
14
|
var _event = _interopRequireDefault(require("../helper/event"));
|
|
22
|
-
|
|
23
15
|
var _codeMap = require("../helper/codeMap");
|
|
24
|
-
|
|
25
16
|
var _utils = require("../../utils");
|
|
26
|
-
|
|
27
17
|
function setupWebViewJavascriptBridge(callback) {
|
|
28
18
|
if (window.WebViewJavascriptBridge) {
|
|
29
19
|
return callback(WebViewJavascriptBridge);
|
|
30
20
|
}
|
|
31
|
-
|
|
32
21
|
if (window.WKWebViewJavascriptBridge) {
|
|
33
22
|
return callback(WKWebViewJavascriptBridge);
|
|
34
23
|
}
|
|
35
|
-
|
|
36
24
|
if (window.WVJBCallbacks) {
|
|
37
25
|
return window.WVJBCallbacks.push(callback);
|
|
38
26
|
}
|
|
39
|
-
|
|
40
27
|
window.WVJBCallbacks = [callback];
|
|
41
28
|
var WVJBIframe = document.createElement('iframe');
|
|
42
29
|
WVJBIframe.style.display = 'none';
|
|
@@ -46,8 +33,7 @@ function setupWebViewJavascriptBridge(callback) {
|
|
|
46
33
|
document.documentElement.removeChild(WVJBIframe);
|
|
47
34
|
}, 0);
|
|
48
35
|
}
|
|
49
|
-
|
|
50
|
-
var mobileBridgeInit = function mobileBridgeInit() {
|
|
36
|
+
var mobileBridgeInit = exports.mobileBridgeInit = function mobileBridgeInit() {
|
|
51
37
|
return new _promise["default"](function (resolve, reject) {
|
|
52
38
|
setupWebViewJavascriptBridge(function (bridge) {
|
|
53
39
|
(0, _utils.log)("\u6CE8\u518Cresume\u4E8B\u4EF6 ");
|
|
@@ -55,7 +41,6 @@ var mobileBridgeInit = function mobileBridgeInit() {
|
|
|
55
41
|
(0, _utils.log)("resume\u76D1\u542C\u5230\u56DE\u8C03\uFF0C\u76F8\u5173\u53C2\u6570 ", {
|
|
56
42
|
resData: resData
|
|
57
43
|
});
|
|
58
|
-
|
|
59
44
|
_event["default"].execEvent('resume', resData);
|
|
60
45
|
});
|
|
61
46
|
(0, _utils.log)("\u6CE8\u518CunreadMsgAction\u4E8B\u4EF6 ");
|
|
@@ -63,7 +48,6 @@ var mobileBridgeInit = function mobileBridgeInit() {
|
|
|
63
48
|
(0, _utils.log)("unreadMsgAction\u76D1\u542C\u5230\u56DE\u8C03\uFF0C\u76F8\u5173\u53C2\u6570 ", {
|
|
64
49
|
resData: resData
|
|
65
50
|
});
|
|
66
|
-
|
|
67
51
|
_event["default"].execEvent('unreadMsgAction', resData);
|
|
68
52
|
});
|
|
69
53
|
(0, _utils.log)("\u6CE8\u518CwebViewMsgReceive\u4E8B\u4EF6 ");
|
|
@@ -71,38 +55,31 @@ var mobileBridgeInit = function mobileBridgeInit() {
|
|
|
71
55
|
(0, _utils.log)("webViewMsgReceive\u76D1\u542C\u5230\u56DE\u8C03\uFF0C\u76F8\u5173\u53C2\u6570 ", {
|
|
72
56
|
resData: resData
|
|
73
57
|
});
|
|
74
|
-
|
|
75
58
|
_event["default"].execEvent('webViewMsgReceive', resData);
|
|
76
59
|
});
|
|
77
60
|
bridge.registerHandler('pushWorkMsg', function (resData) {
|
|
78
61
|
(0, _utils.log)("pushWorkMsg\u76D1\u542C\u5230\u56DE\u8C03\uFF0C\u76F8\u5173\u53C2\u6570 ", {
|
|
79
62
|
resData: resData
|
|
80
63
|
});
|
|
81
|
-
|
|
82
64
|
_event["default"].execEvent('pushWorkMsg', resData);
|
|
83
65
|
});
|
|
84
66
|
bridge.registerHandler('getTogetherCallback', function (resData) {
|
|
85
67
|
(0, _utils.log)("getTogetherCallback\u76D1\u542C\u5230\u56DE\u8C03\uFF0C\u76F8\u5173\u53C2\u6570 ", {
|
|
86
68
|
resData: resData
|
|
87
69
|
});
|
|
88
|
-
|
|
89
70
|
_event["default"].execEvent('getTogetherCallback', resData);
|
|
90
71
|
});
|
|
91
72
|
bridge.registerHandler('sendMsgCommon', function (resData) {
|
|
92
73
|
(0, _utils.log)("sendMsgCommon ", {
|
|
93
74
|
resData: resData
|
|
94
75
|
});
|
|
95
|
-
|
|
96
76
|
_event["default"].execEvent('sendMsgCommon', resData);
|
|
97
77
|
});
|
|
98
78
|
resolve();
|
|
99
79
|
});
|
|
100
80
|
});
|
|
101
81
|
};
|
|
102
|
-
|
|
103
|
-
exports.mobileBridgeInit = mobileBridgeInit;
|
|
104
|
-
|
|
105
|
-
var mobileBridge = function mobileBridge(method, param) {
|
|
82
|
+
var mobileBridge = exports.mobileBridge = function mobileBridge(method, param) {
|
|
106
83
|
return new _promise["default"](function (resolve, reject) {
|
|
107
84
|
var p = (0, _assign["default"])({}, param);
|
|
108
85
|
setupWebViewJavascriptBridge(function (bridge) {
|
|
@@ -110,7 +87,6 @@ var mobileBridge = function mobileBridge(method, param) {
|
|
|
110
87
|
bridge.registerHandler(method, function (data) {
|
|
111
88
|
var onSuccess = param.onSuccess;
|
|
112
89
|
delete p.onSuccess;
|
|
113
|
-
|
|
114
90
|
if ('function' === typeof onSuccess) {
|
|
115
91
|
onSuccess(data);
|
|
116
92
|
resolve({
|
|
@@ -120,35 +96,12 @@ var mobileBridge = function mobileBridge(method, param) {
|
|
|
120
96
|
}
|
|
121
97
|
});
|
|
122
98
|
}
|
|
123
|
-
|
|
124
99
|
bridge.callHandler(method, param, function (e) {
|
|
125
100
|
var code = e.code,
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
101
|
+
message = e.message,
|
|
102
|
+
data = e.data;
|
|
129
103
|
var _code = (0, _parseInt2["default"])(code);
|
|
130
|
-
|
|
131
104
|
var callbackStr = (0, _codeMap.electronResCodeMap)(_code);
|
|
132
|
-
|
|
133
|
-
if (_code === -2 || _code === 7) {
|
|
134
|
-
(0, _utils.bpitLog)({
|
|
135
|
-
method: method,
|
|
136
|
-
errorcode: _code,
|
|
137
|
-
message: message || 'SDK执行失败回调,相关参数'
|
|
138
|
-
});
|
|
139
|
-
(0, _utils.log)("SDK\u6267\u884C\u540E\u56DE\u8C03\uFF0C\u76F8\u5173\u53C2\u6570 ", {
|
|
140
|
-
method: method,
|
|
141
|
-
param: param,
|
|
142
|
-
data: data,
|
|
143
|
-
_code: _code,
|
|
144
|
-
message: message
|
|
145
|
-
});
|
|
146
|
-
reject({
|
|
147
|
-
_code: _code,
|
|
148
|
-
message: message
|
|
149
|
-
}); // return;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
105
|
var callbackFun = p[callbackStr];
|
|
153
106
|
(0, _utils.log)("SDK\u6267\u884C\u540E\u56DE\u8C03\uFF0C\u76F8\u5173\u53C2\u6570 ", {
|
|
154
107
|
method: method,
|
|
@@ -158,19 +111,65 @@ var mobileBridge = function mobileBridge(method, param) {
|
|
|
158
111
|
message: message,
|
|
159
112
|
callbackFun: callbackFun
|
|
160
113
|
});
|
|
161
|
-
|
|
114
|
+
// 请求失败
|
|
115
|
+
if (callbackStr === 'onFail') {
|
|
116
|
+
(0, _utils.bpitLog)({
|
|
117
|
+
method: method,
|
|
118
|
+
errorcode: _code,
|
|
119
|
+
message: message || (0, _stringify["default"])(data) || 'SDK执行失败回调,相关参数'
|
|
120
|
+
});
|
|
121
|
+
if ('function' === typeof callbackFun) {
|
|
122
|
+
message ? callbackFun({
|
|
123
|
+
code: code,
|
|
124
|
+
message: message
|
|
125
|
+
}) : callbackFun(data);
|
|
126
|
+
}
|
|
127
|
+
reject({
|
|
128
|
+
_code: _code,
|
|
129
|
+
message: message,
|
|
130
|
+
data: data
|
|
131
|
+
});
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
// 请求成功
|
|
162
135
|
if ('function' === typeof callbackFun) {
|
|
163
136
|
callbackFun(data || message);
|
|
164
137
|
}
|
|
165
|
-
|
|
166
138
|
resolve({
|
|
167
139
|
_code: _code,
|
|
168
140
|
message: message,
|
|
169
141
|
data: data
|
|
170
142
|
});
|
|
143
|
+
// if (_code === -2 || _code === 7) {
|
|
144
|
+
// bpitLog({
|
|
145
|
+
// method,
|
|
146
|
+
// errorcode: _code,
|
|
147
|
+
// message: message || 'SDK执行失败回调,相关参数',
|
|
148
|
+
// });
|
|
149
|
+
// log(`SDK执行后回调,相关参数 `, {
|
|
150
|
+
// method,
|
|
151
|
+
// param,
|
|
152
|
+
// data,
|
|
153
|
+
// _code,
|
|
154
|
+
// message,
|
|
155
|
+
// });
|
|
156
|
+
// reject({_code, message});
|
|
157
|
+
// // return;
|
|
158
|
+
// }
|
|
159
|
+
// const callbackFun = p[callbackStr];
|
|
160
|
+
// log(`SDK执行后回调,相关参数 `, {
|
|
161
|
+
// method,
|
|
162
|
+
// param,
|
|
163
|
+
// data,
|
|
164
|
+
// _code,
|
|
165
|
+
// message,
|
|
166
|
+
// callbackFun,
|
|
167
|
+
// });
|
|
168
|
+
// if ('function' === typeof callbackFun) {
|
|
169
|
+
// callbackFun(data || message);
|
|
170
|
+
// }
|
|
171
|
+
// resolve({_code, message, data});
|
|
171
172
|
});
|
|
172
173
|
});
|
|
173
174
|
});
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
exports.mobileBridge = mobileBridge;
|
|
175
|
+
};
|
package/libs/lib/bridge/pc.js
CHANGED
|
@@ -1,50 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
|
|
6
|
-
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
7
5
|
_Object$defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
|
-
|
|
11
|
-
exports.PcBridgeInit = exports.pcBridge = void 0;
|
|
12
|
-
|
|
13
|
-
var _parseInt2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/parse-int"));
|
|
14
|
-
|
|
8
|
+
exports.pcBridge = exports.PcBridgeInit = void 0;
|
|
15
9
|
var _promise = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/promise"));
|
|
16
|
-
|
|
10
|
+
var _parseInt2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/parse-int"));
|
|
11
|
+
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/json/stringify"));
|
|
17
12
|
var _pcIframe = _interopRequireDefault(require("../helper/pcIframe"));
|
|
18
|
-
|
|
19
13
|
var _codeMap = require("../helper/codeMap");
|
|
20
|
-
|
|
21
14
|
var _utils = require("../../utils");
|
|
22
|
-
|
|
23
|
-
var PcBridgeInit = function PcBridgeInit() {
|
|
15
|
+
var PcBridgeInit = exports.PcBridgeInit = function PcBridgeInit() {
|
|
24
16
|
_pcIframe["default"].init();
|
|
25
17
|
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var pcBridge = function pcBridge(method, param) {
|
|
30
|
-
return new _promise["default"](function (resolve) {
|
|
18
|
+
var pcBridge = exports.pcBridge = function pcBridge(method, param) {
|
|
19
|
+
return new _promise["default"](function (resolve, reject) {
|
|
31
20
|
return _pcIframe["default"].invokeAPI(method, param, function (_ref) {
|
|
32
21
|
var data = _ref.data,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
22
|
+
code = _ref.code,
|
|
23
|
+
message = _ref.message;
|
|
36
24
|
var _code = (0, _parseInt2["default"])(code);
|
|
37
|
-
|
|
38
25
|
var callbackStr = (0, _codeMap.electronResCodeMap)(_code);
|
|
39
|
-
|
|
40
|
-
if (_code === -2) {
|
|
41
|
-
(0, _utils.bpitLog)({
|
|
42
|
-
method: method,
|
|
43
|
-
errorcode: _code,
|
|
44
|
-
message: message || 'SDK执行失败回调,相关参数'
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
|
|
48
26
|
var callbackFun = param[callbackStr];
|
|
49
27
|
(0, _utils.log)("SDK\u6267\u884C\u540E\u56DE\u8C03\uFF0C\u76F8\u5173\u53C2\u6570 ", {
|
|
50
28
|
method: method,
|
|
@@ -54,18 +32,56 @@ var pcBridge = function pcBridge(method, param) {
|
|
|
54
32
|
message: message,
|
|
55
33
|
callbackFun: callbackFun
|
|
56
34
|
});
|
|
57
|
-
|
|
35
|
+
// 请求失败
|
|
36
|
+
if (callbackStr === 'onFail') {
|
|
37
|
+
(0, _utils.bpitLog)({
|
|
38
|
+
method: method,
|
|
39
|
+
errorcode: _code,
|
|
40
|
+
message: message || (0, _stringify["default"])(data) || 'SDK执行失败回调,相关参数'
|
|
41
|
+
});
|
|
42
|
+
if ('function' === typeof callbackFun) {
|
|
43
|
+
console.log('wenai-code', code, _code);
|
|
44
|
+
message ? callbackFun({
|
|
45
|
+
code: code,
|
|
46
|
+
message: message
|
|
47
|
+
}) : callbackFun(data);
|
|
48
|
+
}
|
|
49
|
+
reject({
|
|
50
|
+
_code: _code,
|
|
51
|
+
message: message,
|
|
52
|
+
data: data
|
|
53
|
+
});
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
// 请求成功
|
|
58
57
|
if ('function' === typeof callbackFun) {
|
|
59
58
|
callbackFun(data || message);
|
|
60
59
|
}
|
|
61
|
-
|
|
62
60
|
resolve({
|
|
63
61
|
_code: _code,
|
|
64
62
|
message: message,
|
|
65
63
|
data: data
|
|
66
64
|
});
|
|
65
|
+
// if (_code === -2) {
|
|
66
|
+
// bpitLog({
|
|
67
|
+
// method,
|
|
68
|
+
// errorcode: _code,
|
|
69
|
+
// message: message || 'SDK执行失败回调,相关参数',
|
|
70
|
+
// });
|
|
71
|
+
// }
|
|
72
|
+
// const callbackFun = param[callbackStr];
|
|
73
|
+
// log(`SDK执行后回调,相关参数 `, {
|
|
74
|
+
// method,
|
|
75
|
+
// param,
|
|
76
|
+
// data,
|
|
77
|
+
// _code,
|
|
78
|
+
// message,
|
|
79
|
+
// callbackFun
|
|
80
|
+
// });
|
|
81
|
+
// if ('function' === typeof callbackFun) {
|
|
82
|
+
// callbackFun(data || message);
|
|
83
|
+
// }
|
|
84
|
+
// resolve({ _code, message, data });
|
|
67
85
|
});
|
|
68
86
|
});
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
exports.pcBridge = pcBridge;
|
|
87
|
+
};
|
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
|
|
6
|
-
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
7
5
|
_Object$defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
|
-
|
|
11
8
|
exports.genDefaultParamsDealFn = genDefaultParamsDealFn;
|
|
12
|
-
|
|
13
9
|
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/object/assign"));
|
|
14
|
-
|
|
15
10
|
function genDefaultParamsDealFn(p) {
|
|
16
11
|
return function (r) {
|
|
17
12
|
return (0, _assign["default"])((0, _assign["default"])({}, p), r);
|
|
18
13
|
};
|
|
19
14
|
}
|
|
20
|
-
|
|
21
15
|
;
|
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
|
|
6
|
-
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
7
5
|
_Object$defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
|
-
|
|
11
8
|
exports.electronResCodeMap = electronResCodeMap;
|
|
12
|
-
|
|
13
9
|
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/map"));
|
|
14
|
-
|
|
15
10
|
var resCodeMap = new _map["default"]([[0, 'onSuccess'], [-1, 'onCancel'], [-2, 'onFail'], [-3, 'onProgress'], [-4, 'onSubmit']]);
|
|
16
|
-
|
|
17
11
|
function electronResCodeMap(code) {
|
|
18
12
|
return resCodeMap.get(code) || 'onFail';
|
|
19
13
|
}
|
package/libs/lib/helper/event.js
CHANGED
|
@@ -1,56 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
|
|
6
|
-
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
7
5
|
_Object$defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
|
-
|
|
11
8
|
exports["default"] = void 0;
|
|
12
|
-
|
|
13
|
-
var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/for-each"));
|
|
14
|
-
|
|
15
|
-
var _splice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/splice"));
|
|
16
|
-
|
|
17
|
-
var _indexOf = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/index-of"));
|
|
18
|
-
|
|
19
9
|
var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/array/is-array"));
|
|
20
|
-
|
|
10
|
+
var _indexOf = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/index-of"));
|
|
11
|
+
var _splice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/splice"));
|
|
12
|
+
var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/for-each"));
|
|
13
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
21
14
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
22
|
-
|
|
23
|
-
var Event = function Event() {
|
|
15
|
+
var Event = /*#__PURE__*/(0, _createClass2["default"])(function Event() {
|
|
24
16
|
var _this = this;
|
|
25
|
-
|
|
26
17
|
(0, _classCallCheck2["default"])(this, Event);
|
|
27
|
-
|
|
28
18
|
this.on = function (event, fn) {
|
|
29
19
|
if (!event || 'function' !== typeof fn) throw 'eventName is null or handle is not a function, on fail';
|
|
30
20
|
if (!(0, _isArray["default"])(_this.eventsHandle[event])) _this.eventsHandle[event] = [];
|
|
31
|
-
|
|
32
21
|
_this.eventsHandle[event].push(fn);
|
|
33
22
|
};
|
|
34
|
-
|
|
35
23
|
this.off = function (event, fn) {
|
|
36
24
|
if (!event) throw 'eventName is null, invoke off fail';
|
|
37
|
-
|
|
38
25
|
if (!fn) {
|
|
39
26
|
_this.eventsHandle[event] = [];
|
|
40
27
|
return;
|
|
41
28
|
}
|
|
42
|
-
|
|
43
29
|
if ((0, _isArray["default"])(_this.eventsHandle[event])) {
|
|
44
30
|
var _context, _context2;
|
|
45
|
-
|
|
46
31
|
var n = (0, _indexOf["default"])(_context = _this.eventsHandle[event]).call(_context, fn);
|
|
47
32
|
-1 !== n && (0, _splice["default"])(_context2 = _this.eventsHandle[event]).call(_context2, n, 1);
|
|
48
33
|
}
|
|
49
34
|
};
|
|
50
|
-
|
|
51
35
|
this.execEvent = function (event, data) {
|
|
52
36
|
var _context3;
|
|
53
|
-
|
|
54
37
|
(0, _isArray["default"])(this.eventsHandle[event]) && (0, _forEach["default"])(_context3 = this.eventsHandle[event]).call(_context3, function (fn) {
|
|
55
38
|
try {
|
|
56
39
|
fn(data);
|
|
@@ -59,10 +42,7 @@ var Event = function Event() {
|
|
|
59
42
|
}
|
|
60
43
|
});
|
|
61
44
|
};
|
|
62
|
-
|
|
63
45
|
this.eventsHandle = {};
|
|
64
|
-
};
|
|
65
|
-
|
|
46
|
+
});
|
|
66
47
|
var event = new Event();
|
|
67
|
-
var _default = event;
|
|
68
|
-
exports["default"] = _default;
|
|
48
|
+
var _default = exports["default"] = event;
|