feat:符号选择
This commit is contained in:
@@ -1,6 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="y-f" style="height: 55vh">
|
<view class="y-f" style="height: 55vh">
|
||||||
<view class="weight">
|
<view class="weight">
|
||||||
|
<view class="symbol">
|
||||||
|
<uni-data-select
|
||||||
|
v-if="showSymbol"
|
||||||
|
v-model="symbol"
|
||||||
|
:localdata="range"
|
||||||
|
placeholder="请选择符号"
|
||||||
|
:clear="false"
|
||||||
|
></uni-data-select>
|
||||||
|
</view>
|
||||||
<view class="weight-data">{{ nums }}</view>
|
<view class="weight-data">{{ nums }}</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -35,6 +44,10 @@ const props = defineProps({
|
|||||||
numKeyboardParam: {
|
numKeyboardParam: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => null
|
default: () => null
|
||||||
|
},
|
||||||
|
showSymbol: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -43,6 +56,13 @@ const props = defineProps({
|
|||||||
|
|
||||||
// Data
|
// Data
|
||||||
const nums = ref('')
|
const nums = ref('')
|
||||||
|
|
||||||
|
const symbol = ref('')
|
||||||
|
|
||||||
|
const range = ref([
|
||||||
|
{ value: '=', text: '=' },
|
||||||
|
{ value: '<', text: '<' }
|
||||||
|
])
|
||||||
const numbers = ref([
|
const numbers = ref([
|
||||||
{ text: '1' },
|
{ text: '1' },
|
||||||
{ text: '2' },
|
{ text: '2' },
|
||||||
@@ -60,8 +80,9 @@ const numbers = ref([
|
|||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
const ok = () => {
|
const ok = () => {
|
||||||
const val = { val: nums.value }
|
const val = { val: nums.value, symbol: symbol.value }
|
||||||
nums.value = ''
|
nums.value = ''
|
||||||
|
symbol.value = ''
|
||||||
if (val.val) {
|
if (val.val) {
|
||||||
uni.$emit('keyboardOK', val)
|
uni.$emit('keyboardOK', val)
|
||||||
}
|
}
|
||||||
@@ -69,10 +90,12 @@ const ok = () => {
|
|||||||
|
|
||||||
const setNull = () => {
|
const setNull = () => {
|
||||||
nums.value = ''
|
nums.value = ''
|
||||||
|
symbol.value = ''
|
||||||
uni.$emit('keyboardOK', null)
|
uni.$emit('keyboardOK', null)
|
||||||
}
|
}
|
||||||
const clearNum = () => {
|
const clearNum = () => {
|
||||||
nums.value = ''
|
nums.value = ''
|
||||||
|
symbol.value = ''
|
||||||
}
|
}
|
||||||
const jianshao = () => {
|
const jianshao = () => {
|
||||||
if (nums.value) {
|
if (nums.value) {
|
||||||
@@ -171,9 +194,15 @@ defineExpose({ clearNum })
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
.symbol {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.weight-data {
|
.weight-data {
|
||||||
|
flex: 5;
|
||||||
color: #4cd964;
|
color: #4cd964;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
letter-spacing: 5px;
|
letter-spacing: 5px;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user