适配微信小程序
This commit is contained in:
@@ -477,8 +477,8 @@ import ServiceListFurniture from "./serviceListFurniture.vue";
|
||||
*/
|
||||
refreshPageData() {
|
||||
this.$nextTick(() => {
|
||||
const list = this.$refs.serviceListRef;
|
||||
if (this.activeTab === 'status') {
|
||||
const list = this.$refs.serviceListRef;
|
||||
if (list && typeof list.onServiceStatusRefresh === 'function') {
|
||||
list.onServiceStatusRefresh();
|
||||
}
|
||||
@@ -489,7 +489,9 @@ import ServiceListFurniture from "./serviceListFurniture.vue";
|
||||
},
|
||||
applyIncomingTab(tab) {
|
||||
const allowed = ['status', 'reception', 'tag'];
|
||||
if (!allowed.includes(tab)) return;
|
||||
if (!allowed.includes(tab)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 切tab并执行必要初始化(开始接待需要重置表单)
|
||||
if (this.activeTab !== tab) {
|
||||
@@ -500,6 +502,11 @@ import ServiceListFurniture from "./serviceListFurniture.vue";
|
||||
} else if (tab === 'tag') {
|
||||
this.tagViewMode = 'list';
|
||||
this.fetchTagList({ force: true });
|
||||
} else if (tab === 'status') {
|
||||
// 从工作台进入「服务中」时补拉列表(mounted 可能早于布局或与 refresh 竞态)
|
||||
this.$nextTick(() => {
|
||||
this.refreshPageData();
|
||||
});
|
||||
}
|
||||
},
|
||||
// 计算并更新导航栏和内容区域的位置
|
||||
@@ -568,11 +575,11 @@ import ServiceListFurniture from "./serviceListFurniture.vue";
|
||||
// 检查页面栈,如果当前是第一个页面,则不能返回
|
||||
const pages = getCurrentPages();
|
||||
if (pages.length <= 1) {
|
||||
// 作为 tabBar 页从其他入口跳转进来时,兜底切回 AI 分析页
|
||||
// 作为 tabBar 页从其他入口跳转进来时,兜底切回工作台
|
||||
uni.switchTab({
|
||||
url: '/pages/ai_analysis/ai_analysis',
|
||||
url: '/pages/workbench/workbench',
|
||||
fail: (err) => {
|
||||
console.error('[FurnitureReception][goBack] 切回AI分析页失败:', err);
|
||||
console.error('[FurnitureReception][goBack] 切回工作台失败:', err);
|
||||
}
|
||||
});
|
||||
return;
|
||||
@@ -1247,6 +1254,12 @@ import ServiceListFurniture from "./serviceListFurniture.vue";
|
||||
/* top值通过内联样式动态设置 */
|
||||
left: 0;
|
||||
right: 0;
|
||||
/* #ifdef MP-WEIXIN */
|
||||
/* 子组件内 scroll-view 需明确高度链;flex 可避免 MP 下 height:100% 失效导致空白 */
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 0;
|
||||
/* #endif */
|
||||
/* #ifndef MP-WEIXIN */
|
||||
bottom: 96rpx; /* H5环境:底部导航栏高度 */
|
||||
/* #endif */
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
<template>
|
||||
<furniture-reception-impl :incomingTab="incomingTab" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import FurnitureReceptionImpl from './furniture_reception-impl.vue';
|
||||
|
||||
export default {
|
||||
name: 'FurnitureReceptionEntry',
|
||||
components: {
|
||||
FurnitureReceptionImpl,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
incomingTab: '',
|
||||
};
|
||||
},
|
||||
onLoad(options = {}) {
|
||||
const allowed = ['status', 'reception', 'tag'];
|
||||
const raw = options.tab != null ? String(options.tab) : '';
|
||||
this.incomingTab = allowed.includes(raw) ? raw : 'reception';
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -79,6 +79,10 @@
|
||||
<text>服务中</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="service-title" v-if="item.title">
|
||||
<text class="service-title__text">{{ item.title }}</text>
|
||||
</view>
|
||||
|
||||
<view class="customer-info">
|
||||
<text class="customer-name">客户:{{ item.customerName || '未知客户' }}</text>
|
||||
@@ -540,6 +544,11 @@ export default {
|
||||
if (record.projectName) {
|
||||
tags.push({ text: `项目:${record.projectName}`, color: 'blue' });
|
||||
}
|
||||
|
||||
const title =
|
||||
firstNonEmptyString(record.recordingName) ||
|
||||
(firstNonEmptyString(record.customerName) ? `${String(record.customerName).trim()}的接待记录` : '') ||
|
||||
'';
|
||||
|
||||
return {
|
||||
id: record.id || '',
|
||||
@@ -549,6 +558,7 @@ export default {
|
||||
customerPhone: record.customerPhone || '',
|
||||
customerId: record.customerId || '',
|
||||
recordingName: record.recordingName || '',
|
||||
title,
|
||||
remarks: record.remarks || '',
|
||||
tags,
|
||||
durationText: formattedCreateTime ? `开始时间:${formattedCreateTime}` : '暂无开始时间'
|
||||
@@ -1012,11 +1022,16 @@ export default {
|
||||
<style scoped>
|
||||
/* 最外层容器 */
|
||||
.service-status-list {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background-color: #F5F5F5;
|
||||
padding: 24rpx 16rpx 0 16rpx;
|
||||
box-sizing: border-box;
|
||||
/* #ifndef MP-WEIXIN */
|
||||
height: 100%;
|
||||
/* #endif */
|
||||
/* #ifdef MP-WEIXIN */
|
||||
height: 100%;
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
.service-status-toolbar {
|
||||
@@ -1103,6 +1118,21 @@ export default {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.service-title {
|
||||
margin-top: 16rpx;
|
||||
margin-bottom: 8rpx;
|
||||
}
|
||||
|
||||
.service-title__text {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: #111827;
|
||||
display: block;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.staff-info {
|
||||
display: flex;
|
||||
|
||||
Reference in New Issue
Block a user