@hlw-uni/mp-vue 1.1.2 → 1.1.4
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/README.md +82 -0
- package/dist/index.js +176 -168
- package/dist/index.mjs +177 -169
- package/dist/style.css +94 -58
- package/package.json +8 -7
- package/src/components/hlw-header/index.vue +7 -1
- package/src/components/hlw-page/index.vue +5 -1
- package/src/components/hlw-popup/index.vue +40 -17
- package/src/components/hlw-tag/index.vue +30 -3
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,
|
|
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$
|
|
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$
|
|
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$
|
|
67
|
-
createElementVNode("text", _hoisted_3$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
356
|
+
const _hoisted_1$b = { class: "hlw-empty" };
|
|
357
357
|
const _hoisted_2$9 = ["src"];
|
|
358
|
-
const _hoisted_3$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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", {
|
|
@@ -491,8 +491,8 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
491
491
|
};
|
|
492
492
|
}
|
|
493
493
|
});
|
|
494
|
-
const index$a = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-
|
|
495
|
-
const _hoisted_1$
|
|
494
|
+
const index$a = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-8497ffe5"]]);
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
698
|
+
const _hoisted_3$2 = { class: "hlw-modal-footer" };
|
|
699
699
|
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
700
700
|
__name: "index",
|
|
701
701
|
props: {
|
|
@@ -737,12 +737,12 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
737
737
|
onTap: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
738
738
|
}, ["stop"]))
|
|
739
739
|
}, [
|
|
740
|
-
__props.title ? (openBlock(), createElementBlock("view", _hoisted_1$
|
|
740
|
+
__props.title ? (openBlock(), createElementBlock("view", _hoisted_1$7, toDisplayString(__props.title), 1)) : createCommentVNode("", true),
|
|
741
741
|
createElementVNode("view", _hoisted_2$5, [
|
|
742
742
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
743
743
|
]),
|
|
744
744
|
renderSlot(_ctx.$slots, "footer", {}, () => [
|
|
745
|
-
createElementVNode("view", _hoisted_3$
|
|
745
|
+
createElementVNode("view", _hoisted_3$2, [
|
|
746
746
|
__props.showCancel ? (openBlock(), createElementBlock("view", {
|
|
747
747
|
key: 0,
|
|
748
748
|
class: "hlw-modal-btn hlw-modal-btn--cancel",
|
|
@@ -760,12 +760,12 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
760
760
|
}
|
|
761
761
|
});
|
|
762
762
|
const index$7 = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-91d9e108"]]);
|
|
763
|
-
const _hoisted_1$
|
|
763
|
+
const _hoisted_1$6 = {
|
|
764
764
|
key: 1,
|
|
765
765
|
class: "hlw-notice-left-icon i-fa6-solid-bullhorn"
|
|
766
766
|
};
|
|
767
767
|
const _hoisted_2$4 = { class: "hlw-notice-text" };
|
|
768
|
-
const _hoisted_3$
|
|
768
|
+
const _hoisted_3$1 = {
|
|
769
769
|
key: 1,
|
|
770
770
|
class: "hlw-notice-text hlw-notice-text--ellipsis"
|
|
771
771
|
};
|
|
@@ -798,7 +798,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
798
798
|
__props.leftIcon ? (openBlock(), createElementBlock("view", {
|
|
799
799
|
key: 0,
|
|
800
800
|
class: normalizeClass([__props.leftIcon, "hlw-notice-left-icon"])
|
|
801
|
-
}, null, 2)) : (openBlock(), createElementBlock("view", _hoisted_1$
|
|
801
|
+
}, null, 2)) : (openBlock(), createElementBlock("view", _hoisted_1$6)),
|
|
802
802
|
createElementVNode("view", {
|
|
803
803
|
class: "hlw-notice-wrap",
|
|
804
804
|
onTap: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click"))
|
|
@@ -809,7 +809,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
809
809
|
style: normalizeStyle(animStyle.value)
|
|
810
810
|
}, [
|
|
811
811
|
createElementVNode("text", _hoisted_2$4, toDisplayString(__props.text), 1)
|
|
812
|
-
], 4)) : (openBlock(), createElementBlock("text", _hoisted_3$
|
|
812
|
+
], 4)) : (openBlock(), createElementBlock("text", _hoisted_3$1, toDisplayString(__props.text), 1))
|
|
813
813
|
], 32),
|
|
814
814
|
__props.closable ? (openBlock(), createElementBlock("view", {
|
|
815
815
|
key: 2,
|
|
@@ -821,9 +821,111 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
821
821
|
}
|
|
822
822
|
});
|
|
823
823
|
const index$6 = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-7a758299"]]);
|
|
824
|
-
const
|
|
825
|
-
const
|
|
826
|
-
|
|
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" };
|
|
827
929
|
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
828
930
|
__name: "index",
|
|
829
931
|
props: {
|
|
@@ -833,11 +935,15 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
833
935
|
},
|
|
834
936
|
setup(__props) {
|
|
835
937
|
const props = __props;
|
|
938
|
+
const { themePageStyle } = useThemePageStyle();
|
|
836
939
|
return (_ctx, _cache) => {
|
|
837
940
|
const _component_hlw_header = resolveComponent("hlw-header");
|
|
838
941
|
const _component_scroll_view = resolveComponent("scroll-view");
|
|
839
|
-
return openBlock(), createElementBlock("view",
|
|
840
|
-
|
|
942
|
+
return openBlock(), createElementBlock("view", {
|
|
943
|
+
class: "hlw-page",
|
|
944
|
+
style: normalizeStyle(unref(themePageStyle))
|
|
945
|
+
}, [
|
|
946
|
+
createElementVNode("view", _hoisted_1$5, [
|
|
841
947
|
renderSlot(_ctx.$slots, "header", {}, () => [
|
|
842
948
|
props.title || props.isBack ? (openBlock(), createBlock(_component_hlw_header, {
|
|
843
949
|
key: 0,
|
|
@@ -852,22 +958,23 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
852
958
|
"scroll-y": true,
|
|
853
959
|
"enable-flex": true,
|
|
854
960
|
enhanced: true,
|
|
855
|
-
"show-scrollbar": false
|
|
961
|
+
"show-scrollbar": false,
|
|
962
|
+
style: normalizeStyle(unref(themePageStyle))
|
|
856
963
|
}, {
|
|
857
964
|
default: withCtx(() => [
|
|
858
965
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
859
966
|
]),
|
|
860
967
|
_: 3
|
|
861
|
-
}),
|
|
862
|
-
createElementVNode("view",
|
|
968
|
+
}, 8, ["style"]),
|
|
969
|
+
createElementVNode("view", _hoisted_2$3, [
|
|
863
970
|
renderSlot(_ctx.$slots, "footer", {}, void 0, true)
|
|
864
971
|
])
|
|
865
|
-
]);
|
|
972
|
+
], 4);
|
|
866
973
|
};
|
|
867
974
|
}
|
|
868
975
|
});
|
|
869
|
-
const index$5 = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-
|
|
870
|
-
const _hoisted_1$
|
|
976
|
+
const index$5 = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-01bb7796"]]);
|
|
977
|
+
const _hoisted_1$4 = {
|
|
871
978
|
key: 0,
|
|
872
979
|
class: "hlw-popup-header"
|
|
873
980
|
};
|
|
@@ -889,16 +996,17 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
889
996
|
emit("close");
|
|
890
997
|
}
|
|
891
998
|
return (_ctx, _cache) => {
|
|
892
|
-
return openBlock(), createElementBlock(Fragment,
|
|
893
|
-
|
|
894
|
-
key: 0,
|
|
999
|
+
return __props.show ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
1000
|
+
createElementVNode("view", {
|
|
895
1001
|
class: "hlw-popup-mask",
|
|
896
1002
|
onTap: withModifiers(onClose, ["self"])
|
|
897
|
-
}, null, 32)
|
|
1003
|
+
}, null, 32),
|
|
898
1004
|
createElementVNode("view", {
|
|
899
|
-
class: normalizeClass(["hlw-popup", [`hlw-popup--${__props.position}`, { "hlw-popup--
|
|
1005
|
+
class: normalizeClass(["hlw-popup", [`hlw-popup--${__props.position}`, { "hlw-popup--round": __props.round }]]),
|
|
1006
|
+
onTap: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
1007
|
+
}, ["stop"]))
|
|
900
1008
|
}, [
|
|
901
|
-
__props.title || __props.closable ? (openBlock(), createElementBlock("view", _hoisted_1$
|
|
1009
|
+
__props.title || __props.closable ? (openBlock(), createElementBlock("view", _hoisted_1$4, [
|
|
902
1010
|
createElementVNode("text", _hoisted_2$2, toDisplayString(__props.title), 1),
|
|
903
1011
|
__props.closable ? (openBlock(), createElementBlock("view", {
|
|
904
1012
|
key: 0,
|
|
@@ -907,13 +1015,13 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
907
1015
|
}, null, 32)) : createCommentVNode("", true)
|
|
908
1016
|
])) : createCommentVNode("", true),
|
|
909
1017
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
910
|
-
],
|
|
911
|
-
], 64);
|
|
1018
|
+
], 34)
|
|
1019
|
+
], 64)) : createCommentVNode("", true);
|
|
912
1020
|
};
|
|
913
1021
|
}
|
|
914
1022
|
});
|
|
915
|
-
const index$4 = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-
|
|
916
|
-
const _hoisted_1$
|
|
1023
|
+
const index$4 = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-be12aee0"]]);
|
|
1024
|
+
const _hoisted_1$3 = ["value", "placeholder", "disabled"];
|
|
917
1025
|
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
918
1026
|
__name: "index",
|
|
919
1027
|
props: {
|
|
@@ -955,7 +1063,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
955
1063
|
onConfirm: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("search", __props.modelValue)),
|
|
956
1064
|
onFocus: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("focus")),
|
|
957
1065
|
onBlur: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("blur"))
|
|
958
|
-
}, null, 40, _hoisted_1$
|
|
1066
|
+
}, null, 40, _hoisted_1$3),
|
|
959
1067
|
__props.clearable && __props.modelValue ? (openBlock(), createElementBlock("view", {
|
|
960
1068
|
key: 0,
|
|
961
1069
|
class: "hlw-search-clear i-fa6-solid-xmark",
|
|
@@ -967,7 +1075,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
967
1075
|
}
|
|
968
1076
|
});
|
|
969
1077
|
const index$3 = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-4fe1bfab"]]);
|
|
970
|
-
const _hoisted_1$
|
|
1078
|
+
const _hoisted_1$2 = { class: "hlw-skeleton-content" };
|
|
971
1079
|
const _hoisted_2$1 = {
|
|
972
1080
|
key: 0,
|
|
973
1081
|
class: "hlw-skeleton-title"
|
|
@@ -992,7 +1100,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
992
1100
|
key: 0,
|
|
993
1101
|
class: normalizeClass(["hlw-skeleton-avatar", `hlw-skeleton-avatar--${__props.avatarSize}`])
|
|
994
1102
|
}, null, 2)) : createCommentVNode("", true),
|
|
995
|
-
createElementVNode("view", _hoisted_1$
|
|
1103
|
+
createElementVNode("view", _hoisted_1$2, [
|
|
996
1104
|
__props.title ? (openBlock(), createElementBlock("view", _hoisted_2$1)) : createCommentVNode("", true),
|
|
997
1105
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.rows, (i) => {
|
|
998
1106
|
return openBlock(), createElementBlock("view", {
|
|
@@ -1007,7 +1115,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
1007
1115
|
}
|
|
1008
1116
|
});
|
|
1009
1117
|
const index$2 = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-bc3155a2"]]);
|
|
1010
|
-
const _hoisted_1 = { class: "hlw-tabs-wrap" };
|
|
1118
|
+
const _hoisted_1$1 = { class: "hlw-tabs-wrap" };
|
|
1011
1119
|
const _hoisted_2 = ["onTap"];
|
|
1012
1120
|
const _hoisted_3 = { class: "hlw-tab-text" };
|
|
1013
1121
|
const _hoisted_4 = {
|
|
@@ -1038,7 +1146,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1038
1146
|
"show-scrollbar": false
|
|
1039
1147
|
}, {
|
|
1040
1148
|
default: withCtx(() => [
|
|
1041
|
-
createElementVNode("view", _hoisted_1, [
|
|
1149
|
+
createElementVNode("view", _hoisted_1$1, [
|
|
1042
1150
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item, index2) => {
|
|
1043
1151
|
return openBlock(), createElementBlock("view", {
|
|
1044
1152
|
key: index2,
|
|
@@ -1062,6 +1170,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1062
1170
|
}
|
|
1063
1171
|
});
|
|
1064
1172
|
const index$1 = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-5a47c034"]]);
|
|
1173
|
+
const _hoisted_1 = { class: "hlw-tag-text" };
|
|
1065
1174
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
1066
1175
|
__name: "index",
|
|
1067
1176
|
props: {
|
|
@@ -1086,7 +1195,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1086
1195
|
style: normalizeStyle(customStyle.value),
|
|
1087
1196
|
onTap: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("click"))
|
|
1088
1197
|
}, [
|
|
1089
|
-
|
|
1198
|
+
createElementVNode("text", _hoisted_1, [
|
|
1199
|
+
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
1200
|
+
]),
|
|
1090
1201
|
__props.closable ? (openBlock(), createElementBlock("view", {
|
|
1091
1202
|
key: 0,
|
|
1092
1203
|
class: "hlw-tag-close i-fa6-solid-xmark",
|
|
@@ -1096,110 +1207,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1096
1207
|
};
|
|
1097
1208
|
}
|
|
1098
1209
|
});
|
|
1099
|
-
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
1100
|
-
const FONT_SCALE_KEY = "hlw_font_scale";
|
|
1101
|
-
const FONT_PRESETS = {
|
|
1102
|
-
small: {
|
|
1103
|
-
label: "小字体",
|
|
1104
|
-
vars: {
|
|
1105
|
-
"--font-xs": "16rpx",
|
|
1106
|
-
"--font-sm": "20rpx",
|
|
1107
|
-
"--font-base": "24rpx",
|
|
1108
|
-
"--font-md": "28rpx",
|
|
1109
|
-
"--font-lg": "32rpx",
|
|
1110
|
-
"--font-xl": "36rpx"
|
|
1111
|
-
}
|
|
1112
|
-
},
|
|
1113
|
-
normal: {
|
|
1114
|
-
label: "标准",
|
|
1115
|
-
vars: {
|
|
1116
|
-
"--font-xs": "20rpx",
|
|
1117
|
-
"--font-sm": "24rpx",
|
|
1118
|
-
"--font-base": "28rpx",
|
|
1119
|
-
"--font-md": "32rpx",
|
|
1120
|
-
"--font-lg": "36rpx",
|
|
1121
|
-
"--font-xl": "40rpx"
|
|
1122
|
-
}
|
|
1123
|
-
},
|
|
1124
|
-
large: {
|
|
1125
|
-
label: "大字体",
|
|
1126
|
-
vars: {
|
|
1127
|
-
"--font-xs": "24rpx",
|
|
1128
|
-
"--font-sm": "30rpx",
|
|
1129
|
-
"--font-base": "34rpx",
|
|
1130
|
-
"--font-md": "40rpx",
|
|
1131
|
-
"--font-lg": "46rpx",
|
|
1132
|
-
"--font-xl": "52rpx"
|
|
1133
|
-
}
|
|
1134
|
-
},
|
|
1135
|
-
xlarge: {
|
|
1136
|
-
label: "超大字体",
|
|
1137
|
-
vars: {
|
|
1138
|
-
"--font-xs": "28rpx",
|
|
1139
|
-
"--font-sm": "36rpx",
|
|
1140
|
-
"--font-base": "42rpx",
|
|
1141
|
-
"--font-md": "48rpx",
|
|
1142
|
-
"--font-lg": "56rpx",
|
|
1143
|
-
"--font-xl": "64rpx"
|
|
1144
|
-
}
|
|
1145
|
-
}
|
|
1146
|
-
};
|
|
1147
|
-
function getCurrentFontScale() {
|
|
1148
|
-
try {
|
|
1149
|
-
const v = uni.getStorageSync(FONT_SCALE_KEY);
|
|
1150
|
-
if (v === "small" || v === "large" || v === "xlarge")
|
|
1151
|
-
return v;
|
|
1152
|
-
} catch {
|
|
1153
|
-
}
|
|
1154
|
-
return "normal";
|
|
1155
|
-
}
|
|
1156
|
-
function getCurrentFontVars() {
|
|
1157
|
-
return FONT_PRESETS[getCurrentFontScale()].vars;
|
|
1158
|
-
}
|
|
1159
|
-
const { hexToRgba, darkenHex } = useColor();
|
|
1160
|
-
const THEME_COLOR_KEY = "hlw_theme_color";
|
|
1161
|
-
const DEFAULT_THEMES = [
|
|
1162
|
-
{ label: "默认蓝", value: "#3b82f6" },
|
|
1163
|
-
{ label: "活力橙", value: "#f97316" },
|
|
1164
|
-
{ label: "翡翠绿", value: "#10b981" },
|
|
1165
|
-
{ label: "玫瑰红", value: "#f43f5e" },
|
|
1166
|
-
{ label: "紫罗兰", value: "#8b5cf6" },
|
|
1167
|
-
{ label: "青石灰", value: "#64748b" }
|
|
1168
|
-
];
|
|
1169
|
-
function getCurrentThemeColor() {
|
|
1170
|
-
try {
|
|
1171
|
-
const v = uni.getStorageSync(THEME_COLOR_KEY);
|
|
1172
|
-
if (v && typeof v === "string")
|
|
1173
|
-
return v;
|
|
1174
|
-
} catch {
|
|
1175
|
-
}
|
|
1176
|
-
return DEFAULT_THEMES[0].value;
|
|
1177
|
-
}
|
|
1178
|
-
function getCurrentThemeVars() {
|
|
1179
|
-
const color = getCurrentThemeColor();
|
|
1180
|
-
return {
|
|
1181
|
-
"--primary-color": color,
|
|
1182
|
-
"--primary-light": hexToRgba(color, 0.12),
|
|
1183
|
-
"--primary-dark": darkenHex(color)
|
|
1184
|
-
};
|
|
1185
|
-
}
|
|
1186
|
-
const { varsToStyle } = useColor();
|
|
1187
|
-
const THEME_CHANGE_EVENT = "hlw:theme-change";
|
|
1188
|
-
function buildThemeStyle() {
|
|
1189
|
-
return varsToStyle({
|
|
1190
|
-
...getCurrentFontVars(),
|
|
1191
|
-
...getCurrentThemeVars()
|
|
1192
|
-
});
|
|
1193
|
-
}
|
|
1194
|
-
function useThemePageStyle() {
|
|
1195
|
-
const themePageStyle = ref(buildThemeStyle());
|
|
1196
|
-
const onThemeChange = () => {
|
|
1197
|
-
themePageStyle.value = buildThemeStyle();
|
|
1198
|
-
};
|
|
1199
|
-
onMounted(() => uni.$on(THEME_CHANGE_EVENT, onThemeChange));
|
|
1200
|
-
onUnmounted(() => uni.$off(THEME_CHANGE_EVENT, onThemeChange));
|
|
1201
|
-
return { themePageStyle };
|
|
1202
|
-
}
|
|
1210
|
+
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e4ea56ad"]]);
|
|
1203
1211
|
const useThemeStore = defineStore(
|
|
1204
1212
|
"theme",
|
|
1205
1213
|
() => {
|