From 8686b47587625909e8a243266421e407fa0e2078 Mon Sep 17 00:00:00 2001 From: Kuizuo Date: Fri, 8 Sep 2023 17:20:34 +0800 Subject: [PATCH] pref: enhance sign type tips --- app.vue | 6 +++++- components/AccountItem.vue | 9 +++++---- components/CodeOrGestureSignModal.client.vue | 17 ++++++++++++++--- components/Operation.vue | 17 +++++++---------- components/QrCodeSignModal.client.vue | 14 ++++++++------ nuxt.config.ts | 2 -- types/account.d.ts | 4 +--- 7 files changed, 40 insertions(+), 29 deletions(-) diff --git a/app.vue b/app.vue index 0e42465..53caa87 100644 --- a/app.vue +++ b/app.vue @@ -5,6 +5,10 @@ import { darkTheme, dateZhCN, lightTheme, zhCN } from 'naive-ui' const colorMode = useColorMode() const { title, keywords, description } = useAppConfig() +const theme = computed(() => { + return colorMode.value === 'system' ? (colorMode.value ? lightTheme : darkTheme) : colorMode.value === 'light' ? lightTheme : darkTheme +}) + const themeColor = ref('#e70012') const themeOverrides = computed(() => { @@ -50,7 +54,7 @@ useHead({ diff --git a/components/QrCodeSignModal.client.vue b/components/QrCodeSignModal.client.vue index 3191f73..1cacd25 100644 --- a/components/QrCodeSignModal.client.vue +++ b/components/QrCodeSignModal.client.vue @@ -23,11 +23,13 @@ export interface BoundingBox { left: number } -interface Emit { - (e: 'success', text: string): void -} +const props = defineProps<{ + title?: string +}>() -const emit = defineEmits() +const emit = defineEmits<{ + (e: 'success', text: string): void +}>() const ms = useMessage() const text = ref('') @@ -92,7 +94,7 @@ async function onDetect(detectedCodes: DetectedBarcode[]) { if (firstCode) { const rawValue = firstCode.rawValue - ms.success('二维码识别成功,正在签到...') + ms.success('二维码识别成功,准备签到...') text.value = rawValue showScan.value = false @@ -131,7 +133,7 @@ watch(text, () => { :mask-closable="false" preset="card" size="large" - title="上传二维码图片" + :title="title ?? '二维码签到'" :bordered="false" :closable="true" :style="{ 'max-width': '360px' }" diff --git a/nuxt.config.ts b/nuxt.config.ts index 6d83825..c931939 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -66,8 +66,6 @@ export default defineNuxtConfig({ ], colorMode: { classSuffix: '', - preference: 'light', - fallback: 'light', }, unocss: { uno: true, diff --git a/types/account.d.ts b/types/account.d.ts index fa288f2..3fd9b8c 100644 --- a/types/account.d.ts +++ b/types/account.d.ts @@ -20,9 +20,7 @@ export interface Course extends CX.Course { isLoadActivity?: boolean } -export interface Activity extends CX.ActivityDetail { - result?: string -} +export interface Activity extends CX.ActivityItem & CX.Course {} export interface History { id: stringÏ