Commit 7d25cdcc by cen

fix: leftside

1 parent b320052e
...@@ -49,8 +49,8 @@ const props = defineProps<{ ...@@ -49,8 +49,8 @@ const props = defineProps<{
const emit = defineEmits<{ const emit = defineEmits<{
changeTab: [index: number] changeTab: [index: number]
}>(); }>();
const scenePopupRef = ref<any | null>(null); const scenePopupRef = ref(null);
const settingRef = ref<any | null>(null); const settingRef = ref(null);
const isPortraitMode = computed((): boolean => { const isPortraitMode = computed((): boolean => {
return props.isPortrait === true; return props.isPortrait === true;
...@@ -149,9 +149,9 @@ function onChangeTab(index: number): void { ...@@ -149,9 +149,9 @@ function onChangeTab(index: number): void {
function onSceneChange(): void { function onSceneChange(): void {
const pop = scenePopupRef.value; const pop = scenePopupRef.value;
if (pop != null) { if (pop != null) {
const anyPop = pop as any; const obj = pop as UTSJSONObject;
const fn = anyPop.open as (() => void) | null; const fn = obj.open as (() => void) | null;
if (typeof fn === "function") { if (fn != null && typeof fn === "function") {
fn(); fn();
} }
} }
...@@ -160,9 +160,9 @@ function onSceneChange(): void { ...@@ -160,9 +160,9 @@ function onSceneChange(): void {
function onSetting(): void { function onSetting(): void {
const box = settingRef.value; const box = settingRef.value;
if (box != null) { if (box != null) {
const anyBox = box as any; const obj = box as UTSJSONObject;
const fn = anyBox.open as (() => void) | null; const fn = obj.open as (() => void) | null;
if (typeof fn === "function") { if (fn != null && typeof fn === "function") {
fn(); fn();
} }
} }
......
...@@ -5,92 +5,92 @@ ...@@ -5,92 +5,92 @@
* - values: 分辨率 -> 值;未列出的分辨率用 baseWidth 线性缩放 * - values: 分辨率 -> 值;未列出的分辨率用 baseWidth 线性缩放
*/ */
export const LAYOUT_VARS: UTSJSONObject = { export const LAYOUT_VARS: UTSJSONObject = {
'spacingXs': { "spacingXs": {
'css': '--l-spacing-xs', "css": "--l-spacing-xs",
'values': { '1024': 8, '1174': 8, '1920': 15 } as UTSJSONObject "values": { "1024": 8, "1174": 8, "1920": 15 } as UTSJSONObject
} as UTSJSONObject, } as UTSJSONObject,
'spacingSm': { "spacingSm": {
'css': '--l-spacing-sm', "css": "--l-spacing-sm",
'values': { '1024': 12, '1174': 12, '1920': 23 } as UTSJSONObject "values": { "1024": 12, "1174": 12, "1920": 23 } as UTSJSONObject
} as UTSJSONObject, } as UTSJSONObject,
'spacingMd': { "spacingMd": {
'css': '--l-spacing-md', "css": "--l-spacing-md",
'values': { '1024': 16, '1174': 16, '1920': 30 } as UTSJSONObject "values": { "1024": 16, "1174": 16, "1920": 30 } as UTSJSONObject
} as UTSJSONObject, } as UTSJSONObject,
'spacingLg': { "spacingLg": {
'css': '--l-spacing-lg', "css": "--l-spacing-lg",
'values': { '1024': 24, '1174': 24, '1920': 45 } as UTSJSONObject "values": { "1024": 24, "1174": 24, "1920": 45 } as UTSJSONObject
} as UTSJSONObject, } as UTSJSONObject,
'spacingXl': { "spacingXl": {
'css': '--l-spacing-xl', "css": "--l-spacing-xl",
'values': { '1024': 32, '1174': 32, '1920': 60 } as UTSJSONObject "values": { "1024": 32, "1174": 32, "1920": 60 } as UTSJSONObject
} as UTSJSONObject, } as UTSJSONObject,
'spacing2xl': { "spacing2xl": {
'css': '--l-spacing-2xl', "css": "--l-spacing-2xl",
'values': { '1024': 40, '1174': 40, '1920': 75 } as UTSJSONObject "values": { "1024": 40, "1174": 40, "1920": 75 } as UTSJSONObject
} as UTSJSONObject, } as UTSJSONObject,
'fontXs': { "fontXs": {
'css': '--l-font-xs', "css": "--l-font-xs",
'values': { '1024': 12, '1174': 12, '1920': 23 } as UTSJSONObject "values": { "1024": 12, "1174": 12, "1920": 23 } as UTSJSONObject
} as UTSJSONObject, } as UTSJSONObject,
'fontSm': { "fontSm": {
'css': '--l-font-sm', "css": "--l-font-sm",
'values': { '1024': 14, '1174': 14, '1920': 26 } as UTSJSONObject "values": { "1024": 14, "1174": 14, "1920": 26 } as UTSJSONObject
} as UTSJSONObject, } as UTSJSONObject,
'fontBase': { "fontBase": {
'css': '--l-font-base', "css": "--l-font-base",
'values': { '1024': 16, '1174': 16, '1920': 30 } as UTSJSONObject "values": { "1024": 16, "1174": 16, "1920": 30 } as UTSJSONObject
} as UTSJSONObject, } as UTSJSONObject,
'fontLg': { "fontLg": {
'css': '--l-font-lg', "css": "--l-font-lg",
'values': { '1024': 18, '1174': 18, '1920': 34 } as UTSJSONObject "values": { "1024": 18, "1174": 18, "1920": 34 } as UTSJSONObject
} as UTSJSONObject, } as UTSJSONObject,
'fontXl': { "fontXl": {
'css': '--l-font-xl', "css": "--l-font-xl",
'values': { '1024': 20, '1174': 20, '1920': 38 } as UTSJSONObject "values": { "1024": 20, "1174": 20, "1920": 38 } as UTSJSONObject
} as UTSJSONObject, } as UTSJSONObject,
'font2xl': { "font2xl": {
'css': '--l-font-2xl', "css": "--l-font-2xl",
'values': { '1024': 24, '1174': 24, '1920': 45 } as UTSJSONObject "values": { "1024": 24, "1174": 24, "1920": 45 } as UTSJSONObject
} as UTSJSONObject, } as UTSJSONObject,
'radiusSm': { "radiusSm": {
'css': '--l-radius-sm', "css": "--l-radius-sm",
'values': { '1024': 4, '1174': 4, '1920': 8 } as UTSJSONObject "values": { "1024": 4, "1174": 4, "1920": 8 } as UTSJSONObject
} as UTSJSONObject, } as UTSJSONObject,
'radiusMd': { "radiusMd": {
'css': '--l-radius-md', "css": "--l-radius-md",
'values': { '1024': 8, '1174': 8, '1920': 15 } as UTSJSONObject "values": { "1024": 8, "1174": 8, "1920": 15 } as UTSJSONObject
} as UTSJSONObject, } as UTSJSONObject,
'radiusLg': { "radiusLg": {
'css': '--l-radius-lg', "css": "--l-radius-lg",
'values': { '1024': 12, '1174': 12, '1920': 23 } as UTSJSONObject "values": { "1024": 12, "1174": 12, "1920": 23 } as UTSJSONObject
} as UTSJSONObject, } as UTSJSONObject,
'radiusXl': { "radiusXl": {
'css': '--l-radius-xl', "css": "--l-radius-xl",
'values': { '1024': 16, '1174': 16, '1920': 30 } as UTSJSONObject "values": { "1024": 16, "1174": 16, "1920": 30 } as UTSJSONObject
} as UTSJSONObject, } as UTSJSONObject,
'sidebarWidth': { "sidebarWidth": {
'css': '--l-sidebar-width', "css": "--l-sidebar-width",
'values': { '1024': 120, '1174': 120, '1920': 225 } as UTSJSONObject "values": { "1024": 120, "1174": 120, "1920": 225 } as UTSJSONObject
} as UTSJSONObject, } as UTSJSONObject,
'contentLeftWidth': { "contentLeftWidth": {
'css': '--l-content-left-width', "css": "--l-content-left-width",
'values': { '1024': 605, '1174': 605, '1920': 1134 } as UTSJSONObject "values": { "1024": 605, "1174": 605, "1920": 1134 } as UTSJSONObject
} as UTSJSONObject, } as UTSJSONObject,
'moduleBoxHeight': { "moduleBoxHeight": {
'css': '--l-module-box-height', "css": "--l-module-box-height",
'values': { '1024': 332, '1174': 332, '1920': 623 } as UTSJSONObject "values": { "1024": 332, "1174": 332, "1920": 623 } as UTSJSONObject
} as UTSJSONObject, } as UTSJSONObject,
'toolBoxMinHeight': { "toolBoxMinHeight": {
'css': '--l-tool-box-min-height', "css": "--l-tool-box-min-height",
'values': { '1024': 120, '1174': 120, '1920': 225 } as UTSJSONObject "values": { "1024": 120, "1174": 120, "1920": 225 } as UTSJSONObject
} as UTSJSONObject, } as UTSJSONObject,
'commonTitleHeight': { "commonTitleHeight": {
'css': '--l-common-title-height', "css": "--l-common-title-height",
'values': { '1024': 60, '1174': 60, '1920': 113 } as UTSJSONObject "values": { "1024": 60, "1174": 60, "1920": 113 } as UTSJSONObject
} as UTSJSONObject, } as UTSJSONObject,
'storeFooterHeight': { "storeFooterHeight": {
'css': '--l-store-footer-height', "css": "--l-store-footer-height",
'values': { '1024': 60, '1174': 60, '1920': 113 } as UTSJSONObject "values": { "1024": 60, "1174": 60, "1920": 113 } as UTSJSONObject
} as UTSJSONObject } as UTSJSONObject
} };
...@@ -343,8 +343,11 @@ async function getBoutiquePackageList(): Promise<void> { ...@@ -343,8 +343,11 @@ async function getBoutiquePackageList(): Promise<void> {
for (const element of arr) { for (const element of arr) {
const e = element as UTSJSONObject; const e = element as UTSJSONObject;
if (e != null) { if (e != null) {
e.scriptIntroduction = ((e.scriptIntroduction ?? "") as string).replaceAll(/<\/?br\s*\/?>|\\n|\n/g, "<br>"); // UTS replaceAll 仅支持字符串参数,正则需用 replace(reg, 'g')
e.content = ((e.content ?? "") as string).replaceAll(/<\/?br\s*\/?>|\\n|\n/g, "<br>"); // eslint-disable-next-line unicorn/prefer-string-replace-all
e.scriptIntroduction = ((e.scriptIntroduction ?? "") as string).replace(/<\/?br\s*\/?>|\\n|\n/g, "<br>");
// eslint-disable-next-line unicorn/prefer-string-replace-all
e.content = ((e.content ?? "") as string).replace(/<\/?br\s*\/?>|\\n|\n/g, "<br>");
if (e.marketPrice != null) e.marketPrice = Number.parseFloat((e.marketPrice as any).toString()).toString(); if (e.marketPrice != null) e.marketPrice = Number.parseFloat((e.marketPrice as any).toString()).toString();
if (e.packagePrice != null) e.packagePrice = Number.parseFloat((e.packagePrice as any).toString()).toString(); if (e.packagePrice != null) e.packagePrice = Number.parseFloat((e.packagePrice as any).toString()).toString();
list.push(e); list.push(e);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!