@arcblock/bridge 2.5.57 → 2.5.59
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.js +0 -22
- package/package.json +2 -3
package/lib/index.js
CHANGED
|
@@ -4,11 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _dsbridge = _interopRequireDefault(require("dsbridge"));
|
|
9
|
-
|
|
10
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
9
|
var _default = {
|
|
13
10
|
// 基本功能
|
|
14
11
|
shareMessage(params) {
|
|
@@ -18,18 +15,15 @@ var _default = {
|
|
|
18
15
|
success,
|
|
19
16
|
fail
|
|
20
17
|
} = params;
|
|
21
|
-
|
|
22
18
|
if (!content && !imgUrl) {
|
|
23
19
|
fail('params error');
|
|
24
20
|
return;
|
|
25
21
|
}
|
|
26
|
-
|
|
27
22
|
_dsbridge.default.call('arcShare', JSON.stringify({
|
|
28
23
|
content,
|
|
29
24
|
imgUrl
|
|
30
25
|
}), result => {
|
|
31
26
|
const parseResult = JSON.parse(result);
|
|
32
|
-
|
|
33
27
|
if (parseResult && parseResult.code === 0) {
|
|
34
28
|
if (typeof success === 'function') {
|
|
35
29
|
success(result);
|
|
@@ -39,21 +33,17 @@ var _default = {
|
|
|
39
33
|
}
|
|
40
34
|
});
|
|
41
35
|
},
|
|
42
|
-
|
|
43
36
|
showLoading() {
|
|
44
37
|
_dsbridge.default.call('arcShowLoading');
|
|
45
38
|
},
|
|
46
|
-
|
|
47
39
|
hideLoading() {
|
|
48
40
|
_dsbridge.default.call('arcHideLoading');
|
|
49
41
|
},
|
|
50
|
-
|
|
51
42
|
showToast(msg) {
|
|
52
43
|
if (msg && typeof msg === 'string') {
|
|
53
44
|
_dsbridge.default.call('arcToast', msg);
|
|
54
45
|
}
|
|
55
46
|
},
|
|
56
|
-
|
|
57
47
|
// 图片功能
|
|
58
48
|
chooseImgs(params) {
|
|
59
49
|
const {
|
|
@@ -61,12 +51,10 @@ var _default = {
|
|
|
61
51
|
success,
|
|
62
52
|
fail
|
|
63
53
|
} = params;
|
|
64
|
-
|
|
65
54
|
_dsbridge.default.call('arcChooseImgs', JSON.stringify({
|
|
66
55
|
limit
|
|
67
56
|
}), result => {
|
|
68
57
|
const parseResult = JSON.parse(result);
|
|
69
|
-
|
|
70
58
|
if (parseResult && parseResult.code === 0) {
|
|
71
59
|
if (typeof success === 'function') {
|
|
72
60
|
success(result);
|
|
@@ -76,29 +64,23 @@ var _default = {
|
|
|
76
64
|
}
|
|
77
65
|
});
|
|
78
66
|
},
|
|
79
|
-
|
|
80
67
|
previewImgs(params) {
|
|
81
68
|
const {
|
|
82
69
|
imgs
|
|
83
70
|
} = params;
|
|
84
|
-
|
|
85
71
|
if (!imgs || imgs.length === 0) {
|
|
86
72
|
return;
|
|
87
73
|
}
|
|
88
|
-
|
|
89
74
|
_dsbridge.default.call('arcPreviewImgs', JSON.stringify(params));
|
|
90
75
|
},
|
|
91
|
-
|
|
92
76
|
// 钱包功能
|
|
93
77
|
isSetPWD(params) {
|
|
94
78
|
const {
|
|
95
79
|
success,
|
|
96
80
|
fail
|
|
97
81
|
} = params;
|
|
98
|
-
|
|
99
82
|
_dsbridge.default.call('arcIsSetPWD', '', result => {
|
|
100
83
|
const parseResult = JSON.parse(result);
|
|
101
|
-
|
|
102
84
|
if (parseResult && parseResult.code === 0) {
|
|
103
85
|
if (typeof success === 'function') {
|
|
104
86
|
success(result);
|
|
@@ -108,16 +90,13 @@ var _default = {
|
|
|
108
90
|
}
|
|
109
91
|
});
|
|
110
92
|
},
|
|
111
|
-
|
|
112
93
|
isCodeABOk(params) {
|
|
113
94
|
const {
|
|
114
95
|
success,
|
|
115
96
|
fail
|
|
116
97
|
} = params;
|
|
117
|
-
|
|
118
98
|
_dsbridge.default.call('arcIsCodeABOk', '', result => {
|
|
119
99
|
const parseResult = JSON.parse(result);
|
|
120
|
-
|
|
121
100
|
if (parseResult && parseResult.code === 0) {
|
|
122
101
|
if (typeof success === 'function') {
|
|
123
102
|
success(result);
|
|
@@ -127,6 +106,5 @@ var _default = {
|
|
|
127
106
|
}
|
|
128
107
|
});
|
|
129
108
|
}
|
|
130
|
-
|
|
131
109
|
};
|
|
132
110
|
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcblock/bridge",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.59",
|
|
4
4
|
"description": "a bridge sdk support all js api from DID Wallet.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bridge",
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
"url": "git+https://github.com/ArcBlock/ux.git"
|
|
16
16
|
},
|
|
17
17
|
"scripts": {
|
|
18
|
-
"lint": "",
|
|
19
18
|
"build": "babel src --out-dir lib --copy-files --no-copy-ignored",
|
|
20
19
|
"watch": "babel src --out-dir lib -w --copy-files --no-copy-ignored",
|
|
21
20
|
"precommit": "CI=1 npm run lint",
|
|
@@ -41,5 +40,5 @@
|
|
|
41
40
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
42
41
|
"jest": "^28.1.3"
|
|
43
42
|
},
|
|
44
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "f50c420e5f06ae108d59636cfdcfde88d1e10f4c"
|
|
45
44
|
}
|