适配微信小程序
This commit is contained in:
@@ -4,24 +4,24 @@
|
||||
<view class="category-section two-column">
|
||||
<view class="category-header">
|
||||
<text class="category-icon">🏷️</text>
|
||||
<text class="category-title">接待页面标签</text>
|
||||
<text class="category-title">接待</text>
|
||||
</view>
|
||||
<view class="function-grid">
|
||||
<view class="function-item" @click="openReceptionTab('reception')">
|
||||
<view class="function-icon">🛎️</view>
|
||||
<text class="function-name">开始接待</text>
|
||||
<text class="function-desc">进入接待页并切到开始接待</text>
|
||||
<text class="function-desc"></text>
|
||||
</view>
|
||||
<view class="function-item" @click="openReceptionTab('status')">
|
||||
<view class="function-icon">📌</view>
|
||||
<text class="function-name">服务中</text>
|
||||
<text class="function-desc">进入接待页并切到服务中</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>
|
||||
<text class="function-desc"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -29,18 +29,18 @@
|
||||
<view class="category-section two-column">
|
||||
<view class="category-header">
|
||||
<text class="category-icon">👤</text>
|
||||
<text class="category-title">客户页面标签</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>
|
||||
<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>
|
||||
<text class="function-desc"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -62,32 +62,24 @@ export default {
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
/** 与「服务记录」一致:直跳分包页 + query,避免主包宿主页在微信上的 ref/占位问题 */
|
||||
openReceptionTab(tab) {
|
||||
this.switchTabWithQuery('/pages/furniture_reception/furniture_reception', tab);
|
||||
const allowed = ['status', 'reception', 'tag'];
|
||||
if (!allowed.includes(tab)) {
|
||||
return;
|
||||
}
|
||||
const url = `/pages-subpackage/furniture_reception/furniture_reception_entry?tab=${encodeURIComponent(tab)}`;
|
||||
uni.navigateTo({
|
||||
url,
|
||||
fail: () => {
|
||||
uni.showToast({ title: '跳转接待页失败', icon: 'none' });
|
||||
},
|
||||
});
|
||||
},
|
||||
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.navigateTo({
|
||||
url: basePath,
|
||||
fail: () => {
|
||||
uni.showToast({ title: '跳转接待页失败', icon: 'none' });
|
||||
},
|
||||
});
|
||||
return;
|
||||
}
|
||||
uni.switchTab({
|
||||
url: basePath,
|
||||
fail: () => {
|
||||
const fallbackUrl = `${basePath}?tab=${tab}`;
|
||||
uni.navigateTo({ url: fallbackUrl });
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -19,7 +19,14 @@
|
||||
:contentTop="contentTop"
|
||||
:contentBottom="contentBottom"
|
||||
/>
|
||||
<view v-else class="redirecting-text">正在跳转到 AI 分析...</view>
|
||||
<ai-analysis-dashboard-body
|
||||
v-else-if="isSoftSalesScenario"
|
||||
:content-top="contentTop"
|
||||
:content-bottom="contentBottom"
|
||||
/>
|
||||
<view v-else class="redirecting-text">
|
||||
<text>当前未配置为销售或轻销场景(backend-scenario 不是 sales / soft_sales),工作台入口已隐藏。</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -29,6 +36,7 @@
|
||||
import statusBar from '@/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-status-bar';
|
||||
// #endif
|
||||
import SalesScenarioNew from './components/sales_scenario_new.vue';
|
||||
import AiAnalysisDashboardBody from '@/components/ai-analysis-dashboard-body.vue';
|
||||
|
||||
function getSystemInfo() {
|
||||
try {
|
||||
@@ -49,6 +57,7 @@ export default {
|
||||
statusBar,
|
||||
// #endif
|
||||
SalesScenarioNew,
|
||||
AiAnalysisDashboardBody,
|
||||
},
|
||||
data() {
|
||||
const systemInfo = getSystemInfo();
|
||||
@@ -57,6 +66,7 @@ export default {
|
||||
contentTop: totalNavbarHeight + 'rpx',
|
||||
contentBottom: '96rpx',
|
||||
isSalesScenario: false,
|
||||
isSoftSalesScenario: false,
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
@@ -64,13 +74,9 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
refreshScenario() {
|
||||
const scenario = (uni.getStorageSync('backend-scenario') || '').toString().toLowerCase();
|
||||
const scenario = (uni.getStorageSync('backend-scenario') || '').toString().trim().toLowerCase();
|
||||
this.isSalesScenario = scenario === 'sales';
|
||||
if (!this.isSalesScenario) {
|
||||
uni.switchTab({
|
||||
url: '/pages/ai_analysis/ai_analysis',
|
||||
});
|
||||
}
|
||||
this.isSoftSalesScenario = scenario === 'soft_sales';
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -86,9 +92,13 @@ page {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
/* 子组件(销售工作台 / AI 分析主体)使用 position:absolute + top/bottom,不占文档流;
|
||||
若此处无明确高度,父级会被压成 0,导致整块空白。 */
|
||||
.content {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
min-height: 100vh;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.redirecting-text {
|
||||
|
||||
Reference in New Issue
Block a user