diff --git a/src/assets/demo/zuowen.jpg b/src/assets/demo/zuowen.jpg new file mode 100644 index 0000000..adb466e Binary files /dev/null and b/src/assets/demo/zuowen.jpg differ diff --git a/src/views/EssayCorrection.vue b/src/views/EssayCorrection.vue index 3715e0c..7915b3e 100644 --- a/src/views/EssayCorrection.vue +++ b/src/views/EssayCorrection.vue @@ -9,6 +9,7 @@ import { IMAGE_MAX_SIZE_MB, IMAGE_ALLOWED_TYPES_ESSAY, } from "@/config/index.js"; +import demoZuowen from "@/assets/demo/zuowen.jpg"; const API_KEY = GRS_API_KEY; const API_URL = ESSAY_API_URL; @@ -75,6 +76,13 @@ const resetUpload = () => { if (fileInputRef.value) fileInputRef.value.value = ""; }; +const loadDemoImage = async () => { + const response = await fetch(demoZuowen); + const blob = await response.blob(); + const file = new File([blob], "zuowen.jpg", { type: "image/jpeg" }); + await handleFile(file); +}; + const startCorrection = async () => { if (!originalBase64.value || status.value === "processing") return; status.value = "processing"; @@ -217,6 +225,7 @@ const closeLightbox = () => {
点击或拖拽上传作文图片
支持 JPG、PNG 格式,最大 10MB
+ @@ -433,6 +442,21 @@ const closeLightbox = () => { color: var(--text-secondary); margin: 0; } +.demo-btn { + margin-top: 0.75rem; + background: rgba(236, 72, 153, 0.1); + border: 1px solid rgba(236, 72, 153, 0.3); + color: #ec4899; + padding: 0.5rem 1.25rem; + border-radius: 20px; + font-size: 0.875rem; + cursor: pointer; + transition: all 0.2s; +} +.demo-btn:hover { + background: rgba(236, 72, 153, 0.2); + transform: translateY(-1px); +} /* Preview */ .preview-section {