@uxda/appkit 1.2.52 → 1.2.56

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/appkit.css CHANGED
@@ -1230,9 +1230,14 @@ page {
1230
1230
  height: 30px;
1231
1231
  margin-bottom: 8px;
1232
1232
  }
1233
+ .notice-banner.fixed {
1234
+ position: fixed;
1235
+ z-index: 10;
1236
+ width: 100%;
1237
+ }
1233
1238
  .notice-banner .dd-notice-bar {
1234
1239
  position: relative;
1235
- background: #f2f3ff;
1240
+ background: #e6f2ff;
1236
1241
  font-size: 10px;
1237
1242
  color: rgba(0, 0, 0, 0.8980392157);
1238
1243
  padding: 0 8px;
@@ -1267,6 +1272,7 @@ page {
1267
1272
  display: -webkit-box;
1268
1273
  -webkit-line-clamp: 1;
1269
1274
  -webkit-box-orient: vertical;
1275
+ text-align: left;
1270
1276
  }
1271
1277
  .notice-banner-btn {
1272
1278
  color: #017fff;
package/dist/index.js CHANGED
@@ -111,7 +111,7 @@ function requestPayment$2(json) {
111
111
 
112
112
  function useSafeArea() {
113
113
  const systemInfo = Taro.getSystemInfoSync(), capsule = Taro.getMenuButtonBoundingClientRect();
114
- const status = systemInfo.statusBarHeight || 0, gap = capsule.top - status, nav = capsule.height + gap * 2, safeAreaBottom = systemInfo.safeArea?.bottom || 0, bottom = systemInfo.screenHeight - safeAreaBottom;
114
+ const status = systemInfo.statusBarHeight || 0, gap = capsule.top - status, nav = capsule.height + gap * 2, safeAreaBottom = (systemInfo.safeArea || {}).bottom || 0, bottom = systemInfo.screenHeight - safeAreaBottom;
115
115
  return {
116
116
  status,
117
117
  nav,
@@ -246,7 +246,7 @@ const _hoisted_2$h = /* @__PURE__ */ createElementVNode(
246
246
  -1
247
247
  /* HOISTED */
248
248
  );
249
- const _hoisted_3$e = [
249
+ const _hoisted_3$f = [
250
250
  _hoisted_2$h
251
251
  ];
252
252
  var script$l = /* @__PURE__ */ defineComponent({
@@ -291,7 +291,7 @@ var script$l = /* @__PURE__ */ defineComponent({
291
291
  key: 0,
292
292
  class: "dd-notice-bar__close",
293
293
  onClick: close
294
- }, [..._hoisted_3$e])) : createCommentVNode("v-if", true)
294
+ }, [..._hoisted_3$f])) : createCommentVNode("v-if", true)
295
295
  ],
296
296
  6
297
297
  /* CLASS, STYLE */
@@ -842,7 +842,7 @@ const services$1 = [
842
842
 
843
843
  const _hoisted_1$i = { class: "view recharge-view" };
844
844
  const _hoisted_2$g = { class: "flex-grow" };
845
- const _hoisted_3$d = { class: "amount-footer" };
845
+ const _hoisted_3$e = { class: "amount-footer" };
846
846
  const _hoisted_4$a = { class: "agreement" };
847
847
  var script$j = /* @__PURE__ */ defineComponent({
848
848
  __name: "RechargeView",
@@ -915,7 +915,7 @@ var script$j = /* @__PURE__ */ defineComponent({
915
915
  onChange: onAmountSelect
916
916
  }, null, 8, ["items", "selected"])
917
917
  ]),
918
- createElementVNode("view", _hoisted_3$d, [
918
+ createElementVNode("view", _hoisted_3$e, [
919
919
  createElementVNode("view", _hoisted_4$a, [
920
920
  createVNode(_component_nut_checkbox, {
921
921
  modelValue: state.agreed,
@@ -966,7 +966,7 @@ script$j.__file = "src/payment/components/RechargeView.vue";
966
966
 
967
967
  const _hoisted_1$h = { class: "recharge-result" };
968
968
  const _hoisted_2$f = { class: "content" };
969
- const _hoisted_3$c = /* @__PURE__ */ createElementVNode(
969
+ const _hoisted_3$d = /* @__PURE__ */ createElementVNode(
970
970
  "div",
971
971
  { class: "figure" },
972
972
  null,
@@ -1001,7 +1001,7 @@ var script$i = /* @__PURE__ */ defineComponent({
1001
1001
  const _component_nut_button = resolveComponent("nut-button");
1002
1002
  return openBlock(), createElementBlock("div", _hoisted_1$h, [
1003
1003
  createElementVNode("div", _hoisted_2$f, [
1004
- _hoisted_3$c,
1004
+ _hoisted_3$d,
1005
1005
  createElementVNode(
1006
1006
  "h2",
1007
1007
  null,
@@ -1037,7 +1037,7 @@ script$i.__file = "src/payment/components/RechargeResult.vue";
1037
1037
 
1038
1038
  const _hoisted_1$g = { class: "tag" };
1039
1039
  const _hoisted_2$e = { class: "token-line number" };
1040
- const _hoisted_3$b = { class: "number" };
1040
+ const _hoisted_3$c = { class: "number" };
1041
1041
  var script$h = /* @__PURE__ */ defineComponent({
1042
1042
  __name: "RightsPicker",
1043
1043
  props: {
@@ -1092,7 +1092,7 @@ var script$h = /* @__PURE__ */ defineComponent({
1092
1092
  createTextVNode("\xA5"),
1093
1093
  createElementVNode(
1094
1094
  "span",
1095
- _hoisted_3$b,
1095
+ _hoisted_3$c,
1096
1096
  toDisplayString(amount.paymentAmount),
1097
1097
  1
1098
1098
  /* TEXT */
@@ -1118,7 +1118,7 @@ script$h.__file = "src/payment/components/RightsPicker.vue";
1118
1118
 
1119
1119
  const _hoisted_1$f = { class: "view recharge-view2" };
1120
1120
  const _hoisted_2$d = { class: "flex-grow" };
1121
- const _hoisted_3$a = {
1121
+ const _hoisted_3$b = {
1122
1122
  key: 0,
1123
1123
  class: "bean-buy"
1124
1124
  };
@@ -1252,7 +1252,7 @@ var script$g = /* @__PURE__ */ defineComponent({
1252
1252
  selected: state.selected,
1253
1253
  onChange: onAmountSelect
1254
1254
  }, null, 8, ["items", "selected"]),
1255
- amounts.value[state.selected] ? (openBlock(), createElementBlock("div", _hoisted_3$a, [
1255
+ amounts.value[state.selected] ? (openBlock(), createElementBlock("div", _hoisted_3$b, [
1256
1256
  createElementVNode("div", _hoisted_4$8, [
1257
1257
  _hoisted_5$6,
1258
1258
  !selectBean.value ? (openBlock(), createElementBlock(
@@ -1402,7 +1402,7 @@ const components = {
1402
1402
 
1403
1403
  const _hoisted_1$e = { class: "account-card" };
1404
1404
  const _hoisted_2$c = { class: "card" };
1405
- const _hoisted_3$9 = { class: "card-row" };
1405
+ const _hoisted_3$a = { class: "card-row" };
1406
1406
  const _hoisted_4$7 = { class: "card-row-left" };
1407
1407
  const _hoisted_5$5 = /* @__PURE__ */ createElementVNode(
1408
1408
  "div",
@@ -1523,7 +1523,7 @@ var script$f = /* @__PURE__ */ defineComponent({
1523
1523
  return (_ctx, _cache) => {
1524
1524
  return openBlock(), createElementBlock("div", _hoisted_1$e, [
1525
1525
  createElementVNode("div", _hoisted_2$c, [
1526
- createElementVNode("div", _hoisted_3$9, [
1526
+ createElementVNode("div", _hoisted_3$a, [
1527
1527
  createElementVNode("div", _hoisted_4$7, [
1528
1528
  _hoisted_5$5,
1529
1529
  createElementVNode(
@@ -1584,7 +1584,7 @@ const _hoisted_2$b = /* @__PURE__ */ createElementVNode(
1584
1584
  -1
1585
1585
  /* HOISTED */
1586
1586
  );
1587
- const _hoisted_3$8 = { class: "consumption-filter-content" };
1587
+ const _hoisted_3$9 = { class: "consumption-filter-content" };
1588
1588
  const _hoisted_4$6 = { class: "title" };
1589
1589
  const _hoisted_5$4 = { class: "info" };
1590
1590
  const _hoisted_6$2 = ["onClick"];
@@ -1649,7 +1649,7 @@ var script$e = /* @__PURE__ */ defineComponent({
1649
1649
  return (_ctx, _cache) => {
1650
1650
  return openBlock(), createElementBlock("div", _hoisted_1$d, [
1651
1651
  _hoisted_2$b,
1652
- createElementVNode("div", _hoisted_3$8, [
1652
+ createElementVNode("div", _hoisted_3$9, [
1653
1653
  (openBlock(true), createElementBlock(
1654
1654
  Fragment,
1655
1655
  null,
@@ -1715,7 +1715,7 @@ const _hoisted_2$a = /* @__PURE__ */ createElementVNode(
1715
1715
  -1
1716
1716
  /* HOISTED */
1717
1717
  );
1718
- const _hoisted_3$7 = { class: "content" };
1718
+ const _hoisted_3$8 = { class: "content" };
1719
1719
  const _hoisted_4$5 = /* @__PURE__ */ createElementVNode(
1720
1720
  "div",
1721
1721
  { class: "title" },
@@ -1799,7 +1799,7 @@ var script$d = /* @__PURE__ */ defineComponent({
1799
1799
  [
1800
1800
  createElementVNode("div", _hoisted_1$c, [
1801
1801
  _hoisted_2$a,
1802
- createElementVNode("div", _hoisted_3$7, [
1802
+ createElementVNode("div", _hoisted_3$8, [
1803
1803
  _hoisted_4$5,
1804
1804
  createElementVNode("div", _hoisted_5$3, [
1805
1805
  createElementVNode(
@@ -1866,7 +1866,7 @@ const _hoisted_2$9 = /* @__PURE__ */ createElementVNode(
1866
1866
  -1
1867
1867
  /* HOISTED */
1868
1868
  );
1869
- const _hoisted_3$6 = /* @__PURE__ */ createElementVNode(
1869
+ const _hoisted_3$7 = /* @__PURE__ */ createElementVNode(
1870
1870
  "div",
1871
1871
  { class: "desc" },
1872
1872
  [
@@ -1889,7 +1889,7 @@ var script$c = /* @__PURE__ */ defineComponent({
1889
1889
  return (_ctx, _cache) => {
1890
1890
  return openBlock(), createElementBlock("div", _hoisted_1$b, [
1891
1891
  _hoisted_2$9,
1892
- _hoisted_3$6,
1892
+ _hoisted_3$7,
1893
1893
  createElementVNode("div", {
1894
1894
  class: "know",
1895
1895
  onClick: _cache[0] || (_cache[0] = ($event) => emit("complete"))
@@ -1912,7 +1912,7 @@ const _hoisted_2$8 = /* @__PURE__ */ createElementVNode(
1912
1912
  -1
1913
1913
  /* HOISTED */
1914
1914
  );
1915
- const _hoisted_3$5 = /* @__PURE__ */ createElementVNode(
1915
+ const _hoisted_3$6 = /* @__PURE__ */ createElementVNode(
1916
1916
  "div",
1917
1917
  { class: "empty-view-text" },
1918
1918
  "\u6682\u65E0\u6570\u636E",
@@ -1921,7 +1921,7 @@ const _hoisted_3$5 = /* @__PURE__ */ createElementVNode(
1921
1921
  );
1922
1922
  const _hoisted_4$4 = [
1923
1923
  _hoisted_2$8,
1924
- _hoisted_3$5
1924
+ _hoisted_3$6
1925
1925
  ];
1926
1926
  function render(_ctx, _cache) {
1927
1927
  return openBlock(), createElementBlock("div", _hoisted_1$a, [..._hoisted_4$4]);
@@ -1946,7 +1946,7 @@ const _hoisted_2$7 = /* @__PURE__ */ createElementVNode(
1946
1946
  -1
1947
1947
  /* HOISTED */
1948
1948
  );
1949
- const _hoisted_3$4 = /* @__PURE__ */ createElementVNode(
1949
+ const _hoisted_3$5 = /* @__PURE__ */ createElementVNode(
1950
1950
  "div",
1951
1951
  { class: "tip-content" },
1952
1952
  "2024\u5E745\u670831\u65E5\u8D77\uFF0C\u4EBA\u6C11\u5E01\u4E0E\u4E91\u8C46\u5151\u6362\u6BD4\u4F8B\u8C03\u6574\u4E3A1\u4EBA\u6C11\u5E01=1\u4E91\u8C46\uFF0C\u4E91\u8C46\u4F59\u989D\u6839\u636E\u5151\u6362\u6BD4\u4F8B\u8C03\u6574",
@@ -1955,7 +1955,7 @@ const _hoisted_3$4 = /* @__PURE__ */ createElementVNode(
1955
1955
  );
1956
1956
  const _hoisted_4$3 = [
1957
1957
  _hoisted_2$7,
1958
- _hoisted_3$4
1958
+ _hoisted_3$5
1959
1959
  ];
1960
1960
  var script$a = /* @__PURE__ */ defineComponent({
1961
1961
  __name: "Tip",
@@ -1978,7 +1978,7 @@ script$a.__file = "src/balance/components/Tip.vue";
1978
1978
 
1979
1979
  const _hoisted_1$8 = { class: "account-view" };
1980
1980
  const _hoisted_2$6 = { class: "scroll-content" };
1981
- const _hoisted_3$3 = /* @__PURE__ */ createElementVNode(
1981
+ const _hoisted_3$4 = /* @__PURE__ */ createElementVNode(
1982
1982
  "label",
1983
1983
  null,
1984
1984
  "\u6536\u652F\u660E\u7EC6",
@@ -1986,7 +1986,7 @@ const _hoisted_3$3 = /* @__PURE__ */ createElementVNode(
1986
1986
  /* HOISTED */
1987
1987
  );
1988
1988
  const _hoisted_4$2 = [
1989
- _hoisted_3$3
1989
+ _hoisted_3$4
1990
1990
  ];
1991
1991
  const _hoisted_5$2 = { class: "balance" };
1992
1992
  const _hoisted_6 = { class: "bean-box spa-between" };
@@ -2622,7 +2622,7 @@ const _hoisted_2$5 = /* @__PURE__ */ createElementVNode(
2622
2622
  -1
2623
2623
  /* HOISTED */
2624
2624
  );
2625
- const _hoisted_3$2 = { class: "footer" };
2625
+ const _hoisted_3$3 = { class: "footer" };
2626
2626
  const _hoisted_4$1 = { class: "col" };
2627
2627
  const _hoisted_5$1 = { class: "col" };
2628
2628
  var script$8 = /* @__PURE__ */ defineComponent({
@@ -2647,7 +2647,7 @@ var script$8 = /* @__PURE__ */ defineComponent({
2647
2647
  default: withCtx(() => [
2648
2648
  createElementVNode("div", _hoisted_1$7, [
2649
2649
  _hoisted_2$5,
2650
- createElementVNode("div", _hoisted_3$2, [
2650
+ createElementVNode("div", _hoisted_3$3, [
2651
2651
  createElementVNode("div", _hoisted_4$1, [
2652
2652
  createVNode(_component_nut_button, {
2653
2653
  class: "cancel-button",
@@ -3121,7 +3121,7 @@ script$4.__file = "src/components/dd-selector/index.vue";
3121
3121
 
3122
3122
  const _hoisted_1$3 = { class: "self-registration" };
3123
3123
  const _hoisted_2$3 = { class: "self-registration-body" };
3124
- const _hoisted_3$1 = ["src"];
3124
+ const _hoisted_3$2 = ["src"];
3125
3125
  const _hoisted_4 = { class: "self-registration__input" };
3126
3126
  const _hoisted_5 = { class: "self-registration-bottom" };
3127
3127
  var script$3 = /* @__PURE__ */ defineComponent({
@@ -3234,7 +3234,7 @@ var script$3 = /* @__PURE__ */ defineComponent({
3234
3234
  src: _ctx.banner,
3235
3235
  class: "self-registration-banner",
3236
3236
  alt: ""
3237
- }, null, 8, _hoisted_3$1),
3237
+ }, null, 8, _hoisted_3$2),
3238
3238
  createVNode(_component_nut_form, null, {
3239
3239
  default: withCtx(() => [
3240
3240
  createVNode(_component_nut_form_item, {
@@ -3552,6 +3552,7 @@ const _hoisted_1$2 = /* @__PURE__ */ createElementVNode(
3552
3552
  /* HOISTED */
3553
3553
  );
3554
3554
  const _hoisted_2$2 = { class: "notice-popup-bd" };
3555
+ const _hoisted_3$1 = { style: { "white-space": "pre-wrap" } };
3555
3556
  var script$2 = /* @__PURE__ */ defineComponent({
3556
3557
  __name: "NoticePopup",
3557
3558
  props: {
@@ -3560,7 +3561,6 @@ var script$2 = /* @__PURE__ */ defineComponent({
3560
3561
  emits: ["close", "view"],
3561
3562
  setup(__props, { emit: __emit }) {
3562
3563
  const props = __props;
3563
- const { toReadFun, noticeClick } = useNotice();
3564
3564
  const showPopup = ref(true);
3565
3565
  onMounted(() => {
3566
3566
  });
@@ -3568,11 +3568,9 @@ var script$2 = /* @__PURE__ */ defineComponent({
3568
3568
  showPopup.value = false;
3569
3569
  emits("close");
3570
3570
  }
3571
- function toAllSystemNotice() {
3572
- noticeClick(props.message, () => {
3573
- onClose();
3574
- emits("view", props.message.id);
3575
- });
3571
+ function toViewAttachment() {
3572
+ onClose();
3573
+ emits("view", props.message.jumpUrl || props.message.link);
3576
3574
  }
3577
3575
  async function onClose() {
3578
3576
  const $http = useHttp();
@@ -3580,9 +3578,6 @@ var script$2 = /* @__PURE__ */ defineComponent({
3580
3578
  device: "MINI",
3581
3579
  receiveId: props.message.id
3582
3580
  }).then(() => {
3583
- if (props.message.isRead === 0) {
3584
- toReadFun([props.message.id]);
3585
- }
3586
3581
  onCancel();
3587
3582
  });
3588
3583
  }
@@ -3599,15 +3594,18 @@ var script$2 = /* @__PURE__ */ defineComponent({
3599
3594
  default: withCtx(() => [
3600
3595
  _hoisted_1$2,
3601
3596
  createElementVNode("div", _hoisted_2$2, [
3602
- createTextVNode(
3603
- toDisplayString(_ctx.message.context) + " ",
3597
+ createElementVNode(
3598
+ "div",
3599
+ _hoisted_3$1,
3600
+ toDisplayString(_ctx.message.context),
3604
3601
  1
3605
3602
  /* TEXT */
3606
3603
  ),
3607
- createElementVNode("div", {
3604
+ _ctx.message.jumpUrl || _ctx.message.link ? (openBlock(), createElementBlock("div", {
3605
+ key: 0,
3608
3606
  class: "notice-popup-bd-link",
3609
- onClick: toAllSystemNotice
3610
- }, "\u70B9\u51FB\u67E5\u770B\u9644\u4EF6")
3607
+ onClick: toViewAttachment
3608
+ }, " \u70B9\u51FB\u67E5\u770B\u9644\u4EF6 ")) : createCommentVNode("v-if", true)
3611
3609
  ]),
3612
3610
  createElementVNode("div", { class: "notice-popup-ft" }, [
3613
3611
  createElementVNode("div", {
@@ -3625,8 +3623,7 @@ var script$2 = /* @__PURE__ */ defineComponent({
3625
3623
 
3626
3624
  script$2.__file = "src/notice/components/NoticePopup.vue";
3627
3625
 
3628
- const _hoisted_1$1 = { class: "notice-banner" };
3629
- const _hoisted_2$1 = /* @__PURE__ */ createElementVNode(
3626
+ const _hoisted_1$1 = /* @__PURE__ */ createElementVNode(
3630
3627
  "img",
3631
3628
  {
3632
3629
  class: "notice-banner-icon",
@@ -3637,19 +3634,33 @@ const _hoisted_2$1 = /* @__PURE__ */ createElementVNode(
3637
3634
  -1
3638
3635
  /* HOISTED */
3639
3636
  );
3640
- const _hoisted_3 = { class: "notice-banner-text" };
3637
+ const _hoisted_2$1 = {
3638
+ class: "notice-banner-text",
3639
+ style: { "white-space": "pre-wrap" }
3640
+ };
3641
+ const _hoisted_3 = ["onClick"];
3641
3642
  var script$1 = /* @__PURE__ */ defineComponent({
3642
3643
  __name: "NoticeBanner",
3643
3644
  props: {
3644
- app: { type: String, required: true, default: "" }
3645
+ app: { type: String, required: true, default: "" },
3646
+ bannerStyle: { type: null, required: false, default: "" },
3647
+ fixed: { type: Boolean, required: false, default: false }
3645
3648
  },
3646
- emits: ["detail", "close"],
3649
+ emits: ["detail", "close", "view"],
3647
3650
  setup(__props, { emit: __emit }) {
3648
3651
  const props = __props;
3649
3652
  const { toReadFun, noticeClick } = useNotice();
3650
3653
  const bannerMessages = ref([]);
3651
3654
  const popMessages = ref([]);
3652
3655
  const activeKey = ref(0);
3656
+ const safeArea = useSafeArea();
3657
+ const topStype = computed(() => {
3658
+ if (!props.fixed) {
3659
+ return props.bannerStyle;
3660
+ } else {
3661
+ return `top: ${safeArea.nav + safeArea.status}px; ${props.bannerStyle}}`;
3662
+ }
3663
+ });
3653
3664
  onMounted(() => {
3654
3665
  queryNoticeMsg();
3655
3666
  });
@@ -3665,17 +3676,17 @@ var script$1 = /* @__PURE__ */ defineComponent({
3665
3676
  }).then((result) => {
3666
3677
  bannerMessages.value = (result || []).filter((item) => item.noticeType !== void 0);
3667
3678
  popMessages.value = (result || []).filter((item) => item.isPop);
3668
- startMessage();
3679
+ startMessageCarousel();
3669
3680
  });
3670
3681
  }
3671
3682
  let interval = null;
3672
- function startMessage() {
3673
- clearInterval(interval);
3683
+ function startMessageCarousel() {
3684
+ stopMessageCarousel();
3674
3685
  if (bannerMessages.value.length > 1) {
3675
3686
  interval = setInterval(() => {
3676
3687
  startMessageCalc();
3677
3688
  if (bannerMessages.value.length <= 1) {
3678
- clearInterval(interval);
3689
+ stopMessageCarousel();
3679
3690
  }
3680
3691
  }, 3e3);
3681
3692
  }
@@ -3687,7 +3698,11 @@ var script$1 = /* @__PURE__ */ defineComponent({
3687
3698
  activeKey.value = 0;
3688
3699
  }
3689
3700
  }
3701
+ function stopMessageCarousel() {
3702
+ clearInterval(interval);
3703
+ }
3690
3704
  function onClose(item, index) {
3705
+ stopMessageCarousel();
3691
3706
  const $http = useHttp();
3692
3707
  $http.post("/cas/msg/setMsgStatus", {
3693
3708
  device: "PC",
@@ -3700,56 +3715,76 @@ var script$1 = /* @__PURE__ */ defineComponent({
3700
3715
  icon: "none"
3701
3716
  });
3702
3717
  bannerMessages.value.splice(index, 1);
3703
- startMessage();
3704
- if (item.isRead === 0) {
3705
- toReadFun([item.id]);
3706
- }
3718
+ startMessageCarousel();
3719
+ }).catch(() => {
3720
+ startMessageCarousel();
3707
3721
  });
3708
3722
  }
3709
- function onDetail(item) {
3710
- noticeClick(item, (url) => {
3711
- emits("detail", url);
3712
- });
3723
+ async function onDetail(item) {
3724
+ await noticeClick(item);
3725
+ emits("detail", item);
3713
3726
  }
3727
+ function onView(item) {
3728
+ emits("view", item.link);
3729
+ }
3730
+ function onTouchStart() {
3731
+ stopMessageCarousel();
3732
+ }
3733
+ const onTouchEnd = debounce(() => {
3734
+ startMessageCarousel();
3735
+ }, 100);
3714
3736
  const emits = __emit;
3715
3737
  return (_ctx, _cache) => {
3716
3738
  return openBlock(), createElementBlock(
3717
3739
  Fragment,
3718
3740
  null,
3719
3741
  [
3720
- createElementVNode("div", _hoisted_1$1, [
3721
- (openBlock(true), createElementBlock(
3722
- Fragment,
3723
- null,
3724
- renderList(bannerMessages.value, (item, key) => {
3725
- return openBlock(), createBlock(script$l, {
3726
- class: normalizeClass({ show: key === activeKey.value }),
3727
- key,
3728
- showClose: item.noticeType === 0,
3729
- onClose: ($event) => onClose(item, key)
3730
- }, {
3731
- default: withCtx(() => [
3732
- _hoisted_2$1,
3733
- createElementVNode(
3734
- "div",
3735
- _hoisted_3,
3736
- toDisplayString(item.context),
3737
- 1
3738
- /* TEXT */
3739
- ),
3740
- createElementVNode("div", {
3741
- class: "notice-banner-btn",
3742
- onClick: onDetail
3743
- }, "\u8BE6\u60C5")
3744
- ]),
3745
- _: 2
3746
- /* DYNAMIC */
3747
- }, 1032, ["class", "showClose", "onClose"]);
3748
- }),
3749
- 128
3750
- /* KEYED_FRAGMENT */
3751
- ))
3752
- ]),
3742
+ bannerMessages.value.length ? (openBlock(), createElementBlock(
3743
+ "div",
3744
+ {
3745
+ key: 0,
3746
+ class: normalizeClass(["notice-banner", { fixed: _ctx.fixed }]),
3747
+ style: normalizeStyle(topStype.value),
3748
+ onTouchstart: onTouchStart,
3749
+ onTouchend: _cache[0] || (_cache[0] = //@ts-ignore
3750
+ (...args) => unref(onTouchEnd) && unref(onTouchEnd)(...args))
3751
+ },
3752
+ [
3753
+ (openBlock(true), createElementBlock(
3754
+ Fragment,
3755
+ null,
3756
+ renderList(bannerMessages.value, (item, key) => {
3757
+ return openBlock(), createBlock(script$l, {
3758
+ class: normalizeClass({ show: key === activeKey.value }),
3759
+ key,
3760
+ showClose: item.noticeType === 0,
3761
+ onClose: ($event) => onClose(item, key)
3762
+ }, {
3763
+ default: withCtx(() => [
3764
+ _hoisted_1$1,
3765
+ createElementVNode(
3766
+ "div",
3767
+ _hoisted_2$1,
3768
+ toDisplayString(item.context),
3769
+ 1
3770
+ /* TEXT */
3771
+ ),
3772
+ createElementVNode("div", {
3773
+ class: "notice-banner-btn",
3774
+ onClick: ($event) => onDetail(item)
3775
+ }, "\u8BE6\u60C5", 8, _hoisted_3)
3776
+ ]),
3777
+ _: 2
3778
+ /* DYNAMIC */
3779
+ }, 1032, ["class", "showClose", "onClose"]);
3780
+ }),
3781
+ 128
3782
+ /* KEYED_FRAGMENT */
3783
+ ))
3784
+ ],
3785
+ 38
3786
+ /* CLASS, STYLE, NEED_HYDRATION */
3787
+ )) : createCommentVNode("v-if", true),
3753
3788
  createCommentVNode(" \u7CFB\u7EDF\u516C\u544A\u5F3A\u5236\u5F39\u6846 "),
3754
3789
  (openBlock(true), createElementBlock(
3755
3790
  Fragment,
@@ -3758,8 +3793,9 @@ var script$1 = /* @__PURE__ */ defineComponent({
3758
3793
  return openBlock(), createBlock(script$2, {
3759
3794
  key,
3760
3795
  message: item,
3761
- onClose: ($event) => popMessages.value.splice(key, 1)
3762
- }, null, 8, ["message", "onClose"]);
3796
+ onClose: ($event) => popMessages.value.splice(key, 1),
3797
+ onView: ($event) => onView(item)
3798
+ }, null, 8, ["message", "onClose", "onView"]);
3763
3799
  }),
3764
3800
  128
3765
3801
  /* KEYED_FRAGMENT */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxda/appkit",
3
- "version": "1.2.52",
3
+ "version": "1.2.56",
4
4
  "description": "小程序应用开发包",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.ts",
@@ -1,5 +1,12 @@
1
1
  <template>
2
- <div class="notice-banner">
2
+ <div
3
+ class="notice-banner"
4
+ :class="{ fixed: fixed }"
5
+ :style="topStype"
6
+ v-if="bannerMessages.length"
7
+ @touchstart="onTouchStart"
8
+ @touchend="onTouchEnd"
9
+ >
3
10
  <DdNoticeBar
4
11
  :class="{ show: key === activeKey }"
5
12
  v-for="(item, key) in bannerMessages"
@@ -12,34 +19,40 @@
12
19
  src="https://cdn.ddjf.com/static/images/customer-center/notice-icon.png"
13
20
  alt=""
14
21
  />
15
- <div class="notice-banner-text">
22
+ <div class="notice-banner-text" style="white-space: pre-wrap">
16
23
  {{ item.context }}
17
24
  </div>
18
- <div class="notice-banner-btn" @click="onDetail">详情</div>
25
+ <div class="notice-banner-btn" @click="onDetail(item)">详情</div>
19
26
  </DdNoticeBar>
20
27
  </div>
21
28
 
22
29
  <!-- 系统公告强制弹框 -->
23
30
  <template v-for="(item, key) in popMessages" :key="key">
24
- <NoticePopup :message="item" @close="popMessages.splice(key, 1)" />
31
+ <NoticePopup :message="item" @close="popMessages.splice(key, 1)" @view="onView(item)" />
25
32
  </template>
26
33
  </template>
27
34
 
28
35
  <script lang="ts" setup>
29
- import { onMounted, ref } from 'vue'
36
+ import { computed, onMounted, ref } from 'vue'
30
37
  import { useHttp } from '../api'
31
38
  import { useAppKitOptions } from '../../Appkit'
32
39
  import DdNoticeBar from '../../components/dd-notice-bar/index.vue'
33
40
  import NoticePopup from './NoticePopup.vue'
34
41
  import Taro from '@tarojs/taro'
35
42
  import { useNotice } from './useNotice'
43
+ import debounce from 'lodash/debounce'
44
+ import { useSafeArea } from '../../shared/composables'
36
45
 
37
46
  const props = withDefaults(
38
47
  defineProps<{
39
48
  app: string
49
+ bannerStyle?: any
50
+ fixed?: boolean
40
51
  }>(),
41
52
  {
42
53
  app: '',
54
+ bannerStyle: '',
55
+ fixed: false,
43
56
  }
44
57
  )
45
58
 
@@ -47,6 +60,15 @@ const { toReadFun, noticeClick } = useNotice()
47
60
  const bannerMessages = ref<any[]>([]) // 横幅消息
48
61
  const popMessages = ref<any[]>([]) // 弹窗消息
49
62
  const activeKey = ref(0)
63
+ const safeArea = useSafeArea()
64
+
65
+ const topStype = computed(() => {
66
+ if (!props.fixed) {
67
+ return props.bannerStyle
68
+ } else {
69
+ return `top: ${safeArea.nav + safeArea.status}px; ${props.bannerStyle}}`
70
+ }
71
+ })
50
72
 
51
73
  onMounted(() => {
52
74
  queryNoticeMsg()
@@ -66,132 +88,22 @@ async function queryNoticeMsg() {
66
88
  tenantId: appkitOptions.tenant(),
67
89
  })
68
90
  .then((result) => {
69
- // const result = [
70
- // {
71
- // id: 92989,
72
- // appCode: 'loankit',
73
- // sendType: 11,
74
- // isRead: 1,
75
- // receiveTime: 1718189848000,
76
- // textId: 173545,
77
- // title: '测试消息',
78
- // context:
79
- // '尊敬的客户,为给您提供更加丰富和优质的金融产品及服为给您提供更加丰富和优质的金融产品及服',
80
- // businessId: '123123',
81
- // link: 'www.baidu.com',
82
- // miniLink: 'www.baidu.com',
83
- // appLink: '',
84
- // source: '测试',
85
- // msgType: 3,
86
- // userName: 'gao',
87
- // deviceType: 0,
88
- // customerName: '',
89
- // userId: '1580078112058789890',
90
- // sendTenant: '',
91
- // receiveTenant: '',
92
- // popDevice: '',
93
- // isPop: 1,
94
- // expiryTime: '2025-06-09 14:35:28',
95
- // noticeType: 0,
96
- // noticeStatus: '0',
97
- // },
98
- // {
99
- // id: 92989,
100
- // appCode: 'loankit',
101
- // sendType: 11,
102
- // isRead: 1,
103
- // receiveTime: 1718189848000,
104
- // textId: 173545,
105
- // title: '测试消息',
106
- // context: '你好呀,我111',
107
- // businessId: '123123',
108
- // link: 'www.baidu.com',
109
- // miniLink: 'www.baidu.com',
110
- // appLink: '',
111
- // source: '测试',
112
- // msgType: 3,
113
- // userName: 'gao',
114
- // deviceType: 0,
115
- // customerName: '',
116
- // userId: '1580078112058789890',
117
- // sendTenant: '',
118
- // receiveTenant: '',
119
- // popDevice: '',
120
- // isPop: 1,
121
- // expiryTime: '2025-06-09 14:35:28',
122
- // noticeType: 0,
123
- // noticeStatus: '0',
124
- // },
125
- // {
126
- // id: 92989,
127
- // appCode: 'loankit',
128
- // sendType: 11,
129
- // isRead: 1,
130
- // receiveTime: 1718189848000,
131
- // textId: 173545,
132
- // title: '测试消息',
133
- // context: '你好呀,我222',
134
- // businessId: '123123',
135
- // link: 'www.baidu.com',
136
- // miniLink: 'www.baidu.com',
137
- // appLink: '',
138
- // source: '测试',
139
- // msgType: 3,
140
- // userName: 'gao',
141
- // deviceType: 0,
142
- // customerName: '',
143
- // userId: '1580078112058789890',
144
- // sendTenant: '',
145
- // receiveTenant: '',
146
- // popDevice: '',
147
- // isPop: 1,
148
- // expiryTime: '2025-06-09 14:35:28',
149
- // noticeType: 0,
150
- // noticeStatus: '0',
151
- // },
152
- // {
153
- // id: 92989,
154
- // appCode: 'loankit',
155
- // sendType: 11,
156
- // isRead: 1,
157
- // receiveTime: 1718189848000,
158
- // textId: 173545,
159
- // title: '测试消息',
160
- // context: '你好呀,我333',
161
- // businessId: '123123',
162
- // link: 'www.baidu.com',
163
- // miniLink: 'www.baidu.com',
164
- // appLink: '',
165
- // source: '测试',
166
- // msgType: 3,
167
- // userName: 'gao',
168
- // deviceType: 0,
169
- // customerName: '',
170
- // userId: '1580078112058789890',
171
- // sendTenant: '',
172
- // receiveTenant: '',
173
- // popDevice: '',
174
- // isPop: 1,
175
- // expiryTime: '2025-06-09 14:35:28',
176
- // noticeType: 0,
177
- // noticeStatus: '0',
178
- // },
179
- // ]
180
91
  bannerMessages.value = (result || []).filter((item: any) => item.noticeType !== undefined)
181
92
  popMessages.value = (result || []).filter((item: any) => item.isPop)
182
- startMessage()
93
+
94
+ startMessageCarousel()
183
95
  })
184
96
  }
185
97
 
186
98
  let interval: any = null
187
99
  // 启动消息轮播
188
- function startMessage() {
189
- clearInterval(interval)
100
+ function startMessageCarousel() {
101
+ stopMessageCarousel()
190
102
  if (bannerMessages.value.length > 1) {
191
103
  interval = setInterval(() => {
192
104
  startMessageCalc()
193
105
  if (bannerMessages.value.length <= 1) {
194
- clearInterval(interval)
106
+ stopMessageCarousel()
195
107
  }
196
108
  }, 3000)
197
109
  }
@@ -203,9 +115,15 @@ function startMessageCalc() {
203
115
  activeKey.value = 0
204
116
  }
205
117
  }
118
+ // 停止消息轮播
119
+ function stopMessageCarousel() {
120
+ clearInterval(interval)
121
+ }
206
122
 
207
123
  // 关闭横幅
208
124
  function onClose(item: any, index: number) {
125
+ stopMessageCarousel()
126
+
209
127
  const $http = useHttp()
210
128
  $http
211
129
  .post('/cas/msg/setMsgStatus', {
@@ -221,32 +139,54 @@ function onClose(item: any, index: number) {
221
139
  })
222
140
  bannerMessages.value.splice(index, 1)
223
141
 
224
- startMessage()
142
+ startMessageCarousel()
225
143
 
226
- if (item.isRead === 0) {
227
- toReadFun([item.id])
228
- }
144
+ // if (item.isRead === 0) {
145
+ // toReadFun([item.id])
146
+ // }
147
+ })
148
+ .catch(() => {
149
+ startMessageCarousel()
229
150
  })
230
151
  }
231
152
 
232
153
  // 跳转详情
233
- function onDetail(item) {
234
- noticeClick(item, (url) => {
235
- emits('detail', url)
236
- })
154
+ async function onDetail(item) {
155
+ await noticeClick(item)
156
+
157
+ emits('detail', item)
158
+ }
159
+
160
+ // 查看附件(webview跳转)
161
+ function onView(item) {
162
+ emits('view', item.link)
237
163
  }
238
164
 
165
+ // 处理手势移入/移出
166
+ function onTouchStart() {
167
+ stopMessageCarousel()
168
+ }
169
+ const onTouchEnd = debounce(() => {
170
+ startMessageCarousel()
171
+ }, 100)
172
+
239
173
  // 父组件事件
240
- const emits = defineEmits(['detail', 'close'])
174
+ const emits = defineEmits(['detail', 'close', 'view'])
241
175
  </script>
242
176
 
243
177
  <style lang="scss">
244
178
  .notice-banner {
245
179
  height: 30px;
246
180
  margin-bottom: 8px;
181
+ &.fixed {
182
+ position: fixed;
183
+ z-index: 10;
184
+ width: 100%;
185
+ }
186
+
247
187
  .dd-notice-bar {
248
188
  position: relative;
249
- background: #f2f3ff;
189
+ background: #e6f2ff;
250
190
  font-size: 10px;
251
191
  color: #000000e5;
252
192
  padding: 0 8px;
@@ -281,6 +221,7 @@ const emits = defineEmits(['detail', 'close'])
281
221
  display: -webkit-box;
282
222
  -webkit-line-clamp: 1;
283
223
  -webkit-box-orient: vertical;
224
+ text-align: left;
284
225
  }
285
226
  &-btn {
286
227
  color: #017fff;
@@ -13,8 +13,14 @@
13
13
  />系统公告
14
14
  </div>
15
15
  <div class="notice-popup-bd">
16
- {{ message.context }}
17
- <div class="notice-popup-bd-link" @click="toAllSystemNotice">点击查看附件</div>
16
+ <div style="white-space: pre-wrap">{{ message.context }}</div>
17
+ <div
18
+ v-if="message.jumpUrl || message.link"
19
+ class="notice-popup-bd-link"
20
+ @click="toViewAttachment"
21
+ >
22
+ 点击查看附件
23
+ </div>
18
24
  </div>
19
25
  <div class="notice-popup-ft">
20
26
  <div class="notice-popup-ft-btn" @click="onClose">我知道了</div>
@@ -36,7 +42,7 @@ const props = withDefaults(
36
42
  }
37
43
  )
38
44
 
39
- const { toReadFun, noticeClick } = useNotice()
45
+ const { noticeClick } = useNotice()
40
46
  const showPopup = ref(true)
41
47
 
42
48
  onMounted(() => {})
@@ -48,13 +54,11 @@ function onCancel() {
48
54
  emits('close')
49
55
  }
50
56
 
51
- // 查看全部系统公告
52
- function toAllSystemNotice() {
53
- noticeClick(props.message, () => {
54
- onClose()
57
+ // 查看附件
58
+ function toViewAttachment() {
59
+ onClose()
55
60
 
56
- emits('view', props.message.id)
57
- })
61
+ emits('view', props.message.jumpUrl || props.message.link)
58
62
  }
59
63
 
60
64
  // 关闭弹框
@@ -67,9 +71,9 @@ async function onClose() {
67
71
  receiveId: props.message.id,
68
72
  })
69
73
  .then(() => {
70
- if (props.message.isRead === 0) {
71
- toReadFun([props.message.id])
72
- }
74
+ // if (props.message.isRead === 0) {
75
+ // toReadFun([props.message.id])
76
+ // }
73
77
  onCancel()
74
78
  })
75
79
  }
@@ -2,7 +2,7 @@ import { useHttp } from '../api'
2
2
 
3
3
  export function useNotice() {
4
4
  // 点击消息时
5
- async function noticeClick(item: any, cb: Function) {
5
+ async function noticeClick(item: any, cb?: Function) {
6
6
  if (item.isRead === 0) {
7
7
  await toReadFun([item.id ?? item.msgId])
8
8
  }
@@ -35,7 +35,7 @@ export function useSafeArea(): SafeArea {
35
35
  */
36
36
  gap = capsule.top - status,
37
37
  nav = capsule.height + gap * 2,
38
- safeAreaBottom = systemInfo.safeArea?.bottom || 0,
38
+ safeAreaBottom = (systemInfo.safeArea || {}).bottom || 0,
39
39
  bottom = systemInfo.screenHeight - safeAreaBottom
40
40
  return {
41
41
  status,