🎨chore: 使用 oxlint, oxfmt&格式化代码
This commit is contained in:
@@ -18,7 +18,7 @@ const emit = defineEmits<Emits>()
|
||||
|
||||
const isOpen = computed({
|
||||
get: () => props.modelValue,
|
||||
set: (value) => emit('update:modelValue', value)
|
||||
set: (value) => emit('update:modelValue', value),
|
||||
})
|
||||
|
||||
// 表单状态
|
||||
@@ -36,7 +36,7 @@ const isSubmitting = ref(false)
|
||||
const uploadProgress = reactive({
|
||||
step: 0,
|
||||
total: 3,
|
||||
message: ''
|
||||
message: '',
|
||||
})
|
||||
|
||||
// 表单验证
|
||||
@@ -189,7 +189,7 @@ const onSubmit = async (event: FormSubmitEvent<typeof formState>) => {
|
||||
color: 'green',
|
||||
icon: 'i-tabler-check',
|
||||
})
|
||||
|
||||
|
||||
// 重置表单
|
||||
formState.dh_name = ''
|
||||
formState.organization = ''
|
||||
@@ -197,7 +197,7 @@ const onSubmit = async (event: FormSubmitEvent<typeof formState>) => {
|
||||
authVideoFile.value = null
|
||||
uploadProgress.step = 0
|
||||
uploadProgress.message = ''
|
||||
|
||||
|
||||
// 关闭弹窗
|
||||
isOpen.value = false
|
||||
} else {
|
||||
@@ -205,7 +205,8 @@ const onSubmit = async (event: FormSubmitEvent<typeof formState>) => {
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('数字人定制失败:', error)
|
||||
const errorMessage = error instanceof Error ? error.message : '数字人定制失败,请重试'
|
||||
const errorMessage =
|
||||
error instanceof Error ? error.message : '数字人定制失败,请重试'
|
||||
toast.add({
|
||||
title: '提交失败',
|
||||
description: errorMessage,
|
||||
@@ -241,7 +242,10 @@ const showAuthModal = ref(false)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UModal v-model="isOpen" :ui="{ width: 'sm:max-w-6xl' }">
|
||||
<UModal
|
||||
v-model="isOpen"
|
||||
:ui="{ width: 'sm:max-w-6xl' }"
|
||||
>
|
||||
<UCard
|
||||
:ui="{
|
||||
ring: '',
|
||||
@@ -273,7 +277,10 @@ const showAuthModal = ref(false)
|
||||
@submit="onSubmit"
|
||||
>
|
||||
<!-- 数字人视频素材 -->
|
||||
<UFormGroup label="数字人视频素材" required>
|
||||
<UFormGroup
|
||||
label="数字人视频素材"
|
||||
required
|
||||
>
|
||||
<UniFileDnD
|
||||
accept="video/mp4,video/mov"
|
||||
class="h-36"
|
||||
@@ -291,7 +298,8 @@ const showAuthModal = ref(false)
|
||||
</span>
|
||||
</div>
|
||||
<p class="text-xs text-gray-500 mt-1">
|
||||
小于 1GB 的 mov/mp4 格式,比例 9:16,帧率 25FPS,分辨率 1080P,时长 3-6 分钟
|
||||
小于 1GB 的 mov/mp4 格式,比例 9:16,帧率 25FPS,分辨率
|
||||
1080P,时长 3-6 分钟
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
@@ -299,7 +307,11 @@ const showAuthModal = ref(false)
|
||||
</UFormGroup>
|
||||
|
||||
<!-- 数字人名称 -->
|
||||
<UFormGroup label="数字人名称" name="dh_name" required>
|
||||
<UFormGroup
|
||||
label="数字人名称"
|
||||
name="dh_name"
|
||||
required
|
||||
>
|
||||
<UInput
|
||||
v-model="formState.dh_name"
|
||||
placeholder="请输入数字人名称"
|
||||
@@ -307,7 +319,11 @@ const showAuthModal = ref(false)
|
||||
</UFormGroup>
|
||||
|
||||
<!-- 单位名称 -->
|
||||
<UFormGroup label="单位名称" name="organization" required>
|
||||
<UFormGroup
|
||||
label="单位名称"
|
||||
name="organization"
|
||||
required
|
||||
>
|
||||
<UInput
|
||||
v-model="formState.organization"
|
||||
placeholder="请输入单位名称"
|
||||
@@ -315,7 +331,10 @@ const showAuthModal = ref(false)
|
||||
</UFormGroup>
|
||||
|
||||
<!-- 形象授权视频 -->
|
||||
<UFormGroup label="形象授权视频" required>
|
||||
<UFormGroup
|
||||
label="形象授权视频"
|
||||
required
|
||||
>
|
||||
<template #description>
|
||||
<div class="flex items-center justify-between">
|
||||
<span class="text-xs text-gray-500">
|
||||
@@ -344,7 +363,11 @@ const showAuthModal = ref(false)
|
||||
/>
|
||||
<div class="mt-2">
|
||||
<span class="text-sm text-gray-600 dark:text-gray-400">
|
||||
{{ authVideoFile ? authVideoFile.name : '点击或拖拽上传授权视频' }}
|
||||
{{
|
||||
authVideoFile
|
||||
? authVideoFile.name
|
||||
: '点击或拖拽上传授权视频'
|
||||
}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -364,10 +387,15 @@ const showAuthModal = ref(false)
|
||||
</UButton>
|
||||
|
||||
<!-- 上传进度 -->
|
||||
<div v-if="isSubmitting" class="mt-4 space-y-2">
|
||||
<div
|
||||
v-if="isSubmitting"
|
||||
class="mt-4 space-y-2"
|
||||
>
|
||||
<div class="flex justify-between text-sm">
|
||||
<span>{{ uploadProgress.message }}</span>
|
||||
<span>{{ uploadProgress.step }}/{{ uploadProgress.total }}</span>
|
||||
<span>
|
||||
{{ uploadProgress.step }}/{{ uploadProgress.total }}
|
||||
</span>
|
||||
</div>
|
||||
<UProgress
|
||||
:value="(uploadProgress.step / uploadProgress.total) * 100"
|
||||
@@ -382,54 +410,105 @@ const showAuthModal = ref(false)
|
||||
<div class="flex flex-col h-full gap-6">
|
||||
<!-- 教程视频 -->
|
||||
<div class="flex-1">
|
||||
<h3 class="text-lg font-semibold mb-3 text-gray-800 dark:text-white flex items-center gap-2">
|
||||
<UIcon name="i-heroicons-video-camera" class="h-5 w-5" />
|
||||
<h3
|
||||
class="text-lg font-semibold mb-3 text-gray-800 dark:text-white flex items-center gap-2"
|
||||
>
|
||||
<UIcon
|
||||
name="i-heroicons-video-camera"
|
||||
class="h-5 w-5"
|
||||
/>
|
||||
视频录制教程
|
||||
</h3>
|
||||
<div class="w-full aspect-video border rounded-lg bg-gray-100 dark:bg-gray-800 flex items-center justify-center">
|
||||
<UIcon name="i-heroicons-video-camera" class="h-12 w-12 text-gray-400" />
|
||||
<div
|
||||
class="w-full aspect-video border rounded-lg bg-gray-100 dark:bg-gray-800 flex items-center justify-center"
|
||||
>
|
||||
<UIcon
|
||||
name="i-heroicons-video-camera"
|
||||
class="h-12 w-12 text-gray-400"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 联系方式 -->
|
||||
<div class="bg-blue-50 dark:bg-blue-900/20 rounded-lg p-4 border border-blue-200 dark:border-blue-700">
|
||||
<div
|
||||
class="bg-blue-50 dark:bg-blue-900/20 rounded-lg p-4 border border-blue-200 dark:border-blue-700"
|
||||
>
|
||||
<div class="flex items-center gap-3">
|
||||
<div class="bg-blue-100 dark:bg-blue-900 p-2 rounded-lg">
|
||||
<UIcon name="i-heroicons-chat-bubble-left-right" class="h-5 w-5 text-blue-600 dark:text-blue-400" />
|
||||
<UIcon
|
||||
name="i-heroicons-chat-bubble-left-right"
|
||||
class="h-5 w-5 text-blue-600 dark:text-blue-400"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<p class="text-sm font-medium text-gray-800 dark:text-white">需要帮助?</p>
|
||||
<p class="text-sm font-medium text-gray-800 dark:text-white">
|
||||
需要帮助?
|
||||
</p>
|
||||
<p class="text-sm text-gray-600 dark:text-gray-300">
|
||||
客服微信:<span class="font-mono text-blue-600 dark:text-blue-400">xxxxxx</span>
|
||||
客服微信:
|
||||
<span class="font-mono text-blue-600 dark:text-blue-400">
|
||||
xxxxxx
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 录制指南 -->
|
||||
<div class="bg-amber-50 dark:bg-amber-900/20 rounded-lg p-4 border border-amber-200 dark:border-amber-700">
|
||||
<div
|
||||
class="bg-amber-50 dark:bg-amber-900/20 rounded-lg p-4 border border-amber-200 dark:border-amber-700"
|
||||
>
|
||||
<div class="flex items-start gap-3">
|
||||
<div class="bg-amber-100 dark:bg-amber-900 p-2 rounded-lg mt-0.5">
|
||||
<UIcon name="i-heroicons-light-bulb" class="h-5 w-5 text-amber-600 dark:text-amber-400" />
|
||||
<div
|
||||
class="bg-amber-100 dark:bg-amber-900 p-2 rounded-lg mt-0.5"
|
||||
>
|
||||
<UIcon
|
||||
name="i-heroicons-light-bulb"
|
||||
class="h-5 w-5 text-amber-600 dark:text-amber-400"
|
||||
/>
|
||||
</div>
|
||||
<div class="flex-1">
|
||||
<h4 class="text-sm font-semibold text-gray-800 dark:text-white mb-3">录制注意事项</h4>
|
||||
<h4
|
||||
class="text-sm font-semibold text-gray-800 dark:text-white mb-3"
|
||||
>
|
||||
录制注意事项
|
||||
</h4>
|
||||
<div class="space-y-2">
|
||||
<div class="flex items-center gap-2">
|
||||
<UIcon name="i-heroicons-sun" class="h-4 w-4 text-amber-500 mt-0.5 flex-shrink-0" />
|
||||
<span class="text-xs text-gray-600 dark:text-gray-300">确保光线充足,避免背光</span>
|
||||
<UIcon
|
||||
name="i-heroicons-sun"
|
||||
class="h-4 w-4 text-amber-500 mt-0.5 flex-shrink-0"
|
||||
/>
|
||||
<span class="text-xs text-gray-600 dark:text-gray-300">
|
||||
确保光线充足,避免背光
|
||||
</span>
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
<UIcon name="i-heroicons-speaker-wave" class="h-4 w-4 text-green-500 mt-0.5 flex-shrink-0" />
|
||||
<span class="text-xs text-gray-600 dark:text-gray-300">选择安静环境,减少噪音干扰</span>
|
||||
<UIcon
|
||||
name="i-heroicons-speaker-wave"
|
||||
class="h-4 w-4 text-green-500 mt-0.5 flex-shrink-0"
|
||||
/>
|
||||
<span class="text-xs text-gray-600 dark:text-gray-300">
|
||||
选择安静环境,减少噪音干扰
|
||||
</span>
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
<UIcon name="i-heroicons-viewfinder-circle" class="h-4 w-4 text-blue-500 mt-0.5 flex-shrink-0" />
|
||||
<span class="text-xs text-gray-600 dark:text-gray-300">人脸占画面比例控制在 1/4 以内</span>
|
||||
<UIcon
|
||||
name="i-heroicons-viewfinder-circle"
|
||||
class="h-4 w-4 text-blue-500 mt-0.5 flex-shrink-0"
|
||||
/>
|
||||
<span class="text-xs text-gray-600 dark:text-gray-300">
|
||||
人脸占画面比例控制在 1/4 以内
|
||||
</span>
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
<UIcon name="i-heroicons-face-smile" class="h-4 w-4 text-purple-500 mt-0.5 flex-shrink-0" />
|
||||
<span class="text-xs text-gray-600 dark:text-gray-300">保持自然表情,使用恰当手势</span>
|
||||
<UIcon
|
||||
name="i-heroicons-face-smile"
|
||||
class="h-4 w-4 text-purple-500 mt-0.5 flex-shrink-0"
|
||||
/>
|
||||
<span class="text-xs text-gray-600 dark:text-gray-300">
|
||||
保持自然表情,使用恰当手势
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -473,4 +552,4 @@ const showAuthModal = ref(false)
|
||||
</UModal>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
<style scoped></style>
|
||||
|
||||
Reference in New Issue
Block a user