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