Commit c8087b44 by Lin

refactor(HomeFrame, ReceptionDetail): 移除嵌入模式和导航栏,简化接待详情组件

1 parent edc402f8
<template>
<view class="detail-container">
<!-- 顶部导航栏 -->
<view class="glass-header" :class="{ 'header-shadow': headerShadow }">
<view class="header-left" @click="onBack">
<text class="header-icon">‹</text>
</view>
<text class="header-title">接待详情</text>
</view>
<!-- 主内容区:可滚动 -->
<scroll-view class="main-scroll" scroll-y="true" @scroll="onMainScroll">
<scroll-view class="main-scroll" scroll-y="true">
<!-- 客户卡片 -->
<view class="customer-card">
<view class="card-top">
......@@ -166,16 +158,10 @@
<script setup lang="uts">
import { ref } from "vue";
// 嵌入模式:为 true 时返回按钮 emit close,否则执行 uni.navigateBack
const props = defineProps<{
embedded?: boolean
defineProps<{
item?: UTSJSONObject
}>();
const emit = defineEmits<{
close: []
}>();
// ── Tab 数据 ─────────────────────────────────────────────────────────────────
type TabItem = {
label: string;
......@@ -190,22 +176,12 @@ const tabList: TabItem[] = [
const activeTabIndex = ref(0);
const inputValue = ref("");
const headerShadow = ref(false);
// ── 切换 Tab ─────────────────────────────────────────────────────────────────
function switchTab(idx: number): void {
activeTabIndex.value = idx;
}
// ── 返回 ─────────────────────────────────────────────────────────────────────
function onBack(): void {
if (props.embedded === true) {
emit("close");
} else {
uni.navigateBack();
}
}
// ── 快捷操作 ─────────────────────────────────────────────────────────────────
function onQualityReport(): void {
uni.showToast({ title: "质检报告", icon: "none" });
......@@ -219,19 +195,6 @@ function onPlay(): void {
uni.showToast({ title: "播放", icon: "none" });
}
// ── 滚动时头部阴影 ───────────────────────────────────────────────────────────
function onMainScroll(e: any): void {
const obj = e as UTSJSONObject;
const evtDetail = obj['detail'] as UTSJSONObject | null;
if (evtDetail != null) {
const scrollTop = evtDetail["scrollTop"];
if (scrollTop != null) {
const top = scrollTop as number;
headerShadow.value = top > 10;
}
}
}
// ── 发送 ───────────────────────────────────────────────────────────────────
function onSend(): void {
if (inputValue.value != null && inputValue.value != "") {
......@@ -255,45 +218,6 @@ function onSend(): void {
background-color: #F8FAFC;
}
/* ── 顶部导航 ───────────────────────────────────────────────────────────────── */
.glass-header {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: 12px 20px;
padding-top: 44px;
background-color: rgba(255, 255, 255, 0.9);
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: #F3F4F6;
}
.header-left {
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
}
.header-icon {
font-size: 24px;
color: #374151;
}
.header-title {
flex: 1;
font-size: 18px;
font-weight: 700;
color: #1F2937;
text-align: center;
}
.header-shadow {
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}
/* ── 主滚动区 ───────────────────────────────────────────────────────────────── */
.main-scroll {
flex: 1;
......
......@@ -56,9 +56,7 @@
<ReceptionCenterCenter @show-reception-detail="onShowReceptionDetail" />
</view>
<view v-show="showReceptionDetail" class="reception-detail-inner">
<ReceptionDetail :embedded="true"
:item="receptionDetailItem"
@close="onReceptionDetailClose" />
<ReceptionDetail :item="receptionDetailItem" />
</view>
</view>
</view>
......@@ -113,9 +111,7 @@
<ReceptionCenterCenter :only-right="true" @show-reception-detail="onShowReceptionDetail" />
</view>
<view v-show="showReceptionDetail" class="reception-detail-inner">
<ReceptionDetail :embedded="true"
:item="receptionDetailItem"
@close="onReceptionDetailClose" />
<ReceptionDetail :item="receptionDetailItem" />
</view>
</view>
</view>
......@@ -223,10 +219,6 @@ function onShowReceptionDetail(item: UTSJSONObject): void {
showReceptionDetail.value = true;
}
function onReceptionDetailClose(): void {
showReceptionDetail.value = false;
}
function onStartClick(): void {
emit("start");
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!