Merge branch 'master' of https://gitea.zianxin.com/zax/biz-mobile-react-cloud
This commit is contained in:
commit
82b49190e9
6 files changed
+531
-306
No files matched your search
+235
-235
@@ -1,235 +1,235 @@
|
||||
<script lang="ts">
|
||||
import { getLaunchParam } from "@/sheep/utils/app"
|
||||
import { getAppInfo } from "@@/utils/app"
|
||||
import { APPENV } from "./sheep/constant"
|
||||
|
||||
interface TabbarItem {
|
||||
pagePath: string
|
||||
text: string
|
||||
iconPath: string
|
||||
selectedIconPath: string
|
||||
launchParam: string[]
|
||||
auth: string[]
|
||||
}
|
||||
|
||||
const tabbar: TabbarItem[] = [
|
||||
{
|
||||
pagePath: "pages/tabbar/index",
|
||||
text: "导航",
|
||||
iconPath: "",
|
||||
selectedIconPath: "",
|
||||
launchParam: [],
|
||||
auth: [],
|
||||
},
|
||||
{
|
||||
pagePath: "pages/tabbar/canteen",
|
||||
text: "食堂",
|
||||
iconPath: "/static/tabbar/canteen.png",
|
||||
selectedIconPath: "/static/tabbar/canteen-select.png",
|
||||
launchParam: ["canteen"],
|
||||
auth: [],
|
||||
},
|
||||
{
|
||||
pagePath: "pages/tabbar/canteenAnalyse",
|
||||
text: "喜好分析",
|
||||
iconPath: "/static/tabbar/canteen-analyse.png",
|
||||
selectedIconPath: "/static/tabbar/canteen-analyse-select.png",
|
||||
launchParam: ["canteen"],
|
||||
auth: [],
|
||||
},
|
||||
{
|
||||
pagePath: "pages/tabbar/selfMerchant",
|
||||
text: "自营商家",
|
||||
iconPath: "/static/tabbar/selfMerchant.png",
|
||||
selectedIconPath: "/static/tabbar/selfMerchant-select.png",
|
||||
launchParam: ["selfMerchant"],
|
||||
auth: ["user"],
|
||||
},
|
||||
{
|
||||
pagePath: "pages/tabbar/coopMerchant",
|
||||
text: "合作商家",
|
||||
iconPath: "/static/tabbar/coopMerchant.png",
|
||||
selectedIconPath: "/static/tabbar/coopMerchant-select.png",
|
||||
launchParam: ["coopMerchant"],
|
||||
auth: ["user"],
|
||||
},
|
||||
{
|
||||
pagePath: "pages/tabbar/onlineShop",
|
||||
text: "在线商城",
|
||||
iconPath: "/static/tabbar/online-shop.png",
|
||||
selectedIconPath: "/static/tabbar/online-shop-select.png",
|
||||
launchParam: ["onlineShop"],
|
||||
auth: ["user"],
|
||||
},
|
||||
{
|
||||
pagePath: "pages/tabbar/prosperityShop",
|
||||
text: "共富商城",
|
||||
iconPath: "/static/tabbar/prosperity-shop.png",
|
||||
selectedIconPath: "/static/tabbar/prosperity-shop-select.png",
|
||||
launchParam: ["prosperityShop"],
|
||||
auth: ["user"],
|
||||
},
|
||||
{
|
||||
pagePath: "pages/tabbar/cabinet",
|
||||
text: "智能柜",
|
||||
iconPath: "/static/tabbar/cabinet.png",
|
||||
selectedIconPath: "/static/tabbar/cabinet-select.png",
|
||||
launchParam: [],
|
||||
auth: ["doorAdmin"],
|
||||
},
|
||||
{
|
||||
pagePath: "pages/tabbar/order",
|
||||
text: "订单",
|
||||
iconPath: "/static/tabbar/order.png",
|
||||
selectedIconPath: "/static/tabbar/order-select.png",
|
||||
launchParam: ["canteen", "selfMerchant", "onlineShop", "coopMerchant"],
|
||||
auth: ["user"],
|
||||
},
|
||||
{
|
||||
pagePath: "pages/tabbar/flowStatistics",
|
||||
text: "流水统计",
|
||||
iconPath: "/static/tabbar/order.png",
|
||||
selectedIconPath: "/static/tabbar/order-select.png",
|
||||
launchParam: [],
|
||||
auth: ["merchant"],
|
||||
},
|
||||
{
|
||||
pagePath: "pages/tabbar/individualOrder",
|
||||
text: "订单",
|
||||
iconPath: "/static/tabbar/order.png",
|
||||
selectedIconPath: "/static/tabbar/order-select.png",
|
||||
launchParam: [],
|
||||
auth: ["merchant"],
|
||||
},
|
||||
{
|
||||
pagePath: "pages/tabbar/integrated",
|
||||
text: "综合服务",
|
||||
iconPath: "/static/tabbar/integrated.png",
|
||||
selectedIconPath: "/static/tabbar/integrated-select.png",
|
||||
launchParam: ["integrated"],
|
||||
auth: ["user"],
|
||||
},
|
||||
{
|
||||
pagePath: "pages/tabbar/my",
|
||||
text: "我的",
|
||||
iconPath: "/static/tabbar/my.png",
|
||||
selectedIconPath: "/static/tabbar/my-select.png",
|
||||
launchParam: ["canteen", "selfMerchant", "onlineShop", "coopMerchant", "integrated", "prosperityShop"],
|
||||
auth: ["user", "merchant", "doorAdmin"],
|
||||
},
|
||||
]
|
||||
|
||||
// 设置tabbar
|
||||
const setTabbarItem = (index: number, item: TabbarItem, visible: boolean) => {
|
||||
uni.setTabBarItem({
|
||||
index,
|
||||
pagePath: item.pagePath,
|
||||
text: item.text,
|
||||
iconPath: item.iconPath,
|
||||
selectedIconPath: item.selectedIconPath,
|
||||
visible,
|
||||
})
|
||||
}
|
||||
|
||||
// 根据启动参数和用户角色设置tabbar
|
||||
const setTabbar = (launchParam?: string, auth?: string) => {
|
||||
if (launchParam && !auth) {
|
||||
tabbar.forEach((item, index) => {
|
||||
const visible = item.launchParam.includes(launchParam)
|
||||
setTabbarItem(index, item, visible)
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!launchParam && auth) {
|
||||
tabbar.forEach((item, index) => {
|
||||
const visible = item.auth.includes(auth)
|
||||
setTabbarItem(index, item, visible)
|
||||
})
|
||||
}
|
||||
if (launchParam && auth) {
|
||||
tabbar.forEach((item, index) => {
|
||||
const visible = item.launchParam.includes(launchParam) && item.auth.includes(auth)
|
||||
setTabbarItem(index, item, visible)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
methods: {
|
||||
async _initTabbar() {
|
||||
const launchParam = getLaunchParam()
|
||||
const appInfo = await getAppInfo()
|
||||
|
||||
// 浙政钉环境
|
||||
if (appInfo == APPENV.ZZD) {
|
||||
if (!launchParam) return uni.hideTabBar()
|
||||
|
||||
setTabbar(launchParam)
|
||||
uni.showTabBar()
|
||||
return
|
||||
}
|
||||
|
||||
// 诗画环境
|
||||
if (appInfo == APPENV.SH) {
|
||||
if (!launchParam) return uni.hideTabBar()
|
||||
|
||||
const userRole = uni.getStorageSync("userRole")
|
||||
switch (userRole) {
|
||||
case "user":
|
||||
setTabbar(launchParam, "user")
|
||||
uni.showTabBar()
|
||||
break
|
||||
case "merchant":
|
||||
setTabbar(undefined, "merchant")
|
||||
uni.showTabBar()
|
||||
break
|
||||
case "doorAdmin":
|
||||
setTabbar(undefined, "doorAdmin")
|
||||
uni.showTabBar()
|
||||
break
|
||||
default:
|
||||
uni.hideTabBar()
|
||||
uni.removeStorageSync("userRole")
|
||||
uni.showToast({ title: "用户身份未确认", icon: "none" })
|
||||
uni.reLaunch({ url: "/pages/user/userRole" })
|
||||
break
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "@/sheep/scss/global.scss";
|
||||
@import "@/uni_modules/tm-ui/css/remixicon.min.css";
|
||||
|
||||
$theme-green: #06be36;
|
||||
$theme-blue: #0094ff;
|
||||
$theme-gray: #999;
|
||||
|
||||
.botder_btn {
|
||||
border: 1px solid #999;
|
||||
color: #999;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
border-radius: 10rpx;
|
||||
padding: 8rpx 15rpx;
|
||||
}
|
||||
|
||||
.prefix_title {
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
|
||||
&::before {
|
||||
content: "";
|
||||
display: inline-block;
|
||||
width: 8rpx;
|
||||
height: 24rpx;
|
||||
background: $theme-blue;
|
||||
border-radius: 4rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<script lang="ts">
|
||||
import { getLaunchParam } from "@/sheep/utils/app"
|
||||
import { getAppInfo } from "@@/utils/app"
|
||||
import { APPENV } from "./sheep/constant"
|
||||
|
||||
interface TabbarItem {
|
||||
pagePath: string
|
||||
text: string
|
||||
iconPath: string
|
||||
selectedIconPath: string
|
||||
launchParam: string[]
|
||||
auth: string[]
|
||||
}
|
||||
|
||||
const tabbar: TabbarItem[] = [
|
||||
{
|
||||
pagePath: "pages/tabbar/index",
|
||||
text: "导航",
|
||||
iconPath: "",
|
||||
selectedIconPath: "",
|
||||
launchParam: [],
|
||||
auth: [],
|
||||
},
|
||||
{
|
||||
pagePath: "pages/tabbar/canteen",
|
||||
text: "食堂",
|
||||
iconPath: "/static/tabbar/canteen.png",
|
||||
selectedIconPath: "/static/tabbar/canteen-select.png",
|
||||
launchParam: ["canteen"],
|
||||
auth: [],
|
||||
},
|
||||
{
|
||||
pagePath: "pages/tabbar/canteenAnalyse",
|
||||
text: "喜好分析",
|
||||
iconPath: "/static/tabbar/canteen-analyse.png",
|
||||
selectedIconPath: "/static/tabbar/canteen-analyse-select.png",
|
||||
launchParam: ["canteen"],
|
||||
auth: [],
|
||||
},
|
||||
{
|
||||
pagePath: "pages/tabbar/selfMerchant",
|
||||
text: "自营商家",
|
||||
iconPath: "/static/tabbar/selfMerchant.png",
|
||||
selectedIconPath: "/static/tabbar/selfMerchant-select.png",
|
||||
launchParam: ["selfMerchant"],
|
||||
auth: ["user"],
|
||||
},
|
||||
{
|
||||
pagePath: "pages/tabbar/coopMerchant",
|
||||
text: "合作商家",
|
||||
iconPath: "/static/tabbar/coopMerchant.png",
|
||||
selectedIconPath: "/static/tabbar/coopMerchant-select.png",
|
||||
launchParam: ["coopMerchant"],
|
||||
auth: ["user"],
|
||||
},
|
||||
{
|
||||
pagePath: "pages/tabbar/onlineShop",
|
||||
text: "在线商城",
|
||||
iconPath: "/static/tabbar/online-shop.png",
|
||||
selectedIconPath: "/static/tabbar/online-shop-select.png",
|
||||
launchParam: ["onlineShop"],
|
||||
auth: ["user"],
|
||||
},
|
||||
{
|
||||
pagePath: "pages/tabbar/prosperityShop",
|
||||
text: "共富商城",
|
||||
iconPath: "/static/tabbar/prosperity-shop.png",
|
||||
selectedIconPath: "/static/tabbar/prosperity-shop-select.png",
|
||||
launchParam: ["prosperityShop"],
|
||||
auth: ["user"],
|
||||
},
|
||||
{
|
||||
pagePath: "pages/tabbar/cabinet",
|
||||
text: "智能柜",
|
||||
iconPath: "/static/tabbar/cabinet.png",
|
||||
selectedIconPath: "/static/tabbar/cabinet-select.png",
|
||||
launchParam: [],
|
||||
auth: ["doorAdmin"],
|
||||
},
|
||||
{
|
||||
pagePath: "pages/tabbar/order",
|
||||
text: "订单",
|
||||
iconPath: "/static/tabbar/order.png",
|
||||
selectedIconPath: "/static/tabbar/order-select.png",
|
||||
launchParam: ["canteen", "selfMerchant", "onlineShop", "coopMerchant"],
|
||||
auth: ["user"],
|
||||
},
|
||||
{
|
||||
pagePath: "pages/tabbar/flowStatistics",
|
||||
text: "流水统计",
|
||||
iconPath: "/static/tabbar/order.png",
|
||||
selectedIconPath: "/static/tabbar/order-select.png",
|
||||
launchParam: [],
|
||||
auth: ["merchant"],
|
||||
},
|
||||
{
|
||||
pagePath: "pages/tabbar/individualOrder",
|
||||
text: "订单",
|
||||
iconPath: "/static/tabbar/order.png",
|
||||
selectedIconPath: "/static/tabbar/order-select.png",
|
||||
launchParam: [],
|
||||
auth: ["merchant"],
|
||||
},
|
||||
{
|
||||
pagePath: "pages/tabbar/integrated",
|
||||
text: "综合服务",
|
||||
iconPath: "/static/tabbar/integrated.png",
|
||||
selectedIconPath: "/static/tabbar/integrated-select.png",
|
||||
launchParam: ["integrated"],
|
||||
auth: ["user"],
|
||||
},
|
||||
{
|
||||
pagePath: "pages/tabbar/my",
|
||||
text: "我的",
|
||||
iconPath: "/static/tabbar/my.png",
|
||||
selectedIconPath: "/static/tabbar/my-select.png",
|
||||
launchParam: ["canteen", "selfMerchant", "onlineShop", "coopMerchant", "integrated", "prosperityShop"],
|
||||
auth: ["user", "merchant", "doorAdmin"],
|
||||
},
|
||||
]
|
||||
|
||||
// 设置tabbar
|
||||
const setTabbarItem = (index: number, item: TabbarItem, visible: boolean) => {
|
||||
uni.setTabBarItem({
|
||||
index,
|
||||
pagePath: item.pagePath,
|
||||
text: item.text,
|
||||
iconPath: item.iconPath,
|
||||
selectedIconPath: item.selectedIconPath,
|
||||
visible,
|
||||
})
|
||||
}
|
||||
|
||||
// 根据启动参数和用户角色设置tabbar
|
||||
const setTabbar = (launchParam?: string, auth?: string) => {
|
||||
if (launchParam && !auth) {
|
||||
tabbar.forEach((item, index) => {
|
||||
const visible = item.launchParam.includes(launchParam)
|
||||
setTabbarItem(index, item, visible)
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!launchParam && auth) {
|
||||
tabbar.forEach((item, index) => {
|
||||
const visible = item.auth.includes(auth)
|
||||
setTabbarItem(index, item, visible)
|
||||
})
|
||||
}
|
||||
if (launchParam && auth) {
|
||||
tabbar.forEach((item, index) => {
|
||||
const visible = item.launchParam.includes(launchParam) && item.auth.includes(auth)
|
||||
setTabbarItem(index, item, visible)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
methods: {
|
||||
async _initTabbar() {
|
||||
const launchParam = getLaunchParam()
|
||||
const appInfo = await getAppInfo()
|
||||
|
||||
// 浙政钉环境
|
||||
if (appInfo == APPENV.ZZD) {
|
||||
if (!launchParam) return uni.hideTabBar()
|
||||
|
||||
setTabbar(launchParam)
|
||||
uni.showTabBar()
|
||||
return
|
||||
}
|
||||
|
||||
// 诗画环境
|
||||
if (appInfo == APPENV.SH) {
|
||||
if (!launchParam) return uni.hideTabBar()
|
||||
|
||||
const userRole = uni.getStorageSync("userRole")
|
||||
switch (userRole) {
|
||||
case "user":
|
||||
setTabbar(launchParam, "user")
|
||||
uni.showTabBar()
|
||||
break
|
||||
case "merchant":
|
||||
setTabbar(undefined, "merchant")
|
||||
uni.showTabBar()
|
||||
break
|
||||
case "doorAdmin":
|
||||
setTabbar(undefined, "doorAdmin")
|
||||
uni.showTabBar()
|
||||
break
|
||||
default:
|
||||
uni.hideTabBar()
|
||||
uni.removeStorageSync("userRole")
|
||||
uni.showToast({ title: "用户身份未确认", icon: "none" })
|
||||
uni.reLaunch({ url: "/pages/user/userRole" })
|
||||
break
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "@/sheep/scss/global.scss";
|
||||
@import "@/uni_modules/tm-ui/css/remixicon.min.css";
|
||||
|
||||
$theme-green: #06be36;
|
||||
$theme-blue: #0094ff;
|
||||
$theme-gray: #999;
|
||||
|
||||
.botder_btn {
|
||||
border: 1px solid #999;
|
||||
color: #999;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
border-radius: 10rpx;
|
||||
padding: 8rpx 15rpx;
|
||||
}
|
||||
|
||||
.prefix_title {
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
|
||||
&::before {
|
||||
content: "";
|
||||
display: inline-block;
|
||||
width: 8rpx;
|
||||
height: 24rpx;
|
||||
background: $theme-blue;
|
||||
border-radius: 4rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,42 +1,75 @@
|
||||
<template>
|
||||
<view class="booking-detail">
|
||||
<view class="room-info">
|
||||
<view class="room-name">{{ detail.roomName }}</view>
|
||||
<!-- 会议室信息卡片 -->
|
||||
<view class="room-card">
|
||||
<view class="room-header">
|
||||
<view class="room-name">{{ detail.roomName }}</view>
|
||||
<view class="status-badge" :class="getStatusClass(detail.checkStatus)">
|
||||
{{ detail.checkStatusText }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="room-meta">
|
||||
<text>容量:{{ detail.roomCapacity }}人</text>
|
||||
<text>位置:{{ detail.roomLocation || '未设置' }}</text>
|
||||
<view class="meta-item">
|
||||
<text class="icon">👥</text>
|
||||
<text>{{ detail.roomCapacity }}人</text>
|
||||
</view>
|
||||
<view class="meta-item">
|
||||
<text class="icon">📍</text>
|
||||
<text>{{ detail.roomLocation || '未设置' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="detail.roomEquipment" class="room-equip">
|
||||
设备:{{ detail.roomEquipment }}
|
||||
</view>
|
||||
<view v-if="detail.roomStatusText" class="room-status">
|
||||
状态:{{ detail.roomStatusText }}
|
||||
<text class="icon">🔧</text>
|
||||
<text>{{ detail.roomEquipment }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="section">
|
||||
<view class="section-title">预约信息</view>
|
||||
<view class="info-row"><text class="label">预约人:</text>{{ detail.applicantName }}</view>
|
||||
<view class="info-row"><text class="label">预约日期:</text>{{ detail.bookingDate }}</view>
|
||||
<view class="info-row"><text class="label">预约时间:</text>{{ detail.startTime }} ~ {{ detail.endTime }}</view>
|
||||
<view class="info-row"><text class="label">会议时长:</text>{{ detail.duration }}分钟</view>
|
||||
<view class="info-row"><text class="label">预约状态:</text>{{ detail.checkStatusText }}</view>
|
||||
<view class="info-row" v-if="detail.checkReason"><text class="label">审核意见:</text>{{ detail.checkReason }}</view>
|
||||
<!-- 预约信息卡片 -->
|
||||
<view class="info-card">
|
||||
<view class="card-title">
|
||||
<text class="title-icon">📅</text>
|
||||
<text>预约信息</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">预约人</text>
|
||||
<text class="value">{{ detail.applicantName }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">预约日期</text>
|
||||
<text class="value">{{ detail.bookingDate }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">会议时间</text>
|
||||
<text class="value primary">{{ detail.startTime }} ~ {{ detail.endTime }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">会议时长</text>
|
||||
<text class="value">{{ detail.duration }}分钟</text>
|
||||
</view>
|
||||
<view class="info-item" v-if="detail.checkReason">
|
||||
<text class="label">审核意见</text>
|
||||
<text class="value">{{ detail.checkReason }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="section">
|
||||
<view class="section-title">会议配置</view>
|
||||
<view class="info-row"><text class="label">会务服务:</text>{{ detail.needServiceText }}</view>
|
||||
<view class="info-row" v-if="detail.deskLayoutText"><text class="label">桌子摆放:</text>{{ detail.deskLayoutText }}</view>
|
||||
<view class="info-row" v-if="detail.description"><text class="label">备注说明:</text>{{ detail.description }}</view>
|
||||
</view>
|
||||
|
||||
<view class="section">
|
||||
<view class="section-title">系统信息</view>
|
||||
<view class="info-row"><text class="label">创建人:</text>{{ detail.createBy }}</view>
|
||||
<view class="info-row"><text class="label">创建时间:</text>{{ detail.createTime }}</view>
|
||||
<view class="info-row" v-if="detail.updateBy"><text class="label">更新人:</text>{{ detail.updateBy }}</view>
|
||||
<view class="info-row" v-if="detail.updateTime"><text class="label">更新时间:</text>{{ detail.updateTime }}</view>
|
||||
<!-- 会议配置卡片 -->
|
||||
<view class="info-card">
|
||||
<view class="card-title">
|
||||
<text class="title-icon">⚙️</text>
|
||||
<text>会议配置</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">会务服务</text>
|
||||
<text class="value">{{ detail.needServiceText }}</text>
|
||||
</view>
|
||||
<view class="info-item" v-if="detail.deskLayoutText">
|
||||
<text class="label">桌子摆放</text>
|
||||
<text class="value">{{ detail.deskLayoutText }}</text>
|
||||
</view>
|
||||
<view class="info-item" v-if="detail.description">
|
||||
<text class="label">备注说明</text>
|
||||
<text class="value remark">{{ detail.description }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -48,6 +81,18 @@ import meetingRoomApi from '@/sheep/api/meetingRoom'
|
||||
|
||||
const detail = ref<any>({})
|
||||
|
||||
// 获取状态样式类
|
||||
function getStatusClass(status: string) {
|
||||
const classMap: Record<string, string> = {
|
||||
'1': 'status-pending',
|
||||
'2': 'status-approved',
|
||||
'3': 'status-rejected',
|
||||
'4': 'status-cancelled',
|
||||
'5': 'status-completed'
|
||||
}
|
||||
return classMap[status] || 'status-pending'
|
||||
}
|
||||
|
||||
onLoad(async (options: any) => {
|
||||
const id = options.id
|
||||
if (!id) return
|
||||
@@ -60,51 +105,154 @@ onLoad(async (options: any) => {
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.booking-detail {
|
||||
min-height: 100vh;
|
||||
background: #f5f6fa;
|
||||
padding: 24rpx;
|
||||
padding-bottom: 60rpx;
|
||||
}
|
||||
|
||||
// 会议室信息卡片
|
||||
.room-card {
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
border-radius: 20rpx;
|
||||
padding: 32rpx;
|
||||
.room-info {
|
||||
background: #f7f8fa;
|
||||
border-radius: 16rpx;
|
||||
padding: 24rpx;
|
||||
margin-bottom: 32rpx;
|
||||
margin-bottom: 24rpx;
|
||||
box-shadow: 0 8rpx 24rpx rgba(102, 126, 234, 0.25);
|
||||
|
||||
.room-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.room-name {
|
||||
font-size: 36rpx;
|
||||
font-size: 40rpx;
|
||||
font-weight: bold;
|
||||
margin-bottom: 12rpx;
|
||||
color: #fff;
|
||||
flex: 1;
|
||||
}
|
||||
.room-meta {
|
||||
font-size: 26rpx;
|
||||
color: #666;
|
||||
margin-bottom: 8rpx;
|
||||
text {
|
||||
margin-right: 32rpx;
|
||||
|
||||
.status-badge {
|
||||
padding: 8rpx 20rpx;
|
||||
border-radius: 20rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
|
||||
&.status-pending {
|
||||
background: rgba(255, 193, 7, 0.9);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
&.status-approved {
|
||||
background: rgba(76, 175, 80, 0.9);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
&.status-rejected {
|
||||
background: rgba(244, 67, 54, 0.9);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
&.status-cancelled {
|
||||
background: rgba(158, 158, 158, 0.9);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
&.status-completed {
|
||||
background: rgba(33, 150, 243, 0.9);
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
.room-equip {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
margin-bottom: 8rpx;
|
||||
}
|
||||
.room-status {
|
||||
font-size: 24rpx;
|
||||
color: #ff6b35;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.room-meta {
|
||||
display: flex;
|
||||
gap: 32rpx;
|
||||
margin-bottom: 16rpx;
|
||||
|
||||
.meta-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 26rpx;
|
||||
color: rgba(255, 255, 255, 0.95);
|
||||
|
||||
.icon {
|
||||
margin-right: 8rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.section {
|
||||
background: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 24rpx;
|
||||
.section-title {
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
margin-bottom: 18rpx;
|
||||
}
|
||||
.info-row {
|
||||
|
||||
.room-equip {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 24rpx;
|
||||
color: rgba(255, 255, 255, 0.85);
|
||||
|
||||
.icon {
|
||||
margin-right: 8rpx;
|
||||
font-size: 26rpx;
|
||||
margin-bottom: 14rpx;
|
||||
.label {
|
||||
color: #888;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 信息卡片
|
||||
.info-card {
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
padding: 32rpx;
|
||||
margin-bottom: 24rpx;
|
||||
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
|
||||
|
||||
.card-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
margin-bottom: 24rpx;
|
||||
padding-bottom: 16rpx;
|
||||
border-bottom: 2rpx solid #f0f0f0;
|
||||
|
||||
.title-icon {
|
||||
margin-right: 12rpx;
|
||||
font-size: 36rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.info-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
padding: 16rpx 0;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.label {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
min-width: 160rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.value {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
font-weight: 500;
|
||||
text-align: right;
|
||||
flex: 1;
|
||||
|
||||
&.primary {
|
||||
color: #1777FF;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
&.remark {
|
||||
text-align: left;
|
||||
line-height: 1.6;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -197,6 +197,17 @@ const handleDateChange = async (index: number) => {
|
||||
await fetchTimeSlots(date)
|
||||
}
|
||||
|
||||
// 判断时间段是否已过期
|
||||
const isTimeSlotExpired = (slot: TimeSlotItem, date: string): boolean => {
|
||||
try {
|
||||
const now = new Date()
|
||||
const slotDateTime = new Date(`${date} ${slot.startTime}`)
|
||||
return slotDateTime < now
|
||||
} catch (error) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// 获取时间段数据
|
||||
const fetchTimeSlots = async (date: string) => {
|
||||
if (!roomId.value) {
|
||||
@@ -212,7 +223,13 @@ const fetchTimeSlots = async (date: string) => {
|
||||
const response = res as unknown as ApiResponse<TimeSlotItem[]>
|
||||
|
||||
if (response.code === 0 && response.data) {
|
||||
timeSlots.value = response.data
|
||||
// 处理时间段数据,将已过期的时间段标记为不可用
|
||||
timeSlots.value = response.data.map(slot => {
|
||||
if (isTimeSlotExpired(slot, date) && slot.status === 'free') {
|
||||
return { ...slot, status: 'disabled' as 'disabled' }
|
||||
}
|
||||
return slot
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: response.msg || '获取时间段失败',
|
||||
|
||||
@@ -44,4 +44,16 @@ export default {
|
||||
method: "POST",
|
||||
data,
|
||||
}),
|
||||
/**
|
||||
* 创建共富商城预约订单
|
||||
* @body body.carParentId 购物车id
|
||||
* @body body.walletTypeId 钱包类型id
|
||||
* @body body.pickUpId 自提点id
|
||||
*/
|
||||
appCreateFarmerReserveOrder: (data: any) =>
|
||||
request({
|
||||
url: "/hard/hard-order/app/create-farmer-order",
|
||||
method: "POST",
|
||||
data,
|
||||
}),
|
||||
}
|
||||
@@ -69,4 +69,26 @@ export default {
|
||||
method: "GET",
|
||||
data: {},
|
||||
}),
|
||||
/**
|
||||
* 自提点分页
|
||||
* @param params.pageNum 页码
|
||||
* @param params.pageSize 每页数量
|
||||
* @param params.mchIds 商户ID列表
|
||||
*/
|
||||
pickUpPage: (params: any): Promise<any> =>
|
||||
request({
|
||||
url: "wallet/mch-pick-up/app/page",
|
||||
method: "GET",
|
||||
params: params,
|
||||
}),
|
||||
/**
|
||||
* 自提点详情
|
||||
* @param params.id 自提点id
|
||||
*/
|
||||
pickUpDetail: (params: any): Promise<any> =>
|
||||
request({
|
||||
url: "wallet/mch-pick-up/app/detail",
|
||||
method: "GET",
|
||||
params: params,
|
||||
}),
|
||||
}
|
||||
@@ -15,12 +15,13 @@
|
||||
<tm-button
|
||||
class="day-time-button"
|
||||
size="m"
|
||||
:color="selectedTimePointIndex == index ? '' : 'info'"
|
||||
v-for="(item, index) in dayTimePointList"
|
||||
:key="index"
|
||||
@click="selectTimePoint(item, index)"
|
||||
:color="selectedTimePointIndex == item.index ? '' : 'info'"
|
||||
:disabled="item.disabled"
|
||||
v-for="item in availableTimePoints"
|
||||
:key="item.index"
|
||||
@click="selectTimePoint(item.time, item.index)"
|
||||
>
|
||||
{{ item.slice(0, 5) }}
|
||||
{{ item.time.slice(0, 5) }}
|
||||
</tm-button>
|
||||
</view>
|
||||
<view class="px-20rpx py-2 flex justify-between">
|
||||
@@ -56,6 +57,17 @@ const getLast7DaysWeek = (): { week: string; date: string; fullDate: string }[]
|
||||
return result
|
||||
}
|
||||
|
||||
// 判断时间是否已过期
|
||||
const isTimePast = (dateStr: string, timeStr: string): boolean => {
|
||||
try {
|
||||
const now = new Date()
|
||||
const selectedDateTime = new Date(`${dateStr} ${timeStr}`)
|
||||
return selectedDateTime < now
|
||||
} catch (error) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// 生成时间点列表(8:00-18:00,每半小时一个时间点)
|
||||
const dayTimePointList = computed(() => {
|
||||
const times: string[] = []
|
||||
@@ -67,6 +79,15 @@ const dayTimePointList = computed(() => {
|
||||
return times
|
||||
})
|
||||
|
||||
// 过滤出可用的时间点(未过期的)
|
||||
const availableTimePoints = computed(() => {
|
||||
return dayTimePointList.value.map((time, index) => ({
|
||||
time,
|
||||
index,
|
||||
disabled: isTimePast(selectedDateValue.value.fullDate, time)
|
||||
}))
|
||||
})
|
||||
|
||||
const selectedDateIndex = ref(0)
|
||||
const selectedDateValue = ref<{ week: string; date: string; fullDate: string }>(getLast7DaysWeek()[0])
|
||||
const selectedTimePointIndex = ref(0)
|
||||
@@ -80,6 +101,11 @@ const selectDate = (value: { week: string; date: string; fullDate: string }, ind
|
||||
|
||||
// 选择时间点
|
||||
const selectTimePoint = (value: string, index: number) => {
|
||||
// 检查是否已过期
|
||||
if (isTimePast(selectedDateValue.value.fullDate, value)) {
|
||||
uni.showToast({ title: '不能选择过去的时间', icon: 'none' })
|
||||
return
|
||||
}
|
||||
selectedTimePointValue.value = value
|
||||
selectedTimePointIndex.value = index
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user