包厢改餐桌

This commit is contained in:
zjf committed 2025-08-14 16:47:26 +08:00
1 parent ccb2a8b31e
commit 17c99e0f84
2 files changed
+218 -55

No files matched your search

+4 -4
View File
@@ -19,15 +19,15 @@ VITE_OAUTH2_APP_CLIENT='mini:mini'
# --------------------------- 开发环境 api地址 ----------------------------------
# VITE_APP_DEV_SERVICE = https://stgl.pj.gov.cn/api # 域名线上
#VITE_APP_DEV_SERVICE = http://59.202.170.152:81/api # 信创线上
VITE_APP_DEV_SERVICE = http://192.168.101.174:9999 # 邓-本地
# VITE_APP_DEV_SERVICE = http://127.0.0.1:9999 # 邓-本地
#VITE_APP_DEV_SERVICE = http://192.168.101.174:9999 # 邓-本地
VITE_APP_DEV_SERVICE = http://127.0.0.1:9999 # 邓-本地
# VITE_APP_DEV_SERVICE = http://123.157.250.162:8089/api # 测试线上
# --------------------------- 开发环境 图片访问基础地址 ---------------------------
# VITE_IMAGE_DEV_PATH = https://stgl.pj.gov.cn/api # 域名线上
#VITE_IMAGE_DEV_PATH = http://59.202.170.152:81/api # 信创线上
VITE_IMAGE_DEV_PATH = http://192.168.101.174:9999 # 邓-本地
# VITE_IMAGE_DEV_PATH = http://127.0.0.1:9999
#VITE_IMAGE_DEV_PATH = http://192.168.101.174:9999 # 邓-本地
VITE_IMAGE_DEV_PATH = http://127.0.0.1:9999
# VITE_IMAGE_DEV_PATH = http://123.157.250.162:8089/api # 测试线上
# --------------------------- 生产环境 api地址 ----------------------------------
+214 -51
View File
@@ -6,23 +6,12 @@ import { isEmpty } from "radash"
import { hooks, router } from "@@/index"
import { boxesApi } from "@@/api"
import zTabs from "@@/components/other/z-tabs/z-tabs.vue"
import CustomWaterfallsFlow from "@@/components/other/custom-waterfalls-flow/custom-waterfalls-flow.vue"
import { filePath } from "@/sheep/utils/file"
const data = {
tabs: [
{ id: null, name: "全部", disabled: false },
{ id: 0, name: "空闲", disabled: false },
{ id: 1, name: "部分空闲", disabled: false },
{ id: 2, name: "已满", disabled: false },
],
}
const state = reactive<any>({
detailId: null,
pa: {
status: data.tabs[0].id,
status: null, // 移除状态筛选
},
})
@@ -35,35 +24,47 @@ const boxesList = computed(() => {
const pageRef = ref<any>(null)
const pageHook = hooks.usePage(pageRef, boxesApi.page, null, "data.records")
const query = (page: number, pagesize: number) => {
pageHook.startPage(page, pagesize, false, state.pa)
}
// 获取状态样式类
const getStatusClass = (status: number) => {
const statusMap: Record<number, string> = {
0: 'status-available',
1: 'status-partial',
2: 'status-full'
}
return statusMap[status] || 'status-available'
}
// 获取状态文本
const getStatusText = (status: number) => {
const statusMap: Record<number, string> = {
0: '空闲',
1: '部分空闲',
2: '已满'
}
return statusMap[status] || '空闲'
}
onLoad((options: any) => {
if (!isEmpty(options.id)) {
state.detailId = options.id
state.pa.merchantId = options.id
}
})
onShow(() => {
if (pageRef.value) {
pageRef.value.reload(false)
}
})
const doTab = (e: any) => {
const target = data.tabs[e]
state.pa.status = target.id
pageRef.value.reload(true)
}
const doCard = (v: any) => {
router.jump("/pages/boxes/detail", { id: v.id })
}
</script>
<template>
<crud-layout title="包厢预定" bg="/static/page/blue-bg.png">
<crud-layout title="餐桌列表" bg="/static/page/blue-bg.png">
<z-paging
ref="pageRef"
height="100%"
@@ -79,41 +80,203 @@ const doCard = (v: any) => {
@scroll="pageHook.scroll"
>
<template #top>
<view class="bg-white rounded-16rpx px-20rpx m-x-10rpx m-t-20rpx">
<z-tabs :list="data.tabs" @change="doTab" />
<view class="header-section">
<view class="welcome-text">餐厅餐桌列表</view>
</view>
</template>
<view class="h-20rpx" />
<custom-waterfalls-flow v-model="boxesList" imageKey="images" :columnSpace="1" @wapperClick="doCard" @imageClick="doCard">
<template v-slot:default="v">
<view class="p-x-15rpx p-t-10rpx p-b-20rpx">
<view class="sub-text-28 show-line">{{ v.name }}</view>
<view class="m-t-10rpx flex-row items-center">
<view class="second-text-32 color-#f63a36!"> ¥{{ v.price }} </view>
</view>
<view class="flex-row items-center justify-between m-t-10rpx">
<view class="second-text-26">可容纳{{ v.capacity }}人</view>
<view class="w-2rpx h-20rpx m-x-5rpx bg-#999" />
<view class="flex-row-center">
<tm-tag v-if="v.status == 0" size="xs" color="success">
{{ hooks.useEnum("boxesBxStatusEnum", v.status.toString()) }}
</tm-tag>
<tm-tag v-if="v.status == 1" size="xs">
{{ hooks.useEnum("boxesBxStatusEnum", v.status) }}
</tm-tag>
<tm-tag v-if="v.status == 2" size="xs" color="error">
{{ hooks.useEnum("boxesBxStatusEnum", v.status) }}
</tm-tag>
<view class="boxes-container">
<view class="boxes-grid">
<view v-for="item in boxesList" :key="item.id" class="box-card">
<view class="card-image-section">
<image v-if="item.images" :src="item.images" class="box-image" mode="aspectFill" />
<view v-else class="image-placeholder">
<text class="placeholder-icon">🍴</text>
<text class="placeholder-text">餐桌</text>
</view>
</view>
<view class="flex-row items-center m-t-10rpx">
<view class="second-text-26">{{ v.address }}</view>
<view class="card-content">
<view class="box-title">{{ item.name }}</view>
<view class="box-subtitle">{{ item.tableNumber }}</view>
<view class="box-features">
<view class="feature-item">
<text class="feature-icon">👥</text>
<text class="feature-text">{{ item.tableTypeName }}</text>
</view>
</view>
</view>
</view>
</template>
</custom-waterfalls-flow>
</view>
</view>
</z-paging>
</crud-layout>
</template>
<style lang="scss" scoped></style>
<style lang="scss" scoped>
.header-section {
padding: 40rpx 24rpx 32rpx 24rpx;
background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
border-radius: 0 0 32rpx 32rpx;
margin: 0 24rpx 32rpx 24rpx;
box-shadow: 0 4rpx 20rpx rgba(59, 130, 246, 0.3);
}
.welcome-text {
color: #fff;
font-size: 38rpx;
font-weight: 600;
text-align: center;
letter-spacing: 1rpx;
}
.boxes-container {
padding: 0 24rpx;
background: transparent;
min-height: 100vh;
}
.boxes-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 20rpx;
}
.box-card {
background: #fff;
border-radius: 16rpx;
box-shadow: 0 2rpx 12rpx rgba(59, 130, 246, 0.08);
overflow: hidden;
position: relative;
border: 1rpx solid #DBEAFE;
transition: all 0.3s ease;
}
.box-card:hover {
transform: translateY(-4rpx);
box-shadow: 0 8rpx 24rpx rgba(59, 130, 246, 0.15);
border-color: #93C5FD;
}
.card-image-section {
position: relative;
height: 160rpx;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
}
.box-image {
width: 100%;
height: 100%;
object-fit: cover;
transition: transform 0.3s ease;
}
.box-card:hover .box-image {
transform: scale(1.02);
}
.image-placeholder {
width: 100%;
height: 100%;
background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
}
.placeholder-icon {
font-size: 48rpx;
margin-bottom: 8rpx;
display: block;
}
.placeholder-text {
font-size: 24rpx;
color: #3B82F6;
font-weight: 500;
display: block;
}
.card-content {
padding: 24rpx;
background: #fff;
position: relative;
}
.card-content::before {
content: '';
position: absolute;
top: 0;
left: 24rpx;
right: 24rpx;
height: 1rpx;
background: linear-gradient(90deg, transparent 0%, #E5E7EB 20%, #E5E7EB 80%, transparent 100%);
}
.box-title {
font-size: 32rpx;
font-weight: 700;
color: #1E40AF;
margin-bottom: 12rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
line-height: 1.3;
}
.box-subtitle {
font-size: 26rpx;
color: #3B82F6;
margin-bottom: 20rpx;
display: inline-block;
background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
padding: 10rpx 18rpx;
border-radius: 12rpx;
color: #1D4ED8;
font-weight: 600;
border: 1rpx solid #DBEAFE;
box-shadow: 0 2rpx 8rpx rgba(59, 130, 246, 0.1);
}
.box-features {
margin-bottom: 0;
}
.feature-item {
display: flex;
align-items: center;
margin-bottom: 0;
padding: 8rpx 0;
}
.feature-icon {
font-size: 32rpx;
margin-right: 16rpx;
width: 48rpx;
text-align: center;
background: linear-gradient(135deg, #60A5FA 0%, #3B82F6 100%);
padding: 12rpx;
border-radius: 12rpx;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 2rpx 8rpx rgba(59, 130, 246, 0.2);
}
.feature-text {
font-size: 28rpx;
color: #1E40AF;
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-weight: 600;
}
</style>