crh-jssdk 0.10.28 → 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.
@@ -202,6 +202,32 @@ export default {
202
202
  }
203
203
  },
204
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
+
205
231
  /**
206
232
  * 获取Bridge实例(供其他模块使用)
207
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
  }
@@ -282,6 +282,37 @@ exports.default = {
282
282
  return "0.0.0";
283
283
  }
284
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
+ },
285
316
  /**
286
317
  * 获取Bridge实例(供其他模块使用)
287
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "crh-jssdk",
3
- "version": "0.10.28",
3
+ "version": "0.10.29",
4
4
  "description": "crh-jssdk",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {