crh-jssdk 1.0.10 → 1.0.12
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.
|
@@ -126,45 +126,23 @@ exports.default = {
|
|
|
126
126
|
});
|
|
127
127
|
});
|
|
128
128
|
},
|
|
129
|
-
/**
|
|
130
|
-
* 通过url打开新的webview打开外部链接
|
|
131
|
-
* iOS: client://hxsecurity.frame.router/browser?url=xxx
|
|
132
|
-
* Android: client://hxsecurity.frame.router/quote_browser?url=xxx
|
|
133
|
-
*/
|
|
134
|
-
goWebview: function (url) {
|
|
135
|
-
var timestamp = new Date().getTime();
|
|
136
|
-
var safeUrl = typeof url === "string" ? url : "".concat(url || "");
|
|
137
|
-
var pinurl = safeUrl.indexOf("?") > -1
|
|
138
|
-
? "".concat(safeUrl, "×tamp=").concat(timestamp)
|
|
139
|
-
: "".concat(safeUrl, "?timestamp=").concat(timestamp);
|
|
140
|
-
console.log("金圆统一 pinurl", pinurl);
|
|
141
|
-
// 金圆统一区分 iOS/Android
|
|
142
|
-
if (utils_1.ios) {
|
|
143
|
-
// iOS: 使用 browser
|
|
144
|
-
location.href = "client://hxsecurity.frame.router/browser?url=".concat(encodeURIComponent(pinurl), "&rp_flag_push_to_stack_directly=true&rp_flag_back_to_last_tab=true&rp_flag_finish_when_back_to_last_tab=true&hideNavBar=1&isHiddenNavigationBar=1&physicKey=1");
|
|
145
|
-
}
|
|
146
|
-
else {
|
|
147
|
-
// Android: 使用 quote_browser
|
|
148
|
-
location.href = "client://hxsecurity.frame.router/quote_browser?url=".concat(encodeURIComponent(pinurl), "&rp_flag_recreate=true&rp_flag_push_to_stack_directly=true&rp_flag_finish_when_back_to_last_tab=true&hideNavBar=1&isHiddenNavigationBar=1&physicKey=1");
|
|
149
|
-
}
|
|
150
|
-
},
|
|
151
129
|
/**
|
|
152
130
|
* 跳转到客户端页面(通过JSBridge)
|
|
153
131
|
* @param url 完整跳转链接,与中台路由格式一样
|
|
154
132
|
* @param needTitle 是否显示原生标题栏
|
|
155
133
|
*/
|
|
156
|
-
|
|
134
|
+
goWebview: function (params) {
|
|
157
135
|
return __awaiter(this, void 0, void 0, function () {
|
|
158
136
|
var url, _a, needTitle, pageId, gotoUrl, error_3;
|
|
159
137
|
return __generator(this, function (_b) {
|
|
160
138
|
switch (_b.label) {
|
|
161
139
|
case 0:
|
|
162
|
-
url = params.url, _a = params.needTitle, needTitle = _a === void 0 ?
|
|
140
|
+
url = params.url, _a = params.needTitle, needTitle = _a === void 0 ? true : _a;
|
|
163
141
|
_b.label = 1;
|
|
164
142
|
case 1:
|
|
165
143
|
_b.trys.push([1, 3, , 4]);
|
|
166
|
-
pageId =
|
|
167
|
-
gotoUrl = "client.html?action=ymtz^webid=".concat(pageId, "^url=").concat(
|
|
144
|
+
pageId = utils_1.ios ? "5032" : "2804";
|
|
145
|
+
gotoUrl = "client.html?action=ymtz^webid=".concat(pageId, "^url=").concat(url, "^isHiddenNavigationBar=").concat(needTitle ? 1 : 0, "^isHiddenBottomBar=1^isNeedWtLogin=1");
|
|
168
146
|
console.log("金圆统一调用gotoNextPage,参数:", gotoUrl);
|
|
169
147
|
return [4 /*yield*/, utils_1.jyBridge.bridgeCallHandler("Promise", "gotoNextPage", {
|
|
170
148
|
url: gotoUrl,
|
|
@@ -174,7 +152,6 @@ exports.default = {
|
|
|
174
152
|
error_3 = _b.sent();
|
|
175
153
|
console.error("金圆统一跳转客户端页面失败:", error_3);
|
|
176
154
|
// 降级方案:使用 goWebview
|
|
177
|
-
this.goWebview(url);
|
|
178
155
|
return [2 /*return*/, { success: false }];
|
|
179
156
|
case 4: return [2 /*return*/];
|
|
180
157
|
}
|
|
@@ -199,6 +199,9 @@ exports.default = {
|
|
|
199
199
|
console.log("设置状态栏参数:", params);
|
|
200
200
|
try {
|
|
201
201
|
console.log("ios && params?.wordColorStyle", utils_1.ios && (params === null || params === void 0 ? void 0 : params.wordColorStyle));
|
|
202
|
+
utils_1.globalBridge.bridgeCallHandler("", "modifyStatusColor", {
|
|
203
|
+
statusColor: params.color,
|
|
204
|
+
});
|
|
202
205
|
// iOS端额外设置状态栏文字颜色
|
|
203
206
|
if (utils_1.ios) {
|
|
204
207
|
style = params.wordColorStyle === "0" ? "light" : "dark";
|
|
@@ -207,11 +210,6 @@ exports.default = {
|
|
|
207
210
|
});
|
|
208
211
|
console.log("设置iOS状态栏文字颜色成功:", style);
|
|
209
212
|
}
|
|
210
|
-
else {
|
|
211
|
-
utils_1.globalBridge.bridgeCallHandler("", "modifyStatusColor", {
|
|
212
|
-
statusColor: params.color,
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
213
|
console.log("设置状态栏颜色成功");
|
|
216
214
|
return [2 /*return*/, { success: true }];
|
|
217
215
|
}
|