From 9739f49cab0b3feb46680c5fbe6dff07967d529e Mon Sep 17 00:00:00 2001 From: Fox-33 <1466778434@qq.com> Date: Thu, 27 Mar 2025 23:46:11 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=B4=E5=AE=A0=E5=B8=88=E8=AE=A4?= =?UTF-8?q?=E8=AF=81=E6=B5=81=E7=A8=8B(=E6=9A=82=E5=AD=98);?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/dForm/index.vue | 43 +++-- otherPages/authentication/examination/base.vue | 182 +++++++++++++++------ otherPages/authentication/examination/start.vue | 38 ++++- otherPages/authentication/list/index.vue | 174 ++++++++++++++++++-- .../authentication/static/list/cat-active.png | Bin .../authentication/static/list/cat.png | Bin .../authentication/static/list/dog-active.png | Bin .../authentication/static/list/dog.png | Bin .../authentication/static/list/icon-upload.png | Bin 0 -> 6869 bytes .../static/list/special-pet-active.png | Bin .../authentication/static/list/special-pet.png | Bin pages.json | 17 +- project.config.json | 2 +- static/images/ydd/img3.png | Bin 6350 -> 0 bytes utils/pageList.js | 55 +++++++ 15 files changed, 423 insertions(+), 88 deletions(-) rename static/images/ydd/img1.png => otherPages/authentication/static/list/cat-active.png (100%) rename static/images/ydd/img5.png => otherPages/authentication/static/list/cat.png (100%) rename static/images/ydd/img7.png => otherPages/authentication/static/list/dog-active.png (100%) rename static/images/ydd/img2.png => otherPages/authentication/static/list/dog.png (100%) create mode 100644 otherPages/authentication/static/list/icon-upload.png rename static/images/ydd/img6.png => otherPages/authentication/static/list/special-pet-active.png (100%) rename static/images/ydd/img4.png => otherPages/authentication/static/list/special-pet.png (100%) delete mode 100644 static/images/ydd/img3.png create mode 100644 utils/pageList.js diff --git a/components/dForm/index.vue b/components/dForm/index.vue index 8db56cf..5e36cea 100644 --- a/components/dForm/index.vue +++ b/components/dForm/index.vue @@ -10,34 +10,36 @@ class="ml10">{{item.unit?item.unit:""}} - - + - + + v-for="option in item.options" :key="option.value" :label="option.name" :name="option.value"> - + - + - + + + 提交 @@ -50,7 +52,8 @@ import { reactive, ref, - computed + computed, + watch, } from "vue" const { list, @@ -66,12 +69,18 @@ }, isFooter: true }) - const emit = defineEmits(['submit']) + const emit = defineEmits(['submit', 'input']) const formData = reactive({ name: "" }) + + watch(formData, (val) => { + emit('input', val) + }) + const sheet = reactive({ show: false, + key: null, actions: [], title: "", description: "" @@ -89,6 +98,7 @@ // 开启弹框 const open = (item) => { sheet.show = true + sheet.key = item.key sheet.actions = item.options sheet.title = item.placeholder sheet.description = item.description || "" @@ -100,8 +110,13 @@ // 选择 const handleSelect = (val) => { - console.log(val) + formData[sheet.key] = val?.value } + + const getDesc = (val, options) => { + return options.find(item => item.value === val)?.name + } + // 上传 const afterRead = () => {} // 删除上传文件 @@ -115,11 +130,17 @@ } }) } + + const validate = () => { + return dFormRef.value.validate() + } + + defineExpose({ validate }) \ No newline at end of file diff --git a/otherPages/authentication/examination/start.vue b/otherPages/authentication/examination/start.vue index 237dc59..4fc9131 100644 --- a/otherPages/authentication/examination/start.vue +++ b/otherPages/authentication/examination/start.vue @@ -6,7 +6,9 @@ 您选择的宠物类型 - + + + @@ -30,8 +32,9 @@ - - 剩余考试次数:3次 + + + 剩余考试机会:{{ restTimes }}次 开始考试 @@ -41,6 +44,18 @@