crh-jssdk 0.10.27 → 0.10.29

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.
@@ -11,9 +11,8 @@ export default {
11
11
  isApp(): boolean {
12
12
  const ua = navigator.userAgent;
13
13
  console.log(ua);
14
- return (
15
- ua.includes("lczq")
16
- );
14
+ // 通过检测qsid来判断是否是联储证券App
15
+ return ua.includes("qsid/185");
17
16
  },
18
17
 
19
18
  /**
@@ -203,6 +202,32 @@ export default {
203
202
  }
204
203
  },
205
204
 
205
+ /**
206
+ * 关注公众号
207
+ * @param appid 公众号的appid,默认为wxf45c81345f5ea70e
208
+ */
209
+ async followOfficialAccount(
210
+ appid: string = "wxf45c81345f5ea70e"
211
+ ): Promise<any> {
212
+ try {
213
+ const params = {
214
+ jumptype: "1",
215
+ downloadurl: `weixin://dl/officialaccounts?appid=${appid}`,
216
+ };
217
+ console.log("调用关注公众号,参数:", params);
218
+ const result = await globalBridge.bridgeCallHandler(
219
+ "",
220
+ "startApplication",
221
+ params
222
+ );
223
+ console.log("关注公众号调用成功:", result);
224
+ return result;
225
+ } catch (error) {
226
+ console.error("关注公众号失败:", error);
227
+ throw error;
228
+ }
229
+ },
230
+
206
231
  /**
207
232
  * 获取Bridge实例(供其他模块使用)
208
233
  */
package/business/index.ts CHANGED
@@ -246,4 +246,12 @@ export default class BUSINESS {
246
246
  }
247
247
  return this.sdkObj.goBack();
248
248
  }
249
+
250
+ //关注公众号
251
+ public followOfficialAccount(appid?: string) {
252
+ if (!this.sdkObj.followOfficialAccount) {
253
+ return empty("followOfficialAccount");
254
+ }
255
+ return this.sdkObj.followOfficialAccount(appid);
256
+ }
249
257
  }
@@ -59,7 +59,8 @@ exports.default = {
59
59
  isApp: function () {
60
60
  var ua = navigator.userAgent;
61
61
  console.log(ua);
62
- return (ua.includes("lczq"));
62
+ // 通过检测qsid来判断是否是联储证券App
63
+ return ua.includes("qsid/185");
63
64
  },
64
65
  /**
65
66
  * 获取webview类型
@@ -281,6 +282,37 @@ exports.default = {
281
282
  return "0.0.0";
282
283
  }
283
284
  },
285
+ /**
286
+ * 关注公众号
287
+ * @param appid 公众号的appid,默认为wxf45c81345f5ea70e
288
+ */
289
+ followOfficialAccount: function () {
290
+ return __awaiter(this, arguments, void 0, function (appid) {
291
+ var params, result, error_6;
292
+ if (appid === void 0) { appid = "wxf45c81345f5ea70e"; }
293
+ return __generator(this, function (_a) {
294
+ switch (_a.label) {
295
+ case 0:
296
+ _a.trys.push([0, 2, , 3]);
297
+ params = {
298
+ jumptype: "1",
299
+ downloadurl: "weixin://dl/officialaccounts?appid=".concat(appid),
300
+ };
301
+ console.log("调用关注公众号,参数:", params);
302
+ return [4 /*yield*/, utils_1.globalBridge.bridgeCallHandler("", "startApplication", params)];
303
+ case 1:
304
+ result = _a.sent();
305
+ console.log("关注公众号调用成功:", result);
306
+ return [2 /*return*/, result];
307
+ case 2:
308
+ error_6 = _a.sent();
309
+ console.error("关注公众号失败:", error_6);
310
+ throw error_6;
311
+ case 3: return [2 /*return*/];
312
+ }
313
+ });
314
+ });
315
+ },
284
316
  /**
285
317
  * 获取Bridge实例(供其他模块使用)
286
318
  */
@@ -303,6 +303,13 @@ var BUSINESS = /** @class */ (function () {
303
303
  }
304
304
  return this.sdkObj.goBack();
305
305
  };
306
+ //关注公众号
307
+ BUSINESS.prototype.followOfficialAccount = function (appid) {
308
+ if (!this.sdkObj.followOfficialAccount) {
309
+ return (0, utils_1.empty)("followOfficialAccount");
310
+ }
311
+ return this.sdkObj.followOfficialAccount(appid);
312
+ };
306
313
  return BUSINESS;
307
314
  }());
308
315
  exports.default = BUSINESS;
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "crh-jssdk",
3
- "version": "0.10.27",
3
+ "version": "0.10.28",
4
4
  "description": "crh-jssdk",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "crh-jssdk",
3
- "version": "0.10.27",
3
+ "version": "0.10.29",
4
4
  "description": "crh-jssdk",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {