<script setup lang="ts">
|
import { reactive, ref } from "vue";
|
import { useRouter } from "vue-router";
|
|
const router = useRouter();
|
|
const goBack = () => {
|
router.back(); // 或者使用 router.go(-1);
|
};
|
|
const checked = ref("1");
|
const menuList = reactive([
|
{
|
name: "体积设置",
|
value: 0.52,
|
unit: "L"
|
},
|
{
|
name: "起始频率",
|
value: 10500,
|
unit: "MHz"
|
},
|
{
|
name: "皮重",
|
value: 1028,
|
unit: "g"
|
},
|
{
|
name: "终止频率",
|
value: 12000,
|
unit: "MHz"
|
},
|
{
|
name: "频率码",
|
value: 0,
|
unit: ""
|
},
|
{
|
name: "步长",
|
value: 12000,
|
unit: "MHz"
|
},
|
{
|
name: "衰减码",
|
value: 0,
|
unit: "1"
|
}
|
]);
|
</script>
|
|
<template>
|
<div class="app">
|
<div class="title-box">
|
<van-nav-bar
|
title="参数配置"
|
left-text="返回"
|
left-arrow
|
@click-left="goBack"
|
/>
|
</div>
|
<div class="w-full flex justify-center">
|
<div class="content-box">
|
<div v-for="(item, index) in menuList" :key="index" class="item">
|
<span class="w-[90px]">{{ item.name }}</span>
|
<span class="ml-1">
|
<van-stepper
|
:min="0"
|
:v-model="item.value"
|
step="0.2"
|
:decimal-length="2"
|
input-width="40px"
|
button-size="32px"
|
/>
|
</span>
|
<span class="ml-1 font-thin text-sm">{{ item.unit }}</span>
|
</div>
|
<div class="item">
|
<span class="w-[90px]">ASK选择</span>
|
<van-radio-group v-model="checked" direction="horizontal">
|
<van-radio name="1">外部</van-radio>
|
<van-radio name="2">内部</van-radio>
|
</van-radio-group>
|
</div>
|
</div>
|
</div>
|
|
<div class="w-full flex justify-center pt-12">
|
<van-button icon="bar-chart-o" type="primary" class="w-[140px]" color="var(--base-green)"
|
>参数生效</van-button
|
>
|
</div>
|
</div>
|
</template>
|
|
<style scoped lang="less">
|
.app {
|
width: 100vw;
|
display: flex;
|
justify-content: center;
|
flex-direction: column;
|
|
.title-box {
|
height: 60px;
|
align-items: center;
|
background: white;
|
margin: 10px 10px 0 10px;
|
border-radius: 10px;
|
overflow: hidden;
|
}
|
|
.content-box {
|
width: 100%;
|
display: flex;
|
flex-wrap: wrap;
|
justify-content: space-between;
|
row-gap: 10px;
|
padding: 10px;
|
box-sizing: border-box;
|
.item {
|
width: calc(50% - 5px);
|
height: 60px;
|
display: flex;
|
align-items: center;
|
font-size: 20px;
|
background: white;
|
border-radius: 10px;
|
padding-left: 10px;
|
}
|
}
|
}
|
|
.bg-green {
|
background: var(--base-green);
|
}
|
|
:deep(.van-stepper__minus) {
|
background: var(--base-green);
|
color: white;
|
}
|
:deep(.van-stepper__input) {
|
background:var(--base-green);
|
color: white;
|
width: 60px !important;
|
font-size: 18px;
|
}
|
:deep(.van-stepper__plus) {
|
background:var(--base-green);
|
color: white;
|
}
|
|
:deep(.van-nav-bar__text) {
|
font-size: 20px;
|
}
|
|
</style>
|