@hlw-uni/mp-vue 1.1.1 → 1.1.3

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.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { defineComponent, resolveComponent, openBlock, createBlock, ref, computed, createElementBlock, normalizeClass, createElementVNode, toDisplayString, createCommentVNode, renderSlot, useSlots, withCtx, createTextVNode, normalizeStyle, unref, Fragment, renderList, withModifiers, createVNode, onMounted, onUnmounted } from "vue";
1
+ import { defineComponent, resolveComponent, openBlock, createBlock, ref, computed, createElementBlock, normalizeClass, createElementVNode, toDisplayString, createCommentVNode, renderSlot, useSlots, withCtx, createTextVNode, normalizeStyle, unref, Fragment, renderList, withModifiers, onMounted, onUnmounted, createVNode } from "vue";
2
2
  import { useColor } from "@hlw-uni/mp-core";
3
3
  import { defineStore } from "pinia";
4
4
  const _sfc_main$h = /* @__PURE__ */ defineComponent({
@@ -32,12 +32,12 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
32
32
  };
33
33
  }
34
34
  });
35
- const _hoisted_1$f = ["src"];
35
+ const _hoisted_1$g = ["src"];
36
36
  const _hoisted_2$d = {
37
37
  key: 1,
38
38
  class: "hlw-avatar__placeholder"
39
39
  };
40
- const _hoisted_3$8 = { class: "hlw-avatar__initial" };
40
+ const _hoisted_3$7 = { class: "hlw-avatar__initial" };
41
41
  const _sfc_main$g = /* @__PURE__ */ defineComponent({
42
42
  __name: "index",
43
43
  props: {
@@ -63,8 +63,8 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
63
63
  src: __props.src,
64
64
  mode: "aspectFill",
65
65
  onError: _cache[0] || (_cache[0] = ($event) => loadError.value = true)
66
- }, null, 40, _hoisted_1$f)) : (openBlock(), createElementBlock("view", _hoisted_2$d, [
67
- createElementVNode("text", _hoisted_3$8, toDisplayString(initial.value), 1)
66
+ }, null, 40, _hoisted_1$g)) : (openBlock(), createElementBlock("view", _hoisted_2$d, [
67
+ createElementVNode("text", _hoisted_3$7, toDisplayString(initial.value), 1)
68
68
  ]))
69
69
  ], 2);
70
70
  };
@@ -78,7 +78,7 @@ const _export_sfc = (sfc, props) => {
78
78
  return target;
79
79
  };
80
80
  const index$g = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-19006b2d"]]);
81
- const _hoisted_1$e = ["disabled", "open-type"];
81
+ const _hoisted_1$f = ["disabled", "open-type"];
82
82
  const _hoisted_2$c = {
83
83
  key: 0,
84
84
  class: "hlw-btn-spinner"
@@ -113,17 +113,17 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
113
113
  class: normalizeClass([__props.icon, "hlw-btn-icon"])
114
114
  }, null, 2)) : createCommentVNode("", true),
115
115
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
116
- ], 42, _hoisted_1$e);
116
+ ], 42, _hoisted_1$f);
117
117
  };
118
118
  }
119
119
  });
120
120
  const index$f = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-19a9c118"]]);
121
- const _hoisted_1$d = {
121
+ const _hoisted_1$e = {
122
122
  key: 0,
123
123
  class: "hlw-card-header"
124
124
  };
125
125
  const _hoisted_2$b = { class: "hlw-card-header-inner" };
126
- const _hoisted_3$7 = { class: "hlw-card-header-left" };
126
+ const _hoisted_3$6 = { class: "hlw-card-header-left" };
127
127
  const _hoisted_4$4 = {
128
128
  key: 0,
129
129
  class: "hlw-card-title"
@@ -181,10 +181,10 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
181
181
  __props.border ? "hlw-card--bordered" : ""
182
182
  ]])
183
183
  }, [
184
- hasHeader.value ? (openBlock(), createElementBlock("view", _hoisted_1$d, [
184
+ hasHeader.value ? (openBlock(), createElementBlock("view", _hoisted_1$e, [
185
185
  renderSlot(_ctx.$slots, "header", {}, () => [
186
186
  createElementVNode("view", _hoisted_2$b, [
187
- createElementVNode("view", _hoisted_3$7, [
187
+ createElementVNode("view", _hoisted_3$6, [
188
188
  renderSlot(_ctx.$slots, "header-left", {}, () => [
189
189
  __props.title ? (openBlock(), createElementBlock("text", _hoisted_4$4, toDisplayString(__props.title), 1)) : createCommentVNode("", true)
190
190
  ], true)
@@ -220,12 +220,12 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
220
220
  }
221
221
  });
222
222
  const index$e = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-cf55252e"]]);
223
- const _hoisted_1$c = {
223
+ const _hoisted_1$d = {
224
224
  key: 0,
225
225
  class: "hlw-cell-icon"
226
226
  };
227
227
  const _hoisted_2$a = { class: "hlw-cell-body" };
228
- const _hoisted_3$6 = { class: "hlw-cell-title" };
228
+ const _hoisted_3$5 = { class: "hlw-cell-title" };
229
229
  const _hoisted_4$3 = {
230
230
  key: 0,
231
231
  class: "hlw-cell-label"
@@ -269,7 +269,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
269
269
  "hover-class": "hlw-cell--hover"
270
270
  }, {
271
271
  default: withCtx(() => [
272
- __props.icon || _ctx.$slots.icon ? (openBlock(), createElementBlock("view", _hoisted_1$c, [
272
+ __props.icon || _ctx.$slots.icon ? (openBlock(), createElementBlock("view", _hoisted_1$d, [
273
273
  renderSlot(_ctx.$slots, "icon", {}, () => [
274
274
  createElementVNode("view", {
275
275
  class: normalizeClass(__props.icon)
@@ -277,7 +277,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
277
277
  ], true)
278
278
  ])) : createCommentVNode("", true),
279
279
  createElementVNode("view", _hoisted_2$a, [
280
- createElementVNode("view", _hoisted_3$6, [
280
+ createElementVNode("view", _hoisted_3$5, [
281
281
  renderSlot(_ctx.$slots, "title", {}, () => [
282
282
  createTextVNode(toDisplayString(__props.title), 1)
283
283
  ], true),
@@ -325,7 +325,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
325
325
  }
326
326
  });
327
327
  const index$d = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-996053be"]]);
328
- const _hoisted_1$b = {
328
+ const _hoisted_1$c = {
329
329
  key: 0,
330
330
  class: "hlw-divider-text"
331
331
  };
@@ -342,7 +342,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
342
342
  class: normalizeClass(["hlw-divider", [`hlw-divider--${__props.position}`, { "hlw-divider--dashed": __props.dashed }]])
343
343
  }, [
344
344
  _cache[0] || (_cache[0] = createElementVNode("view", { class: "hlw-divider-line" }, null, -1)),
345
- __props.text || _ctx.$slots.default ? (openBlock(), createElementBlock("view", _hoisted_1$b, [
345
+ __props.text || _ctx.$slots.default ? (openBlock(), createElementBlock("view", _hoisted_1$c, [
346
346
  renderSlot(_ctx.$slots, "default", {}, () => [
347
347
  createTextVNode(toDisplayString(__props.text), 1)
348
348
  ], true)
@@ -353,9 +353,9 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
353
353
  }
354
354
  });
355
355
  const index$c = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-beaa0298"]]);
356
- const _hoisted_1$a = { class: "hlw-empty" };
356
+ const _hoisted_1$b = { class: "hlw-empty" };
357
357
  const _hoisted_2$9 = ["src"];
358
- const _hoisted_3$5 = {
358
+ const _hoisted_3$4 = {
359
359
  key: 1,
360
360
  class: "hlw-empty__icon i-fa6-solid-box-open"
361
361
  };
@@ -368,13 +368,13 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
368
368
  },
369
369
  setup(__props) {
370
370
  return (_ctx, _cache) => {
371
- return openBlock(), createElementBlock("view", _hoisted_1$a, [
371
+ return openBlock(), createElementBlock("view", _hoisted_1$b, [
372
372
  __props.image ? (openBlock(), createElementBlock("image", {
373
373
  key: 0,
374
374
  class: "hlw-empty__image",
375
375
  src: __props.image,
376
376
  mode: "aspectFit"
377
- }, null, 8, _hoisted_2$9)) : (openBlock(), createElementBlock("view", _hoisted_3$5)),
377
+ }, null, 8, _hoisted_2$9)) : (openBlock(), createElementBlock("view", _hoisted_3$4)),
378
378
  createElementVNode("text", _hoisted_4$2, toDisplayString(__props.text || "暂无数据"), 1),
379
379
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
380
380
  ]);
@@ -382,7 +382,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
382
382
  }
383
383
  });
384
384
  const index$b = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-94fefc47"]]);
385
- const _hoisted_1$9 = {
385
+ const _hoisted_1$a = {
386
386
  key: 0,
387
387
  class: "header-placeholder"
388
388
  };
@@ -477,7 +477,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
477
477
  }, toDisplayString(props.title), 5)
478
478
  ], true)
479
479
  ], 2),
480
- props.titleAlign === "center" ? (openBlock(), createElementBlock("view", _hoisted_1$9)) : createCommentVNode("", true)
480
+ props.titleAlign === "center" ? (openBlock(), createElementBlock("view", _hoisted_1$a)) : createCommentVNode("", true)
481
481
  ], 64)) : renderSlot(_ctx.$slots, "default", { key: 1 }, () => [
482
482
  props.title ? (openBlock(), createElementBlock("view", _hoisted_2$8, [
483
483
  createElementVNode("text", {
@@ -492,7 +492,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
492
492
  }
493
493
  });
494
494
  const index$a = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-b85e90ac"]]);
495
- const _hoisted_1$8 = { class: "hlw-loading" };
495
+ const _hoisted_1$9 = { class: "hlw-loading" };
496
496
  const _hoisted_2$7 = {
497
497
  key: 0,
498
498
  class: "hlw-loading__text"
@@ -504,7 +504,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
504
504
  },
505
505
  setup(__props) {
506
506
  return (_ctx, _cache) => {
507
- return openBlock(), createElementBlock("view", _hoisted_1$8, [
507
+ return openBlock(), createElementBlock("view", _hoisted_1$9, [
508
508
  _cache[0] || (_cache[0] = createElementVNode("view", { class: "hlw-loading__spinner" }, null, -1)),
509
509
  __props.text ? (openBlock(), createElementBlock("text", _hoisted_2$7, toDisplayString(__props.text), 1)) : createCommentVNode("", true)
510
510
  ]);
@@ -512,7 +512,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
512
512
  }
513
513
  });
514
514
  const index$9 = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-fd9272d5"]]);
515
- const _hoisted_1$7 = {
515
+ const _hoisted_1$8 = {
516
516
  key: 0,
517
517
  class: "hlw-menu-title"
518
518
  };
@@ -520,7 +520,7 @@ const _hoisted_2$6 = {
520
520
  key: 1,
521
521
  class: "hlw-menu-title-divider"
522
522
  };
523
- const _hoisted_3$4 = { class: "hlw-menu-left" };
523
+ const _hoisted_3$3 = { class: "hlw-menu-left" };
524
524
  const _hoisted_4$1 = { class: "hlw-menu-label" };
525
525
  const _hoisted_5 = { class: "hlw-menu-right" };
526
526
  const _hoisted_6 = {
@@ -570,7 +570,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
570
570
  return openBlock(), createElementBlock("view", {
571
571
  class: normalizeClass(["hlw-menu", { "hlw-menu--no-border": !props.border }])
572
572
  }, [
573
- props.title ? (openBlock(), createElementBlock("view", _hoisted_1$7, [
573
+ props.title ? (openBlock(), createElementBlock("view", _hoisted_1$8, [
574
574
  createElementVNode("text", null, toDisplayString(props.title), 1)
575
575
  ])) : createCommentVNode("", true),
576
576
  props.title ? (openBlock(), createElementBlock("view", _hoisted_2$6)) : createCommentVNode("", true),
@@ -583,7 +583,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
583
583
  "hover-class": "hlw-menu-item--active"
584
584
  }, {
585
585
  default: withCtx(() => [
586
- createElementVNode("view", _hoisted_3$4, [
586
+ createElementVNode("view", _hoisted_3$3, [
587
587
  createElementVNode("view", {
588
588
  class: normalizeClass(["hlw-menu-icon", `hlw-menu-icon--${item.iconTheme || "slate"}`])
589
589
  }, [
@@ -690,12 +690,12 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
690
690
  }
691
691
  });
692
692
  const index$8 = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-2d7cd322"]]);
693
- const _hoisted_1$6 = {
693
+ const _hoisted_1$7 = {
694
694
  key: 0,
695
695
  class: "hlw-modal-title"
696
696
  };
697
697
  const _hoisted_2$5 = { class: "hlw-modal-body" };
698
- const _hoisted_3$3 = { class: "hlw-modal-footer" };
698
+ const _hoisted_3$2 = { class: "hlw-modal-footer" };
699
699
  const _sfc_main$7 = /* @__PURE__ */ defineComponent({
700
700
  __name: "index",
701
701
  props: {
@@ -708,11 +708,14 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
708
708
  },
709
709
  emits: ["update:show", "confirm", "cancel"],
710
710
  setup(__props, { emit: __emit }) {
711
+ const props = __props;
711
712
  const emit = __emit;
712
713
  function close() {
713
714
  emit("update:show", false);
714
715
  }
715
716
  function onMask() {
717
+ if (!props.closeOnMask)
718
+ return;
716
719
  close();
717
720
  }
718
721
  function onConfirm() {
@@ -730,37 +733,39 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
730
733
  onTap: withModifiers(onMask, ["self"])
731
734
  }, [
732
735
  createElementVNode("view", {
733
- class: normalizeClass(["hlw-modal", { "hlw-modal--show": __props.show }])
736
+ class: normalizeClass(["hlw-modal", { "hlw-modal--show": __props.show }]),
737
+ onTap: _cache[0] || (_cache[0] = withModifiers(() => {
738
+ }, ["stop"]))
734
739
  }, [
735
- __props.title ? (openBlock(), createElementBlock("view", _hoisted_1$6, toDisplayString(__props.title), 1)) : createCommentVNode("", true),
740
+ __props.title ? (openBlock(), createElementBlock("view", _hoisted_1$7, toDisplayString(__props.title), 1)) : createCommentVNode("", true),
736
741
  createElementVNode("view", _hoisted_2$5, [
737
742
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
738
743
  ]),
739
744
  renderSlot(_ctx.$slots, "footer", {}, () => [
740
- createElementVNode("view", _hoisted_3$3, [
745
+ createElementVNode("view", _hoisted_3$2, [
741
746
  __props.showCancel ? (openBlock(), createElementBlock("view", {
742
747
  key: 0,
743
748
  class: "hlw-modal-btn hlw-modal-btn--cancel",
744
- onTap: onCancel
749
+ onTap: withModifiers(onCancel, ["stop"])
745
750
  }, toDisplayString(__props.cancelText), 33)) : createCommentVNode("", true),
746
751
  createElementVNode("view", {
747
752
  class: "hlw-modal-btn hlw-modal-btn--confirm",
748
- onTap: onConfirm
753
+ onTap: withModifiers(onConfirm, ["stop"])
749
754
  }, toDisplayString(__props.confirmText), 33)
750
755
  ])
751
756
  ], true)
752
- ], 2)
757
+ ], 34)
753
758
  ], 32)) : createCommentVNode("", true);
754
759
  };
755
760
  }
756
761
  });
757
- const index$7 = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-397b9549"]]);
758
- const _hoisted_1$5 = {
762
+ const index$7 = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-91d9e108"]]);
763
+ const _hoisted_1$6 = {
759
764
  key: 1,
760
765
  class: "hlw-notice-left-icon i-fa6-solid-bullhorn"
761
766
  };
762
767
  const _hoisted_2$4 = { class: "hlw-notice-text" };
763
- const _hoisted_3$2 = {
768
+ const _hoisted_3$1 = {
764
769
  key: 1,
765
770
  class: "hlw-notice-text hlw-notice-text--ellipsis"
766
771
  };
@@ -793,7 +798,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
793
798
  __props.leftIcon ? (openBlock(), createElementBlock("view", {
794
799
  key: 0,
795
800
  class: normalizeClass([__props.leftIcon, "hlw-notice-left-icon"])
796
- }, null, 2)) : (openBlock(), createElementBlock("view", _hoisted_1$5)),
801
+ }, null, 2)) : (openBlock(), createElementBlock("view", _hoisted_1$6)),
797
802
  createElementVNode("view", {
798
803
  class: "hlw-notice-wrap",
799
804
  onTap: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click"))
@@ -804,7 +809,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
804
809
  style: normalizeStyle(animStyle.value)
805
810
  }, [
806
811
  createElementVNode("text", _hoisted_2$4, toDisplayString(__props.text), 1)
807
- ], 4)) : (openBlock(), createElementBlock("text", _hoisted_3$2, toDisplayString(__props.text), 1))
812
+ ], 4)) : (openBlock(), createElementBlock("text", _hoisted_3$1, toDisplayString(__props.text), 1))
808
813
  ], 32),
809
814
  __props.closable ? (openBlock(), createElementBlock("view", {
810
815
  key: 2,
@@ -816,9 +821,111 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
816
821
  }
817
822
  });
818
823
  const index$6 = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-7a758299"]]);
819
- const _hoisted_1$4 = { class: "hlw-page" };
820
- const _hoisted_2$3 = { class: "hlw-page-header" };
821
- const _hoisted_3$1 = { class: "hlw-page-footer" };
824
+ const FONT_SCALE_KEY = "hlw_font_scale";
825
+ const FONT_PRESETS = {
826
+ small: {
827
+ label: "小字体",
828
+ vars: {
829
+ "--font-xs": "16rpx",
830
+ "--font-sm": "20rpx",
831
+ "--font-base": "24rpx",
832
+ "--font-md": "28rpx",
833
+ "--font-lg": "32rpx",
834
+ "--font-xl": "36rpx"
835
+ }
836
+ },
837
+ normal: {
838
+ label: "标准",
839
+ vars: {
840
+ "--font-xs": "20rpx",
841
+ "--font-sm": "24rpx",
842
+ "--font-base": "28rpx",
843
+ "--font-md": "32rpx",
844
+ "--font-lg": "36rpx",
845
+ "--font-xl": "40rpx"
846
+ }
847
+ },
848
+ large: {
849
+ label: "大字体",
850
+ vars: {
851
+ "--font-xs": "24rpx",
852
+ "--font-sm": "30rpx",
853
+ "--font-base": "34rpx",
854
+ "--font-md": "40rpx",
855
+ "--font-lg": "46rpx",
856
+ "--font-xl": "52rpx"
857
+ }
858
+ },
859
+ xlarge: {
860
+ label: "超大字体",
861
+ vars: {
862
+ "--font-xs": "28rpx",
863
+ "--font-sm": "36rpx",
864
+ "--font-base": "42rpx",
865
+ "--font-md": "48rpx",
866
+ "--font-lg": "56rpx",
867
+ "--font-xl": "64rpx"
868
+ }
869
+ }
870
+ };
871
+ function getCurrentFontScale() {
872
+ try {
873
+ const v = uni.getStorageSync(FONT_SCALE_KEY);
874
+ if (v === "small" || v === "large" || v === "xlarge")
875
+ return v;
876
+ } catch {
877
+ }
878
+ return "normal";
879
+ }
880
+ function getCurrentFontVars() {
881
+ return FONT_PRESETS[getCurrentFontScale()].vars;
882
+ }
883
+ const { hexToRgba, darkenHex } = useColor();
884
+ const THEME_COLOR_KEY = "hlw_theme_color";
885
+ const DEFAULT_THEMES = [
886
+ { label: "默认蓝", value: "#3b82f6" },
887
+ { label: "活力橙", value: "#f97316" },
888
+ { label: "翡翠绿", value: "#10b981" },
889
+ { label: "玫瑰红", value: "#f43f5e" },
890
+ { label: "紫罗兰", value: "#8b5cf6" },
891
+ { label: "青石灰", value: "#64748b" }
892
+ ];
893
+ function getCurrentThemeColor() {
894
+ try {
895
+ const v = uni.getStorageSync(THEME_COLOR_KEY);
896
+ if (v && typeof v === "string")
897
+ return v;
898
+ } catch {
899
+ }
900
+ return DEFAULT_THEMES[0].value;
901
+ }
902
+ function getCurrentThemeVars() {
903
+ const color = getCurrentThemeColor();
904
+ return {
905
+ "--primary-color": color,
906
+ "--primary-light": hexToRgba(color, 0.12),
907
+ "--primary-dark": darkenHex(color)
908
+ };
909
+ }
910
+ const { varsToStyle } = useColor();
911
+ const THEME_CHANGE_EVENT = "hlw:theme-change";
912
+ function buildThemeStyle() {
913
+ return varsToStyle({
914
+ ...getCurrentFontVars(),
915
+ ...getCurrentThemeVars()
916
+ });
917
+ }
918
+ function useThemePageStyle() {
919
+ const themePageStyle = ref(buildThemeStyle());
920
+ const onThemeChange = () => {
921
+ themePageStyle.value = buildThemeStyle();
922
+ };
923
+ onMounted(() => uni.$on(THEME_CHANGE_EVENT, onThemeChange));
924
+ onUnmounted(() => uni.$off(THEME_CHANGE_EVENT, onThemeChange));
925
+ return { themePageStyle };
926
+ }
927
+ const _hoisted_1$5 = { class: "hlw-page-header" };
928
+ const _hoisted_2$3 = { class: "hlw-page-footer" };
822
929
  const _sfc_main$5 = /* @__PURE__ */ defineComponent({
823
930
  __name: "index",
824
931
  props: {
@@ -828,11 +935,15 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
828
935
  },
829
936
  setup(__props) {
830
937
  const props = __props;
938
+ const { themePageStyle } = useThemePageStyle();
831
939
  return (_ctx, _cache) => {
832
940
  const _component_hlw_header = resolveComponent("hlw-header");
833
941
  const _component_scroll_view = resolveComponent("scroll-view");
834
- return openBlock(), createElementBlock("view", _hoisted_1$4, [
835
- createElementVNode("view", _hoisted_2$3, [
942
+ return openBlock(), createElementBlock("view", {
943
+ class: "hlw-page",
944
+ style: normalizeStyle(unref(themePageStyle))
945
+ }, [
946
+ createElementVNode("view", _hoisted_1$5, [
836
947
  renderSlot(_ctx.$slots, "header", {}, () => [
837
948
  props.title || props.isBack ? (openBlock(), createBlock(_component_hlw_header, {
838
949
  key: 0,
@@ -847,22 +958,23 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
847
958
  "scroll-y": true,
848
959
  "enable-flex": true,
849
960
  enhanced: true,
850
- "show-scrollbar": false
961
+ "show-scrollbar": false,
962
+ style: normalizeStyle(unref(themePageStyle))
851
963
  }, {
852
964
  default: withCtx(() => [
853
965
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
854
966
  ]),
855
967
  _: 3
856
- }),
857
- createElementVNode("view", _hoisted_3$1, [
968
+ }, 8, ["style"]),
969
+ createElementVNode("view", _hoisted_2$3, [
858
970
  renderSlot(_ctx.$slots, "footer", {}, void 0, true)
859
971
  ])
860
- ]);
972
+ ], 4);
861
973
  };
862
974
  }
863
975
  });
864
- const index$5 = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-0cf37585"]]);
865
- const _hoisted_1$3 = {
976
+ const index$5 = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-01bb7796"]]);
977
+ const _hoisted_1$4 = {
866
978
  key: 0,
867
979
  class: "hlw-popup-header"
868
980
  };
@@ -884,16 +996,17 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
884
996
  emit("close");
885
997
  }
886
998
  return (_ctx, _cache) => {
887
- return openBlock(), createElementBlock(Fragment, null, [
888
- __props.show ? (openBlock(), createElementBlock("view", {
889
- key: 0,
999
+ return __props.show ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1000
+ createElementVNode("view", {
890
1001
  class: "hlw-popup-mask",
891
1002
  onTap: withModifiers(onClose, ["self"])
892
- }, null, 32)) : createCommentVNode("", true),
1003
+ }, null, 32),
893
1004
  createElementVNode("view", {
894
- class: normalizeClass(["hlw-popup", [`hlw-popup--${__props.position}`, { "hlw-popup--show": __props.show, "hlw-popup--round": __props.round }]])
1005
+ class: normalizeClass(["hlw-popup", [`hlw-popup--${__props.position}`, { "hlw-popup--round": __props.round }]]),
1006
+ onTap: _cache[0] || (_cache[0] = withModifiers(() => {
1007
+ }, ["stop"]))
895
1008
  }, [
896
- __props.title || __props.closable ? (openBlock(), createElementBlock("view", _hoisted_1$3, [
1009
+ __props.title || __props.closable ? (openBlock(), createElementBlock("view", _hoisted_1$4, [
897
1010
  createElementVNode("text", _hoisted_2$2, toDisplayString(__props.title), 1),
898
1011
  __props.closable ? (openBlock(), createElementBlock("view", {
899
1012
  key: 0,
@@ -902,13 +1015,13 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
902
1015
  }, null, 32)) : createCommentVNode("", true)
903
1016
  ])) : createCommentVNode("", true),
904
1017
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
905
- ], 2)
906
- ], 64);
1018
+ ], 34)
1019
+ ], 64)) : createCommentVNode("", true);
907
1020
  };
908
1021
  }
909
1022
  });
910
- const index$4 = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-2d71ef9b"]]);
911
- const _hoisted_1$2 = ["value", "placeholder", "disabled"];
1023
+ const index$4 = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-be12aee0"]]);
1024
+ const _hoisted_1$3 = ["value", "placeholder", "disabled"];
912
1025
  const _sfc_main$3 = /* @__PURE__ */ defineComponent({
913
1026
  __name: "index",
914
1027
  props: {
@@ -950,7 +1063,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
950
1063
  onConfirm: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("search", __props.modelValue)),
951
1064
  onFocus: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("focus")),
952
1065
  onBlur: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("blur"))
953
- }, null, 40, _hoisted_1$2),
1066
+ }, null, 40, _hoisted_1$3),
954
1067
  __props.clearable && __props.modelValue ? (openBlock(), createElementBlock("view", {
955
1068
  key: 0,
956
1069
  class: "hlw-search-clear i-fa6-solid-xmark",
@@ -962,7 +1075,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
962
1075
  }
963
1076
  });
964
1077
  const index$3 = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-4fe1bfab"]]);
965
- const _hoisted_1$1 = { class: "hlw-skeleton-content" };
1078
+ const _hoisted_1$2 = { class: "hlw-skeleton-content" };
966
1079
  const _hoisted_2$1 = {
967
1080
  key: 0,
968
1081
  class: "hlw-skeleton-title"
@@ -987,7 +1100,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
987
1100
  key: 0,
988
1101
  class: normalizeClass(["hlw-skeleton-avatar", `hlw-skeleton-avatar--${__props.avatarSize}`])
989
1102
  }, null, 2)) : createCommentVNode("", true),
990
- createElementVNode("view", _hoisted_1$1, [
1103
+ createElementVNode("view", _hoisted_1$2, [
991
1104
  __props.title ? (openBlock(), createElementBlock("view", _hoisted_2$1)) : createCommentVNode("", true),
992
1105
  (openBlock(true), createElementBlock(Fragment, null, renderList(__props.rows, (i) => {
993
1106
  return openBlock(), createElementBlock("view", {
@@ -1002,7 +1115,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
1002
1115
  }
1003
1116
  });
1004
1117
  const index$2 = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-bc3155a2"]]);
1005
- const _hoisted_1 = { class: "hlw-tabs-wrap" };
1118
+ const _hoisted_1$1 = { class: "hlw-tabs-wrap" };
1006
1119
  const _hoisted_2 = ["onTap"];
1007
1120
  const _hoisted_3 = { class: "hlw-tab-text" };
1008
1121
  const _hoisted_4 = {
@@ -1033,7 +1146,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
1033
1146
  "show-scrollbar": false
1034
1147
  }, {
1035
1148
  default: withCtx(() => [
1036
- createElementVNode("view", _hoisted_1, [
1149
+ createElementVNode("view", _hoisted_1$1, [
1037
1150
  (openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item, index2) => {
1038
1151
  return openBlock(), createElementBlock("view", {
1039
1152
  key: index2,
@@ -1057,6 +1170,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
1057
1170
  }
1058
1171
  });
1059
1172
  const index$1 = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-5a47c034"]]);
1173
+ const _hoisted_1 = { class: "hlw-tag-text" };
1060
1174
  const _sfc_main = /* @__PURE__ */ defineComponent({
1061
1175
  __name: "index",
1062
1176
  props: {
@@ -1081,7 +1195,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1081
1195
  style: normalizeStyle(customStyle.value),
1082
1196
  onTap: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("click"))
1083
1197
  }, [
1084
- renderSlot(_ctx.$slots, "default", {}, void 0, true),
1198
+ createElementVNode("text", _hoisted_1, [
1199
+ renderSlot(_ctx.$slots, "default", {}, void 0, true)
1200
+ ]),
1085
1201
  __props.closable ? (openBlock(), createElementBlock("view", {
1086
1202
  key: 0,
1087
1203
  class: "hlw-tag-close i-fa6-solid-xmark",
@@ -1091,110 +1207,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1091
1207
  };
1092
1208
  }
1093
1209
  });
1094
- const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-fd774288"]]);
1095
- const FONT_SCALE_KEY = "hlw_font_scale";
1096
- const FONT_PRESETS = {
1097
- small: {
1098
- label: "小字体",
1099
- vars: {
1100
- "--font-xs": "16rpx",
1101
- "--font-sm": "20rpx",
1102
- "--font-base": "24rpx",
1103
- "--font-md": "28rpx",
1104
- "--font-lg": "32rpx",
1105
- "--font-xl": "36rpx"
1106
- }
1107
- },
1108
- normal: {
1109
- label: "标准",
1110
- vars: {
1111
- "--font-xs": "20rpx",
1112
- "--font-sm": "24rpx",
1113
- "--font-base": "28rpx",
1114
- "--font-md": "32rpx",
1115
- "--font-lg": "36rpx",
1116
- "--font-xl": "40rpx"
1117
- }
1118
- },
1119
- large: {
1120
- label: "大字体",
1121
- vars: {
1122
- "--font-xs": "24rpx",
1123
- "--font-sm": "30rpx",
1124
- "--font-base": "34rpx",
1125
- "--font-md": "40rpx",
1126
- "--font-lg": "46rpx",
1127
- "--font-xl": "52rpx"
1128
- }
1129
- },
1130
- xlarge: {
1131
- label: "超大字体",
1132
- vars: {
1133
- "--font-xs": "28rpx",
1134
- "--font-sm": "36rpx",
1135
- "--font-base": "42rpx",
1136
- "--font-md": "48rpx",
1137
- "--font-lg": "56rpx",
1138
- "--font-xl": "64rpx"
1139
- }
1140
- }
1141
- };
1142
- function getCurrentFontScale() {
1143
- try {
1144
- const v = uni.getStorageSync(FONT_SCALE_KEY);
1145
- if (v === "small" || v === "large" || v === "xlarge")
1146
- return v;
1147
- } catch {
1148
- }
1149
- return "normal";
1150
- }
1151
- function getCurrentFontVars() {
1152
- return FONT_PRESETS[getCurrentFontScale()].vars;
1153
- }
1154
- const { hexToRgba, darkenHex } = useColor();
1155
- const THEME_COLOR_KEY = "hlw_theme_color";
1156
- const DEFAULT_THEMES = [
1157
- { label: "默认蓝", value: "#3b82f6" },
1158
- { label: "活力橙", value: "#f97316" },
1159
- { label: "翡翠绿", value: "#10b981" },
1160
- { label: "玫瑰红", value: "#f43f5e" },
1161
- { label: "紫罗兰", value: "#8b5cf6" },
1162
- { label: "青石灰", value: "#64748b" }
1163
- ];
1164
- function getCurrentThemeColor() {
1165
- try {
1166
- const v = uni.getStorageSync(THEME_COLOR_KEY);
1167
- if (v && typeof v === "string")
1168
- return v;
1169
- } catch {
1170
- }
1171
- return DEFAULT_THEMES[0].value;
1172
- }
1173
- function getCurrentThemeVars() {
1174
- const color = getCurrentThemeColor();
1175
- return {
1176
- "--primary-color": color,
1177
- "--primary-light": hexToRgba(color, 0.12),
1178
- "--primary-dark": darkenHex(color)
1179
- };
1180
- }
1181
- const { varsToStyle } = useColor();
1182
- const THEME_CHANGE_EVENT = "hlw:theme-change";
1183
- function buildThemeStyle() {
1184
- return varsToStyle({
1185
- ...getCurrentFontVars(),
1186
- ...getCurrentThemeVars()
1187
- });
1188
- }
1189
- function useThemePageStyle() {
1190
- const themePageStyle = ref(buildThemeStyle());
1191
- const onThemeChange = () => {
1192
- themePageStyle.value = buildThemeStyle();
1193
- };
1194
- onMounted(() => uni.$on(THEME_CHANGE_EVENT, onThemeChange));
1195
- onUnmounted(() => uni.$off(THEME_CHANGE_EVENT, onThemeChange));
1196
- return { themePageStyle };
1197
- }
1210
+ const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-a407a3ce"]]);
1198
1211
  const useThemeStore = defineStore(
1199
1212
  "theme",
1200
1213
  () => {