客户接待主包的一些代码移动到子包内

This commit is contained in:
zhonghua.li
2026-04-15 08:32:13 +08:00
parent a15d539f59
commit b37b9c6ada
15 changed files with 2992 additions and 6639 deletions

View File

@@ -0,0 +1,180 @@
<template>
<view class="scenario-wrapper" :style="{ top: contentTop, bottom: contentBottom }">
<scroll-view class="content-scroll" scroll-y="true">
<view class="category-section two-column">
<view class="category-header">
<text class="category-icon">🏷</text>
<text class="category-title">接待页面标签</text>
</view>
<view class="function-grid">
<view class="function-item" @click="openReceptionTab('status')">
<view class="function-icon">📌</view>
<text class="function-name">服务状态</text>
<text class="function-desc">进入接待页并切到服务状态</text>
</view>
<view class="function-item" @click="openReceptionTab('reception')">
<view class="function-icon">🛎</view>
<text class="function-name">开始接待</text>
<text class="function-desc">进入接待页并切到开始接待</text>
</view>
<view class="function-item" @click="openReceptionTab('tag')">
<view class="function-icon">🗂</view>
<text class="function-name">标签管理</text>
<text class="function-desc">进入接待页并切到标签管理</text>
</view>
</view>
</view>
<view class="category-section two-column">
<view class="category-header">
<text class="category-icon">👤</text>
<text class="category-title">客户页面标签</text>
</view>
<view class="function-grid">
<view class="function-item" @click="openCustomerTab('service')">
<view class="function-icon">📝</view>
<text class="function-name">服务记录</text>
<text class="function-desc">进入客户页并切到服务记录</text>
</view>
<view class="function-item" @click="openCustomerTab('customer')">
<view class="function-icon">👥</view>
<text class="function-name">客户</text>
<text class="function-desc">进入客户页并切到客户列表</text>
</view>
</view>
</view>
</scroll-view>
</view>
</template>
<script>
export default {
name: 'SalesScenarioNew',
props: {
contentTop: {
type: String,
default: '0rpx',
},
contentBottom: {
type: String,
default: '0rpx',
},
},
methods: {
openReceptionTab(tab) {
this.switchTabWithQuery('/pages/furniture_reception/furniture_reception', tab);
},
openCustomerTab(tab) {
const url = `/pages-subpackage/furniture_customer/furniture_customer?tab=${tab}`;
uni.navigateTo({ url });
},
switchTabWithQuery(basePath, tab) {
if (basePath === '/pages/furniture_reception/furniture_reception') {
uni.setStorageSync('workbench-reception-tab', tab);
}
uni.switchTab({
url: basePath,
fail: () => {
const fallbackUrl = `${basePath}?tab=${tab}`;
uni.navigateTo({ url: fallbackUrl });
},
});
},
},
};
</script>
<style scoped>
.scenario-wrapper {
position: absolute;
left: 0;
right: 0;
}
.content-scroll {
height: 100%;
}
.category-section {
margin: 20rpx 30rpx;
background: #ffffff;
border-radius: 16rpx;
overflow: hidden;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
}
.category-section:first-child {
margin-top: 0;
}
.category-section:last-child {
margin-bottom: 0;
}
.category-header {
display: flex;
align-items: center;
padding: 30rpx;
background: #ffffff;
border-bottom: 1rpx solid #f0f0f0;
}
.category-icon {
font-size: 32rpx;
margin-right: 20rpx;
}
.category-title {
font-size: 32rpx;
font-weight: 500;
color: #333;
}
.function-grid {
display: flex;
flex-wrap: wrap;
padding: 10rpx;
}
/* 与 ai_analysis 页面保持一致的两列卡片风格 */
.two-column .function-item {
flex: 1;
background: #ffffff;
border-radius: 12rpx;
padding: 24rpx 16rpx;
margin: 0 5rpx;
text-align: center;
box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.04);
transition: all 0.3s ease;
border: 1rpx solid #f0f0f0;
}
.function-item {
min-width: 42%;
}
.function-item:active {
transform: scale(0.95);
box-shadow: 0 1rpx 2rpx rgba(0, 0, 0, 0.1);
}
.function-icon {
font-size: 48rpx;
margin-bottom: 12rpx;
}
.function-name {
display: block;
font-size: 28rpx;
font-weight: 500;
color: #333;
margin-bottom: 8rpx;
}
.function-desc {
display: block;
font-size: 24rpx;
color: #666;
line-height: 1.4;
}
</style>

View File

@@ -14,69 +14,12 @@
/>
<view class="content">
<scroll-view class="content-scroll" scroll-y="true" :style="{ top: contentTop, bottom: contentBottom }">
<view class="category-section">
<view class="category-header">
<text class="category-icon">🧭</text>
<text class="category-title">快捷入口</text>
</view>
<view class="function-grid">
<view class="function-item" @click="goTo('/pages/furniture_reception/furniture_reception')">
<view class="function-icon">🤝</view>
<text class="function-name">接待</text>
<text class="function-desc">快速进入接待流程</text>
</view>
<view class="function-item" @click="goTo('/pages-subpackage/furniture_customer/furniture_customer')">
<view class="function-icon">👥</view>
<text class="function-name">客户</text>
<text class="function-desc">查看与管理客户信息</text>
</view>
</view>
</view>
<view class="category-section">
<view class="category-header">
<text class="category-icon">🏷</text>
<text class="category-title">接待页面标签</text>
</view>
<view class="function-grid">
<view class="function-item" @click="openReceptionTab('status')">
<view class="function-icon">📌</view>
<text class="function-name">服务状态</text>
<text class="function-desc">进入接待页并切到服务状态</text>
</view>
<view class="function-item" @click="openReceptionTab('reception')">
<view class="function-icon">🛎</view>
<text class="function-name">开始接待</text>
<text class="function-desc">进入接待页并切到开始接待</text>
</view>
<view class="function-item" @click="openReceptionTab('tag')">
<view class="function-icon">🗂</view>
<text class="function-name">标签管理</text>
<text class="function-desc">进入接待页并切到标签管理</text>
</view>
</view>
</view>
<view class="category-section">
<view class="category-header">
<text class="category-icon">👤</text>
<text class="category-title">客户页面标签</text>
</view>
<view class="function-grid">
<view class="function-item" @click="openCustomerTab('service')">
<view class="function-icon">📝</view>
<text class="function-name">服务记录</text>
<text class="function-desc">进入客户页并切到服务记录</text>
</view>
<view class="function-item" @click="openCustomerTab('customer')">
<view class="function-icon">👥</view>
<text class="function-name">客户</text>
<text class="function-desc">进入客户页并切到客户列表</text>
</view>
</view>
</view>
</scroll-view>
<sales-scenario-new
v-if="isSalesScenario"
:contentTop="contentTop"
:contentBottom="contentBottom"
/>
<view v-else class="redirecting-text">正在跳转到 AI 分析...</view>
</view>
</view>
</template>
@@ -85,6 +28,7 @@
// #ifdef APP
import statusBar from '@/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-status-bar';
// #endif
import SalesScenarioNew from './components/sales_scenario_new.vue';
function getSystemInfo() {
try {
@@ -104,6 +48,7 @@ export default {
// #ifdef APP
statusBar,
// #endif
SalesScenarioNew,
},
data() {
const systemInfo = getSystemInfo();
@@ -111,41 +56,21 @@ export default {
return {
contentTop: totalNavbarHeight + 'rpx',
contentBottom: '96rpx',
isSalesScenario: false,
};
},
onShow() {
this.refreshScenario();
},
methods: {
openReceptionTab(tab) {
this.switchTabWithQuery('/pages/furniture_reception/furniture_reception', tab);
},
openCustomerTab(tab) {
const url = `/pages-subpackage/furniture_customer/furniture_customer?tab=${tab}`;
uni.navigateTo({ url });
},
switchTabWithQuery(basePath, tab) {
if (basePath === '/pages/furniture_reception/furniture_reception') {
uni.setStorageSync('workbench-reception-tab', tab);
refreshScenario() {
const scenario = (uni.getStorageSync('backend-scenario') || '').toString().toLowerCase();
this.isSalesScenario = scenario === 'sales';
if (!this.isSalesScenario) {
uni.switchTab({
url: '/pages/ai_analysis/ai_analysis',
});
}
uni.switchTab({
url: basePath,
fail: () => {
const fallbackUrl = `${basePath}?tab=${tab}`;
uni.navigateTo({ url: fallbackUrl });
},
});
},
goTo(path) {
if (!path) return;
const tabBarPaths = [
'/pages/furniture_reception/furniture_reception',
'/pages/ai_analysis/ai_analysis',
'/pages/workbench/workbench',
'/pages/ucenter/ucenter',
];
if (tabBarPaths.includes(path)) {
uni.switchTab({ url: path });
return;
}
uni.navigateTo({ url: path });
},
},
};
@@ -166,84 +91,10 @@ page {
min-height: 100vh;
}
.content-scroll {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
}
.category-section {
margin: 20rpx 30rpx;
background: #ffffff;
border-radius: 16rpx;
overflow: hidden;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
}
.category-section:first-child {
margin-top: 0;
}
.category-header {
display: flex;
align-items: center;
padding: 30rpx;
background: #ffffff;
border-bottom: 1rpx solid #f0f0f0;
}
.category-icon {
font-size: 32rpx;
margin-right: 20rpx;
}
.category-title {
font-size: 32rpx;
font-weight: 500;
color: #333;
}
.function-grid {
display: flex;
flex-wrap: wrap;
padding: 10rpx;
}
.function-item {
flex: 1;
min-width: 42%;
background: #ffffff;
border-radius: 12rpx;
padding: 24rpx 16rpx;
margin: 0 5rpx 10rpx;
text-align: center;
box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.04);
border: 1rpx solid #f0f0f0;
}
.function-item:active {
transform: scale(0.98);
}
.function-icon {
font-size: 48rpx;
margin-bottom: 12rpx;
}
.function-name {
display: block;
.redirecting-text {
padding: 40rpx 30rpx;
color: #999;
font-size: 28rpx;
font-weight: 500;
color: #333;
margin-bottom: 8rpx;
}
.function-desc {
display: block;
font-size: 24rpx;
color: #666;
line-height: 1.4;
text-align: center;
}
</style>