hylid-bridge 2.8.0 → 2.9.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/CHANGELOG.md +16 -0
- package/canIUse.json +1 -1
- package/lib/appEnv/clients.js +5 -0
- package/lib/appEnv/getEnv.js +4 -42
- package/lib/appEnv/index.js +0 -1
- package/lib/appEnv/utils.js +0 -4
- package/lib/bridges.js +10 -306
- package/lib/clients/mp/alipay/custom.d.ts +3 -1
- package/lib/clients/mp/alipay/custom.js +4 -1
- package/lib/clients/mp/alipay/generated.d.ts +1 -0
- package/lib/clients/mp/alipay/generated.js +2 -0
- package/lib/clients/mp/alipay/index.d.ts +6 -1
- package/lib/clients/mp/alipay/index.js +13 -1
- package/lib/clients/mp/alipay/navigateTo.d.ts +2 -0
- package/lib/clients/mp/alipay/navigateTo.js +2 -0
- package/lib/clients/mp/alipay/tradePay.d.ts +2 -0
- package/lib/clients/mp/alipay/tradePay.js +2 -0
- package/lib/clients/mp/alipay_plus/getOpenUserInfo.js +2 -3
- package/lib/clients/mp/alipay_plus/index.js +1 -7
- package/lib/clients/mp/lazada/getAuthCode.js +6 -15
- package/lib/clients/mp/lazada/getOpenUserInfo.js +2 -3
- package/lib/clients/mp/lazada/index.js +1 -7
- package/lib/clients/mp/taobao/getAuthCode.js +7 -16
- package/lib/clients/mp/taobao/getOpenUserInfo.js +5 -12
- package/lib/clients/mp/taobao/index.js +1 -7
- package/lib/clients/mp_web/alipay/crossPay.js +0 -2
- package/lib/clients/mp_web/alipay/custom.d.ts +1 -0
- package/lib/clients/mp_web/alipay/custom.js +3 -1
- package/lib/clients/mp_web/alipay/generated.d.ts +1 -1
- package/lib/clients/mp_web/alipay/generated.js +2 -2
- package/lib/clients/mp_web/alipay/index.d.ts +2 -1
- package/lib/clients/mp_web/alipay/index.js +1 -7
- package/lib/clients/mp_web/alipay/navigateTo.d.ts +2 -0
- package/lib/clients/mp_web/alipay/navigateTo.js +2 -0
- package/lib/clients/mp_web/alipay/tradePay.d.ts +1 -1
- package/lib/clients/mp_web/alipay/tradePay.js +1 -1
- package/lib/clients/mp_web/alipay_plus/getOpenUserInfo.js +1 -9
- package/lib/clients/mp_web/alipay_plus/index.js +1 -7
- package/lib/clients/web/alipay/custom.d.ts +1 -0
- package/lib/clients/web/alipay/custom.js +2 -0
- package/lib/clients/web/alipay/generated.d.ts +1 -1
- package/lib/clients/web/alipay/generated.js +2 -2
- package/lib/clients/web/alipay/index.d.ts +2 -1
- package/lib/clients/web/alipay/index.js +1 -7
- package/lib/clients/web/alipay/tradePay.d.ts +1 -1
- package/lib/clients/web/alipay/tradePay.js +1 -1
- package/lib/clients/web/alipay_plus/getOpenUserInfo.js +1 -9
- package/lib/clients/web/alipay_plus/index.js +1 -7
- package/lib/clients/web/alipay_plus/paySignCenter.js +1 -7
- package/lib/clients/web/h5/index.js +1 -7
- package/lib/clients/web/h5/rpc.js +1 -7
- package/lib/common/apis/custom/mp/crossPay.js +0 -2
- package/lib/common/apis/custom/tradePay.d.ts +3 -0
- package/lib/common/apis/custom/tradePay.js +34 -0
- package/lib/common/apis/custom/web/alert.js +5 -17
- package/lib/common/apis/custom/web/choosePhoneContact.js +0 -2
- package/lib/common/apis/custom/web/clearStorage.js +0 -2
- package/lib/common/apis/custom/web/confirm.js +6 -20
- package/lib/common/apis/custom/web/datePicker.js +7 -21
- package/lib/common/apis/custom/web/downloadFile.js +4 -19
- package/lib/common/apis/custom/web/getAuthCode.js +4 -18
- package/lib/common/apis/custom/web/getLocation.js +4 -18
- package/lib/common/apis/custom/web/getNetworkType.js +1 -9
- package/lib/common/apis/custom/web/getPhoneNumber.js +1 -9
- package/lib/common/apis/custom/web/getStorage.js +1 -9
- package/lib/common/apis/custom/web/hideNavigationBarLoading.js +0 -2
- package/lib/common/apis/custom/web/multiLevelSelect.js +0 -2
- package/lib/common/apis/custom/web/navigateBack.js +6 -20
- package/lib/common/apis/custom/web/navigateTo.js +0 -2
- package/lib/common/apis/custom/web/previewImage.js +5 -19
- package/lib/common/apis/custom/web/reLaunch.js +0 -2
- package/lib/common/apis/custom/web/redirectTo.js +7 -9
- package/lib/common/apis/custom/web/removeStorage.js +0 -2
- package/lib/common/apis/custom/web/request.js +6 -27
- package/lib/common/apis/custom/web/saveFile.js +4 -18
- package/lib/common/apis/custom/web/saveImage.js +4 -18
- package/lib/common/apis/custom/web/setKeepScreenOn.js +1 -9
- package/lib/common/apis/custom/web/setNavigationBar.js +7 -12
- package/lib/common/apis/custom/web/setOptionMenu.js +0 -2
- package/lib/common/apis/custom/web/setStorage.js +4 -18
- package/lib/common/apis/custom/web/setTabBarStyle.js +1 -9
- package/lib/common/apis/custom/web/showActionSheet.js +5 -19
- package/lib/common/apis/custom/web/showAuthGuide.js +1 -9
- package/lib/common/apis/custom/web/showNavigationBarLoading.js +0 -2
- package/lib/common/apis/custom/web/showToast.js +1 -9
- package/lib/common/apis/custom/web/startPullDownRefresh.js +0 -2
- package/lib/common/apis/custom/web/stopPullDownRefresh.js +0 -2
- package/lib/common/apis/custom/web/uploadFile.js +5 -19
- package/lib/common/call/index.js +1 -18
- package/lib/common/call/mp.js +2 -2
- package/lib/common/call/mpWeb.js +2 -12
- package/lib/common/call/web.js +3 -5
- package/lib/common/constants.js +0 -9
- package/lib/common/logger.js +5 -6
- package/lib/common/notFound.js +0 -3
- package/lib/common/utils.js +8 -22
- package/lib/common/webview-bridge.js +70 -125
- package/lib/common/whichCanIUse.js +4 -4
- package/lib/index.js +12 -4
- package/lib/types/jsapi.d.ts +2 -0
- package/lib/umd/index.js +6350 -2
- package/lib/umd/mp_ae.js +45 -1
- package/lib/umd/mp_alipay.js +1744 -1
- package/lib/umd/mp_alipay_hk.js +45 -1
- package/lib/umd/mp_alipay_plus.js +3328 -2
- package/lib/umd/mp_alipay_vn.js +45 -1
- package/lib/umd/mp_dana.js +45 -1
- package/lib/umd/mp_gcash.js +45 -1
- package/lib/umd/mp_lazada.js +3240 -2
- package/lib/umd/mp_taobao.js +2206 -2
- package/lib/umd/mp_tmall.js +45 -1
- package/lib/umd/mp_tmn.js +45 -1
- package/lib/umd/mp_tngd.js +45 -1
- package/lib/umd/mp_web_alipay.js +2162 -2
- package/lib/umd/mp_web_alipay_plus.js +2987 -2
- package/lib/umd/web_ae.js +45 -1
- package/lib/umd/web_alipay.js +2646 -2
- package/lib/umd/web_alipay_hk.js +45 -1
- package/lib/umd/web_alipay_mo.js +45 -1
- package/lib/umd/web_alipay_plus.js +2866 -2
- package/lib/umd/web_alipay_vn.js +45 -1
- package/lib/umd/web_daraz.js +45 -1
- package/lib/umd/web_h5.js +2140 -2
- package/lib/umd/web_kkp.js +45 -1
- package/lib/umd/web_lazada.js +45 -1
- package/lib/umd/web_taobao.js +45 -1
- package/lib/umd/web_taobao_overseas.js +45 -1
- package/package.json +2 -25
- package/lib/common/apis/generated/canIUse.d.ts +0 -2
- package/lib/common/apis/generated/canIUse.js +0 -4
- package/lib/umd/index.js.LICENSE.txt +0 -1
- package/lib/umd/mp_alipay_plus.js.LICENSE.txt +0 -1
- package/lib/umd/mp_lazada.js.LICENSE.txt +0 -1
- package/lib/umd/mp_taobao.js.LICENSE.txt +0 -1
- package/lib/umd/mp_web_alipay.js.LICENSE.txt +0 -1
- package/lib/umd/mp_web_alipay_plus.js.LICENSE.txt +0 -1
- package/lib/umd/web_alipay.js.LICENSE.txt +0 -1
- package/lib/umd/web_alipay_plus.js.LICENSE.txt +0 -1
- package/lib/umd/web_h5.js.LICENSE.txt +0 -1
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
var redirectTo = function redirectTo(options) {
|
|
2
2
|
var _a = options || {},
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
url = _a.url,
|
|
4
|
+
success = _a.success,
|
|
5
|
+
complete = _a.complete;
|
|
6
|
+
window.location.replace(url);
|
|
7
|
+
// @ts-ignore
|
|
8
|
+
success === null || success === void 0 ? void 0 : success({});
|
|
9
|
+
// @ts-ignore
|
|
11
10
|
complete === null || complete === void 0 ? void 0 : complete({});
|
|
12
11
|
};
|
|
13
|
-
|
|
14
12
|
export default redirectTo;
|
|
@@ -2,43 +2,29 @@ var __assign = this && this.__assign || function () {
|
|
|
2
2
|
__assign = Object.assign || function (t) {
|
|
3
3
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
4
|
s = arguments[i];
|
|
5
|
-
|
|
6
|
-
for (var p in s) {
|
|
7
|
-
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
8
|
-
}
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
9
6
|
}
|
|
10
|
-
|
|
11
7
|
return t;
|
|
12
8
|
};
|
|
13
|
-
|
|
14
9
|
return __assign.apply(this, arguments);
|
|
15
10
|
};
|
|
16
|
-
|
|
17
11
|
var __rest = this && this.__rest || function (s, e) {
|
|
18
12
|
var t = {};
|
|
19
|
-
|
|
20
|
-
for (var p in s) {
|
|
21
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
22
|
-
}
|
|
23
|
-
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
24
14
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
25
15
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
26
16
|
}
|
|
27
17
|
return t;
|
|
28
18
|
};
|
|
29
|
-
|
|
30
19
|
import call from "../../../call";
|
|
31
20
|
import { isIOS, safeJSONParse } from "../../../utils";
|
|
32
|
-
|
|
33
21
|
var request = function request(options) {
|
|
34
22
|
var _a = options || {},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
23
|
+
headers = _a.headers,
|
|
24
|
+
data = _a.data,
|
|
25
|
+
dataType = _a.dataType,
|
|
26
|
+
rest = __rest(_a, ["headers", "data", "dataType"]);
|
|
40
27
|
var androidHeaders = [];
|
|
41
|
-
|
|
42
28
|
if (!isIOS) {
|
|
43
29
|
for (var i in headers) {
|
|
44
30
|
var o = {};
|
|
@@ -46,27 +32,21 @@ var request = function request(options) {
|
|
|
46
32
|
androidHeaders.push();
|
|
47
33
|
}
|
|
48
34
|
}
|
|
49
|
-
|
|
50
35
|
var formatData = function formatData(data) {
|
|
51
36
|
var result = data;
|
|
52
|
-
|
|
53
37
|
switch (dataType) {
|
|
54
38
|
case 'json':
|
|
55
39
|
result = safeJSONParse(data, {});
|
|
56
40
|
break;
|
|
57
|
-
|
|
58
41
|
case 'base64':
|
|
59
42
|
result = data.startsWith('data:') ? data : 'data:application/json;base64,' + data;
|
|
60
43
|
break;
|
|
61
|
-
|
|
62
44
|
case 'text':
|
|
63
45
|
result = data;
|
|
64
46
|
break;
|
|
65
47
|
}
|
|
66
|
-
|
|
67
48
|
return result;
|
|
68
49
|
};
|
|
69
|
-
|
|
70
50
|
call('httpRequest', __assign({
|
|
71
51
|
headers: isIOS ? headers : androidHeaders,
|
|
72
52
|
data: JSON.stringify(data),
|
|
@@ -82,5 +62,4 @@ var request = function request(options) {
|
|
|
82
62
|
originOptions: options
|
|
83
63
|
});
|
|
84
64
|
};
|
|
85
|
-
|
|
86
65
|
export default request;
|
|
@@ -2,43 +2,29 @@ var __assign = this && this.__assign || function () {
|
|
|
2
2
|
__assign = Object.assign || function (t) {
|
|
3
3
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
4
|
s = arguments[i];
|
|
5
|
-
|
|
6
|
-
for (var p in s) {
|
|
7
|
-
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
8
|
-
}
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
9
6
|
}
|
|
10
|
-
|
|
11
7
|
return t;
|
|
12
8
|
};
|
|
13
|
-
|
|
14
9
|
return __assign.apply(this, arguments);
|
|
15
10
|
};
|
|
16
|
-
|
|
17
11
|
var __rest = this && this.__rest || function (s, e) {
|
|
18
12
|
var t = {};
|
|
19
|
-
|
|
20
|
-
for (var p in s) {
|
|
21
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
22
|
-
}
|
|
23
|
-
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
24
14
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
25
15
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
26
16
|
}
|
|
27
17
|
return t;
|
|
28
18
|
};
|
|
29
|
-
|
|
30
19
|
import call from "../../../call";
|
|
31
|
-
|
|
32
20
|
var saveFile = function saveFile(options) {
|
|
33
21
|
var _a = options || {},
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
22
|
+
apFilePath = _a.apFilePath,
|
|
23
|
+
rest = __rest(_a, ["apFilePath"]);
|
|
37
24
|
call('saveFile', __assign({
|
|
38
25
|
tempFilePath: apFilePath
|
|
39
26
|
}, rest), {
|
|
40
27
|
originOptions: options
|
|
41
28
|
});
|
|
42
29
|
};
|
|
43
|
-
|
|
44
30
|
export default saveFile;
|
|
@@ -2,43 +2,29 @@ var __assign = this && this.__assign || function () {
|
|
|
2
2
|
__assign = Object.assign || function (t) {
|
|
3
3
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
4
|
s = arguments[i];
|
|
5
|
-
|
|
6
|
-
for (var p in s) {
|
|
7
|
-
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
8
|
-
}
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
9
6
|
}
|
|
10
|
-
|
|
11
7
|
return t;
|
|
12
8
|
};
|
|
13
|
-
|
|
14
9
|
return __assign.apply(this, arguments);
|
|
15
10
|
};
|
|
16
|
-
|
|
17
11
|
var __rest = this && this.__rest || function (s, e) {
|
|
18
12
|
var t = {};
|
|
19
|
-
|
|
20
|
-
for (var p in s) {
|
|
21
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
22
|
-
}
|
|
23
|
-
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
24
14
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
25
15
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
26
16
|
}
|
|
27
17
|
return t;
|
|
28
18
|
};
|
|
29
|
-
|
|
30
19
|
import call from "../../../call";
|
|
31
|
-
|
|
32
20
|
var saveImage = function saveImage(options) {
|
|
33
21
|
var _a = options || {},
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
22
|
+
url = _a.url,
|
|
23
|
+
rest = __rest(_a, ["url"]);
|
|
37
24
|
call('saveImage', __assign({
|
|
38
25
|
src: url
|
|
39
26
|
}, rest), {
|
|
40
27
|
originOptions: options
|
|
41
28
|
});
|
|
42
29
|
};
|
|
43
|
-
|
|
44
30
|
export default saveImage;
|
|
@@ -2,20 +2,13 @@ var __assign = this && this.__assign || function () {
|
|
|
2
2
|
__assign = Object.assign || function (t) {
|
|
3
3
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
4
|
s = arguments[i];
|
|
5
|
-
|
|
6
|
-
for (var p in s) {
|
|
7
|
-
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
8
|
-
}
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
9
6
|
}
|
|
10
|
-
|
|
11
7
|
return t;
|
|
12
8
|
};
|
|
13
|
-
|
|
14
9
|
return __assign.apply(this, arguments);
|
|
15
10
|
};
|
|
16
|
-
|
|
17
11
|
import call from "../../../call";
|
|
18
|
-
|
|
19
12
|
var setKeepScreenOn = function setKeepScreenOn(options) {
|
|
20
13
|
call('setScreenAutolock', __assign({
|
|
21
14
|
actionType: 'disable'
|
|
@@ -23,5 +16,4 @@ var setKeepScreenOn = function setKeepScreenOn(options) {
|
|
|
23
16
|
originOptions: options
|
|
24
17
|
});
|
|
25
18
|
};
|
|
26
|
-
|
|
27
19
|
export default setKeepScreenOn;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import call from "../../../call";
|
|
2
2
|
import { isNaN } from "../../../utils";
|
|
3
|
-
|
|
4
3
|
var setNavigationBar = function setNavigationBar(options) {
|
|
5
4
|
var title = options.title,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
image = options.image,
|
|
6
|
+
backgroundColor = options.backgroundColor,
|
|
7
|
+
borderBottomColor = options.borderBottomColor,
|
|
8
|
+
reset = options.reset,
|
|
9
|
+
success = options.success,
|
|
10
|
+
complete = options.complete,
|
|
11
|
+
fail = options.fail;
|
|
13
12
|
if (title || image) call('setTitle', {
|
|
14
13
|
title: title,
|
|
15
14
|
image: image
|
|
@@ -33,19 +32,16 @@ var setNavigationBar = function setNavigationBar(options) {
|
|
|
33
32
|
complete: complete,
|
|
34
33
|
fail: fail
|
|
35
34
|
};
|
|
36
|
-
|
|
37
35
|
if (colorValue) {
|
|
38
36
|
Object.assign(setTitleColorParams, {
|
|
39
37
|
color: colorValue || 'ffffff'
|
|
40
38
|
});
|
|
41
39
|
}
|
|
42
|
-
|
|
43
40
|
if (reset) {
|
|
44
41
|
Object.assign(setTitleColorParams, {
|
|
45
42
|
reset: reset
|
|
46
43
|
});
|
|
47
44
|
}
|
|
48
|
-
|
|
49
45
|
call('setTitleColor', setTitleColorParams, {
|
|
50
46
|
modify: {
|
|
51
47
|
fail: function fail(res) {
|
|
@@ -59,5 +55,4 @@ var setNavigationBar = function setNavigationBar(options) {
|
|
|
59
55
|
originOptions: options
|
|
60
56
|
});
|
|
61
57
|
};
|
|
62
|
-
|
|
63
58
|
export default setNavigationBar;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import call from "../../../call";
|
|
2
|
-
|
|
3
2
|
var setOptionMenu = function setOptionMenu(options) {
|
|
4
3
|
call('showOptionMenu', {
|
|
5
4
|
success: function success() {
|
|
@@ -8,5 +7,4 @@ var setOptionMenu = function setOptionMenu(options) {
|
|
|
8
7
|
fail: options === null || options === void 0 ? void 0 : options.fail
|
|
9
8
|
});
|
|
10
9
|
};
|
|
11
|
-
|
|
12
10
|
export default setOptionMenu;
|
|
@@ -2,44 +2,30 @@ var __assign = this && this.__assign || function () {
|
|
|
2
2
|
__assign = Object.assign || function (t) {
|
|
3
3
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
4
|
s = arguments[i];
|
|
5
|
-
|
|
6
|
-
for (var p in s) {
|
|
7
|
-
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
8
|
-
}
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
9
6
|
}
|
|
10
|
-
|
|
11
7
|
return t;
|
|
12
8
|
};
|
|
13
|
-
|
|
14
9
|
return __assign.apply(this, arguments);
|
|
15
10
|
};
|
|
16
|
-
|
|
17
11
|
var __rest = this && this.__rest || function (s, e) {
|
|
18
12
|
var t = {};
|
|
19
|
-
|
|
20
|
-
for (var p in s) {
|
|
21
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
22
|
-
}
|
|
23
|
-
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
24
14
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
25
15
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
26
16
|
}
|
|
27
17
|
return t;
|
|
28
18
|
};
|
|
29
|
-
|
|
30
19
|
import { safeJSONStringify } from "../../../../common/utils";
|
|
31
20
|
import call from "../../../call";
|
|
32
|
-
|
|
33
21
|
var setStorage = function setStorage(options) {
|
|
34
22
|
var _a = options || {},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
23
|
+
data = _a.data,
|
|
24
|
+
rest = __rest(_a, ["data"]);
|
|
38
25
|
call('setTinyLocalStorage', __assign({
|
|
39
26
|
data: safeJSONStringify(data)
|
|
40
27
|
}, rest), {
|
|
41
28
|
originOptions: options
|
|
42
29
|
});
|
|
43
30
|
};
|
|
44
|
-
|
|
45
31
|
export default setStorage;
|
|
@@ -2,20 +2,13 @@ var __assign = this && this.__assign || function () {
|
|
|
2
2
|
__assign = Object.assign || function (t) {
|
|
3
3
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
4
|
s = arguments[i];
|
|
5
|
-
|
|
6
|
-
for (var p in s) {
|
|
7
|
-
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
8
|
-
}
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
9
6
|
}
|
|
10
|
-
|
|
11
7
|
return t;
|
|
12
8
|
};
|
|
13
|
-
|
|
14
9
|
return __assign.apply(this, arguments);
|
|
15
10
|
};
|
|
16
|
-
|
|
17
11
|
import call from "../../../call";
|
|
18
|
-
|
|
19
12
|
var setTabBarStyle = function setTabBarStyle(options) {
|
|
20
13
|
call('setTabBar', __assign({
|
|
21
14
|
actionType: 'setTabbarStyle'
|
|
@@ -23,5 +16,4 @@ var setTabBarStyle = function setTabBarStyle(options) {
|
|
|
23
16
|
originOptions: options
|
|
24
17
|
});
|
|
25
18
|
};
|
|
26
|
-
|
|
27
19
|
export default setTabBarStyle;
|
|
@@ -2,39 +2,26 @@ var __assign = this && this.__assign || function () {
|
|
|
2
2
|
__assign = Object.assign || function (t) {
|
|
3
3
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
4
|
s = arguments[i];
|
|
5
|
-
|
|
6
|
-
for (var p in s) {
|
|
7
|
-
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
8
|
-
}
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
9
6
|
}
|
|
10
|
-
|
|
11
7
|
return t;
|
|
12
8
|
};
|
|
13
|
-
|
|
14
9
|
return __assign.apply(this, arguments);
|
|
15
10
|
};
|
|
16
|
-
|
|
17
11
|
var __rest = this && this.__rest || function (s, e) {
|
|
18
12
|
var t = {};
|
|
19
|
-
|
|
20
|
-
for (var p in s) {
|
|
21
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
22
|
-
}
|
|
23
|
-
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
24
14
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
25
15
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
26
16
|
}
|
|
27
17
|
return t;
|
|
28
18
|
};
|
|
29
|
-
|
|
30
19
|
import call from "../../../call";
|
|
31
|
-
|
|
32
20
|
var showActionSheet = function showActionSheet(options) {
|
|
33
21
|
var _a = options || {},
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
22
|
+
items = _a.items,
|
|
23
|
+
cancelButtonText = _a.cancelButtonText,
|
|
24
|
+
rest = __rest(_a, ["items", "cancelButtonText"]);
|
|
38
25
|
call('actionSheet', __assign({
|
|
39
26
|
btns: items,
|
|
40
27
|
cancelBtn: cancelButtonText
|
|
@@ -42,5 +29,4 @@ var showActionSheet = function showActionSheet(options) {
|
|
|
42
29
|
originOptions: options
|
|
43
30
|
});
|
|
44
31
|
};
|
|
45
|
-
|
|
46
32
|
export default showActionSheet;
|
|
@@ -2,20 +2,13 @@ var __assign = this && this.__assign || function () {
|
|
|
2
2
|
__assign = Object.assign || function (t) {
|
|
3
3
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
4
|
s = arguments[i];
|
|
5
|
-
|
|
6
|
-
for (var p in s) {
|
|
7
|
-
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
8
|
-
}
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
9
6
|
}
|
|
10
|
-
|
|
11
7
|
return t;
|
|
12
8
|
};
|
|
13
|
-
|
|
14
9
|
return __assign.apply(this, arguments);
|
|
15
10
|
};
|
|
16
|
-
|
|
17
11
|
import call from "../../../call";
|
|
18
|
-
|
|
19
12
|
var showAuthGuide = function showAuthGuide(options) {
|
|
20
13
|
call('showAuthGuide', __assign({
|
|
21
14
|
bizType: 'alipayIntl'
|
|
@@ -23,5 +16,4 @@ var showAuthGuide = function showAuthGuide(options) {
|
|
|
23
16
|
originOptions: options
|
|
24
17
|
});
|
|
25
18
|
};
|
|
26
|
-
|
|
27
19
|
export default showAuthGuide;
|
|
@@ -2,20 +2,13 @@ var __assign = this && this.__assign || function () {
|
|
|
2
2
|
__assign = Object.assign || function (t) {
|
|
3
3
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
4
|
s = arguments[i];
|
|
5
|
-
|
|
6
|
-
for (var p in s) {
|
|
7
|
-
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
8
|
-
}
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
9
6
|
}
|
|
10
|
-
|
|
11
7
|
return t;
|
|
12
8
|
};
|
|
13
|
-
|
|
14
9
|
return __assign.apply(this, arguments);
|
|
15
10
|
};
|
|
16
|
-
|
|
17
11
|
import call from "../../../call";
|
|
18
|
-
|
|
19
12
|
var showToast = function showToast(options) {
|
|
20
13
|
call('toast', __assign({
|
|
21
14
|
content: ''
|
|
@@ -23,5 +16,4 @@ var showToast = function showToast(options) {
|
|
|
23
16
|
originOptions: options
|
|
24
17
|
});
|
|
25
18
|
};
|
|
26
|
-
|
|
27
19
|
export default showToast;
|
|
@@ -2,39 +2,26 @@ var __assign = this && this.__assign || function () {
|
|
|
2
2
|
__assign = Object.assign || function (t) {
|
|
3
3
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
4
|
s = arguments[i];
|
|
5
|
-
|
|
6
|
-
for (var p in s) {
|
|
7
|
-
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
8
|
-
}
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
9
6
|
}
|
|
10
|
-
|
|
11
7
|
return t;
|
|
12
8
|
};
|
|
13
|
-
|
|
14
9
|
return __assign.apply(this, arguments);
|
|
15
10
|
};
|
|
16
|
-
|
|
17
11
|
var __rest = this && this.__rest || function (s, e) {
|
|
18
12
|
var t = {};
|
|
19
|
-
|
|
20
|
-
for (var p in s) {
|
|
21
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
22
|
-
}
|
|
23
|
-
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
24
14
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
25
15
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
26
16
|
}
|
|
27
17
|
return t;
|
|
28
18
|
};
|
|
29
|
-
|
|
30
19
|
import call from "../../../call";
|
|
31
|
-
|
|
32
20
|
var uploadFile = function uploadFile(options) {
|
|
33
21
|
var _a = options || {},
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
22
|
+
fileName = _a.fileName,
|
|
23
|
+
fileType = _a.fileType,
|
|
24
|
+
rest = __rest(_a, ["fileName", "fileType"]);
|
|
38
25
|
call('uploadFile', __assign({
|
|
39
26
|
name: fileName,
|
|
40
27
|
type: fileType
|
|
@@ -42,5 +29,4 @@ var uploadFile = function uploadFile(options) {
|
|
|
42
29
|
originOptions: options
|
|
43
30
|
});
|
|
44
31
|
};
|
|
45
|
-
|
|
46
32
|
export default uploadFile;
|
package/lib/common/call/index.js
CHANGED
|
@@ -2,32 +2,23 @@ var __assign = this && this.__assign || function () {
|
|
|
2
2
|
__assign = Object.assign || function (t) {
|
|
3
3
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
4
|
s = arguments[i];
|
|
5
|
-
|
|
6
|
-
for (var p in s) {
|
|
7
|
-
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
8
|
-
}
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
9
6
|
}
|
|
10
|
-
|
|
11
7
|
return t;
|
|
12
8
|
};
|
|
13
|
-
|
|
14
9
|
return __assign.apply(this, arguments);
|
|
15
10
|
};
|
|
16
|
-
|
|
17
11
|
import { getEnv } from "../../appEnv";
|
|
18
12
|
import webCall from "./web";
|
|
19
13
|
import mpWebCall from "./mpWeb";
|
|
20
14
|
import mpCall from "./mp";
|
|
21
15
|
import { ApiCallStage, platformType } from "../constants";
|
|
22
16
|
import { logger } from "../logger";
|
|
23
|
-
|
|
24
17
|
function getOptions(name, options, config) {
|
|
25
18
|
if (name === void 0) {
|
|
26
19
|
name = '';
|
|
27
20
|
}
|
|
28
|
-
|
|
29
21
|
var originOptions = (config || {}).originOptions;
|
|
30
|
-
|
|
31
22
|
if (originOptions) {
|
|
32
23
|
logger({
|
|
33
24
|
stage: ApiCallStage.REQUEST,
|
|
@@ -49,11 +40,9 @@ function getOptions(name, options, config) {
|
|
|
49
40
|
request: options
|
|
50
41
|
});
|
|
51
42
|
}
|
|
52
|
-
|
|
53
43
|
function getRes(state) {
|
|
54
44
|
return function (res) {
|
|
55
45
|
var _a;
|
|
56
|
-
|
|
57
46
|
var cb = options === null || options === void 0 ? void 0 : options[state];
|
|
58
47
|
if (!cb) return;
|
|
59
48
|
logger({
|
|
@@ -76,26 +65,20 @@ function getOptions(name, options, config) {
|
|
|
76
65
|
});
|
|
77
66
|
};
|
|
78
67
|
}
|
|
79
|
-
|
|
80
68
|
return __assign(__assign({}, options), {
|
|
81
69
|
success: getRes('success'),
|
|
82
70
|
fail: getRes('fail'),
|
|
83
71
|
complete: getRes('complete')
|
|
84
72
|
});
|
|
85
73
|
}
|
|
86
|
-
|
|
87
74
|
export function call(name, options, config) {
|
|
88
75
|
var _a;
|
|
89
|
-
|
|
90
76
|
var opts = getOptions(name, options, config);
|
|
91
|
-
|
|
92
77
|
switch ((_a = getEnv()) === null || _a === void 0 ? void 0 : _a.platform) {
|
|
93
78
|
case platformType.mp:
|
|
94
79
|
return mpCall(name, opts);
|
|
95
|
-
|
|
96
80
|
case platformType.web:
|
|
97
81
|
return webCall(name, opts);
|
|
98
|
-
|
|
99
82
|
case platformType.mpWeb:
|
|
100
83
|
return mpWebCall(name, opts, config === null || config === void 0 ? void 0 : config.isSync);
|
|
101
84
|
}
|
package/lib/common/call/mp.js
CHANGED