@uxda/appkit 4.2.97 → 4.3.0

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/dist/index.js CHANGED
@@ -8,6 +8,7 @@ import Taro, { showModal, getSystemInfoSync, getMenuButtonBoundingClientRect, up
8
8
  import '@nutui/nutui-taro/dist/packages/popup/style/css';
9
9
  import isMobilePhone from 'validator/es/lib/isMobilePhone';
10
10
  import isIdentityCard from 'validator/es/lib/isIdentityCard';
11
+ import qs from 'qs';
11
12
  import { NsForm, NsInput, NsButton, NsIcon, usePopup, useNutshell, NsButtonGroup, usePaging, NsPage, NsTabs, NsTabsItem, NsPageContent, NsSkeleton, NsRepeator, NsCard, NsEmpty, NsCheckbox } from '@uxda/nutshell/taro';
12
13
  import '@nutui/nutui-taro/dist/packages/actionsheet/style/css';
13
14
  import pako from 'pako';
@@ -474,9 +475,19 @@ function useLogger(options) {
474
475
  const pages = Taro.getCurrentPages();
475
476
  const currentPage = pages?.[pages.length - 1];
476
477
  const lastPage = pages?.[pages.length - 2];
478
+ const taroParams = currentPage.$taroParams;
479
+ if (taroParams) {
480
+ delete taroParams.stamp;
481
+ delete taroParams.$taroTimestamp;
482
+ }
483
+ const laseTaroParams = lastPage?.$taroParams;
484
+ if (laseTaroParams) {
485
+ delete laseTaroParams.stamp;
486
+ delete laseTaroParams.$taroTimestamp;
487
+ }
477
488
  params.pages = JSON.stringify({
478
- current: currentPage?.$taroPath,
479
- last: lastPage?.$taroPath
489
+ current: `${currentPage?.route}?${qs.stringify(taroParams)}`,
490
+ last: lastPage ? `${lastPage?.route}?${qs.stringify(laseTaroParams)}` : ""
480
491
  }).slice(0, 1024);
481
492
  console.log(params);
482
493
  const tmpStr = Object.keys(params).map((key) => `${key}=${encodeURIComponent(params[key])}`).join("&");
@@ -587,7 +598,7 @@ var script$L = /* @__PURE__ */ defineComponent({
587
598
  512
588
599
  /* NEED_PATCH */
589
600
  ), [
590
- [_directive_track_click, { event: "click", elementText: "\u9875\u9762\u5934\u90E8-\u8FD4\u56DE" }]
601
+ [_directive_track_click, "\u9875\u9762\u5934\u90E8-\u8FD4\u56DE"]
591
602
  ]),
592
603
  renderSlot(_ctx.$slots, "default")
593
604
  ],
@@ -742,7 +753,7 @@ var script$J = /* @__PURE__ */ defineComponent({
742
753
  512
743
754
  /* NEED_PATCH */
744
755
  )), [
745
- [_directive_track_click, { event: "click", elementText: "\u624B\u673A\u53F7\u9A8C\u8BC1-\u83B7\u53D6\u9A8C\u8BC1\u7801" }]
756
+ [_directive_track_click, "\u624B\u673A\u53F7\u9A8C\u8BC1-\u83B7\u53D6\u9A8C\u8BC1\u7801"]
746
757
  ]) : createCommentVNode("v-if", true),
747
758
  sent.value ? (openBlock(), createElementBlock(
748
759
  "div",
@@ -771,7 +782,7 @@ var script$J = /* @__PURE__ */ defineComponent({
771
782
  _: 1
772
783
  /* STABLE */
773
784
  })), [
774
- [_directive_track_click, { event: "click", elementText: "\u624B\u673A\u53F7\u9A8C\u8BC1-\u53D6\u6D88" }]
785
+ [_directive_track_click, "\u624B\u673A\u53F7\u9A8C\u8BC1-\u53D6\u6D88"]
775
786
  ]),
776
787
  withDirectives((openBlock(), createBlock(unref(NsButton), {
777
788
  color: "primary",
@@ -787,7 +798,7 @@ var script$J = /* @__PURE__ */ defineComponent({
787
798
  _: 1
788
799
  /* STABLE */
789
800
  })), [
790
- [_directive_track_click, { event: "click", elementText: "\u624B\u673A\u53F7\u9A8C\u8BC1-\u786E\u8BA4" }]
801
+ [_directive_track_click, "\u624B\u673A\u53F7\u9A8C\u8BC1-\u786E\u8BA4"]
791
802
  ])
792
803
  ])
793
804
  ]);
@@ -837,7 +848,7 @@ var script$I = /* @__PURE__ */ defineComponent({
837
848
  )) : createCommentVNode("v-if", true),
838
849
  renderSlot(_ctx.$slots, "default")
839
850
  ])), [
840
- [_directive_track_click, { event: "click", elementText: "\u901A\u77E5\u680F-\u6587\u672C" }]
851
+ [_directive_track_click, "\u901A\u77E5\u680F-\u6587\u672C"]
841
852
  ]),
842
853
  __props.showClose ? withDirectives((openBlock(), createElementBlock("div", {
843
854
  key: 0,
@@ -855,7 +866,7 @@ var script$I = /* @__PURE__ */ defineComponent({
855
866
  /* CACHED */
856
867
  )
857
868
  ])])), [
858
- [_directive_track_click, { event: "click", elementText: "\u901A\u77E5\u680F-\u5173\u95ED" }]
869
+ [_directive_track_click, "\u901A\u77E5\u680F-\u5173\u95ED"]
859
870
  ]) : createCommentVNode("v-if", true)
860
871
  ],
861
872
  6
@@ -1301,7 +1312,7 @@ var script$G = /* @__PURE__ */ defineComponent({
1301
1312
  2
1302
1313
  /* CLASS */
1303
1314
  )), [
1304
- [_directive_track_click, { event: "click", elementText: "\u8EAB\u4EFD\u8BC1\u8BC6\u522B-\u70B9\u51FB" }]
1315
+ [_directive_track_click, "\u8EAB\u4EFD\u8BC1\u8BC6\u522B-\u70B9\u51FB"]
1305
1316
  ]),
1306
1317
  createVNode(_component_nut_action_sheet, {
1307
1318
  visible: activeSheetVisible.value,
@@ -1430,7 +1441,7 @@ var script$F = /* @__PURE__ */ defineComponent({
1430
1441
  2
1431
1442
  /* CLASS */
1432
1443
  )), [
1433
- [_directive_track_click, { event: "click", elementText: "\u8425\u4E1A\u6267\u7167\u8BC6\u522B-\u70B9\u51FB" }]
1444
+ [_directive_track_click, "\u8425\u4E1A\u6267\u7167\u8BC6\u522B-\u70B9\u51FB"]
1434
1445
  ]);
1435
1446
  };
1436
1447
  }
@@ -1610,26 +1621,75 @@ class TrackingSDK {
1610
1621
  if (typeof btoa !== "undefined") {
1611
1622
  base64 = btoa(unescape(encodeURIComponent(raw)));
1612
1623
  } else {
1613
- base64 = this.base64Encode(raw);
1624
+ base64 = this.btoa(raw);
1614
1625
  }
1615
1626
  return base64.split("").reverse().join("");
1616
1627
  }
1617
1628
  /**
1618
- * Base64 编码(降级方案)
1629
+ * 手动实现 btoa 方法(小程序端降级方案)
1630
+ * 与浏览器 btoa(unescape(encodeURIComponent(str))) 行为一致
1631
+ * @param str 要编码的字符串
1632
+ * @returns Base64 编码后的字符串
1619
1633
  */
1620
- base64Encode(str) {
1621
- const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
1634
+ btoa(str) {
1635
+ const utf8Bytes = [];
1636
+ for (let i = 0; i < str.length; i++) {
1637
+ const codePoint = str.charCodeAt(i);
1638
+ if (codePoint < 128) {
1639
+ utf8Bytes.push(codePoint);
1640
+ } else if (codePoint < 2048) {
1641
+ utf8Bytes.push(192 | codePoint >> 6);
1642
+ utf8Bytes.push(128 | codePoint & 63);
1643
+ } else if (codePoint >= 55296 && codePoint <= 56319) {
1644
+ if (i + 1 < str.length) {
1645
+ const lowSurrogate = str.charCodeAt(i + 1);
1646
+ if (lowSurrogate >= 56320 && lowSurrogate <= 57343) {
1647
+ const unicodeCodePoint = 65536 + ((codePoint & 1023) << 10) + (lowSurrogate & 1023);
1648
+ utf8Bytes.push(240 | unicodeCodePoint >> 18);
1649
+ utf8Bytes.push(128 | unicodeCodePoint >> 12 & 63);
1650
+ utf8Bytes.push(128 | unicodeCodePoint >> 6 & 63);
1651
+ utf8Bytes.push(128 | unicodeCodePoint & 63);
1652
+ i++;
1653
+ continue;
1654
+ }
1655
+ }
1656
+ utf8Bytes.push(239, 191, 189);
1657
+ } else {
1658
+ utf8Bytes.push(224 | codePoint >> 12);
1659
+ utf8Bytes.push(128 | codePoint >> 6 & 63);
1660
+ utf8Bytes.push(128 | codePoint & 63);
1661
+ }
1662
+ }
1663
+ return this.base64EncodeBytes(utf8Bytes);
1664
+ }
1665
+ /**
1666
+ * Base64 编码(字节数组版本)
1667
+ * @param bytes 字节数组
1668
+ * @returns Base64 编码后的字符串
1669
+ */
1670
+ base64EncodeBytes(bytes) {
1671
+ const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
1622
1672
  let output = "";
1623
1673
  let i = 0;
1624
- while (i < str.length) {
1625
- const a = str.charCodeAt(i++);
1626
- const b = i < str.length ? str.charCodeAt(i++) : 0;
1627
- const c = i < str.length ? str.charCodeAt(i++) : 0;
1674
+ while (i < bytes.length) {
1675
+ const a = bytes[i++];
1676
+ const hasB = i < bytes.length;
1677
+ const b = hasB ? bytes[i++] : 0;
1678
+ const hasC = i < bytes.length;
1679
+ const c = hasC ? bytes[i++] : 0;
1628
1680
  const bitmap = a << 16 | b << 8 | c;
1629
1681
  output += chars.charAt(bitmap >> 18 & 63);
1630
1682
  output += chars.charAt(bitmap >> 12 & 63);
1631
- output += i - 2 < str.length ? chars.charAt(bitmap >> 6 & 63) : "=";
1632
- output += i - 1 < str.length ? chars.charAt(bitmap & 63) : "=";
1683
+ if (hasB) {
1684
+ output += chars.charAt(bitmap >> 6 & 63);
1685
+ if (hasC) {
1686
+ output += chars.charAt(bitmap & 63);
1687
+ } else {
1688
+ output += "=";
1689
+ }
1690
+ } else {
1691
+ output += "==";
1692
+ }
1633
1693
  }
1634
1694
  return output;
1635
1695
  }
@@ -1942,19 +2002,20 @@ class TrackingSDK {
1942
2002
  * 发送埋点数据
1943
2003
  */
1944
2004
  async flush() {
2005
+ console.log(this.eventQueue.length, "this.eventQueue.length");
1945
2006
  if (this.eventQueue.length === 0) return;
1946
2007
  const events = [...this.eventQueue];
1947
2008
  this.eventQueue = [];
1948
2009
  try {
1949
2010
  const jsonStr = JSON.stringify(events);
1950
- const compressed = pako.deflate(jsonStr);
2011
+ const compressed = getEnv() === "WEAPP" ? jsonStr : pako.deflate(jsonStr);
1951
2012
  const encryptedToken = this.encryptToken();
1952
2013
  const { success } = await this.http({
1953
2014
  url: `${this.config.apiEndpoint}?contentId=${encryptedToken}`,
1954
2015
  method: "POST",
1955
2016
  data: compressed,
1956
2017
  header: {
1957
- "Content-Encoding": "deflate"
2018
+ "Content-Encoding": getEnv() === "WEAPP" ? "" : "deflate"
1958
2019
  }
1959
2020
  });
1960
2021
  if (success && this.config.debug) {
@@ -2131,10 +2192,10 @@ class TrackingSDK {
2131
2192
  flushNow() {
2132
2193
  if (this.eventQueue.length === 0) return;
2133
2194
  const events = [...this.eventQueue];
2134
- this.eventQueue = [];
2135
2195
  try {
2136
2196
  const env = getEnv();
2137
2197
  if (env === "WEB" && typeof navigator !== "undefined" && navigator.sendBeacon) {
2198
+ this.eventQueue = [];
2138
2199
  const blob = new Blob([JSON.stringify(events)], {
2139
2200
  type: "application/json"
2140
2201
  });
@@ -3007,7 +3068,7 @@ var script$E = /* @__PURE__ */ defineComponent({
3007
3068
  /* CACHED */
3008
3069
  )
3009
3070
  ])])), [
3010
- [_directive_track_click, "click"]
3071
+ [_directive_track_click]
3011
3072
  ])
3012
3073
  ]),
3013
3074
  _: 1
@@ -3031,7 +3092,7 @@ var script$E = /* @__PURE__ */ defineComponent({
3031
3092
  _: 1
3032
3093
  /* STABLE */
3033
3094
  }, 8, ["loading"])), [
3034
- [_directive_track_click, "click"]
3095
+ [_directive_track_click]
3035
3096
  ])
3036
3097
  ])
3037
3098
  ]);
@@ -3120,7 +3181,7 @@ var script$C = /* @__PURE__ */ defineComponent({
3120
3181
  _: 1
3121
3182
  /* STABLE */
3122
3183
  })), [
3123
- [_directive_track_click, "click"]
3184
+ [_directive_track_click]
3124
3185
  ])
3125
3186
  ])
3126
3187
  ]);
@@ -3464,7 +3525,7 @@ var script$A = /* @__PURE__ */ defineComponent({
3464
3525
  /* CACHED */
3465
3526
  )
3466
3527
  ])])), [
3467
- [_directive_track_click, "click"]
3528
+ [_directive_track_click]
3468
3529
  ])
3469
3530
  ]),
3470
3531
  _: 1
@@ -3510,7 +3571,7 @@ var script$A = /* @__PURE__ */ defineComponent({
3510
3571
  _: 1
3511
3572
  /* STABLE */
3512
3573
  }, 8, ["loading"])), [
3513
- [_directive_track_click, "click"]
3574
+ [_directive_track_click]
3514
3575
  ])
3515
3576
  ])
3516
3577
  ]),
@@ -3671,23 +3732,11 @@ var script$z = /* @__PURE__ */ defineComponent({
3671
3732
  /* CACHED */
3672
3733
  )
3673
3734
  ])])), [
3674
- [_directive_track_click, "click"]
3735
+ [_directive_track_click]
3675
3736
  ])
3676
3737
  ])
3677
3738
  ]),
3678
- createCommentVNode(` <div class="line"></div>
3679
- <div class="card-row">
3680
- <div class="card-row-left desc">\u6743\u76CA\u4F7F\u7528\u65F6\u81EA\u52A8\u6263\u51CF\u4E91\u8C46</div>
3681
- <div class="card-row-right">
3682
- <div class="pay" v-track-click="'click'" @click="gotoRecharge">
3683
- <div>\u5145\u503C</div>
3684
- <img
3685
- class="pay-icon"
3686
- src="https://cdn.ddjf.com/static/images/bpms-workBench/bean-right.png"
3687
- />
3688
- </div>
3689
- </div>
3690
- </div> `)
3739
+ createCommentVNode(' <div class="line"></div>\n <div class="card-row">\n <div class="card-row-left desc">\u6743\u76CA\u4F7F\u7528\u65F6\u81EA\u52A8\u6263\u51CF\u4E91\u8C46</div>\n <div class="card-row-right">\n <div class="pay" v-track-click @click="gotoRecharge">\n <div>\u5145\u503C</div>\n <img\n class="pay-icon"\n src="https://cdn.ddjf.com/static/images/bpms-workBench/bean-right.png"\n />\n </div>\n </div>\n </div> ')
3691
3740
  ])
3692
3741
  ]);
3693
3742
  };
@@ -3833,7 +3882,7 @@ var script$y = /* @__PURE__ */ defineComponent({
3833
3882
  /* CACHED */
3834
3883
  )
3835
3884
  ])])), [
3836
- [_directive_track_click, { event: "click", elementText: "\u9009\u62E9\u7B5B\u9009\u9879-\u786E\u5B9A" }]
3885
+ [_directive_track_click, "\u9009\u62E9\u7B5B\u9009\u9879-\u786E\u5B9A"]
3837
3886
  ])
3838
3887
  ]),
3839
3888
  _cache[2] || (_cache[2] = createElementVNode(
@@ -3991,7 +4040,7 @@ var script$x = /* @__PURE__ */ defineComponent({
3991
4040
  /* CACHED */
3992
4041
  )
3993
4042
  ])])), [
3994
- [_directive_track_click, { event: "click", elementText: "\u65E5\u671F\u9009\u62E9-\u786E\u5B9A" }]
4043
+ [_directive_track_click, "\u65E5\u671F\u9009\u62E9-\u786E\u5B9A"]
3995
4044
  ])
3996
4045
  ]),
3997
4046
  _cache[8] || (_cache[8] = createElementVNode(
@@ -4071,7 +4120,7 @@ var script$w = /* @__PURE__ */ defineComponent({
4071
4120
  /* CACHED */
4072
4121
  )
4073
4122
  ])])), [
4074
- [_directive_track_click, { event: "click", elementText: "\u89C4\u5219\u8BF4\u660E-\u6211\u77E5\u9053\u4E86" }]
4123
+ [_directive_track_click, "\u89C4\u5219\u8BF4\u660E-\u6211\u77E5\u9053\u4E86"]
4075
4124
  ])
4076
4125
  ]);
4077
4126
  };
@@ -4412,7 +4461,7 @@ var script$t = /* @__PURE__ */ defineComponent({
4412
4461
  /* CACHED */
4413
4462
  )
4414
4463
  ])])), [
4415
- [_directive_track_click, "click"]
4464
+ [_directive_track_click]
4416
4465
  ])
4417
4466
  ]),
4418
4467
  createElementVNode("div", _hoisted_4$a, [
@@ -4441,7 +4490,7 @@ var script$t = /* @__PURE__ */ defineComponent({
4441
4490
  /* CACHED */
4442
4491
  )
4443
4492
  ])])), [
4444
- [_directive_track_click, "click"]
4493
+ [_directive_track_click]
4445
4494
  ]) : createCommentVNode("v-if", true)
4446
4495
  ]),
4447
4496
  createElementVNode("div", _hoisted_6$6, [
@@ -4463,7 +4512,7 @@ var script$t = /* @__PURE__ */ defineComponent({
4463
4512
  /* CACHED */
4464
4513
  )
4465
4514
  ])])), [
4466
- [_directive_track_click, "click"]
4515
+ [_directive_track_click]
4467
4516
  ]) : createCommentVNode("v-if", true)
4468
4517
  ])
4469
4518
  ]),
@@ -4519,7 +4568,7 @@ var script$t = /* @__PURE__ */ defineComponent({
4519
4568
  /* CACHED */
4520
4569
  )
4521
4570
  ])], 8, _hoisted_13$1)), [
4522
- [_directive_track_click, "click"]
4571
+ [_directive_track_click]
4523
4572
  ]),
4524
4573
  _cache[12] || (_cache[12] = createElementVNode(
4525
4574
  "img",
@@ -4582,7 +4631,7 @@ var script$t = /* @__PURE__ */ defineComponent({
4582
4631
  /* CACHED */
4583
4632
  )
4584
4633
  ])], 8, _hoisted_19$1)), [
4585
- [_directive_track_click, "click"]
4634
+ [_directive_track_click]
4586
4635
  ]),
4587
4636
  _cache[15] || (_cache[15] = createElementVNode(
4588
4637
  "img",
@@ -4774,7 +4823,7 @@ var script$t = /* @__PURE__ */ defineComponent({
4774
4823
  /* CACHED */
4775
4824
  )
4776
4825
  ])])), [
4777
- [_directive_track_click, "click"]
4826
+ [_directive_track_click]
4778
4827
  ])
4779
4828
  ],
4780
4829
  2
@@ -4964,7 +5013,7 @@ var script$s = /* @__PURE__ */ defineComponent({
4964
5013
  _: 1
4965
5014
  /* STABLE */
4966
5015
  })), [
4967
- [_directive_track_click, "click"]
5016
+ [_directive_track_click]
4968
5017
  ])
4969
5018
  ])
4970
5019
  ])
@@ -5052,7 +5101,7 @@ var script$r = /* @__PURE__ */ defineComponent({
5052
5101
  /* CACHED */
5053
5102
  ))
5054
5103
  ])), [
5055
- [_directive_track_click, { event: "click", elementText: "\u65E5\u671F\u8303\u56F4-\u70B9\u51FB" }]
5104
+ [_directive_track_click, "\u65E5\u671F\u8303\u56F4-\u70B9\u51FB"]
5056
5105
  ]),
5057
5106
  createVNode(_component_nut_popup, {
5058
5107
  position: "bottom",
@@ -5203,7 +5252,7 @@ var script$q = /* @__PURE__ */ defineComponent({
5203
5252
  /* CACHED */
5204
5253
  )
5205
5254
  ])])), [
5206
- [_directive_track_click, { event: "click", elementText: "\u9009\u62E9\u7B5B\u9009\u9879-\u786E\u5B9A" }]
5255
+ [_directive_track_click, "\u9009\u62E9\u7B5B\u9009\u9879-\u786E\u5B9A"]
5207
5256
  ])
5208
5257
  ]),
5209
5258
  _cache[2] || (_cache[2] = createElementVNode(
@@ -5275,7 +5324,7 @@ var script$p = /* @__PURE__ */ defineComponent({
5275
5324
  /* CACHED */
5276
5325
  )
5277
5326
  ])])), [
5278
- [_directive_track_click, { event: "click", elementText: "\u7B5B\u9009-\u70B9\u51FB" }]
5327
+ [_directive_track_click, "\u7B5B\u9009-\u70B9\u51FB"]
5279
5328
  ]);
5280
5329
  };
5281
5330
  }
@@ -5446,7 +5495,7 @@ var script$o = /* @__PURE__ */ defineComponent({
5446
5495
  alt: ""
5447
5496
  }, null, 8, _hoisted_3$b)
5448
5497
  ])), [
5449
- [_directive_track_click, "click"]
5498
+ [_directive_track_click]
5450
5499
  ]) : createCommentVNode("v-if", true),
5451
5500
  createElementVNode("div", _hoisted_4$7, [
5452
5501
  __props.applyRecord.accessCheckStatus === "Y" ? (openBlock(), createElementBlock("div", _hoisted_5$6, [
@@ -5492,7 +5541,7 @@ var script$o = /* @__PURE__ */ defineComponent({
5492
5541
  512
5493
5542
  /* NEED_PATCH */
5494
5543
  ), [
5495
- [_directive_track_click, { event: "click", elementText: "\u4EA7\u54C1\u9500\u552E\u6536\u76CA-\u8BF4\u660E" }]
5544
+ [_directive_track_click, "\u4EA7\u54C1\u9500\u552E\u6536\u76CA-\u8BF4\u660E"]
5496
5545
  ])
5497
5546
  ]),
5498
5547
  withDirectives((openBlock(), createElementBlock("div", {
@@ -5510,7 +5559,7 @@ var script$o = /* @__PURE__ */ defineComponent({
5510
5559
  alt: ""
5511
5560
  }, null, 8, _hoisted_8$3)
5512
5561
  ])), [
5513
- [_directive_track_click, "click"]
5562
+ [_directive_track_click]
5514
5563
  ])
5515
5564
  ],
5516
5565
  64
@@ -5536,7 +5585,7 @@ var script$o = /* @__PURE__ */ defineComponent({
5536
5585
  512
5537
5586
  /* NEED_PATCH */
5538
5587
  ), [
5539
- [_directive_track_click, { event: "click", elementText: "\u5206\u9500\u8FD4\u4F63\u6536\u76CA-\u8BF4\u660E" }]
5588
+ [_directive_track_click, "\u5206\u9500\u8FD4\u4F63\u6536\u76CA-\u8BF4\u660E"]
5540
5589
  ])
5541
5590
  ]),
5542
5591
  withDirectives((openBlock(), createElementBlock("div", {
@@ -5554,7 +5603,7 @@ var script$o = /* @__PURE__ */ defineComponent({
5554
5603
  alt: ""
5555
5604
  }, null, 8, _hoisted_12$1)
5556
5605
  ])), [
5557
- [_directive_track_click, "click"]
5606
+ [_directive_track_click]
5558
5607
  ])
5559
5608
  ])) : createCommentVNode("v-if", true)
5560
5609
  ])
@@ -6220,7 +6269,7 @@ var script$k = /* @__PURE__ */ defineComponent({
6220
6269
  _: 1
6221
6270
  /* STABLE */
6222
6271
  })), [
6223
- [_directive_track_click, "click"]
6272
+ [_directive_track_click]
6224
6273
  ])
6225
6274
  ])
6226
6275
  ]);
@@ -6442,7 +6491,7 @@ var script$j = /* @__PURE__ */ defineComponent({
6442
6491
  /* CACHED */
6443
6492
  )
6444
6493
  ])])), [
6445
- [_directive_track_click, "click"]
6494
+ [_directive_track_click]
6446
6495
  ]) : createCommentVNode("v-if", true)
6447
6496
  ]),
6448
6497
  createElementVNode("div", _hoisted_3$9, [
@@ -6456,7 +6505,7 @@ var script$j = /* @__PURE__ */ defineComponent({
6456
6505
  /* CACHED */
6457
6506
  )
6458
6507
  ])])), [
6459
- [_directive_track_click, { event: "click", elementText: "\u7CFB\u7EDF\u516C\u544A-\u6211\u77E5\u9053\u4E86" }]
6508
+ [_directive_track_click, "\u7CFB\u7EDF\u516C\u544A-\u6211\u77E5\u9053\u4E86"]
6460
6509
  ])
6461
6510
  ])
6462
6511
  ]),
@@ -6668,13 +6717,13 @@ var script$i = /* @__PURE__ */ defineComponent({
6668
6717
  /* CACHED */
6669
6718
  )
6670
6719
  ])], 8, _hoisted_2$d)), [
6671
- [_directive_track_click, { event: "click", elementText: "\u901A\u77E5\u680F-\u8BE6\u60C5" }]
6720
+ [_directive_track_click, "\u901A\u77E5\u680F-\u8BE6\u60C5"]
6672
6721
  ])
6673
6722
  ]),
6674
6723
  _: 2
6675
6724
  /* DYNAMIC */
6676
6725
  }, 1032, ["class", "showClose", "onClose"])), [
6677
- [_directive_track_click, { event: "click", elementText: "\u901A\u77E5\u680F-\u5173\u95ED" }]
6726
+ [_directive_track_click, "\u901A\u77E5\u680F-\u5173\u95ED"]
6678
6727
  ]);
6679
6728
  }),
6680
6729
  128
@@ -7145,7 +7194,7 @@ var script$f = /* @__PURE__ */ defineComponent({
7145
7194
  /* CACHED */
7146
7195
  )
7147
7196
  ])], 8, _hoisted_7$3)), [
7148
- [_directive_track_click, { event: "click", elementText: "\u6D88\u606F\u8BE6\u60C5-\u9644\u4EF6" }]
7197
+ [_directive_track_click, "\u6D88\u606F\u8BE6\u60C5-\u9644\u4EF6"]
7149
7198
  ]) : createCommentVNode("v-if", true)
7150
7199
  ],
7151
7200
  2
@@ -7153,7 +7202,7 @@ var script$f = /* @__PURE__ */ defineComponent({
7153
7202
  )
7154
7203
  ])
7155
7204
  ], 10, _hoisted_4$5)), [
7156
- [_directive_track_click, { event: "click", elementText: "\u6D88\u606F\u8BE6\u60C5" }]
7205
+ [_directive_track_click, "\u6D88\u606F\u8BE6\u60C5"]
7157
7206
  ]);
7158
7207
  }),
7159
7208
  128
@@ -7356,7 +7405,7 @@ var script$e = /* @__PURE__ */ defineComponent({
7356
7405
  /* CACHED */
7357
7406
  )
7358
7407
  ])])), [
7359
- [_directive_track_click, "click"]
7408
+ [_directive_track_click]
7360
7409
  ])
7361
7410
  ])) : createCommentVNode("v-if", true)
7362
7411
  ],
@@ -7432,10 +7481,7 @@ var script$e = /* @__PURE__ */ defineComponent({
7432
7481
  _: 2
7433
7482
  /* DYNAMIC */
7434
7483
  }, 1032, ["onClick"])), [
7435
- [_directive_track_click, {
7436
- event: "click",
7437
- elementText: "\u6D88\u606F\u8BE6\u60C5"
7438
- }]
7484
+ [_directive_track_click, "\u6D88\u606F\u8BE6\u60C5"]
7439
7485
  ])
7440
7486
  ]),
7441
7487
  _: 1
@@ -7504,7 +7550,7 @@ var script$d = /* @__PURE__ */ defineComponent({
7504
7550
  src: __props.avatar,
7505
7551
  alt: ""
7506
7552
  }, null, 8, _hoisted_3$5)), [
7507
- [_directive_track_click, { event: "click", elementText: "\u7528\u6237\u5165\u53E3-\u5934\u50CF" }]
7553
+ [_directive_track_click, "\u7528\u6237\u5165\u53E3-\u5934\u50CF"]
7508
7554
  ]) : withDirectives((openBlock(), createElementBlock(
7509
7555
  "img",
7510
7556
  {
@@ -7519,7 +7565,7 @@ var script$d = /* @__PURE__ */ defineComponent({
7519
7565
  512
7520
7566
  /* NEED_PATCH */
7521
7567
  )), [
7522
- [_directive_track_click, { event: "click", elementText: "\u7528\u6237\u5165\u53E3-\u5934\u50CF" }]
7568
+ [_directive_track_click, "\u7528\u6237\u5165\u53E3-\u5934\u50CF"]
7523
7569
  ])
7524
7570
  ]),
7525
7571
  createElementVNode("div", _hoisted_4$4, [
@@ -7546,7 +7592,7 @@ var script$d = /* @__PURE__ */ defineComponent({
7546
7592
  /* CACHED */
7547
7593
  )
7548
7594
  ])])), [
7549
- [_directive_track_click, { event: "click", elementText: "\u7528\u6237\u5165\u53E3-\u8BF7\u767B\u5F55" }]
7595
+ [_directive_track_click, "\u7528\u6237\u5165\u53E3-\u8BF7\u767B\u5F55"]
7550
7596
  ]) : (openBlock(), createElementBlock(
7551
7597
  Fragment,
7552
7598
  { key: 1 },
@@ -7573,7 +7619,7 @@ var script$d = /* @__PURE__ */ defineComponent({
7573
7619
  /* CACHED */
7574
7620
  ))
7575
7621
  ])), [
7576
- [_directive_track_click, { event: "click", elementText: "\u7528\u6237\u5165\u53E3-\u7528\u6237\u540D" }]
7622
+ [_directive_track_click, "\u7528\u6237\u5165\u53E3-\u7528\u6237\u540D"]
7577
7623
  ]),
7578
7624
  withDirectives((openBlock(), createElementBlock("div", {
7579
7625
  onClick: toUser,
@@ -7585,7 +7631,7 @@ var script$d = /* @__PURE__ */ defineComponent({
7585
7631
  /* TEXT */
7586
7632
  )
7587
7633
  ])), [
7588
- [_directive_track_click, { event: "click", elementText: "\u7528\u6237\u5165\u53E3-\u624B\u673A\u53F7" }]
7634
+ [_directive_track_click, "\u7528\u6237\u5165\u53E3-\u624B\u673A\u53F7"]
7589
7635
  ])
7590
7636
  ],
7591
7637
  64
@@ -8066,7 +8112,7 @@ var script$b = /* @__PURE__ */ defineComponent({
8066
8112
  /* CACHED */
8067
8113
  ))
8068
8114
  ])), [
8069
- [_directive_track_click, { event: "click", elementText: "\u7528\u6237\u4FE1\u606F-\u5934\u50CF" }]
8115
+ [_directive_track_click, "\u7528\u6237\u4FE1\u606F-\u5934\u50CF"]
8070
8116
  ]),
8071
8117
  withDirectives(createVNode(_component_nut_cell, {
8072
8118
  title: "\u767B\u5F55\u624B\u673A\u53F7",
@@ -8074,7 +8120,7 @@ var script$b = /* @__PURE__ */ defineComponent({
8074
8120
  desc: unref(encodePhone)(userInfo.value.mobile || ""),
8075
8121
  onClick: toBinding
8076
8122
  }, null, 8, ["desc"]), [
8077
- [_directive_track_click, { event: "click", elementText: "\u7528\u6237\u4FE1\u606F-\u767B\u5F55\u624B\u673A\u53F7" }]
8123
+ [_directive_track_click, "\u7528\u6237\u4FE1\u606F-\u767B\u5F55\u624B\u673A\u53F7"]
8078
8124
  ]),
8079
8125
  props.isPersonal ? withDirectives((openBlock(), createBlock(_component_nut_cell, {
8080
8126
  key: 0,
@@ -8083,7 +8129,7 @@ var script$b = /* @__PURE__ */ defineComponent({
8083
8129
  onClick: onNickNameChange,
8084
8130
  desc: userInfo.value?.nickName || "--"
8085
8131
  }, null, 8, ["desc"])), [
8086
- [_directive_track_click, { event: "click", elementText: "\u7528\u6237\u4FE1\u606F-\u6635\u79F0" }]
8132
+ [_directive_track_click, "\u7528\u6237\u4FE1\u606F-\u6635\u79F0"]
8087
8133
  ]) : (openBlock(), createBlock(_component_nut_cell, {
8088
8134
  key: 1,
8089
8135
  title: "\u6635\u79F0",
@@ -8102,7 +8148,7 @@ var script$b = /* @__PURE__ */ defineComponent({
8102
8148
  _: 1
8103
8149
  /* STABLE */
8104
8150
  })), [
8105
- [_directive_track_click, { event: "click", elementText: "\u7528\u6237\u4FE1\u606F-\u8BA4\u8BC1\u4FE1\u606F" }]
8151
+ [_directive_track_click, "\u7528\u6237\u4FE1\u606F-\u8BA4\u8BC1\u4FE1\u606F"]
8106
8152
  ])
8107
8153
  ]),
8108
8154
  __props.hasQiyezuhu ? (openBlock(), createElementBlock("div", _hoisted_8$1, "\u4F01\u4E1A/\u56E2\u961F")) : createCommentVNode("v-if", true),
@@ -8172,7 +8218,7 @@ var script$b = /* @__PURE__ */ defineComponent({
8172
8218
  /* CLASS */
8173
8219
  )
8174
8220
  ], 8, _hoisted_16)), [
8175
- [_directive_track_click, { event: "click", elementText: "\u7528\u6237\u4FE1\u606F-\u89D2\u8272\u8BE6\u60C5" }]
8221
+ [_directive_track_click, "\u7528\u6237\u4FE1\u606F-\u89D2\u8272\u8BE6\u60C5"]
8176
8222
  ])
8177
8223
  ])) : createCommentVNode("v-if", true),
8178
8224
  item.showRole ? (openBlock(), createElementBlock("div", _hoisted_17, [
@@ -8216,7 +8262,7 @@ var script$b = /* @__PURE__ */ defineComponent({
8216
8262
  src: "https://cdn.ddjf.com/static/images/appkit/edit.png",
8217
8263
  alt: ""
8218
8264
  }, null, 8, _hoisted_21), [
8219
- [_directive_track_click, { event: "click", elementText: "\u7528\u6237\u4FE1\u606F-\u7528\u6237\u540D" }]
8265
+ [_directive_track_click, "\u7528\u6237\u4FE1\u606F-\u7528\u6237\u540D"]
8220
8266
  ])
8221
8267
  ]),
8222
8268
  createElementVNode("div", _hoisted_22, [
@@ -8265,7 +8311,7 @@ var script$b = /* @__PURE__ */ defineComponent({
8265
8311
  _: 1
8266
8312
  /* STABLE */
8267
8313
  })), [
8268
- [_directive_track_click, { event: "click", elementText: "\u7528\u6237\u4FE1\u606F-\u9000\u51FA\u767B\u5F55" }]
8314
+ [_directive_track_click, "\u7528\u6237\u4FE1\u606F-\u9000\u51FA\u767B\u5F55"]
8269
8315
  ]) : createCommentVNode("v-if", true)
8270
8316
  ])
8271
8317
  ]))
@@ -8298,7 +8344,7 @@ var script$b = /* @__PURE__ */ defineComponent({
8298
8344
  _: 1
8299
8345
  /* STABLE */
8300
8346
  })), [
8301
- [_directive_track_click, { event: "click", elementText: "\u7528\u6237\u4FE1\u606F-\u4FEE\u6539\u7528\u6237\u540D-\u53D6\u6D88" }]
8347
+ [_directive_track_click, "\u7528\u6237\u4FE1\u606F-\u4FEE\u6539\u7528\u6237\u540D-\u53D6\u6D88"]
8302
8348
  ]),
8303
8349
  withDirectives((openBlock(), createBlock(_component_nut_button, {
8304
8350
  class: "change-username-popup-ok",
@@ -8315,7 +8361,7 @@ var script$b = /* @__PURE__ */ defineComponent({
8315
8361
  _: 1
8316
8362
  /* STABLE */
8317
8363
  })), [
8318
- [_directive_track_click, { event: "click", elementText: "\u7528\u6237\u4FE1\u606F-\u4FEE\u6539\u7528\u6237\u540D-\u786E\u5B9A" }]
8364
+ [_directive_track_click, "\u7528\u6237\u4FE1\u606F-\u4FEE\u6539\u7528\u6237\u540D-\u786E\u5B9A"]
8319
8365
  ])
8320
8366
  ]),
8321
8367
  default: withCtx(() => [
@@ -8354,7 +8400,7 @@ var script$b = /* @__PURE__ */ defineComponent({
8354
8400
  _: 1
8355
8401
  /* STABLE */
8356
8402
  })), [
8357
- [_directive_track_click, { event: "click", elementText: "\u7528\u6237\u4FE1\u606F-\u4FEE\u6539\u6635\u79F0-\u53D6\u6D88" }]
8403
+ [_directive_track_click, "\u7528\u6237\u4FE1\u606F-\u4FEE\u6539\u6635\u79F0-\u53D6\u6D88"]
8358
8404
  ]),
8359
8405
  withDirectives((openBlock(), createBlock(_component_nut_button, {
8360
8406
  class: "change-username-popup-ok",
@@ -8371,7 +8417,7 @@ var script$b = /* @__PURE__ */ defineComponent({
8371
8417
  _: 1
8372
8418
  /* STABLE */
8373
8419
  })), [
8374
- [_directive_track_click, { event: "click", elementText: "\u7528\u6237\u4FE1\u606F-\u4FEE\u6539\u6635\u79F0-\u786E\u5B9A" }]
8420
+ [_directive_track_click, "\u7528\u6237\u4FE1\u606F-\u4FEE\u6539\u6635\u79F0-\u786E\u5B9A"]
8375
8421
  ])
8376
8422
  ]),
8377
8423
  default: withCtx(() => [
@@ -8421,7 +8467,7 @@ var script$b = /* @__PURE__ */ defineComponent({
8421
8467
  /* CACHED */
8422
8468
  )
8423
8469
  ])])), [
8424
- [_directive_track_click, { event: "click", elementText: "\u7528\u6237\u4FE1\u606F-\u66F4\u6362\u5934\u50CF" }]
8470
+ [_directive_track_click, "\u7528\u6237\u4FE1\u606F-\u66F4\u6362\u5934\u50CF"]
8425
8471
  ])
8426
8472
  ])
8427
8473
  ]),
@@ -8620,7 +8666,7 @@ var script$a = /* @__PURE__ */ defineComponent({
8620
8666
  _: 1
8621
8667
  /* STABLE */
8622
8668
  }, 8, ["disabled"])), [
8623
- [_directive_track_click, { event: "click", elementText: "\u6362\u7ED1\u624B\u673A-\u83B7\u53D6\u9A8C\u8BC1\u7801" }]
8669
+ [_directive_track_click, "\u6362\u7ED1\u624B\u673A-\u83B7\u53D6\u9A8C\u8BC1\u7801"]
8624
8670
  ])
8625
8671
  ]),
8626
8672
  _: 1
@@ -8651,7 +8697,7 @@ var script$a = /* @__PURE__ */ defineComponent({
8651
8697
  _: 1
8652
8698
  /* STABLE */
8653
8699
  }, 8, ["disabled"])), [
8654
- [_directive_track_click, { event: "click", elementText: "\u6362\u7ED1\u624B\u673A-\u63D0\u4EA4" }]
8700
+ [_directive_track_click, "\u6362\u7ED1\u624B\u673A-\u63D0\u4EA4"]
8655
8701
  ])
8656
8702
  ])) : (openBlock(), createElementBlock("div", _hoisted_5$2, [
8657
8703
  createVNode(_component_nut_form, null, {
@@ -8701,7 +8747,7 @@ var script$a = /* @__PURE__ */ defineComponent({
8701
8747
  _: 1
8702
8748
  /* STABLE */
8703
8749
  }, 8, ["disabled"])), [
8704
- [_directive_track_click, { event: "click", elementText: "\u6362\u7ED1\u624B\u673A-\u83B7\u53D6\u9A8C\u8BC1\u7801" }]
8750
+ [_directive_track_click, "\u6362\u7ED1\u624B\u673A-\u83B7\u53D6\u9A8C\u8BC1\u7801"]
8705
8751
  ])
8706
8752
  ]),
8707
8753
  _: 1
@@ -8732,7 +8778,7 @@ var script$a = /* @__PURE__ */ defineComponent({
8732
8778
  _: 1
8733
8779
  /* STABLE */
8734
8780
  }, 8, ["disabled"])), [
8735
- [_directive_track_click, { event: "click", elementText: "\u6362\u7ED1\u624B\u673A-\u63D0\u4EA4" }]
8781
+ [_directive_track_click, "\u6362\u7ED1\u624B\u673A-\u63D0\u4EA4"]
8736
8782
  ])
8737
8783
  ]))
8738
8784
  ]);
@@ -8807,7 +8853,7 @@ var script$9 = /* @__PURE__ */ defineComponent({
8807
8853
  _: 1
8808
8854
  /* STABLE */
8809
8855
  })), [
8810
- [_directive_track_click, "click"]
8856
+ [_directive_track_click]
8811
8857
  ])
8812
8858
  ]);
8813
8859
  };
@@ -9687,7 +9733,7 @@ var script$7 = /* @__PURE__ */ defineComponent({
9687
9733
  /* CACHED */
9688
9734
  )
9689
9735
  ])])), [
9690
- [_directive_track_click, { event: "click", elementText: "\u5934\u50CF\u88C1\u526A-\u53D6\u6D88" }]
9736
+ [_directive_track_click, "\u5934\u50CF\u88C1\u526A-\u53D6\u6D88"]
9691
9737
  ]),
9692
9738
  withDirectives((openBlock(), createElementBlock("div", {
9693
9739
  class: "cbtn comfirmBtn",
@@ -9699,7 +9745,7 @@ var script$7 = /* @__PURE__ */ defineComponent({
9699
9745
  /* CACHED */
9700
9746
  )
9701
9747
  ])])), [
9702
- [_directive_track_click, { event: "click", elementText: "\u5934\u50CF\u88C1\u526A-\u786E\u5B9A" }]
9748
+ [_directive_track_click, "\u5934\u50CF\u88C1\u526A-\u786E\u5B9A"]
9703
9749
  ])
9704
9750
  ])
9705
9751
  ]),
@@ -10249,7 +10295,7 @@ var script$5 = /* @__PURE__ */ defineComponent({
10249
10295
  36
10250
10296
  /* STYLE, NEED_HYDRATION */
10251
10297
  )), [
10252
- [_directive_track_click, { event: "click", elementText: "\u53CD\u9988\u5165\u53E3-\u70B9\u51FB" }]
10298
+ [_directive_track_click, "\u53CD\u9988\u5165\u53E3-\u70B9\u51FB"]
10253
10299
  ]) : (openBlock(), createElementBlock(
10254
10300
  "div",
10255
10301
  {
@@ -10274,7 +10320,7 @@ var script$5 = /* @__PURE__ */ defineComponent({
10274
10320
  512
10275
10321
  /* NEED_PATCH */
10276
10322
  ), [
10277
- [_directive_track_click, { event: "click", elementText: "\u53CD\u9988\u5165\u53E3-\u70B9\u51FB" }]
10323
+ [_directive_track_click, "\u53CD\u9988\u5165\u53E3-\u70B9\u51FB"]
10278
10324
  ]),
10279
10325
  withDirectives((openBlock(), createElementBlock("div", {
10280
10326
  class: "user-feedback-entry-close",
@@ -10291,7 +10337,7 @@ var script$5 = /* @__PURE__ */ defineComponent({
10291
10337
  /* CACHED */
10292
10338
  )
10293
10339
  ])])), [
10294
- [_directive_track_click, { event: "click", elementText: "\u53CD\u9988\u5165\u53E3-\u5173\u95ED" }]
10340
+ [_directive_track_click, "\u53CD\u9988\u5165\u53E3-\u5173\u95ED"]
10295
10341
  ])
10296
10342
  ],
10297
10343
  36
@@ -10639,7 +10685,7 @@ var script$2 = /* @__PURE__ */ defineComponent({
10639
10685
  /* CACHED */
10640
10686
  )
10641
10687
  ])])), [
10642
- [_directive_track_click, { event: "click", elementText: "\u7528\u6237\u8BA4\u8BC1-\u4E2A\u4EBA\u4FE1\u606F\u6388\u6743\u534F\u8BAE" }]
10688
+ [_directive_track_click, "\u7528\u6237\u8BA4\u8BC1-\u4E2A\u4EBA\u4FE1\u606F\u6388\u6743\u534F\u8BAE"]
10643
10689
  ])
10644
10690
  ])) : createCommentVNode("v-if", true),
10645
10691
  !\u5DF2\u8BA4\u8BC1.value ? withDirectives((openBlock(), createBlock(unref(NsButton), {
@@ -10659,7 +10705,7 @@ var script$2 = /* @__PURE__ */ defineComponent({
10659
10705
  _: 1
10660
10706
  /* STABLE */
10661
10707
  })), [
10662
- [_directive_track_click, { event: "click", elementText: "\u7528\u6237\u8BA4\u8BC1-\u7ACB\u5373\u8BA4\u8BC1" }]
10708
+ [_directive_track_click, "\u7528\u6237\u8BA4\u8BC1-\u7ACB\u5373\u8BA4\u8BC1"]
10663
10709
  ]) : withDirectives((openBlock(), createBlock(unref(NsButton), {
10664
10710
  key: 2,
10665
10711
  class: "btn",
@@ -10677,7 +10723,7 @@ var script$2 = /* @__PURE__ */ defineComponent({
10677
10723
  _: 1
10678
10724
  /* STABLE */
10679
10725
  })), [
10680
- [_directive_track_click, { event: "click", elementText: "\u7528\u6237\u8BA4\u8BC1-\u8FD4\u56DE" }]
10726
+ [_directive_track_click, "\u7528\u6237\u8BA4\u8BC1-\u8FD4\u56DE"]
10681
10727
  ])
10682
10728
  ])
10683
10729
  ]),
@@ -11068,7 +11114,7 @@ var script = /* @__PURE__ */ defineComponent({
11068
11114
  _: 1
11069
11115
  /* STABLE */
11070
11116
  })), [
11071
- [_directive_track_click, { event: "click", elementText: "\u6D77\u62A5\u5206\u4EAB-\u53D6\u6D88" }]
11117
+ [_directive_track_click, "\u6D77\u62A5\u5206\u4EAB-\u53D6\u6D88"]
11072
11118
  ]),
11073
11119
  withDirectives((openBlock(), createBlock(_component_nut_button, {
11074
11120
  type: "primary",
@@ -11084,7 +11130,7 @@ var script = /* @__PURE__ */ defineComponent({
11084
11130
  _: 1
11085
11131
  /* STABLE */
11086
11132
  })), [
11087
- [_directive_track_click, { event: "click", elementText: "\u6D77\u62A5\u5206\u4EAB-\u786E\u5B9A" }]
11133
+ [_directive_track_click, "\u6D77\u62A5\u5206\u4EAB-\u786E\u5B9A"]
11088
11134
  ])
11089
11135
  ])
11090
11136
  ]),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxda/appkit",
3
- "version": "4.2.97",
3
+ "version": "4.3.0",
4
4
  "description": "小程序应用开发包",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.ts",
@@ -2,6 +2,7 @@
2
2
  * 记录阿里日志
3
3
  * 生产: https://sls.console.aliyun.com/lognext/project/ddyk-prod/logsearch/ddjf-internet-web
4
4
  */
5
+ import qs from 'qs'
5
6
  import { useAppKitOptions } from '../../Appkit'
6
7
  import Taro, { getSystemInfoSync, request } from '@tarojs/taro'
7
8
 
@@ -89,9 +90,21 @@ export function useLogger(options?: LogType) {
89
90
  const pages = Taro.getCurrentPages()
90
91
  const currentPage = pages?.[pages.length - 1]
91
92
  const lastPage = pages?.[pages.length - 2]
93
+ const taroParams = currentPage.$taroParams
94
+ if (taroParams) {
95
+ delete taroParams.stamp
96
+ delete taroParams.$taroTimestamp
97
+ }
98
+ const laseTaroParams = lastPage?.$taroParams
99
+ if (laseTaroParams) {
100
+ delete laseTaroParams.stamp
101
+ delete laseTaroParams.$taroTimestamp
102
+ }
92
103
  params.pages = JSON.stringify({
93
- current: currentPage?.$taroPath,
94
- last: lastPage?.$taroPath,
104
+ current: `${currentPage?.route}?${qs.stringify(taroParams)}`,
105
+ last: lastPage
106
+ ? `${lastPage?.route}?${qs.stringify(laseTaroParams)}`
107
+ : '',
95
108
  }).slice(0, 1024)
96
109
 
97
110
  console.log(params)
@@ -219,32 +219,99 @@ class TrackingSDK {
219
219
  // H5 环境使用 btoa
220
220
  base64 = btoa(unescape(encodeURIComponent(raw)))
221
221
  } else {
222
- // 小程序环境使用手动实现的 Base64 编码
223
- base64 = this.base64Encode(raw)
222
+ // 小程序环境使用手动实现的 Base64 编码(兼容 btoa 的 UTF-8 处理逻辑)
223
+ base64 = this.btoa(raw)
224
224
  }
225
225
 
226
226
  // 反转字符串
227
227
  return base64.split('').reverse().join('')
228
228
  }
229
229
  /**
230
- * Base64 编码(降级方案)
230
+ * 手动实现 btoa 方法(小程序端降级方案)
231
+ * 与浏览器 btoa(unescape(encodeURIComponent(str))) 行为一致
232
+ * @param str 要编码的字符串
233
+ * @returns Base64 编码后的字符串
231
234
  */
232
- private base64Encode(str: string): string {
233
- const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='
235
+ private btoa(str: string): string {
236
+ // 先将字符串转换为 UTF-8 字节序列(模拟 encodeURIComponent + unescape 的行为)
237
+ const utf8Bytes: number[] = []
238
+ for (let i = 0; i < str.length; i++) {
239
+ const codePoint = str.charCodeAt(i)
240
+ if (codePoint < 0x80) {
241
+ // ASCII 字符,直接使用
242
+ utf8Bytes.push(codePoint)
243
+ } else if (codePoint < 0x800) {
244
+ // 2字节 UTF-8 字符
245
+ utf8Bytes.push(0xc0 | (codePoint >> 6))
246
+ utf8Bytes.push(0x80 | (codePoint & 0x3f))
247
+ } else if (codePoint >= 0xd800 && codePoint <= 0xdbff) {
248
+ // 代理对高位
249
+ if (i + 1 < str.length) {
250
+ const lowSurrogate = str.charCodeAt(i + 1)
251
+ if (lowSurrogate >= 0xdc00 && lowSurrogate <= 0xdfff) {
252
+ // 完整的代理对,转换为 4 字节 UTF-8
253
+ const unicodeCodePoint = 0x10000 + ((codePoint & 0x3ff) << 10) + (lowSurrogate & 0x3ff)
254
+ utf8Bytes.push(0xf0 | (unicodeCodePoint >> 18))
255
+ utf8Bytes.push(0x80 | ((unicodeCodePoint >> 12) & 0x3f))
256
+ utf8Bytes.push(0x80 | ((unicodeCodePoint >> 6) & 0x3f))
257
+ utf8Bytes.push(0x80 | (unicodeCodePoint & 0x3f))
258
+ i++ // 跳过低位代理
259
+ continue
260
+ }
261
+ }
262
+ // 无效的代理对,使用替换字符
263
+ utf8Bytes.push(0xef, 0xbf, 0xbd)
264
+ } else {
265
+ // 3字节 UTF-8 字符
266
+ utf8Bytes.push(0xe0 | (codePoint >> 12))
267
+ utf8Bytes.push(0x80 | ((codePoint >> 6) & 0x3f))
268
+ utf8Bytes.push(0x80 | (codePoint & 0x3f))
269
+ }
270
+ }
271
+
272
+ // 将字节序列转换为 Base64
273
+ return this.base64EncodeBytes(utf8Bytes)
274
+ }
275
+ /**
276
+ * Base64 编码(字节数组版本)
277
+ * @param bytes 字节数组
278
+ * @returns Base64 编码后的字符串
279
+ */
280
+ private base64EncodeBytes(bytes: number[]): string {
281
+ const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
234
282
  let output = ''
235
283
  let i = 0
236
284
 
237
- while (i < str.length) {
238
- const a = str.charCodeAt(i++)
239
- const b = i < str.length ? str.charCodeAt(i++) : 0
240
- const c = i < str.length ? str.charCodeAt(i++) : 0
285
+ while (i < bytes.length) {
286
+ const a = bytes[i++]
287
+ const hasB = i < bytes.length
288
+ const b = hasB ? bytes[i++] : 0
289
+ const hasC = i < bytes.length
290
+ const c = hasC ? bytes[i++] : 0
241
291
 
242
292
  const bitmap = (a << 16) | (b << 8) | c
243
293
 
244
294
  output += chars.charAt((bitmap >> 18) & 63)
245
295
  output += chars.charAt((bitmap >> 12) & 63)
246
- output += i - 2 < str.length ? chars.charAt((bitmap >> 6) & 63) : '='
247
- output += i - 1 < str.length ? chars.charAt(bitmap & 63) : '='
296
+
297
+ // 填充逻辑:
298
+ // - 如果有 3 个字节:所有字符都有效
299
+ // - 如果只有 2 个字节:第 4 个字符是 '='
300
+ // - 如果只有 1 个字节:第 3、4 个字符都是 '='
301
+ if (hasB) {
302
+ // 有第 2 个字节
303
+ output += chars.charAt((bitmap >> 6) & 63)
304
+ if (hasC) {
305
+ // 有第 3 个字节,所有字符都有效
306
+ output += chars.charAt(bitmap & 63)
307
+ } else {
308
+ // 只有 2 个字节,第 4 个字符是填充符
309
+ output += '='
310
+ }
311
+ } else {
312
+ // 只有 1 个字节,第 3、4 个字符都是填充符
313
+ output += '=='
314
+ }
248
315
  }
249
316
 
250
317
  return output
@@ -630,6 +697,7 @@ class TrackingSDK {
630
697
  * 发送埋点数据
631
698
  */
632
699
  private async flush(): Promise<void> {
700
+ console.log(this.eventQueue.length, 'this.eventQueue.length')
633
701
  if (this.eventQueue.length === 0) return
634
702
 
635
703
  const events = [...this.eventQueue]
@@ -640,7 +708,7 @@ class TrackingSDK {
640
708
  const jsonStr = JSON.stringify(events)
641
709
 
642
710
  // 使用 pako 压缩
643
- const compressed = pako.deflate(jsonStr)
711
+ const compressed = getEnv() === 'WEAPP' ? jsonStr: pako.deflate(jsonStr)
644
712
 
645
713
  // if (this.config.debug) {
646
714
  // console.log('[TrackingSDK] 原始数据大小:', new Blob([jsonStr]).size, 'bytes')
@@ -658,7 +726,7 @@ class TrackingSDK {
658
726
  method: 'POST',
659
727
  data: compressed,
660
728
  header: {
661
- 'Content-Encoding': 'deflate',
729
+ 'Content-Encoding': getEnv() === 'WEAPP' ? '' : 'deflate',
662
730
  },
663
731
  })
664
732
 
@@ -904,13 +972,14 @@ class TrackingSDK {
904
972
  if (this.eventQueue.length === 0) return
905
973
 
906
974
  const events = [...this.eventQueue]
907
- this.eventQueue = []
908
975
 
909
976
  try {
910
977
  // 使用同步方式发送(适用于页面关闭场景)
911
978
  const env = getEnv()
912
979
 
913
980
  if (env === 'WEB' && typeof navigator !== 'undefined' && navigator.sendBeacon) {
981
+ this.eventQueue = []
982
+
914
983
  // H5 环境:使用 sendBeacon API(专为页面卸载场景设计)(sendBeacon无法指定header头, 无法deflate压缩)
915
984
  const blob = new Blob([JSON.stringify(events)], {
916
985
  type: 'application/json',