适配微信小程序
This commit is contained in:
@@ -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