键盘折叠

This commit is contained in:
weiwei committed 2025-04-14 14:32:16 +08:00
1 parent 9dde19289d
commit 0be23710ad
5 files changed
+17 -19

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
<template>
<crud-layout bg="/static/page/blue-bg.png">
<view class="h-screen flex flex-col position-relative">
<view class="h-screen flex flex-col">
<view class="mx-auto text-34 py-2 h-80rpx">{{ scanData.name }}</view>
<tm-sheet class="flex flex-row">
+1 -10
View File
@@ -70,6 +70,7 @@ const state = reactive<{
wallet: [],
userInfo: {},
menuList: [
{ text: "扫一扫", icon: "/static/icon/scan.png", router: "" },
{ text: "钱包管理", icon: "/static/icon/service_3.png", router: "/pages/wallet/list" },
// { text: "包厢预定", icon: "/static/icon/service_4.png", router: "/pages/boxes/apply-list" },
// { text: "外来人员就餐", icon: "/static/icon/service_1.png", router: "/pages/apply/foreign-list" },
@@ -360,16 +361,6 @@ const initMenuConfig = () => {
router: "/pages/user/userRole",
})
}
// 根据启动参数添加扫一扫菜单项
const launchParam = new URL(window.location.href).searchParams.get("launchParam")
if (launchParam === "selfMerchant") {
state.menuList.unshift({
text: "扫一扫",
icon: "/static/icon/scan.png",
router: "",
})
}
}
onLoad(async () => {
+13 -8
View File
@@ -1,8 +1,12 @@
<template>
<view class="bg-[#f5f5f5] px-1 py-2 rounded-4 absolute bottom-0 w-full">
<view class="flex mb-2.5" v-for="(row, rowIndex) in keyboardLayout" :key="rowIndex">
<view class="bg-[#f5f5f5] px-1 py-2 rounded-4 fixed bottom-0 left-0 right-0 w-full">
<view class="flex justify-end">
<image v-show="show" class="w-[50rpx] h-[50rpx] mx-2 mb-1" src="@/static/page/折叠.svg" @click="show = !show" />
<image v-show="!show" class="w-[50rpx] h-[50rpx] mx-2 mb-1" src="@/static/page/展开.svg" @click="show = !show" />
</view>
<view v-show="show" class="flex mb-2.5" v-for="(row, rowIndex) in keyboardLayout" :key="rowIndex">
<view
class="flex-1 h-[60px] flex items-center justify-center bg-white text-2xl text-[#333] mx-[5px] rounded-lg cursor-pointer select-none active:bg-[#f0f0f0]"
class="flex-1 h-[80rpx] flex items-center justify-center bg-white text-2xl text-[#333] mx-[5px] rounded-lg cursor-pointer select-none active:bg-[#f0f0f0]"
v-for="(key, keyIndex) in row"
:key="keyIndex"
@click="handleKeyPress(key.toString())"
@@ -10,24 +14,24 @@
{{ key }}
</view>
</view>
<view class="flex mb-0">
<view v-show="show" class="flex mb-0">
<view
class="flex-1 h-[60px] flex items-center justify-center bg-white text-2xl text-[#333] mx-[5px] rounded-lg cursor-pointer select-none active:bg-[#f0f0f0]"
class="flex-1 h-[80rpx] flex items-center justify-center bg-white text-2xl text-[#333] mx-[5px] rounded-lg cursor-pointer select-none active:bg-[#f0f0f0]"
@click="handleKeyPress('.')"
>
.
</view>
<view
class="flex-auto h-[60px] flex items-center justify-center bg-white text-2xl text-[#333] mx-[5px] rounded-lg cursor-pointer select-none active:bg-[#f0f0f0]"
class="flex-auto h-[80rpx] flex items-center justify-center bg-white text-2xl text-[#333] mx-[5px] rounded-lg cursor-pointer select-none active:bg-[#f0f0f0]"
@click="handleKeyPress('0')"
>
0
</view>
<view
class="flex-1 h-[60px] flex items-center justify-center bg-white mx-[5px] rounded-lg cursor-pointer select-none active:bg-[#f0f0f0]"
class="flex-1 h-[80rpx] flex items-center justify-center bg-white mx-[5px] rounded-lg cursor-pointer select-none active:bg-[#f0f0f0]"
@click="handleDelete"
>
<image class="w-[30px] h-[30px]" src="@/static/page/keyboardDelete.svg" />
<image class="w-[30rpx] h-[30rpx]" src="@/static/page/keyboardDelete.svg" />
</view>
</view>
</view>
@@ -43,6 +47,7 @@ const keyboardLayout = ref([
["4", "5", "6"],
["7", "8", "9"],
])
const show = ref(true)
// 按下键盘
const handleKeyPress = (key) => {
+1
View File
@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1744612190511" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="12706" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><path d="M736 544c-12.5 12.5-32.8 12.5-45.3 0L523.3 376.6c-6.2-6.2-16.4-6.2-22.6 0L333.3 544c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L466.7 320c25-25 65.5-25 90.5 0L736 498.7c12.5 12.5 12.5 32.8 0 45.3z" p-id="12707"></path></svg>

After

Width:  |  Height:  |  Size: 558 B

+1
View File
@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1744612158830" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="12544" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><path d="M736 480c-12.5-12.5-32.8-12.5-45.3 0L523.3 647.4c-6.2 6.2-16.4 6.2-22.6 0L333.3 480c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L466.7 704c25 25 65.5 25 90.5 0L736 525.3c12.5-12.5 12.5-32.8 0-45.3z" p-id="12545"></path></svg>

After

Width:  |  Height:  |  Size: 558 B