@uxda/appkit 1.2.54 → 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;
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: {
@@ -3593,8 +3594,10 @@ var script$2 = /* @__PURE__ */ defineComponent({
3593
3594
  default: withCtx(() => [
3594
3595
  _hoisted_1$2,
3595
3596
  createElementVNode("div", _hoisted_2$2, [
3596
- createTextVNode(
3597
- toDisplayString(_ctx.message.context) + " ",
3597
+ createElementVNode(
3598
+ "div",
3599
+ _hoisted_3$1,
3600
+ toDisplayString(_ctx.message.context),
3598
3601
  1
3599
3602
  /* TEXT */
3600
3603
  ),
@@ -3631,13 +3634,17 @@ const _hoisted_1$1 = /* @__PURE__ */ createElementVNode(
3631
3634
  -1
3632
3635
  /* HOISTED */
3633
3636
  );
3634
- const _hoisted_2$1 = { class: "notice-banner-text" };
3637
+ const _hoisted_2$1 = {
3638
+ class: "notice-banner-text",
3639
+ style: { "white-space": "pre-wrap" }
3640
+ };
3635
3641
  const _hoisted_3 = ["onClick"];
3636
3642
  var script$1 = /* @__PURE__ */ defineComponent({
3637
3643
  __name: "NoticeBanner",
3638
3644
  props: {
3639
3645
  app: { type: String, required: true, default: "" },
3640
- bannerStyle: { type: null, required: false, default: "" }
3646
+ bannerStyle: { type: null, required: false, default: "" },
3647
+ fixed: { type: Boolean, required: false, default: false }
3641
3648
  },
3642
3649
  emits: ["detail", "close", "view"],
3643
3650
  setup(__props, { emit: __emit }) {
@@ -3646,6 +3653,14 @@ var script$1 = /* @__PURE__ */ defineComponent({
3646
3653
  const bannerMessages = ref([]);
3647
3654
  const popMessages = ref([]);
3648
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
+ });
3649
3664
  onMounted(() => {
3650
3665
  queryNoticeMsg();
3651
3666
  });
@@ -3666,12 +3681,12 @@ var script$1 = /* @__PURE__ */ defineComponent({
3666
3681
  }
3667
3682
  let interval = null;
3668
3683
  function startMessageCarousel() {
3669
- clearInterval(interval);
3684
+ stopMessageCarousel();
3670
3685
  if (bannerMessages.value.length > 1) {
3671
3686
  interval = setInterval(() => {
3672
3687
  startMessageCalc();
3673
3688
  if (bannerMessages.value.length <= 1) {
3674
- clearInterval(interval);
3689
+ stopMessageCarousel();
3675
3690
  }
3676
3691
  }, 3e3);
3677
3692
  }
@@ -3683,8 +3698,11 @@ var script$1 = /* @__PURE__ */ defineComponent({
3683
3698
  activeKey.value = 0;
3684
3699
  }
3685
3700
  }
3686
- function onClose(item, index) {
3701
+ function stopMessageCarousel() {
3687
3702
  clearInterval(interval);
3703
+ }
3704
+ function onClose(item, index) {
3705
+ stopMessageCarousel();
3688
3706
  const $http = useHttp();
3689
3707
  $http.post("/cas/msg/setMsgStatus", {
3690
3708
  device: "PC",
@@ -3709,6 +3727,12 @@ var script$1 = /* @__PURE__ */ defineComponent({
3709
3727
  function onView(item) {
3710
3728
  emits("view", item.link);
3711
3729
  }
3730
+ function onTouchStart() {
3731
+ stopMessageCarousel();
3732
+ }
3733
+ const onTouchEnd = debounce(() => {
3734
+ startMessageCarousel();
3735
+ }, 100);
3712
3736
  const emits = __emit;
3713
3737
  return (_ctx, _cache) => {
3714
3738
  return openBlock(), createElementBlock(
@@ -3719,8 +3743,11 @@ var script$1 = /* @__PURE__ */ defineComponent({
3719
3743
  "div",
3720
3744
  {
3721
3745
  key: 0,
3722
- class: "notice-banner",
3723
- style: normalizeStyle(_ctx.bannerStyle)
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))
3724
3751
  },
3725
3752
  [
3726
3753
  (openBlock(true), createElementBlock(
@@ -3755,8 +3782,8 @@ var script$1 = /* @__PURE__ */ defineComponent({
3755
3782
  /* KEYED_FRAGMENT */
3756
3783
  ))
3757
3784
  ],
3758
- 4
3759
- /* STYLE */
3785
+ 38
3786
+ /* CLASS, STYLE, NEED_HYDRATION */
3760
3787
  )) : createCommentVNode("v-if", true),
3761
3788
  createCommentVNode(" \u7CFB\u7EDF\u516C\u544A\u5F3A\u5236\u5F39\u6846 "),
3762
3789
  (openBlock(true), createElementBlock(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxda/appkit",
3
- "version": "1.2.54",
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" :style="bannerStyle" v-if="bannerMessages.length">
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,7 +19,7 @@
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
25
  <div class="notice-banner-btn" @click="onDetail(item)">详情</div>
@@ -26,22 +33,26 @@
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
40
49
  bannerStyle?: any
50
+ fixed?: boolean
41
51
  }>(),
42
52
  {
43
53
  app: '',
44
54
  bannerStyle: '',
55
+ fixed: false,
45
56
  }
46
57
  )
47
58
 
@@ -49,6 +60,15 @@ const { toReadFun, noticeClick } = useNotice()
49
60
  const bannerMessages = ref<any[]>([]) // 横幅消息
50
61
  const popMessages = ref<any[]>([]) // 弹窗消息
51
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
+ })
52
72
 
53
73
  onMounted(() => {
54
74
  queryNoticeMsg()
@@ -78,12 +98,12 @@ async function queryNoticeMsg() {
78
98
  let interval: any = null
79
99
  // 启动消息轮播
80
100
  function startMessageCarousel() {
81
- clearInterval(interval)
101
+ stopMessageCarousel()
82
102
  if (bannerMessages.value.length > 1) {
83
103
  interval = setInterval(() => {
84
104
  startMessageCalc()
85
105
  if (bannerMessages.value.length <= 1) {
86
- clearInterval(interval)
106
+ stopMessageCarousel()
87
107
  }
88
108
  }, 3000)
89
109
  }
@@ -95,10 +115,14 @@ function startMessageCalc() {
95
115
  activeKey.value = 0
96
116
  }
97
117
  }
118
+ // 停止消息轮播
119
+ function stopMessageCarousel() {
120
+ clearInterval(interval)
121
+ }
98
122
 
99
123
  // 关闭横幅
100
124
  function onClose(item: any, index: number) {
101
- clearInterval(interval)
125
+ stopMessageCarousel()
102
126
 
103
127
  const $http = useHttp()
104
128
  $http
@@ -138,6 +162,14 @@ function onView(item) {
138
162
  emits('view', item.link)
139
163
  }
140
164
 
165
+ // 处理手势移入/移出
166
+ function onTouchStart() {
167
+ stopMessageCarousel()
168
+ }
169
+ const onTouchEnd = debounce(() => {
170
+ startMessageCarousel()
171
+ }, 100)
172
+
141
173
  // 父组件事件
142
174
  const emits = defineEmits(['detail', 'close', 'view'])
143
175
  </script>
@@ -146,10 +178,15 @@ const emits = defineEmits(['detail', 'close', 'view'])
146
178
  .notice-banner {
147
179
  height: 30px;
148
180
  margin-bottom: 8px;
181
+ &.fixed {
182
+ position: fixed;
183
+ z-index: 10;
184
+ width: 100%;
185
+ }
149
186
 
150
187
  .dd-notice-bar {
151
188
  position: relative;
152
- background: #f2f3ff;
189
+ background: #e6f2ff;
153
190
  font-size: 10px;
154
191
  color: #000000e5;
155
192
  padding: 0 8px;
@@ -13,7 +13,7 @@
13
13
  />系统公告
14
14
  </div>
15
15
  <div class="notice-popup-bd">
16
- {{ message.context }}
16
+ <div style="white-space: pre-wrap">{{ message.context }}</div>
17
17
  <div
18
18
  v-if="message.jumpUrl || message.link"
19
19
  class="notice-popup-bd-link"
@@ -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,