This commit is contained in:
gyq
2024-07-12 16:36:28 +08:00
parent bb554a28d2
commit 8c1e1d3fbc
12 changed files with 304 additions and 342 deletions

View File

@@ -80,7 +80,8 @@
<takeFoodCode
ref="takeFoodCodeRef"
title="支付密码"
type="password"
:type="2"
input-type="password"
placeholder="请输入支付密码"
@success="passwordSuccess"
/>
@@ -141,7 +142,7 @@ function payTypeChange(index, item) {
if (money.value > 0) {
scanModalRef.value.show();
} else {
ElMessage.error("请输入大于0的金额");
ElMessage.error("请输入金额");
return;
}
}
@@ -173,13 +174,13 @@ async function confirmOrder() {
try {
if (payList.value[payActive.value].payType == "scanCode") {
if (money.value <= 0) {
ElMessage.error("请输入大于0的金额");
ElMessage.error("请输入金额");
return;
}
scanModalRef.value.show();
} else {
if (money.value <= 0) {
ElMessage.error("请输入大于0的金额");
ElMessage.error("请输入金额");
return;
}
switch (payList.value[payActive.value].payType) {

View File

@@ -1,7 +1,7 @@
<!-- 取餐号组件 -->
<template>
<el-dialog :title="props.title" width="600" v-model="dialogVisible" @open="opne">
<el-input :type="props.type" v-model="number" :placeholder="props.placeholder" readonly></el-input>
<el-input :type="props.inputType" v-model="number" :placeholder="props.placeholder" readonly></el-input>
<div class="keybord_wrap">
<div v-for="item in 9" :key="item">
<el-button plain type="info" style="width: 100%" @click="inputHandle(item)">{{ item }}</el-button>
@@ -24,11 +24,16 @@
<script setup>
import { ref } from "vue";
import { ElMessage } from "element-plus";
const props = defineProps({
type: {
type: [String, Number],
default: 1, // 1取餐号 2密码
},
inputType: {
type: String,
default: "text",
default: 'text'
},
title: {
type: String,
@@ -66,8 +71,19 @@ function delHandle() {
// 确认
function confirmHandle() {
emit("success", number.value);
dialogVisible.value = false;
if (!number.value) return
if (props.type == 2) {
if (number.value.length < 6) {
ElMessage.error('请输入正确的密码')
return
} else {
emit("success", number.value);
dialogVisible.value = false;
}
} else {
emit("success", number.value);
dialogVisible.value = false;
}
}
defineExpose({