@atooyu/uxto-ui 1.1.27 → 1.1.28
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.js +425 -386
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +425 -386
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +3 -11
- package/package.json +1 -1
- package/src/components/u-qrcode/u-qrcode.vue +316 -305
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
5
5
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
6
6
|
const vue = require("vue");
|
|
7
7
|
const _hoisted_1$I = ["disabled", "hover-class"];
|
|
8
|
-
const _hoisted_2$
|
|
8
|
+
const _hoisted_2$x = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "u-button__loading"
|
|
11
11
|
};
|
|
@@ -77,7 +77,7 @@ const _sfc_main$N = /* @__PURE__ */ vue.defineComponent({
|
|
|
77
77
|
"hover-class": __props.disabled || __props.loading ? "" : "u-button--active",
|
|
78
78
|
onClick: handleClick
|
|
79
79
|
}, [
|
|
80
|
-
__props.loading ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$
|
|
80
|
+
__props.loading ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$x, [..._cache[0] || (_cache[0] = [
|
|
81
81
|
vue.createElementVNode("view", { class: "u-button__loading-icon" }, null, -1)
|
|
82
82
|
])])) : (vue.openBlock(), vue.createElementBlock("view", _hoisted_3$q, [
|
|
83
83
|
__props.icon ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_4$h, vue.toDisplayString(__props.icon), 1)) : vue.createCommentVNode("", true),
|
|
@@ -101,7 +101,7 @@ const _hoisted_1$H = {
|
|
|
101
101
|
key: 0,
|
|
102
102
|
class: "u-input__prefix"
|
|
103
103
|
};
|
|
104
|
-
const _hoisted_2$
|
|
104
|
+
const _hoisted_2$w = { class: "u-input__icon" };
|
|
105
105
|
const _hoisted_3$p = { class: "u-input__body" };
|
|
106
106
|
const _hoisted_4$g = ["type", "value", "placeholder", "placeholder-style", "disabled", "maxlength", "focus", "confirm-type", "adjust-position"];
|
|
107
107
|
const _hoisted_5$c = {
|
|
@@ -168,7 +168,7 @@ const _sfc_main$M = /* @__PURE__ */ vue.defineComponent({
|
|
|
168
168
|
}, [
|
|
169
169
|
_ctx.$slots.prefix || __props.prefixIcon ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_1$H, [
|
|
170
170
|
vue.renderSlot(_ctx.$slots, "prefix", {}, () => [
|
|
171
|
-
vue.createElementVNode("text", _hoisted_2$
|
|
171
|
+
vue.createElementVNode("text", _hoisted_2$w, vue.toDisplayString(__props.prefixIcon), 1)
|
|
172
172
|
], true)
|
|
173
173
|
])) : vue.createCommentVNode("", true),
|
|
174
174
|
vue.createElementVNode("view", _hoisted_3$p, [
|
|
@@ -208,7 +208,7 @@ const _sfc_main$M = /* @__PURE__ */ vue.defineComponent({
|
|
|
208
208
|
});
|
|
209
209
|
const uInput = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["__scopeId", "data-v-2f635824"]]);
|
|
210
210
|
const _hoisted_1$G = ["hover-class"];
|
|
211
|
-
const _hoisted_2$
|
|
211
|
+
const _hoisted_2$v = {
|
|
212
212
|
key: 0,
|
|
213
213
|
class: "u-cell__icon"
|
|
214
214
|
};
|
|
@@ -271,7 +271,7 @@ const _sfc_main$L = /* @__PURE__ */ vue.defineComponent({
|
|
|
271
271
|
"hover-class": isClickable.value && !__props.disabled ? "u-cell--active" : "",
|
|
272
272
|
onClick: handleClick
|
|
273
273
|
}, [
|
|
274
|
-
_ctx.$slots.icon || __props.icon ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$
|
|
274
|
+
_ctx.$slots.icon || __props.icon ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$v, [
|
|
275
275
|
vue.renderSlot(_ctx.$slots, "icon", {}, () => [
|
|
276
276
|
__props.icon ? (vue.openBlock(), vue.createElementBlock("image", {
|
|
277
277
|
key: 0,
|
|
@@ -302,7 +302,7 @@ const _sfc_main$L = /* @__PURE__ */ vue.defineComponent({
|
|
|
302
302
|
});
|
|
303
303
|
const uCell = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["__scopeId", "data-v-c3a35a65"]]);
|
|
304
304
|
const _hoisted_1$F = { class: "u-cell-group" };
|
|
305
|
-
const _hoisted_2$
|
|
305
|
+
const _hoisted_2$u = {
|
|
306
306
|
key: 0,
|
|
307
307
|
class: "u-cell-group__title"
|
|
308
308
|
};
|
|
@@ -322,7 +322,7 @@ const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
|
|
|
322
322
|
setup(__props) {
|
|
323
323
|
return (_ctx, _cache) => {
|
|
324
324
|
return vue.openBlock(), vue.createElementBlock("view", _hoisted_1$F, [
|
|
325
|
-
__props.title || _ctx.$slots.title ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$
|
|
325
|
+
__props.title || _ctx.$slots.title ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$u, [
|
|
326
326
|
vue.renderSlot(_ctx.$slots, "title", {}, () => [
|
|
327
327
|
vue.createTextVNode(vue.toDisplayString(__props.title), 1)
|
|
328
328
|
], true)
|
|
@@ -339,7 +339,7 @@ const _hoisted_1$E = {
|
|
|
339
339
|
key: 0,
|
|
340
340
|
class: "u-modal__header"
|
|
341
341
|
};
|
|
342
|
-
const _hoisted_2$
|
|
342
|
+
const _hoisted_2$t = { class: "u-modal__title" };
|
|
343
343
|
const _hoisted_3$m = { class: "u-modal__body" };
|
|
344
344
|
const _hoisted_4$e = { class: "u-modal__message" };
|
|
345
345
|
const _hoisted_5$a = { class: "u-modal__footer" };
|
|
@@ -390,7 +390,7 @@ const _sfc_main$J = /* @__PURE__ */ vue.defineComponent({
|
|
|
390
390
|
}, ["stop"]))
|
|
391
391
|
}, [
|
|
392
392
|
__props.title ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_1$E, [
|
|
393
|
-
vue.createElementVNode("text", _hoisted_2$
|
|
393
|
+
vue.createElementVNode("text", _hoisted_2$t, vue.toDisplayString(__props.title), 1)
|
|
394
394
|
])) : vue.createCommentVNode("", true),
|
|
395
395
|
vue.createElementVNode("view", _hoisted_3$m, [
|
|
396
396
|
vue.renderSlot(_ctx.$slots, "default", {}, () => [
|
|
@@ -632,7 +632,7 @@ function addIcon(name, svg) {
|
|
|
632
632
|
icons[name] = svg;
|
|
633
633
|
}
|
|
634
634
|
const _hoisted_1$D = ["src"];
|
|
635
|
-
const _hoisted_2$
|
|
635
|
+
const _hoisted_2$s = {
|
|
636
636
|
key: 1,
|
|
637
637
|
class: "u-icon__inner"
|
|
638
638
|
};
|
|
@@ -665,8 +665,8 @@ const _sfc_main$I = /* @__PURE__ */ vue.defineComponent({
|
|
|
665
665
|
return getIcon(props.name) || "";
|
|
666
666
|
});
|
|
667
667
|
const sizePx = vue.computed(() => {
|
|
668
|
-
const
|
|
669
|
-
return
|
|
668
|
+
const size = typeof props.size === "number" ? props.size : parseInt(props.size);
|
|
669
|
+
return size + "px";
|
|
670
670
|
});
|
|
671
671
|
const colorToFilter = (color) => {
|
|
672
672
|
const colorMap = {
|
|
@@ -690,11 +690,11 @@ const _sfc_main$I = /* @__PURE__ */ vue.defineComponent({
|
|
|
690
690
|
return `invert(1) sepia(1) saturate(10000%) hue-rotate(${hue}deg)`;
|
|
691
691
|
};
|
|
692
692
|
const iconStyle = vue.computed(() => {
|
|
693
|
-
const
|
|
693
|
+
const size = typeof props.size === "number" ? props.size : parseInt(props.size);
|
|
694
694
|
const style = {
|
|
695
|
-
fontSize:
|
|
696
|
-
width:
|
|
697
|
-
height:
|
|
695
|
+
fontSize: size + "px",
|
|
696
|
+
width: size + "px",
|
|
697
|
+
height: size + "px"
|
|
698
698
|
};
|
|
699
699
|
if (props.color && isSvgIcon.value) {
|
|
700
700
|
style.filter = colorToFilter(props.color);
|
|
@@ -722,7 +722,7 @@ const _sfc_main$I = /* @__PURE__ */ vue.defineComponent({
|
|
|
722
722
|
src: iconSrc.value,
|
|
723
723
|
style: vue.normalizeStyle(svgStyle.value),
|
|
724
724
|
mode: "aspectFit"
|
|
725
|
-
}, null, 12, _hoisted_1$D)) : (vue.openBlock(), vue.createElementBlock("text", _hoisted_2$
|
|
725
|
+
}, null, 12, _hoisted_1$D)) : (vue.openBlock(), vue.createElementBlock("text", _hoisted_2$s, vue.toDisplayString(__props.name), 1))
|
|
726
726
|
], 6);
|
|
727
727
|
};
|
|
728
728
|
}
|
|
@@ -896,7 +896,7 @@ const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
|
|
|
896
896
|
});
|
|
897
897
|
const uSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["__scopeId", "data-v-8922fa66"]]);
|
|
898
898
|
const _hoisted_1$B = ["src", "mode", "lazy-load", "fade"];
|
|
899
|
-
const _hoisted_2$
|
|
899
|
+
const _hoisted_2$r = {
|
|
900
900
|
key: 0,
|
|
901
901
|
class: "u-image__loading"
|
|
902
902
|
};
|
|
@@ -950,7 +950,7 @@ const _sfc_main$E = /* @__PURE__ */ vue.defineComponent({
|
|
|
950
950
|
onLoad: handleLoad,
|
|
951
951
|
onError: handleError
|
|
952
952
|
}, null, 40, _hoisted_1$B),
|
|
953
|
-
__props.loading && !loaded.value ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$
|
|
953
|
+
__props.loading && !loaded.value ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$r, [
|
|
954
954
|
vue.renderSlot(_ctx.$slots, "loading", {}, () => [
|
|
955
955
|
vue.createVNode(_component_u_loading, { size: 20 })
|
|
956
956
|
], true)
|
|
@@ -1002,7 +1002,7 @@ const _hoisted_1$z = {
|
|
|
1002
1002
|
key: 0,
|
|
1003
1003
|
class: "u-notice-bar__left-icon"
|
|
1004
1004
|
};
|
|
1005
|
-
const _hoisted_2$
|
|
1005
|
+
const _hoisted_2$q = { class: "u-notice-bar__text-item" };
|
|
1006
1006
|
const _hoisted_3$k = { class: "u-notice-bar__text-item" };
|
|
1007
1007
|
const _hoisted_4$d = {
|
|
1008
1008
|
key: 1,
|
|
@@ -1051,7 +1051,7 @@ const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
|
|
|
1051
1051
|
class: "u-notice-bar__text",
|
|
1052
1052
|
style: vue.normalizeStyle({ animationDuration: __props.speed + "s" })
|
|
1053
1053
|
}, [
|
|
1054
|
-
vue.createElementVNode("text", _hoisted_2$
|
|
1054
|
+
vue.createElementVNode("text", _hoisted_2$q, vue.toDisplayString(__props.text), 1),
|
|
1055
1055
|
vue.createElementVNode("text", _hoisted_3$k, vue.toDisplayString(__props.text), 1)
|
|
1056
1056
|
], 4)) : (vue.openBlock(), vue.createElementBlock("text", _hoisted_4$d, vue.toDisplayString(__props.text), 1))
|
|
1057
1057
|
], 2),
|
|
@@ -1073,7 +1073,7 @@ const _hoisted_1$y = {
|
|
|
1073
1073
|
key: 0,
|
|
1074
1074
|
class: "u-layout__header"
|
|
1075
1075
|
};
|
|
1076
|
-
const _hoisted_2$
|
|
1076
|
+
const _hoisted_2$p = { class: "u-layout__content" };
|
|
1077
1077
|
const _hoisted_3$j = {
|
|
1078
1078
|
key: 1,
|
|
1079
1079
|
class: "u-layout__footer"
|
|
@@ -1097,7 +1097,7 @@ const _sfc_main$B = /* @__PURE__ */ vue.defineComponent({
|
|
|
1097
1097
|
_ctx.$slots.header ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_1$y, [
|
|
1098
1098
|
vue.renderSlot(_ctx.$slots, "header", {}, void 0, true)
|
|
1099
1099
|
])) : vue.createCommentVNode("", true),
|
|
1100
|
-
vue.createElementVNode("view", _hoisted_2$
|
|
1100
|
+
vue.createElementVNode("view", _hoisted_2$p, [
|
|
1101
1101
|
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
1102
1102
|
]),
|
|
1103
1103
|
_ctx.$slots.footer ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_3$j, [
|
|
@@ -1175,7 +1175,7 @@ const _hoisted_1$w = {
|
|
|
1175
1175
|
key: 0,
|
|
1176
1176
|
class: "u-loading-page"
|
|
1177
1177
|
};
|
|
1178
|
-
const _hoisted_2$
|
|
1178
|
+
const _hoisted_2$o = { class: "u-loading-page__content" };
|
|
1179
1179
|
const __default__$z = {
|
|
1180
1180
|
options: {
|
|
1181
1181
|
virtualHost: true,
|
|
@@ -1195,7 +1195,7 @@ const _sfc_main$z = /* @__PURE__ */ vue.defineComponent({
|
|
|
1195
1195
|
setup(__props) {
|
|
1196
1196
|
return (_ctx, _cache) => {
|
|
1197
1197
|
return __props.visible ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_1$w, [
|
|
1198
|
-
vue.createElementVNode("view", _hoisted_2$
|
|
1198
|
+
vue.createElementVNode("view", _hoisted_2$o, [
|
|
1199
1199
|
vue.createElementVNode("view", {
|
|
1200
1200
|
class: "u-loading-page__spinner",
|
|
1201
1201
|
style: vue.normalizeStyle({ width: __props.size + "px", height: __props.size + "px" })
|
|
@@ -1341,7 +1341,7 @@ const _sfc_main$y = /* @__PURE__ */ vue.defineComponent({
|
|
|
1341
1341
|
});
|
|
1342
1342
|
const uParse = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["__scopeId", "data-v-5361245b"]]);
|
|
1343
1343
|
const _hoisted_1$u = { class: "u-keyboard__header" };
|
|
1344
|
-
const _hoisted_2$
|
|
1344
|
+
const _hoisted_2$n = { class: "u-keyboard__title" };
|
|
1345
1345
|
const _hoisted_3$i = ["onClick"];
|
|
1346
1346
|
const __default__$x = {
|
|
1347
1347
|
options: {
|
|
@@ -1473,7 +1473,7 @@ const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
|
|
|
1473
1473
|
}, ["stop"]))
|
|
1474
1474
|
}, [
|
|
1475
1475
|
vue.createElementVNode("view", _hoisted_1$u, [
|
|
1476
|
-
vue.createElementVNode("text", _hoisted_2$
|
|
1476
|
+
vue.createElementVNode("text", _hoisted_2$n, vue.toDisplayString(__props.title), 1),
|
|
1477
1477
|
vue.createElementVNode("text", {
|
|
1478
1478
|
class: "u-keyboard__close",
|
|
1479
1479
|
onClick: handleClose
|
|
@@ -1502,7 +1502,7 @@ const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
|
|
|
1502
1502
|
});
|
|
1503
1503
|
const uKeyboard = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["__scopeId", "data-v-b318be29"]]);
|
|
1504
1504
|
const _hoisted_1$t = { class: "u-picker__toolbar" };
|
|
1505
|
-
const _hoisted_2$
|
|
1505
|
+
const _hoisted_2$m = { class: "u-picker__title" };
|
|
1506
1506
|
const _hoisted_3$h = {
|
|
1507
1507
|
key: 0,
|
|
1508
1508
|
class: "u-picker__loading"
|
|
@@ -1604,7 +1604,7 @@ const _sfc_main$w = /* @__PURE__ */ vue.defineComponent({
|
|
|
1604
1604
|
class: "u-picker__action",
|
|
1605
1605
|
onClick: handleCancel
|
|
1606
1606
|
}, "取消"),
|
|
1607
|
-
vue.createElementVNode("text", _hoisted_2$
|
|
1607
|
+
vue.createElementVNode("text", _hoisted_2$m, vue.toDisplayString(__props.title), 1),
|
|
1608
1608
|
vue.createElementVNode("text", {
|
|
1609
1609
|
class: "u-picker__action u-picker__action--confirm",
|
|
1610
1610
|
onClick: handleConfirm
|
|
@@ -1645,7 +1645,7 @@ const _sfc_main$w = /* @__PURE__ */ vue.defineComponent({
|
|
|
1645
1645
|
});
|
|
1646
1646
|
const uPicker = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["__scopeId", "data-v-54bd44d7"]]);
|
|
1647
1647
|
const _hoisted_1$s = { class: "u-datetime-picker__toolbar" };
|
|
1648
|
-
const _hoisted_2$
|
|
1648
|
+
const _hoisted_2$l = { class: "u-datetime-picker__title" };
|
|
1649
1649
|
const __default__$v = {
|
|
1650
1650
|
options: {
|
|
1651
1651
|
virtualHost: true,
|
|
@@ -1878,7 +1878,7 @@ const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
|
|
|
1878
1878
|
class: "u-datetime-picker__action",
|
|
1879
1879
|
onClick: handleCancel
|
|
1880
1880
|
}, "取消"),
|
|
1881
|
-
vue.createElementVNode("text", _hoisted_2$
|
|
1881
|
+
vue.createElementVNode("text", _hoisted_2$l, vue.toDisplayString(__props.title), 1),
|
|
1882
1882
|
vue.createElementVNode("text", {
|
|
1883
1883
|
class: "u-datetime-picker__action u-datetime-picker__action--confirm",
|
|
1884
1884
|
onClick: handleConfirm
|
|
@@ -2076,7 +2076,7 @@ const _hoisted_1$p = {
|
|
|
2076
2076
|
key: 0,
|
|
2077
2077
|
class: "u-grid-item__icon"
|
|
2078
2078
|
};
|
|
2079
|
-
const _hoisted_2$
|
|
2079
|
+
const _hoisted_2$k = ["src"];
|
|
2080
2080
|
const _hoisted_3$g = {
|
|
2081
2081
|
key: 1,
|
|
2082
2082
|
class: "u-grid-item__icon-text"
|
|
@@ -2152,7 +2152,7 @@ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
|
2152
2152
|
class: "u-grid-item__icon-image",
|
|
2153
2153
|
src: __props.iconUrl,
|
|
2154
2154
|
mode: "aspectFit"
|
|
2155
|
-
}, null, 8, _hoisted_2$
|
|
2155
|
+
}, null, 8, _hoisted_2$k)) : __props.icon ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_3$g, vue.toDisplayString(__props.icon), 1)) : vue.createCommentVNode("", true)
|
|
2156
2156
|
], true),
|
|
2157
2157
|
__props.badge !== void 0 && __props.badge !== null && __props.badge !== "" ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_4$c, [
|
|
2158
2158
|
vue.createElementVNode("text", _hoisted_5$9, vue.toDisplayString(__props.badge), 1)
|
|
@@ -2169,7 +2169,7 @@ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
|
2169
2169
|
});
|
|
2170
2170
|
const uGridItem = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-de6f40c1"]]);
|
|
2171
2171
|
const _hoisted_1$o = { class: "u-swiper" };
|
|
2172
|
-
const _hoisted_2$
|
|
2172
|
+
const _hoisted_2$j = {
|
|
2173
2173
|
key: 0,
|
|
2174
2174
|
class: "u-swiper__loading"
|
|
2175
2175
|
};
|
|
@@ -2300,7 +2300,7 @@ const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
|
|
|
2300
2300
|
]),
|
|
2301
2301
|
_: 3
|
|
2302
2302
|
}, 8, ["style", "autoplay", "interval", "duration", "circular", "vertical", "current"]),
|
|
2303
|
-
__props.loading ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$
|
|
2303
|
+
__props.loading ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$j, [..._cache[0] || (_cache[0] = [
|
|
2304
2304
|
vue.createElementVNode("view", { class: "u-swiper__loading-icon" }, null, -1)
|
|
2305
2305
|
])])) : vue.createCommentVNode("", true),
|
|
2306
2306
|
__props.showTitle && currentTitle.value ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_3$f, [
|
|
@@ -2387,7 +2387,7 @@ const _hoisted_1$n = {
|
|
|
2387
2387
|
key: 0,
|
|
2388
2388
|
class: "u-search__icon"
|
|
2389
2389
|
};
|
|
2390
|
-
const _hoisted_2$
|
|
2390
|
+
const _hoisted_2$i = { class: "u-search__body" };
|
|
2391
2391
|
const _hoisted_3$e = ["type", "value", "placeholder", "placeholder-style", "disabled", "maxlength", "focus", "confirm-type", "adjust-position"];
|
|
2392
2392
|
const _hoisted_4$a = { class: "u-search__action-text" };
|
|
2393
2393
|
const __default__$p = {
|
|
@@ -2472,7 +2472,7 @@ const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
|
|
|
2472
2472
|
__props.showSearchIcon ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_1$n, [..._cache[0] || (_cache[0] = [
|
|
2473
2473
|
vue.createElementVNode("text", { class: "u-search__icon-text" }, "🔍", -1)
|
|
2474
2474
|
])])) : vue.createCommentVNode("", true),
|
|
2475
|
-
vue.createElementVNode("view", _hoisted_2$
|
|
2475
|
+
vue.createElementVNode("view", _hoisted_2$i, [
|
|
2476
2476
|
vue.createElementVNode("input", {
|
|
2477
2477
|
class: "u-search__control",
|
|
2478
2478
|
type: __props.type,
|
|
@@ -2553,8 +2553,8 @@ const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
|
|
|
2553
2553
|
return currentValue.value;
|
|
2554
2554
|
});
|
|
2555
2555
|
const btnSize = vue.computed(() => {
|
|
2556
|
-
const
|
|
2557
|
-
return typeof
|
|
2556
|
+
const size = props.buttonSize;
|
|
2557
|
+
return typeof size === "number" ? `${size}px` : size;
|
|
2558
2558
|
});
|
|
2559
2559
|
const iptWidth = vue.computed(() => {
|
|
2560
2560
|
const width = props.inputWidth;
|
|
@@ -2680,7 +2680,7 @@ const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
|
|
|
2680
2680
|
});
|
|
2681
2681
|
const uNumberBox = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-86153bb8"]]);
|
|
2682
2682
|
const _hoisted_1$l = { class: "u-upload" };
|
|
2683
|
-
const _hoisted_2$
|
|
2683
|
+
const _hoisted_2$h = { class: "u-upload__list" };
|
|
2684
2684
|
const _hoisted_3$d = ["src", "onClick"];
|
|
2685
2685
|
const _hoisted_4$9 = {
|
|
2686
2686
|
key: 1,
|
|
@@ -2811,7 +2811,7 @@ const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
|
|
|
2811
2811
|
});
|
|
2812
2812
|
return (_ctx, _cache) => {
|
|
2813
2813
|
return vue.openBlock(), vue.createElementBlock("view", _hoisted_1$l, [
|
|
2814
|
-
vue.createElementVNode("view", _hoisted_2$
|
|
2814
|
+
vue.createElementVNode("view", _hoisted_2$h, [
|
|
2815
2815
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(fileList.value, (file, index) => {
|
|
2816
2816
|
return vue.openBlock(), vue.createElementBlock("view", {
|
|
2817
2817
|
key: index,
|
|
@@ -2883,7 +2883,7 @@ const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
|
|
|
2883
2883
|
});
|
|
2884
2884
|
const uUpload = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-172bcb23"]]);
|
|
2885
2885
|
const _hoisted_1$k = ["value", "placeholder", "placeholder-style", "disabled", "maxlength", "focus", "auto-height", "fixed", "cursor-spacing", "show-confirm-bar", "adjust-position"];
|
|
2886
|
-
const _hoisted_2$
|
|
2886
|
+
const _hoisted_2$g = {
|
|
2887
2887
|
key: 0,
|
|
2888
2888
|
class: "u-textarea__limit"
|
|
2889
2889
|
};
|
|
@@ -2975,7 +2975,7 @@ const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
|
|
|
2975
2975
|
onConfirm: handleConfirm,
|
|
2976
2976
|
onLinechange: handleLineChange
|
|
2977
2977
|
}, null, 44, _hoisted_1$k),
|
|
2978
|
-
__props.showWordLimit && __props.maxlength ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$
|
|
2978
|
+
__props.showWordLimit && __props.maxlength ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$g, [
|
|
2979
2979
|
vue.createElementVNode("text", _hoisted_3$c, vue.toDisplayString(currentLength.value) + "/" + vue.toDisplayString(__props.maxlength), 1)
|
|
2980
2980
|
])) : vue.createCommentVNode("", true)
|
|
2981
2981
|
], 2);
|
|
@@ -2987,7 +2987,7 @@ const _hoisted_1$j = {
|
|
|
2987
2987
|
key: 0,
|
|
2988
2988
|
class: "u-slider__min"
|
|
2989
2989
|
};
|
|
2990
|
-
const _hoisted_2$
|
|
2990
|
+
const _hoisted_2$f = { class: "u-slider__label" };
|
|
2991
2991
|
const _hoisted_3$b = {
|
|
2992
2992
|
key: 0,
|
|
2993
2993
|
class: "u-slider__tooltip"
|
|
@@ -3053,8 +3053,8 @@ const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
|
|
|
3053
3053
|
return typeof height === "number" ? `${height}px` : height;
|
|
3054
3054
|
});
|
|
3055
3055
|
const buttonSizeStyle = vue.computed(() => {
|
|
3056
|
-
const
|
|
3057
|
-
return typeof
|
|
3056
|
+
const size = props.buttonSize;
|
|
3057
|
+
return typeof size === "number" ? `${size}px` : size;
|
|
3058
3058
|
});
|
|
3059
3059
|
const trackStyle = vue.computed(() => ({
|
|
3060
3060
|
height: barHeightStyle.value,
|
|
@@ -3233,7 +3233,7 @@ const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
|
|
|
3233
3233
|
}])
|
|
3234
3234
|
}, [
|
|
3235
3235
|
__props.showMinMax ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_1$j, [
|
|
3236
|
-
vue.createElementVNode("text", _hoisted_2$
|
|
3236
|
+
vue.createElementVNode("text", _hoisted_2$f, vue.toDisplayString(__props.min), 1)
|
|
3237
3237
|
])) : vue.createCommentVNode("", true),
|
|
3238
3238
|
vue.createElementVNode("view", {
|
|
3239
3239
|
class: "u-slider__track",
|
|
@@ -3303,7 +3303,7 @@ const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
|
|
|
3303
3303
|
});
|
|
3304
3304
|
const uSlider = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-c099c413"]]);
|
|
3305
3305
|
const _hoisted_1$i = { class: "u-list" };
|
|
3306
|
-
const _hoisted_2$
|
|
3306
|
+
const _hoisted_2$e = {
|
|
3307
3307
|
key: 0,
|
|
3308
3308
|
class: "u-list__header"
|
|
3309
3309
|
};
|
|
@@ -3354,7 +3354,7 @@ const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
|
|
|
3354
3354
|
};
|
|
3355
3355
|
return (_ctx, _cache) => {
|
|
3356
3356
|
return vue.openBlock(), vue.createElementBlock("view", _hoisted_1$i, [
|
|
3357
|
-
_ctx.$slots.header || __props.header ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$
|
|
3357
|
+
_ctx.$slots.header || __props.header ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$e, [
|
|
3358
3358
|
vue.renderSlot(_ctx.$slots, "header", {}, () => [
|
|
3359
3359
|
vue.createTextVNode(vue.toDisplayString(__props.header), 1)
|
|
3360
3360
|
], true)
|
|
@@ -3390,7 +3390,7 @@ const _hoisted_1$h = {
|
|
|
3390
3390
|
key: 0,
|
|
3391
3391
|
class: "u-list-item__icon"
|
|
3392
3392
|
};
|
|
3393
|
-
const _hoisted_2$
|
|
3393
|
+
const _hoisted_2$d = ["src"];
|
|
3394
3394
|
const _hoisted_3$9 = {
|
|
3395
3395
|
key: 1,
|
|
3396
3396
|
class: "u-list-item__icon-text"
|
|
@@ -3467,7 +3467,7 @@ const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
|
|
|
3467
3467
|
class: "u-list-item__thumb",
|
|
3468
3468
|
src: __props.thumb,
|
|
3469
3469
|
mode: "aspectFill"
|
|
3470
|
-
}, null, 8, _hoisted_2$
|
|
3470
|
+
}, null, 8, _hoisted_2$d)) : __props.icon ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_3$9, vue.toDisplayString(__props.icon), 1)) : vue.createCommentVNode("", true)
|
|
3471
3471
|
], true)
|
|
3472
3472
|
])) : vue.createCommentVNode("", true),
|
|
3473
3473
|
vue.createElementVNode("view", _hoisted_4$6, [
|
|
@@ -3503,7 +3503,7 @@ const _hoisted_1$g = {
|
|
|
3503
3503
|
key: 0,
|
|
3504
3504
|
class: "u-line-progress__text u-line-progress__text--inside"
|
|
3505
3505
|
};
|
|
3506
|
-
const _hoisted_2$
|
|
3506
|
+
const _hoisted_2$c = {
|
|
3507
3507
|
key: 0,
|
|
3508
3508
|
class: "u-line-progress__text"
|
|
3509
3509
|
};
|
|
@@ -3575,7 +3575,7 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
|
|
|
3575
3575
|
__props.showText && __props.textInside && __props.percentage <= 100 ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_1$g, vue.toDisplayString(textContent.value), 1)) : vue.createCommentVNode("", true)
|
|
3576
3576
|
], 6)
|
|
3577
3577
|
], 4),
|
|
3578
|
-
__props.showText && !__props.textInside ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_2$
|
|
3578
|
+
__props.showText && !__props.textInside ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_2$c, vue.toDisplayString(textContent.value), 1)) : vue.createCommentVNode("", true)
|
|
3579
3579
|
], 4);
|
|
3580
3580
|
};
|
|
3581
3581
|
}
|
|
@@ -3720,7 +3720,7 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
|
|
|
3720
3720
|
});
|
|
3721
3721
|
const uCountDown = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-da70e500"]]);
|
|
3722
3722
|
const _hoisted_1$e = { class: "u-tooltip__content" };
|
|
3723
|
-
const _hoisted_2$
|
|
3723
|
+
const _hoisted_2$b = {
|
|
3724
3724
|
key: 0,
|
|
3725
3725
|
class: "u-tooltip__actions"
|
|
3726
3726
|
};
|
|
@@ -3898,7 +3898,7 @@ const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
|
|
|
3898
3898
|
class: vue.normalizeClass(["u-tooltip__arrow", `u-tooltip__arrow--${actualPlacement.value}`])
|
|
3899
3899
|
}, null, 2),
|
|
3900
3900
|
vue.createElementVNode("view", _hoisted_1$e, [
|
|
3901
|
-
__props.actions.length ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$
|
|
3901
|
+
__props.actions.length ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$b, [
|
|
3902
3902
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.actions, (action, index) => {
|
|
3903
3903
|
return vue.openBlock(), vue.createElementBlock("view", {
|
|
3904
3904
|
key: index,
|
|
@@ -3919,7 +3919,7 @@ const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
|
|
|
3919
3919
|
});
|
|
3920
3920
|
const uTooltip = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-dd1bff02"]]);
|
|
3921
3921
|
const _hoisted_1$d = ["src"];
|
|
3922
|
-
const _hoisted_2$
|
|
3922
|
+
const _hoisted_2$a = {
|
|
3923
3923
|
key: 1,
|
|
3924
3924
|
class: "u-avatar__text"
|
|
3925
3925
|
};
|
|
@@ -3985,9 +3985,9 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
|
|
|
3985
3985
|
]);
|
|
3986
3986
|
const avatarStyle = vue.computed(() => {
|
|
3987
3987
|
const style = {};
|
|
3988
|
-
const
|
|
3989
|
-
style.width = `${
|
|
3990
|
-
style.height = `${
|
|
3988
|
+
const size = avatarSize.value;
|
|
3989
|
+
style.width = `${size}px`;
|
|
3990
|
+
style.height = `${size}px`;
|
|
3991
3991
|
if (props.bgColor) {
|
|
3992
3992
|
style.backgroundColor = props.bgColor;
|
|
3993
3993
|
}
|
|
@@ -4017,7 +4017,7 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
|
|
|
4017
4017
|
src: __props.src,
|
|
4018
4018
|
mode: "aspectFill",
|
|
4019
4019
|
onError: handleError
|
|
4020
|
-
}, null, 40, _hoisted_1$d)) : __props.text ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_2$
|
|
4020
|
+
}, null, 40, _hoisted_1$d)) : __props.text ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_2$a, vue.toDisplayString(displayText.value), 1)) : (vue.openBlock(), vue.createElementBlock("text", _hoisted_3$7, vue.toDisplayString(__props.icon || "👤"), 1))
|
|
4021
4021
|
], true),
|
|
4022
4022
|
__props.badge && !badgeSlot.value ? (vue.openBlock(), vue.createElementBlock("view", {
|
|
4023
4023
|
key: 0,
|
|
@@ -4032,7 +4032,7 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
|
|
|
4032
4032
|
});
|
|
4033
4033
|
const uAvatar = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-10f478fe"]]);
|
|
4034
4034
|
const _hoisted_1$c = { class: "u-empty__image" };
|
|
4035
|
-
const _hoisted_2$
|
|
4035
|
+
const _hoisted_2$9 = ["src"];
|
|
4036
4036
|
const _hoisted_3$6 = {
|
|
4037
4037
|
key: 1,
|
|
4038
4038
|
class: "u-empty__image-default"
|
|
@@ -4071,7 +4071,7 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
|
|
|
4071
4071
|
class: "u-empty__image-src",
|
|
4072
4072
|
src: __props.image,
|
|
4073
4073
|
mode: "aspectFit"
|
|
4074
|
-
}, null, 8, _hoisted_2$
|
|
4074
|
+
}, null, 8, _hoisted_2$9)) : (vue.openBlock(), vue.createElementBlock("view", _hoisted_3$6, [..._cache[0] || (_cache[0] = [
|
|
4075
4075
|
vue.createElementVNode("text", { class: "u-empty__icon" }, "📭", -1)
|
|
4076
4076
|
])]))
|
|
4077
4077
|
], true)
|
|
@@ -4093,7 +4093,7 @@ const _hoisted_1$b = {
|
|
|
4093
4093
|
key: 0,
|
|
4094
4094
|
class: "u-checkbox__check"
|
|
4095
4095
|
};
|
|
4096
|
-
const _hoisted_2$
|
|
4096
|
+
const _hoisted_2$8 = {
|
|
4097
4097
|
key: 0,
|
|
4098
4098
|
class: "u-checkbox__label"
|
|
4099
4099
|
};
|
|
@@ -4174,7 +4174,7 @@ const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
|
|
|
4174
4174
|
}, [
|
|
4175
4175
|
checked.value ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_1$b, "✓")) : vue.createCommentVNode("", true)
|
|
4176
4176
|
], 6),
|
|
4177
|
-
__props.label || _ctx.$slots.default ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$
|
|
4177
|
+
__props.label || _ctx.$slots.default ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$8, [
|
|
4178
4178
|
vue.renderSlot(_ctx.$slots, "default", {}, () => [
|
|
4179
4179
|
vue.createTextVNode(vue.toDisplayString(__props.label), 1)
|
|
4180
4180
|
], true)
|
|
@@ -4238,7 +4238,7 @@ const _hoisted_1$9 = {
|
|
|
4238
4238
|
key: 0,
|
|
4239
4239
|
class: "u-radio__dot"
|
|
4240
4240
|
};
|
|
4241
|
-
const _hoisted_2$
|
|
4241
|
+
const _hoisted_2$7 = {
|
|
4242
4242
|
key: 0,
|
|
4243
4243
|
class: "u-radio__label"
|
|
4244
4244
|
};
|
|
@@ -4316,7 +4316,7 @@ const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
|
|
|
4316
4316
|
}, [
|
|
4317
4317
|
checked.value ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_1$9)) : vue.createCommentVNode("", true)
|
|
4318
4318
|
], 6),
|
|
4319
|
-
__props.label || _ctx.$slots.default ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$
|
|
4319
|
+
__props.label || _ctx.$slots.default ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$7, [
|
|
4320
4320
|
vue.renderSlot(_ctx.$slots, "default", {}, () => [
|
|
4321
4321
|
vue.createTextVNode(vue.toDisplayString(__props.label), 1)
|
|
4322
4322
|
], true)
|
|
@@ -4368,7 +4368,7 @@ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
|
4368
4368
|
});
|
|
4369
4369
|
const uRadioGroup = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-04ea4949"]]);
|
|
4370
4370
|
const _hoisted_1$7 = { class: "u-toast__content" };
|
|
4371
|
-
const _hoisted_2$
|
|
4371
|
+
const _hoisted_2$6 = {
|
|
4372
4372
|
key: 0,
|
|
4373
4373
|
class: "u-toast__loading"
|
|
4374
4374
|
};
|
|
@@ -4452,7 +4452,7 @@ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
|
|
|
4452
4452
|
style: vue.normalizeStyle(toastStyle.value)
|
|
4453
4453
|
}, [
|
|
4454
4454
|
vue.createElementVNode("view", _hoisted_1$7, [
|
|
4455
|
-
__props.type === "loading" ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$
|
|
4455
|
+
__props.type === "loading" ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$6, [..._cache[0] || (_cache[0] = [
|
|
4456
4456
|
vue.createElementVNode("view", { class: "u-toast__loading-icon" }, null, -1)
|
|
4457
4457
|
])])) : __props.icon ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_3$5, vue.toDisplayString(__props.icon), 1)) : vue.createCommentVNode("", true),
|
|
4458
4458
|
__props.message ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_4$2, vue.toDisplayString(__props.message), 1)) : vue.createCommentVNode("", true)
|
|
@@ -4520,7 +4520,7 @@ const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
|
|
|
4520
4520
|
});
|
|
4521
4521
|
const uPopup = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-dc430e12"]]);
|
|
4522
4522
|
const _hoisted_1$5 = { class: "u-code-input" };
|
|
4523
|
-
const _hoisted_2$
|
|
4523
|
+
const _hoisted_2$5 = { class: "u-code-input__wrapper" };
|
|
4524
4524
|
const _hoisted_3$4 = {
|
|
4525
4525
|
key: 0,
|
|
4526
4526
|
class: "u-code-input__char"
|
|
@@ -4619,7 +4619,7 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
4619
4619
|
};
|
|
4620
4620
|
return (_ctx, _cache) => {
|
|
4621
4621
|
return vue.openBlock(), vue.createElementBlock("view", _hoisted_1$5, [
|
|
4622
|
-
vue.createElementVNode("view", _hoisted_2$
|
|
4622
|
+
vue.createElementVNode("view", _hoisted_2$5, [
|
|
4623
4623
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.length, (i) => {
|
|
4624
4624
|
return vue.openBlock(), vue.createElementBlock("view", {
|
|
4625
4625
|
key: i,
|
|
@@ -4652,7 +4652,7 @@ const _hoisted_1$4 = {
|
|
|
4652
4652
|
key: 0,
|
|
4653
4653
|
class: "u-skeleton__content"
|
|
4654
4654
|
};
|
|
4655
|
-
const _hoisted_2$
|
|
4655
|
+
const _hoisted_2$4 = { class: "u-skeleton__content" };
|
|
4656
4656
|
const _hoisted_3$3 = { class: "u-skeleton__paragraphs" };
|
|
4657
4657
|
const __default__$6 = {
|
|
4658
4658
|
options: {
|
|
@@ -4678,10 +4678,10 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
|
4678
4678
|
setup(__props) {
|
|
4679
4679
|
const props = __props;
|
|
4680
4680
|
const avatarStyle = vue.computed(() => {
|
|
4681
|
-
const
|
|
4681
|
+
const size = typeof props.avatarSize === "number" ? `${props.avatarSize}px` : props.avatarSize;
|
|
4682
4682
|
return {
|
|
4683
|
-
width:
|
|
4684
|
-
height:
|
|
4683
|
+
width: size,
|
|
4684
|
+
height: size
|
|
4685
4685
|
};
|
|
4686
4686
|
});
|
|
4687
4687
|
const titleStyle = vue.computed(() => {
|
|
@@ -4725,7 +4725,7 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
|
4725
4725
|
class: vue.normalizeClass(["u-skeleton__avatar", `u-skeleton__avatar--${__props.avatarShape}`]),
|
|
4726
4726
|
style: vue.normalizeStyle(avatarStyle.value)
|
|
4727
4727
|
}, null, 6)) : vue.createCommentVNode("", true),
|
|
4728
|
-
vue.createElementVNode("view", _hoisted_2$
|
|
4728
|
+
vue.createElementVNode("view", _hoisted_2$4, [
|
|
4729
4729
|
__props.title ? (vue.openBlock(), vue.createElementBlock("view", {
|
|
4730
4730
|
key: 0,
|
|
4731
4731
|
class: "u-skeleton__title",
|
|
@@ -4880,7 +4880,7 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
4880
4880
|
});
|
|
4881
4881
|
const uLink = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-f60d6c27"]]);
|
|
4882
4882
|
const _hoisted_1$3 = { class: "u-read-more" };
|
|
4883
|
-
const _hoisted_2$
|
|
4883
|
+
const _hoisted_2$3 = { class: "u-read-more__toggle-text" };
|
|
4884
4884
|
const _hoisted_3$2 = { class: "u-read-more__toggle-icon" };
|
|
4885
4885
|
const __default__$3 = {
|
|
4886
4886
|
options: {
|
|
@@ -4940,7 +4940,7 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
|
4940
4940
|
class: "u-read-more__toggle",
|
|
4941
4941
|
onClick: handleToggle
|
|
4942
4942
|
}, [
|
|
4943
|
-
vue.createElementVNode("text", _hoisted_2$
|
|
4943
|
+
vue.createElementVNode("text", _hoisted_2$3, vue.toDisplayString(toggleText.value), 1),
|
|
4944
4944
|
vue.createElementVNode("text", _hoisted_3$2, vue.toDisplayString(expanded.value ? "↑" : "↓"), 1)
|
|
4945
4945
|
])) : vue.createCommentVNode("", true)
|
|
4946
4946
|
]);
|
|
@@ -4949,7 +4949,7 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
|
4949
4949
|
});
|
|
4950
4950
|
const uReadMore = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-b31720eb"]]);
|
|
4951
4951
|
const _hoisted_1$2 = { class: "u-tabbar" };
|
|
4952
|
-
const _hoisted_2$
|
|
4952
|
+
const _hoisted_2$2 = { class: "u-tabbar__nav-wrap" };
|
|
4953
4953
|
const _hoisted_3$1 = { class: "u-tabbar__center" };
|
|
4954
4954
|
const _hoisted_4 = { class: "u-tabbar__center-brand" };
|
|
4955
4955
|
const _hoisted_5 = { class: "u-tabbar__center-text" };
|
|
@@ -4981,7 +4981,7 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
4981
4981
|
};
|
|
4982
4982
|
return (_ctx, _cache) => {
|
|
4983
4983
|
return vue.openBlock(), vue.createElementBlock("view", _hoisted_1$2, [
|
|
4984
|
-
vue.createElementVNode("view", _hoisted_2$
|
|
4984
|
+
vue.createElementVNode("view", _hoisted_2$2, [
|
|
4985
4985
|
vue.createElementVNode("view", {
|
|
4986
4986
|
class: vue.normalizeClass(["u-tabbar__tab-btn", { "u-tabbar__tab-btn--active": __props.modelValue === __props.leftTab.value }]),
|
|
4987
4987
|
onClick: _cache[0] || (_cache[0] = ($event) => switchTab(__props.leftTab.value))
|
|
@@ -5031,6 +5031,7 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
5031
5031
|
});
|
|
5032
5032
|
const uTabbar = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-10cb84bc"]]);
|
|
5033
5033
|
const _hoisted_1$1 = { class: "u-qrcode" };
|
|
5034
|
+
const _hoisted_2$1 = ["canvas-id", "id"];
|
|
5034
5035
|
const __default__$1 = {
|
|
5035
5036
|
options: {
|
|
5036
5037
|
virtualHost: true,
|
|
@@ -5049,264 +5050,240 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
|
5049
5050
|
},
|
|
5050
5051
|
setup(__props) {
|
|
5051
5052
|
const props = __props;
|
|
5052
|
-
const
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
return props.size / matrix.value.length;
|
|
5056
|
-
});
|
|
5057
|
-
const matrixStyle = vue.computed(() => ({
|
|
5058
|
-
width: `${props.size}px`,
|
|
5059
|
-
height: `${props.size}px`,
|
|
5060
|
-
backgroundColor: props.bgColor
|
|
5061
|
-
}));
|
|
5062
|
-
const cellStyle = (cell) => ({
|
|
5063
|
-
width: `${cellSize.value}px`,
|
|
5064
|
-
height: `${cellSize.value}px`,
|
|
5065
|
-
backgroundColor: cell === 1 ? props.color : props.bgColor
|
|
5066
|
-
});
|
|
5067
|
-
class QRCodeGenerator {
|
|
5068
|
-
// 根据数据长度获取版本
|
|
5053
|
+
const canvasId = vue.ref(`qrcode_${Date.now()}_${Math.random().toString(36).slice(2, 7)}`);
|
|
5054
|
+
class QRCode {
|
|
5055
|
+
// 获取版本
|
|
5069
5056
|
static getVersion(dataLength) {
|
|
5070
5057
|
for (let v = 1; v <= 40; v++) {
|
|
5071
5058
|
if (this.CAPACITY[v] >= dataLength) return v;
|
|
5072
5059
|
}
|
|
5073
5060
|
return 40;
|
|
5074
5061
|
}
|
|
5075
|
-
//
|
|
5062
|
+
// 生成二维码数据
|
|
5076
5063
|
static generate(data, ecl) {
|
|
5077
5064
|
const version = this.getVersion(data.length);
|
|
5078
|
-
const
|
|
5079
|
-
const
|
|
5080
|
-
for (let i = 0; i <
|
|
5081
|
-
|
|
5065
|
+
const size = version * 4 + 17;
|
|
5066
|
+
const modules = [];
|
|
5067
|
+
for (let i = 0; i < size; i++) {
|
|
5068
|
+
modules[i] = new Array(size).fill(0);
|
|
5082
5069
|
}
|
|
5083
|
-
this.
|
|
5084
|
-
this.
|
|
5085
|
-
this.addFinderPattern(matrix2, 0, size2 - 7);
|
|
5086
|
-
this.addSeparator(matrix2, size2);
|
|
5070
|
+
this.addFinderPatterns(modules, size);
|
|
5071
|
+
this.addTimingPatterns(modules, size);
|
|
5087
5072
|
if (version >= 2) {
|
|
5088
|
-
this.addAlignmentPatterns(
|
|
5073
|
+
this.addAlignmentPatterns(modules, version, size);
|
|
5089
5074
|
}
|
|
5090
|
-
this.
|
|
5091
|
-
|
|
5092
|
-
this.
|
|
5093
|
-
const
|
|
5094
|
-
this.
|
|
5095
|
-
this.
|
|
5096
|
-
|
|
5097
|
-
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
for (
|
|
5102
|
-
for (let
|
|
5103
|
-
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
if (r === -1 || r === 7 || c === -1 || c === 7) {
|
|
5107
|
-
matrix2[tr][tc] = 0;
|
|
5108
|
-
} else if (
|
|
5109
|
-
// 外框
|
|
5110
|
-
r === 0 || r === 6 || c === 0 || c === 6 || // 内框(中心 3x3)
|
|
5111
|
-
r >= 2 && r <= 4 && c >= 2 && c <= 4
|
|
5112
|
-
) {
|
|
5113
|
-
matrix2[tr][tc] = 1;
|
|
5114
|
-
} else {
|
|
5115
|
-
matrix2[tr][tc] = 0;
|
|
5075
|
+
this.addDarkModule(modules, size);
|
|
5076
|
+
const codewords = this.encodeCodewords(data, version, ecl);
|
|
5077
|
+
this.fillData(modules, codewords, size);
|
|
5078
|
+
const bestMask = this.findBestMask(modules, size);
|
|
5079
|
+
this.applyMask(modules, size, bestMask);
|
|
5080
|
+
this.addFormatInfo(modules, size, ecl, bestMask);
|
|
5081
|
+
return { version, size, modules };
|
|
5082
|
+
}
|
|
5083
|
+
// 添加定位图案
|
|
5084
|
+
static addFinderPatterns(modules, size) {
|
|
5085
|
+
const positions = [[0, 0], [size - 7, 0], [0, size - 7]];
|
|
5086
|
+
for (const [row, col] of positions) {
|
|
5087
|
+
for (let r = 0; r < 7; r++) {
|
|
5088
|
+
for (let c = 0; c < 7; c++) {
|
|
5089
|
+
if (r === 0 || r === 6 || c === 0 || c === 6 || r >= 2 && r <= 4 && c >= 2 && c <= 4) {
|
|
5090
|
+
modules[row + r][col + c] = 1;
|
|
5116
5091
|
}
|
|
5117
5092
|
}
|
|
5118
5093
|
}
|
|
5094
|
+
for (let i = 0; i < 8; i++) {
|
|
5095
|
+
if (row === 0 && i < size && modules[7]) modules[7][i] = 0;
|
|
5096
|
+
if (row === 0 && i < size && modules[i]) modules[i][7] = 0;
|
|
5097
|
+
if (row === size - 7 && i < size && modules[7]) modules[7][size - 8 + i] = 0;
|
|
5098
|
+
if (row === size - 7 && i < size && modules[i]) modules[i][size - 8] = 0;
|
|
5099
|
+
if (row === 0 && col === size - 7 && i < size && modules[size - 8]) modules[size - 8][i] = 0;
|
|
5100
|
+
if (row === 0 && col === size - 7 && i < size && modules[size - 1 - i]) modules[size - 1 - i][7] = 0;
|
|
5101
|
+
}
|
|
5119
5102
|
}
|
|
5120
5103
|
}
|
|
5121
|
-
//
|
|
5122
|
-
static
|
|
5104
|
+
// 添加时序图案
|
|
5105
|
+
static addTimingPatterns(modules, size) {
|
|
5106
|
+
for (let i = 8; i < size - 8; i++) {
|
|
5107
|
+
modules[6][i] = i % 2 === 0 ? 1 : 0;
|
|
5108
|
+
modules[i][6] = i % 2 === 0 ? 1 : 0;
|
|
5109
|
+
}
|
|
5123
5110
|
}
|
|
5124
5111
|
// 添加定位图案
|
|
5125
|
-
static addAlignmentPatterns(
|
|
5126
|
-
const positions = this.getAlignmentPositions(version);
|
|
5112
|
+
static addAlignmentPatterns(modules, version, size) {
|
|
5113
|
+
const positions = this.getAlignmentPositions(version, size);
|
|
5127
5114
|
for (const row of positions) {
|
|
5128
5115
|
for (const col of positions) {
|
|
5129
|
-
if (row
|
|
5130
|
-
|
|
5131
|
-
|
|
5132
|
-
|
|
5133
|
-
|
|
5116
|
+
if (modules[row][col] !== 0) continue;
|
|
5117
|
+
for (let r = -2; r <= 2; r++) {
|
|
5118
|
+
for (let c = -2; c <= 2; c++) {
|
|
5119
|
+
if (row + r >= 0 && row + r < size && col + c >= 0 && col + c < size) {
|
|
5120
|
+
if (Math.abs(r) === 2 || Math.abs(c) === 2 || r === 0 && c === 0) {
|
|
5121
|
+
modules[row + r][col + c] = 1;
|
|
5122
|
+
} else {
|
|
5123
|
+
modules[row + r][col + c] = 0;
|
|
5124
|
+
}
|
|
5125
|
+
}
|
|
5126
|
+
}
|
|
5134
5127
|
}
|
|
5135
5128
|
}
|
|
5136
5129
|
}
|
|
5137
5130
|
}
|
|
5138
5131
|
// 获取定位图案位置
|
|
5139
|
-
static getAlignmentPositions(version) {
|
|
5132
|
+
static getAlignmentPositions(version, size) {
|
|
5140
5133
|
if (version === 1) return [];
|
|
5141
|
-
const intervals = Math.floor(version / 7) + 1;
|
|
5142
|
-
const size2 = version * 4 + 17;
|
|
5143
|
-
const step = Math.ceil((size2 - 13) / intervals);
|
|
5144
5134
|
const positions = [6];
|
|
5145
|
-
|
|
5146
|
-
|
|
5147
|
-
|
|
5148
|
-
|
|
5149
|
-
|
|
5150
|
-
// 添加单个定位图案(5x5)
|
|
5151
|
-
static addAlignmentPattern(matrix2, row, col) {
|
|
5152
|
-
for (let r = -2; r <= 2; r++) {
|
|
5153
|
-
for (let c = -2; c <= 2; c++) {
|
|
5154
|
-
const tr = row + r;
|
|
5155
|
-
const tc = col + c;
|
|
5156
|
-
if (tr >= 0 && tr < matrix2.length && tc >= 0 && tc < matrix2.length) {
|
|
5157
|
-
if (Math.abs(r) === 2 || Math.abs(c) === 2 || r === 0 && c === 0) {
|
|
5158
|
-
matrix2[tr][tc] = 1;
|
|
5159
|
-
} else {
|
|
5160
|
-
matrix2[tr][tc] = 0;
|
|
5161
|
-
}
|
|
5162
|
-
}
|
|
5163
|
-
}
|
|
5164
|
-
}
|
|
5165
|
-
}
|
|
5166
|
-
// 添加时序图案
|
|
5167
|
-
static addTimingPatterns(matrix2, size2) {
|
|
5168
|
-
for (let i = 8; i < size2 - 8; i++) {
|
|
5169
|
-
if (matrix2[6][i] === -1) {
|
|
5170
|
-
matrix2[6][i] = i % 2 === 0 ? 1 : 0;
|
|
5171
|
-
}
|
|
5172
|
-
if (matrix2[i][6] === -1) {
|
|
5173
|
-
matrix2[i][6] = i % 2 === 0 ? 1 : 0;
|
|
5174
|
-
}
|
|
5135
|
+
const step = version === 32 ? 26 : Math.ceil((size - 13) / (Math.floor(version / 7) + 1));
|
|
5136
|
+
let pos = size - 7;
|
|
5137
|
+
while (pos > 6) {
|
|
5138
|
+
positions.unshift(pos);
|
|
5139
|
+
pos -= step;
|
|
5175
5140
|
}
|
|
5141
|
+
return positions;
|
|
5176
5142
|
}
|
|
5177
|
-
//
|
|
5178
|
-
static
|
|
5179
|
-
|
|
5180
|
-
if (matrix2[8] && matrix2[8][i] === -1) matrix2[8][i] = 0;
|
|
5181
|
-
if (matrix2[i] && matrix2[i][8] === -1) matrix2[i][8] = 0;
|
|
5182
|
-
}
|
|
5183
|
-
for (let i = 0; i < 8; i++) {
|
|
5184
|
-
if (matrix2[8] && matrix2[8][size2 - 1 - i] === -1) matrix2[8][size2 - 1 - i] = 0;
|
|
5185
|
-
if (matrix2[size2 - 1 - i] && matrix2[size2 - 1 - i][8] === -1) matrix2[size2 - 1 - i][8] = 0;
|
|
5186
|
-
}
|
|
5143
|
+
// 添加暗模块
|
|
5144
|
+
static addDarkModule(modules, size) {
|
|
5145
|
+
modules[size - 8][8] = 1;
|
|
5187
5146
|
}
|
|
5188
|
-
//
|
|
5189
|
-
static
|
|
5147
|
+
// 编码码字
|
|
5148
|
+
static encodeCodewords(data, version, ecl) {
|
|
5190
5149
|
const bits = [];
|
|
5191
5150
|
bits.push(0, 1, 0, 0);
|
|
5192
5151
|
const cciBits = version <= 9 ? 8 : 16;
|
|
5193
|
-
const len = data.length;
|
|
5194
5152
|
for (let i = cciBits - 1; i >= 0; i--) {
|
|
5195
|
-
bits.push(
|
|
5153
|
+
bits.push(data.length >> i & 1);
|
|
5196
5154
|
}
|
|
5197
|
-
for (
|
|
5198
|
-
const code2 =
|
|
5199
|
-
for (let
|
|
5200
|
-
bits.push(code2 >>
|
|
5155
|
+
for (const char of data) {
|
|
5156
|
+
const code2 = char.charCodeAt(0);
|
|
5157
|
+
for (let i = 7; i >= 0; i--) {
|
|
5158
|
+
bits.push(code2 >> i & 1);
|
|
5201
5159
|
}
|
|
5202
5160
|
}
|
|
5203
|
-
const
|
|
5204
|
-
|
|
5205
|
-
|
|
5206
|
-
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5161
|
+
const totalDataBits = (this.TOTAL_CODEWORDS[version] - this.ECC_CODEWORDS[version]) * 8;
|
|
5162
|
+
const termLen = Math.min(4, totalDataBits - bits.length);
|
|
5163
|
+
for (let i = 0; i < termLen; i++) bits.push(0);
|
|
5164
|
+
while (bits.length % 8 !== 0) bits.push(0);
|
|
5165
|
+
const padBytes = [236, 17];
|
|
5166
|
+
let padIdx = 0;
|
|
5167
|
+
while (bits.length < totalDataBits) {
|
|
5168
|
+
for (let i = 7; i >= 0; i--) {
|
|
5169
|
+
bits.push(padBytes[padIdx] >> i & 1);
|
|
5170
|
+
}
|
|
5171
|
+
padIdx = (padIdx + 1) % 2;
|
|
5214
5172
|
}
|
|
5215
5173
|
const bytes = [];
|
|
5216
5174
|
for (let i = 0; i < bits.length; i += 8) {
|
|
5217
|
-
let
|
|
5218
|
-
for (let j = 0; j < 8; j++)
|
|
5219
|
-
|
|
5175
|
+
let b = 0;
|
|
5176
|
+
for (let j = 0; j < 8; j++) b = b << 1 | bits[i + j];
|
|
5177
|
+
bytes.push(b);
|
|
5178
|
+
}
|
|
5179
|
+
const eccBytes = this.generateECC(bytes, this.ECC_CODEWORDS[version]);
|
|
5180
|
+
return [...bytes, ...eccBytes];
|
|
5181
|
+
}
|
|
5182
|
+
// Reed-Solomon 纠错码生成
|
|
5183
|
+
static generateECC(data, eccCount) {
|
|
5184
|
+
const GF_EXP = new Array(512);
|
|
5185
|
+
const GF_LOG = new Array(256);
|
|
5186
|
+
let x = 1;
|
|
5187
|
+
for (let i = 0; i < 255; i++) {
|
|
5188
|
+
GF_EXP[i] = x;
|
|
5189
|
+
GF_LOG[x] = i;
|
|
5190
|
+
x = x * 2;
|
|
5191
|
+
if (x >= 256) x ^= 285;
|
|
5192
|
+
}
|
|
5193
|
+
for (let i = 255; i < 512; i++) {
|
|
5194
|
+
GF_EXP[i] = GF_EXP[i - 255];
|
|
5195
|
+
}
|
|
5196
|
+
const gfMul = (a, b) => {
|
|
5197
|
+
if (a === 0 || b === 0) return 0;
|
|
5198
|
+
return GF_EXP[GF_LOG[a] + GF_LOG[b]];
|
|
5199
|
+
};
|
|
5200
|
+
const genPoly = [1];
|
|
5201
|
+
for (let i = 0; i < eccCount; i++) {
|
|
5202
|
+
const newPoly = new Array(genPoly.length + 1).fill(0);
|
|
5203
|
+
for (let j = 0; j < genPoly.length; j++) {
|
|
5204
|
+
newPoly[j] ^= genPoly[j];
|
|
5205
|
+
newPoly[j + 1] ^= gfMul(genPoly[j], GF_EXP[i]);
|
|
5220
5206
|
}
|
|
5221
|
-
|
|
5207
|
+
genPoly = newPoly;
|
|
5222
5208
|
}
|
|
5223
|
-
|
|
5224
|
-
|
|
5225
|
-
|
|
5226
|
-
|
|
5227
|
-
|
|
5228
|
-
0
|
|
5229
|
-
|
|
5230
|
-
|
|
5231
|
-
|
|
5232
|
-
|
|
5233
|
-
134,
|
|
5234
|
-
172,
|
|
5235
|
-
196,
|
|
5236
|
-
242,
|
|
5237
|
-
292,
|
|
5238
|
-
346,
|
|
5239
|
-
404,
|
|
5240
|
-
466,
|
|
5241
|
-
532,
|
|
5242
|
-
581,
|
|
5243
|
-
625,
|
|
5244
|
-
733,
|
|
5245
|
-
815,
|
|
5246
|
-
901,
|
|
5247
|
-
993,
|
|
5248
|
-
1079,
|
|
5249
|
-
1157,
|
|
5250
|
-
1253,
|
|
5251
|
-
1353,
|
|
5252
|
-
1453,
|
|
5253
|
-
1553,
|
|
5254
|
-
1673,
|
|
5255
|
-
1793,
|
|
5256
|
-
1913,
|
|
5257
|
-
2033
|
|
5258
|
-
];
|
|
5259
|
-
const eccPerBlock = [0, 10, 16, 22, 28, 36, 44, 52, 64, 72];
|
|
5260
|
-
const blocks = [0, 1, 1, 1, 1, 1, 2, 2, 2, 2];
|
|
5261
|
-
const totalEcc = eccPerBlock[version] * blocks[version];
|
|
5262
|
-
return totalCodewords[version] - totalEcc;
|
|
5209
|
+
const ecc = new Array(eccCount).fill(0);
|
|
5210
|
+
for (const byte of data) {
|
|
5211
|
+
const factor = byte ^ ecc[0];
|
|
5212
|
+
ecc.shift();
|
|
5213
|
+
ecc.push(0);
|
|
5214
|
+
for (let i = 0; i < ecc.length; i++) {
|
|
5215
|
+
ecc[i] ^= gfMul(genPoly[i], factor);
|
|
5216
|
+
}
|
|
5217
|
+
}
|
|
5218
|
+
return ecc;
|
|
5263
5219
|
}
|
|
5264
5220
|
// 填充数据到矩阵
|
|
5265
|
-
static fillData(
|
|
5266
|
-
let
|
|
5221
|
+
static fillData(modules, codewords, size) {
|
|
5222
|
+
for (let row = 0; row < size; row++) {
|
|
5223
|
+
for (let col = 0; col < size; col++) {
|
|
5224
|
+
if (modules[row][col] !== 0) {
|
|
5225
|
+
modules[row][col] = -1;
|
|
5226
|
+
}
|
|
5227
|
+
}
|
|
5228
|
+
}
|
|
5229
|
+
for (let i = 0; i < 9; i++) {
|
|
5230
|
+
if (modules[8][i] === 0) modules[8][i] = -1;
|
|
5231
|
+
if (modules[i][8] === 0) modules[i][8] = -1;
|
|
5232
|
+
}
|
|
5233
|
+
for (let i = 0; i < 8; i++) {
|
|
5234
|
+
if (modules[8][size - 1 - i] === 0) modules[8][size - 1 - i] = -1;
|
|
5235
|
+
if (modules[size - 1 - i][8] === 0) modules[size - 1 - i][8] = -1;
|
|
5236
|
+
}
|
|
5237
|
+
let bitIdx = 0;
|
|
5267
5238
|
let upward = true;
|
|
5268
|
-
for (let col =
|
|
5239
|
+
for (let col = size - 1; col >= 0; col -= 2) {
|
|
5269
5240
|
if (col === 6) col = 5;
|
|
5270
|
-
for (let row = upward ?
|
|
5241
|
+
for (let row = upward ? size - 1 : 0; upward ? row >= 0 : row < size; upward ? row-- : row++) {
|
|
5271
5242
|
for (let c = 0; c < 2; c++) {
|
|
5272
|
-
const
|
|
5273
|
-
if (
|
|
5243
|
+
const tc = col - c;
|
|
5244
|
+
if (tc >= 0 && modules[row][tc] === 0) {
|
|
5274
5245
|
let bit = 0;
|
|
5275
|
-
if (
|
|
5276
|
-
bit =
|
|
5246
|
+
if (bitIdx < codewords.length * 8) {
|
|
5247
|
+
bit = codewords[Math.floor(bitIdx / 8)] >> 7 - bitIdx % 8 & 1;
|
|
5277
5248
|
}
|
|
5278
|
-
|
|
5279
|
-
|
|
5249
|
+
modules[row][tc] = bit;
|
|
5250
|
+
bitIdx++;
|
|
5280
5251
|
}
|
|
5281
5252
|
}
|
|
5282
5253
|
}
|
|
5283
5254
|
upward = !upward;
|
|
5284
5255
|
}
|
|
5285
5256
|
}
|
|
5257
|
+
// 寻找最佳掩码
|
|
5258
|
+
static findBestMask(modules, size) {
|
|
5259
|
+
let bestMask = 0;
|
|
5260
|
+
let bestScore = Infinity;
|
|
5261
|
+
for (let mask = 0; mask < 8; mask++) {
|
|
5262
|
+
const testModules = modules.map((row) => [...row]);
|
|
5263
|
+
this.applyMask(testModules, size, mask);
|
|
5264
|
+
const score = this.evaluateMask(testModules, size);
|
|
5265
|
+
if (score < bestScore) {
|
|
5266
|
+
bestScore = score;
|
|
5267
|
+
bestMask = mask;
|
|
5268
|
+
}
|
|
5269
|
+
}
|
|
5270
|
+
return bestMask;
|
|
5271
|
+
}
|
|
5286
5272
|
// 应用掩码
|
|
5287
|
-
static applyMask(
|
|
5288
|
-
for (let row = 0; row <
|
|
5289
|
-
for (let col = 0; col <
|
|
5290
|
-
if (
|
|
5291
|
-
if (this.getMaskBit(row, col,
|
|
5292
|
-
|
|
5273
|
+
static applyMask(modules, size, mask) {
|
|
5274
|
+
for (let row = 0; row < size; row++) {
|
|
5275
|
+
for (let col = 0; col < size; col++) {
|
|
5276
|
+
if (modules[row][col] >= 0) {
|
|
5277
|
+
if (this.getMaskBit(row, col, mask)) {
|
|
5278
|
+
modules[row][col] = modules[row][col] === 1 ? 0 : 1;
|
|
5293
5279
|
}
|
|
5294
5280
|
}
|
|
5295
5281
|
}
|
|
5296
5282
|
}
|
|
5297
5283
|
}
|
|
5298
|
-
//
|
|
5299
|
-
static
|
|
5300
|
-
|
|
5301
|
-
if (row < 9 && col > size2 - 9) return true;
|
|
5302
|
-
if (row > size2 - 9 && col < 9) return true;
|
|
5303
|
-
if (row === 6 || col === 6) return true;
|
|
5304
|
-
if (row === size2 - 8 && col === 8) return true;
|
|
5305
|
-
return false;
|
|
5306
|
-
}
|
|
5307
|
-
// 计算掩码位
|
|
5308
|
-
static getMaskBit(row, col, pattern) {
|
|
5309
|
-
switch (pattern) {
|
|
5284
|
+
// 掩码函数
|
|
5285
|
+
static getMaskBit(row, col, mask) {
|
|
5286
|
+
switch (mask) {
|
|
5310
5287
|
case 0:
|
|
5311
5288
|
return (row + col) % 2 === 0;
|
|
5312
5289
|
case 1:
|
|
@@ -5327,136 +5304,198 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
|
5327
5304
|
return false;
|
|
5328
5305
|
}
|
|
5329
5306
|
}
|
|
5330
|
-
//
|
|
5331
|
-
static
|
|
5332
|
-
|
|
5333
|
-
|
|
5334
|
-
|
|
5335
|
-
|
|
5336
|
-
|
|
5337
|
-
|
|
5338
|
-
|
|
5339
|
-
|
|
5340
|
-
|
|
5307
|
+
// 评估掩码质量
|
|
5308
|
+
static evaluateMask(modules, size) {
|
|
5309
|
+
let score = 0;
|
|
5310
|
+
for (let row = 0; row < size; row++) {
|
|
5311
|
+
let count = 1;
|
|
5312
|
+
for (let col = 1; col < size; col++) {
|
|
5313
|
+
if (modules[row][col] === modules[row][col - 1]) {
|
|
5314
|
+
count++;
|
|
5315
|
+
} else {
|
|
5316
|
+
if (count >= 5) score += count - 2;
|
|
5317
|
+
count = 1;
|
|
5318
|
+
}
|
|
5341
5319
|
}
|
|
5320
|
+
if (count >= 5) score += count - 2;
|
|
5342
5321
|
}
|
|
5343
|
-
|
|
5344
|
-
|
|
5345
|
-
|
|
5346
|
-
|
|
5347
|
-
|
|
5348
|
-
|
|
5349
|
-
|
|
5350
|
-
|
|
5351
|
-
|
|
5352
|
-
|
|
5353
|
-
|
|
5354
|
-
matrix2[5 - i][8] = formatBits[5 - i];
|
|
5355
|
-
}
|
|
5356
|
-
for (let i = 0; i < 8; i++) {
|
|
5357
|
-
matrix2[8][size2 - 1 - i] = formatBits[i];
|
|
5358
|
-
}
|
|
5359
|
-
for (let i = 0; i < 7; i++) {
|
|
5360
|
-
matrix2[size2 - 1 - i][8] = formatBits[14 - 7 + i];
|
|
5322
|
+
for (let col = 0; col < size; col++) {
|
|
5323
|
+
let count = 1;
|
|
5324
|
+
for (let row = 1; row < size; row++) {
|
|
5325
|
+
if (modules[row][col] === modules[row - 1][col]) {
|
|
5326
|
+
count++;
|
|
5327
|
+
} else {
|
|
5328
|
+
if (count >= 5) score += count - 2;
|
|
5329
|
+
count = 1;
|
|
5330
|
+
}
|
|
5331
|
+
}
|
|
5332
|
+
if (count >= 5) score += count - 2;
|
|
5361
5333
|
}
|
|
5334
|
+
return score;
|
|
5362
5335
|
}
|
|
5363
|
-
//
|
|
5364
|
-
static
|
|
5365
|
-
|
|
5366
|
-
|
|
5367
|
-
|
|
5368
|
-
|
|
5369
|
-
|
|
5370
|
-
}
|
|
5336
|
+
// 添加格式信息
|
|
5337
|
+
static addFormatInfo(modules, size, ecl, mask) {
|
|
5338
|
+
const eclBits = this.ECC_LEVEL[ecl];
|
|
5339
|
+
const data = eclBits << 3 | mask;
|
|
5340
|
+
let rem = data;
|
|
5341
|
+
for (let i = 0; i < 10; i++) {
|
|
5342
|
+
rem = rem << 1 ^ (rem >> 14) * 1335;
|
|
5371
5343
|
}
|
|
5372
|
-
|
|
5344
|
+
const format = (data << 10 | rem) ^ 21522;
|
|
5345
|
+
const bits = [];
|
|
5346
|
+
for (let i = 14; i >= 0; i--) {
|
|
5347
|
+
bits.push(format >> i & 1);
|
|
5348
|
+
}
|
|
5349
|
+
for (let i = 0; i < 6; i++) modules[8][i] = bits[i];
|
|
5350
|
+
modules[8][7] = bits[6];
|
|
5351
|
+
modules[8][8] = bits[7];
|
|
5352
|
+
modules[7][8] = bits[8];
|
|
5353
|
+
for (let i = 9; i < 15; i++) modules[14 - i][8] = bits[i];
|
|
5354
|
+
for (let i = 0; i < 8; i++) modules[8][size - 1 - i] = bits[14 - i];
|
|
5355
|
+
for (let i = 8; i < 15; i++) modules[size - 15 + i][8] = bits[14 - i];
|
|
5373
5356
|
}
|
|
5374
5357
|
}
|
|
5375
|
-
//
|
|
5376
|
-
__publicField(
|
|
5377
|
-
|
|
5378
|
-
|
|
5379
|
-
Q: [13, 22, 31, 40, 53, 66, 80, 96, 108],
|
|
5380
|
-
H: [17, 28, 41, 56, 77, 96, 114, 136, 156]
|
|
5381
|
-
});
|
|
5382
|
-
// 版本容量表(字节模式)
|
|
5383
|
-
__publicField(QRCodeGenerator, "CAPACITY", [
|
|
5358
|
+
// 纠错级别
|
|
5359
|
+
__publicField(QRCode, "ECC_LEVEL", { L: 1, M: 0, Q: 3, H: 2 });
|
|
5360
|
+
// 每个版本的纠错码字数(M级别)
|
|
5361
|
+
__publicField(QRCode, "ECC_CODEWORDS", [
|
|
5384
5362
|
0,
|
|
5385
|
-
|
|
5386
|
-
|
|
5387
|
-
|
|
5388
|
-
|
|
5389
|
-
|
|
5363
|
+
10,
|
|
5364
|
+
16,
|
|
5365
|
+
22,
|
|
5366
|
+
28,
|
|
5367
|
+
36,
|
|
5368
|
+
44,
|
|
5369
|
+
52,
|
|
5370
|
+
64,
|
|
5371
|
+
72,
|
|
5372
|
+
80,
|
|
5373
|
+
96,
|
|
5374
|
+
108,
|
|
5375
|
+
120,
|
|
5376
|
+
132,
|
|
5377
|
+
144,
|
|
5378
|
+
168,
|
|
5379
|
+
180,
|
|
5380
|
+
196,
|
|
5381
|
+
216,
|
|
5382
|
+
240,
|
|
5383
|
+
260,
|
|
5384
|
+
288,
|
|
5385
|
+
320,
|
|
5386
|
+
344,
|
|
5387
|
+
376,
|
|
5388
|
+
412,
|
|
5389
|
+
452,
|
|
5390
|
+
492,
|
|
5391
|
+
536
|
|
5392
|
+
]);
|
|
5393
|
+
// 每个版本的总码字数
|
|
5394
|
+
__publicField(QRCode, "TOTAL_CODEWORDS", [
|
|
5395
|
+
0,
|
|
5396
|
+
26,
|
|
5397
|
+
44,
|
|
5398
|
+
70,
|
|
5399
|
+
100,
|
|
5390
5400
|
134,
|
|
5401
|
+
172,
|
|
5402
|
+
196,
|
|
5403
|
+
242,
|
|
5404
|
+
292,
|
|
5405
|
+
346,
|
|
5406
|
+
404,
|
|
5407
|
+
466,
|
|
5408
|
+
532,
|
|
5409
|
+
581,
|
|
5410
|
+
625,
|
|
5411
|
+
733,
|
|
5412
|
+
815,
|
|
5413
|
+
901,
|
|
5414
|
+
993,
|
|
5415
|
+
1079,
|
|
5416
|
+
1157,
|
|
5417
|
+
1253,
|
|
5418
|
+
1353,
|
|
5419
|
+
1453,
|
|
5420
|
+
1553,
|
|
5421
|
+
1673,
|
|
5422
|
+
1793,
|
|
5423
|
+
1913,
|
|
5424
|
+
2033
|
|
5425
|
+
]);
|
|
5426
|
+
// 每个版本的容量(字节模式,M级别)
|
|
5427
|
+
__publicField(QRCode, "CAPACITY", [
|
|
5428
|
+
0,
|
|
5429
|
+
16,
|
|
5430
|
+
28,
|
|
5431
|
+
44,
|
|
5432
|
+
64,
|
|
5433
|
+
86,
|
|
5434
|
+
108,
|
|
5435
|
+
124,
|
|
5391
5436
|
154,
|
|
5392
|
-
|
|
5393
|
-
|
|
5394
|
-
|
|
5395
|
-
|
|
5396
|
-
|
|
5397
|
-
|
|
5398
|
-
|
|
5399
|
-
|
|
5400
|
-
|
|
5401
|
-
|
|
5402
|
-
|
|
5403
|
-
|
|
5404
|
-
|
|
5405
|
-
|
|
5406
|
-
|
|
5407
|
-
|
|
5408
|
-
|
|
5409
|
-
|
|
5410
|
-
|
|
5411
|
-
|
|
5412
|
-
|
|
5413
|
-
1628,
|
|
5414
|
-
1732
|
|
5437
|
+
186,
|
|
5438
|
+
216,
|
|
5439
|
+
252,
|
|
5440
|
+
290,
|
|
5441
|
+
334,
|
|
5442
|
+
365,
|
|
5443
|
+
415,
|
|
5444
|
+
453,
|
|
5445
|
+
507,
|
|
5446
|
+
563,
|
|
5447
|
+
623,
|
|
5448
|
+
669,
|
|
5449
|
+
719,
|
|
5450
|
+
783,
|
|
5451
|
+
843,
|
|
5452
|
+
909,
|
|
5453
|
+
969,
|
|
5454
|
+
1047,
|
|
5455
|
+
1119,
|
|
5456
|
+
1193,
|
|
5457
|
+
1273
|
|
5415
5458
|
]);
|
|
5416
|
-
const
|
|
5417
|
-
if (!props.value)
|
|
5418
|
-
|
|
5419
|
-
|
|
5420
|
-
|
|
5421
|
-
|
|
5422
|
-
|
|
5423
|
-
|
|
5424
|
-
|
|
5425
|
-
|
|
5426
|
-
|
|
5459
|
+
const drawQRCode = () => {
|
|
5460
|
+
if (!props.value) return;
|
|
5461
|
+
vue.nextTick(() => {
|
|
5462
|
+
const result = QRCode.generate(props.value, props.errorCorrectLevel);
|
|
5463
|
+
const cellSize = props.size / result.size;
|
|
5464
|
+
const ctx = uni.createCanvasContext(canvasId.value);
|
|
5465
|
+
ctx.setFillStyle(props.bgColor);
|
|
5466
|
+
ctx.fillRect(0, 0, props.size, props.size);
|
|
5467
|
+
ctx.setFillStyle(props.color);
|
|
5468
|
+
for (let row = 0; row < result.size; row++) {
|
|
5469
|
+
for (let col = 0; col < result.size; col++) {
|
|
5470
|
+
if (result.modules[row][col] === 1) {
|
|
5471
|
+
ctx.fillRect(col * cellSize, row * cellSize, cellSize, cellSize);
|
|
5472
|
+
}
|
|
5473
|
+
}
|
|
5474
|
+
}
|
|
5475
|
+
ctx.draw();
|
|
5476
|
+
});
|
|
5427
5477
|
};
|
|
5428
|
-
vue.watch(() => props.value,
|
|
5429
|
-
vue.watch(() => props.
|
|
5478
|
+
vue.watch(() => props.value, drawQRCode);
|
|
5479
|
+
vue.watch(() => props.size, drawQRCode);
|
|
5480
|
+
vue.watch(() => props.color, drawQRCode);
|
|
5481
|
+
vue.watch(() => props.bgColor, drawQRCode);
|
|
5430
5482
|
vue.onMounted(() => {
|
|
5431
|
-
|
|
5483
|
+
drawQRCode();
|
|
5432
5484
|
});
|
|
5433
5485
|
return (_ctx, _cache) => {
|
|
5434
5486
|
return vue.openBlock(), vue.createElementBlock("view", _hoisted_1$1, [
|
|
5435
|
-
|
|
5487
|
+
canvasId.value ? (vue.openBlock(), vue.createElementBlock("canvas", {
|
|
5436
5488
|
key: 0,
|
|
5437
|
-
|
|
5438
|
-
|
|
5439
|
-
|
|
5440
|
-
|
|
5441
|
-
|
|
5442
|
-
key: rowIndex,
|
|
5443
|
-
class: "u-qrcode__row"
|
|
5444
|
-
}, [
|
|
5445
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(row, (cell, colIndex) => {
|
|
5446
|
-
return vue.openBlock(), vue.createElementBlock("view", {
|
|
5447
|
-
key: colIndex,
|
|
5448
|
-
class: "u-qrcode__cell",
|
|
5449
|
-
style: vue.normalizeStyle(cellStyle(cell))
|
|
5450
|
-
}, null, 4);
|
|
5451
|
-
}), 128))
|
|
5452
|
-
]);
|
|
5453
|
-
}), 128))
|
|
5454
|
-
], 4)) : vue.createCommentVNode("", true)
|
|
5489
|
+
"canvas-id": canvasId.value,
|
|
5490
|
+
id: canvasId.value,
|
|
5491
|
+
class: "u-qrcode__canvas",
|
|
5492
|
+
style: vue.normalizeStyle({ width: `${__props.size}px`, height: `${__props.size}px` })
|
|
5493
|
+
}, null, 12, _hoisted_2$1)) : vue.createCommentVNode("", true)
|
|
5455
5494
|
]);
|
|
5456
5495
|
};
|
|
5457
5496
|
}
|
|
5458
5497
|
});
|
|
5459
|
-
const uQrcode = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-
|
|
5498
|
+
const uQrcode = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-ff93204c"]]);
|
|
5460
5499
|
const _hoisted_1 = { class: "u-barcode" };
|
|
5461
5500
|
const _hoisted_2 = ["canvas-id"];
|
|
5462
5501
|
const _hoisted_3 = ["src"];
|