产品化: 统一title

This commit is contained in:
zhonghua1
2025-12-27 14:40:42 +08:00
parent 46e793d4da
commit f93affb4a4
9 changed files with 694 additions and 289 deletions

View File

@@ -1,7 +1,31 @@
<template>
<view>
<view class="list-header">
<text class="total">{{ list.length }}</text>
<view class="customer-list-container">
<view class="service-status-toolbar">
<text class="toolbar-total">{{ list.length }}</text>
<input
class="toolbar-input"
v-model="salesName"
placeholder="所属销售姓名"
placeholder-style="color: #b0b0b0"
confirm-type="search"
@confirm="handleRefresh"
@input="onInputChange"
/>
<input
class="toolbar-input"
v-model="customerName"
placeholder="客户姓名"
placeholder-style="color: #b0b0b0"
confirm-type="search"
@confirm="handleRefresh"
@input="onInputChange"
/>
<view class="toolbar-actions">
<view class="toolbar-btn toolbar-btn--refresh" @click="handleRefresh">
<uni-icons type="refresh" size="18" color="#2A68FF"></uni-icons>
<text>刷新</text>
</view>
</view>
</view>
<scroll-view class="customer-list" scroll-y>
<view
@@ -44,33 +68,119 @@
type: Array,
default: () => []
}
},
data() {
return {
salesName: '',
customerName: ''
}
},
methods: {
onInputChange() {
// 输入框变化时,可以在这里添加实时搜索逻辑(如果需要)
},
handleRefresh() {
// 触发刷新事件,并传递查询参数
this.$emit('filterClick', {
salesName: this.salesName.trim(),
customerName: this.customerName.trim()
});
}
}
}
</script>
<style scoped>
.list-header {
.customer-list-container {
/* 使用绝对定位从tab页底部开始到底部导航栏结束 */
position: absolute;
top: 160rpx; /* 导航栏(88rpx) + tab页(72rpx) = 160rpx */
left: 0;
right: 0;
bottom: 96rpx; /* 底部导航栏高度 */
display: flex;
justify-content: space-between;
align-items: center;
padding: 24rpx 16rpx;
background-color: #FFFFFF;
border-bottom: 1px solid #F0F0F0;
box-sizing: border-box;
}
.total {
font-size: 28rpx;
color: #666;
}
.customer-list {
height: calc(100vh - 300rpx);
flex-direction: column;
background-color: #F5F5F5;
padding: 24rpx 16rpx;
box-sizing: border-box;
}
.service-status-toolbar {
display: flex;
flex-wrap: nowrap;
align-items: center;
gap: 8rpx; /* 增加间距,避免元素被挤压 */
padding: 12rpx 8rpx; /* 增加内边距,给搜索框更多空间 */
margin-bottom: 24rpx; /* 与列表项间距保持一致24rpx */
background-color: #F8F8FA;
border-radius: 8rpx;
border: 1px solid #EFEFF2;
overflow-x: auto;
min-height: 64rpx; /* 设置最小高度,确保搜索区域不被挤压 */
box-sizing: border-box;
flex-shrink: 0; /* 防止被压缩 */
}
.toolbar-total {
font-size: 24rpx;
color: #666;
white-space: nowrap;
flex-shrink: 0;
margin-right: 8rpx; /* 增加右边距,与搜索框保持距离 */
line-height: 1.2;
padding: 0 4rpx; /* 增加左右内边距 */
}
.toolbar-input {
flex: 1;
min-width: 120rpx; /* 增加最小宽度,避免被挤压变形 */
max-width: 200rpx; /* 设置最大宽度,保持合理比例 */
height: 56rpx; /* 稍微增加高度,提升可用性 */
line-height: 56rpx;
background-color: #F5F6FA;
border-radius: 8rpx;
padding: 0 12rpx; /* 增加左右内边距 */
font-size: 24rpx;
border: 1px solid transparent;
box-sizing: border-box;
flex-shrink: 1; /* 允许适当收缩,但保持最小宽度 */
}
.toolbar-actions {
display: flex;
align-items: center;
margin-left: auto;
flex-shrink: 0;
gap: 8rpx; /* 增加按钮之间的间距 */
}
.toolbar-btn {
padding: 0 12rpx; /* 增加左右内边距 */
height: 56rpx; /* 与输入框高度保持一致 */
min-width: 56rpx;
color: #2A68FF;
display: flex;
align-items: center;
justify-content: center;
gap: 4rpx; /* 增加图标和文字之间的间距 */
font-size: 24rpx;
font-weight: 400;
line-height: 1;
box-sizing: border-box;
}
.toolbar-btn text {
color: #2A68FF;
}
.customer-list {
/* 使用flex填充剩余空间 */
flex: 1;
background-color: transparent;
box-sizing: border-box;
overflow-y: auto;
}
.customer-card {
width: 100%;
box-sizing: border-box;

View File

@@ -1,22 +1,30 @@
<template>
<view>
<view class="list-header">
<text class="total">{{ total || list.length }}</text>
<view class="filter-inputs">
<input
class="filter-input"
v-model="salesName"
placeholder="所属销售姓名"
@input="onInputChange" />
<input
class="filter-input"
v-model="customerName"
placeholder="客户姓名"
@input="onInputChange" />
</view>
<view class="refresh-btn" @click="handleRefresh">
<uni-icons type="reload" size="16" color="#007AFF"></uni-icons>
<text>刷新</text>
<view class="service-list-container">
<view class="service-status-toolbar">
<text class="toolbar-total">{{ total || list.length }}</text>
<input
class="toolbar-input"
v-model="salesName"
placeholder="所属销售姓名"
placeholder-style="color: #b0b0b0"
confirm-type="search"
@confirm="handleRefresh"
@input="onInputChange"
/>
<input
class="toolbar-input"
v-model="customerName"
placeholder="客户姓名"
placeholder-style="color: #b0b0b0"
confirm-type="search"
@confirm="handleRefresh"
@input="onInputChange"
/>
<view class="toolbar-actions">
<view class="toolbar-btn toolbar-btn--refresh" @click="handleRefresh">
<uni-icons type="refresh" size="18" color="#2A68FF"></uni-icons>
<text>刷新</text>
</view>
</view>
</view>
<scroll-view class="service-list" scroll-y @scrolltolower="onReachBottom">
@@ -90,69 +98,104 @@
</script>
<style scoped>
.list-header {
.service-list-container {
/* 使用绝对定位从tab页底部开始到底部导航栏结束 */
position: absolute;
top: 160rpx; /* 导航栏(88rpx) + tab页(72rpx) = 160rpx */
left: 0;
right: 0;
bottom: 96rpx; /* 底部导航栏高度 */
display: flex;
justify-content: space-between;
align-items: center;
padding: 24rpx 32rpx;
background-color: #FFFFFF;
border-bottom: 1px solid #F0F0F0;
gap: 16rpx;
flex-wrap: wrap;
}
.total {
font-size: 28rpx;
color: #666;
flex-shrink: 0;
}
.filter-inputs {
display: flex;
align-items: center;
flex: 1;
gap: 16rpx;
min-width: 0;
}
.filter-input {
flex: 1;
height: 64rpx;
padding: 0 24rpx;
flex-direction: column;
background-color: #F5F5F5;
border-radius: 8rpx;
font-size: 26rpx;
color: #333;
padding: 24rpx 16rpx;
box-sizing: border-box;
}
.filter-input::placeholder {
color: #999;
}
.refresh-btn {
.service-status-toolbar {
display: flex;
flex-wrap: nowrap;
align-items: center;
padding: 8rpx 16rpx;
background-color: #F5F5F5;
gap: 8rpx; /* 增加间距,避免元素被挤压 */
padding: 12rpx 8rpx; /* 增加内边距,给搜索框更多空间 */
margin-bottom: 24rpx; /* 与列表项间距保持一致24rpx */
background-color: #F8F8FA;
border-radius: 8rpx;
flex-shrink: 0;
border: 1px solid #EFEFF2;
overflow-x: auto;
min-height: 64rpx; /* 设置最小高度,确保搜索区域不被挤压 */
box-sizing: border-box;
flex-shrink: 0; /* 防止被压缩 */
}
.refresh-btn text {
.toolbar-total {
font-size: 24rpx;
color: #007AFF;
margin-left: 8rpx;
color: #666;
white-space: nowrap;
flex-shrink: 0;
margin-right: 8rpx; /* 增加右边距,与搜索框保持距离 */
line-height: 1.2;
padding: 0 4rpx; /* 增加左右内边距 */
}
.toolbar-input {
flex: 1;
min-width: 120rpx; /* 增加最小宽度,避免被挤压变形 */
max-width: 200rpx; /* 设置最大宽度,保持合理比例 */
height: 56rpx; /* 稍微增加高度,提升可用性 */
line-height: 56rpx;
background-color: #F5F6FA;
border-radius: 8rpx;
padding: 0 12rpx; /* 增加左右内边距 */
font-size: 24rpx;
border: 1px solid transparent;
box-sizing: border-box;
flex-shrink: 1; /* 允许适当收缩,但保持最小宽度 */
}
.toolbar-actions {
display: flex;
align-items: center;
margin-left: auto;
flex-shrink: 0;
gap: 8rpx; /* 增加按钮之间的间距 */
}
.toolbar-btn {
padding: 0 12rpx; /* 增加左右内边距 */
height: 56rpx; /* 与输入框高度保持一致 */
min-width: 56rpx;
color: #2A68FF;
display: flex;
align-items: center;
justify-content: center;
gap: 4rpx; /* 增加图标和文字之间的间距 */
font-size: 24rpx;
font-weight: 400;
line-height: 1;
box-sizing: border-box;
}
.toolbar-btn text {
color: #2A68FF;
}
.service-list {
height: calc(100vh - 420rpx);
background-color: #FFFFFF;
/* 使用flex填充剩余空间 */
flex: 1;
background-color: transparent;
box-sizing: border-box;
overflow-y: auto;
}
.service-item {
padding: 32rpx;
border-bottom: 1px solid #F0F0F0;
width: 100%;
box-sizing: border-box;
background-color: #FFFFFF;
border-radius: 16rpx;
padding: 32rpx;
margin-bottom: 24rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
}
.service-header {

View File

@@ -8,7 +8,7 @@
<uni-nav-bar
:fixed="true"
:statusBar="true"
title="AI销系统"
title="AI销系统"
leftIcon="left"
@clickLeft="goBack"
color="#333"

View File

@@ -8,7 +8,7 @@
<uni-nav-bar
:fixed="true"
:statusBar="true"
title="AI销系统"
title="AI销系统"
leftIcon="left"
@clickLeft="goBack"
color="#333"
@@ -45,7 +45,8 @@
<CustomerList
v-if="activeTab === 'customer'"
:list="customerList"
@itemClick="viewCustomerDetail" />
@itemClick="viewCustomerDetail"
@filterClick="refreshCustomerList" />
</view>
<!-- 客户档案弹窗 -->
@@ -566,6 +567,11 @@
// 重新加载数据,传递查询参数
this.loadServiceList(filterParams);
},
refreshCustomerList(filterParams = {}) {
// 客户列表刷新方法(可以根据需要实现搜索逻辑)
console.log('客户列表刷新', filterParams);
// TODO: 实现客户列表的搜索和刷新逻辑
},
// 服务记录列表到底部加载更多
onServiceListReachBottom() {
// 如果已经加载全部数据,则不再请求
@@ -1722,15 +1728,28 @@
}
.content {
padding-top: 88rpx; /* 导航栏高度 */
padding-top: 0; /* 移除padding-top因为tab页和列表组件都使用绝对定位 */
margin-top: 0;
position: relative;
min-height: 100vh; /* 确保content有足够高度 */
}
/* 标签页 */
/* 隐藏导航栏占位区域,避免产生空白 */
::v-deep .uni-navbar__placeholder {
display: none !important;
}
/* 标签页 - 使用绝对定位紧贴导航栏 */
.tabs {
display: flex;
background-color: #FFFFFF;
border-bottom: 1px solid #E0E0E0;
padding: 0 32rpx;
position: absolute;
top: 88rpx; /* 导航栏高度 */
left: 0;
right: 0;
z-index: 1;
}
.tab-item {