xctc-utils 1.3.8 → 1.3.9

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.
@@ -14,6 +14,7 @@ interface ShareConfig {
14
14
  cb?: any;
15
15
  appId: string;
16
16
  jsApiList?: string[];
17
+ openTagList?: string[];
17
18
  }
18
19
  export declare function weixinShareConfig(config: ShareConfig): void;
19
20
  interface ShareOptions {
@@ -214,6 +214,10 @@ var defaultJsApiList = [
214
214
  "onVoiceRecordEnd", "playVoice", "pauseVoice", "stopVoice", "onVoicePlayEnd", "uploadVoice", "downloadVoice", "chooseImage", "previewImage", "uploadImage", "openProductSpecificView", "addCard",
215
215
  "downloadImage", "translateVoice", "getNetworkType", "openLocation", "getLocation", "hideOptionMenu", "showOptionMenu", "hideMenuItems", "showMenuItems", "hideAllNonBaseMenuItem", "showAllNonBaseMenuItem",
216
216
  ];
217
+ var defaultOpenTagList = [
218
+ "wx-open-subscribe", "wx-open-launch-app", "wx-open-launch-weapp",
219
+ "wx-open-audio"
220
+ ];
217
221
  function weixinShareConfig(config) {
218
222
  if (!config['http'])
219
223
  return;
@@ -223,9 +227,13 @@ function weixinShareConfig(config) {
223
227
  appId: config.appId,
224
228
  };
225
229
  var jsApiList = defaultJsApiList;
226
- if (config && config.jsApiList && config.jsApiList.length) {
230
+ var openTagList = defaultOpenTagList;
231
+ if (config && config['jsApiList'] && config.jsApiList.length) {
227
232
  jsApiList = config.jsApiList;
228
233
  }
234
+ if (config && config['openTagList'] && config.openTagList.length) {
235
+ openTagList = config.openTagList;
236
+ }
229
237
  config.http(param).then(function (res) {
230
238
  if (res.code == 0) {
231
239
  var data = res['data'] || {};
@@ -236,7 +244,8 @@ function weixinShareConfig(config) {
236
244
  timestamp: data.timestamp,
237
245
  nonceStr: data.noncestr,
238
246
  signature: data.signature,
239
- jsApiList: jsApiList //必填,允许分享好友,分享朋友圈
247
+ jsApiList: jsApiList,
248
+ openTagList: openTagList,
240
249
  });
241
250
  wx.ready(function (res) {
242
251
  console.log("加载微信分享配置完成:", res);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xctc-utils",
3
- "version": "1.3.8",
3
+ "version": "1.3.9",
4
4
  "description": "localStorage存储\r ```\r sessionStorage存储\r ```\r crypto-js加密、解密\r ```\r 微信授权登录、微信分享\r ```\r 设备环境获取\r ```\r 是否是微信浏览器\r ```\r 时间戳转时间,字符串转时间戳",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",