Commit a3e90c84 by Lin

feat(homeFrame): 增加客户侧边组件并优化布局

- 新增 CustomerSide 组件以展示客户信息
- 更新 HomeFrame 组件的结构和样式,提升用户体验
- 调整 CSS 样式以改善视觉效果和响应性
1 parent 543468bd
<template>
<view class="container-right">
<view class="customer-header">
<!-- 左 -->
<view class="header-left">
<image
class="header-left-icon"
:src="require('@/assets/images/common/icon-file-custom.png')"
mode="aspectFit"
/>
<view class="header-left-text">
客户档案
</view>
</view>
<!-- 右 -->
<view class="header-right">
<view class="header-right-icon">
<view class="sprite-icon icon-customer-add"></view>
</view>
<view class="header-right-text">
客户建档
</view>
</view>
</view>
<scroll-view class="customer-list" scroll-y show-scrollbar="false">
<view class="customer-count">
<view class="customer-count-left">
<image
class="customer-count-icon"
:src="require('@/assets/images/common/icon-customer-count.png')"
mode="aspectFit"
/>
<text class="customer-count-label">今日({{ todayDate }})已建档</text>
</view>
<view class="customer-count-right">
<text class="customer-count-num">{{ todayCustomerCount }}</text>
<text class="customer-count-unit">位客户</text>
</view>
</view>
<view
v-for="item in customerList"
:key="item.id"
class="customer-item"
@click="handleCustomerItemClick(item)"
>
<view class="customer-item-avatar">
<text class="customer-item-avatar-text">{{ item.surname }}</text>
</view>
<view class="customer-item-body">
<view class="customer-item-row customer-item-row--name">
<text class="customer-item-name">{{ item.name }}</text>
<view v-if="item.carModel" class="customer-item-car-tag">
<text class="customer-item-car-text">{{ item.carModel }}</text>
</view>
</view>
<view class="customer-item-row customer-item-row--meta">
<text class="customer-item-meta">{{ item.phone }}</text>
<view class="customer-item-divider"></view>
<text class="customer-item-meta">交付{{ item.deliveryDate }}</text>
<view class="customer-item-divider"></view>
<text class="customer-item-meta">到店{{ item.visitDate }}</text>
</view>
<view class="customer-item-row customer-item-row--group">
<text class="customer-item-group">客户群:{{ item.groupName }}</text>
</view>
</view>
<view class="customer-item-side">
<view
v-if="item.status"
:class="['customer-item-status', `customer-item-status--${item.statusType || 'warning'}`]"
>
<text class="customer-item-status-text">{{ item.status }}</text>
</view>
<view class="customer-item-arrow">
<view class="sprite-icon icon-arrow-right"></view>
</view>
</view>
</view>
</scroll-view>
</view>
</template>
<script>
const MOCK_CUSTOMER_LIST = [
{
id: 1,
surname: '张',
name: '张**',
carModel: '奥迪 A6L',
phone: '136****6789',
deliveryDate: '06-20',
visitDate: '05-12',
groupName: '张先生2827-客户大定精品服务群吉利古拉',
status: '待跟进',
statusType: 'warning'
},
{
id: 2,
surname: '李',
name: '李**',
carModel: '宝马 5系',
phone: '138****1234',
deliveryDate: '06-18',
visitDate: '05-10',
groupName: '李先生1028-客户精品服务群',
status: '待跟进',
statusType: 'warning'
}
]
export default {
name: 'CustomerSide',
data() {
return {
customerList: MOCK_CUSTOMER_LIST,
todayCustomerCount: 8
}
},
computed: {
todayDate() {
const now = new Date()
const month = String(now.getMonth() + 1).padStart(2, '0')
const day = String(now.getDate()).padStart(2, '0')
return `${month}-${day}`
}
},
methods: {
handleCustomerItemClick(item) {
console.log('点击客户卡片:', item)
}
}
}
</script>
<style lang="scss" scoped>
.container-right {
flex: 1;
min-width: 0;
height: 100%;
display: flex;
flex-direction: column;
background-color: #ffffff;
.customer-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: toRpx(8) 0 toRpx(28) 0;
border-bottom: 1px solid #F5F7FA;
.header-left {
display: flex;
align-items: center;
justify-content: center;
gap: 4px;
.header-left-icon {
width: 24px;
height: 24px;
flex-shrink: 0;
}
.header-left-text {
font-size: 17px;
color: #292D33;
}
}
.header-right {
display: flex;
align-items: center;
justify-content: center;
gap: 4px;
width: 108px;
height: 32px;
border-radius: 8px;
border: 1px solid rgba(44, 102, 247, 0.10);
background-color: #F2F2F2;
.header-right-icon {
width: 16px;
height: 16px;
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
}
.header-right-text {
line-height: 1;
color: #2C66F7;
}
}
}
.customer-list {
flex: 1;
min-height: 0;
padding-top: 12px;
box-sizing: border-box;
}
.customer-count {
display: flex;
align-items: center;
justify-content: space-between;
padding: 8px 12px;
margin-bottom: 8px;
border-radius: 10px;
background: rgba(44, 102, 247, 0.05);
box-sizing: border-box;
.customer-count-left {
display: flex;
align-items: center;
gap: 2px;
min-width: 0;
}
.customer-count-icon {
width: 16px;
height: 16px;
flex-shrink: 0;
}
.customer-count-label {
font-size: 13px;
line-height: normal;
color: #6C6F75;
white-space: nowrap;
}
.customer-count-right {
display: flex;
align-items: flex-start;
gap: 2px;
flex-shrink: 0;
}
.customer-count-num,
.customer-count-unit {
font-size: 14px;
line-height: normal;
font-weight: 500;
color: #2C66F7;
white-space: nowrap;
}
}
.customer-item {
display: flex;
align-items: flex-start;
gap: 8px;
padding: 10px 12px;
margin-bottom: 8px;
background: #FFFFFF;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(44, 102, 247, 0.10);
box-sizing: border-box;
&:last-child {
margin-bottom: 0;
}
.customer-item-avatar {
width: 32px;
height: 32px;
border-radius: 50%;
background: rgba(44, 102, 247, 0.10);
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.customer-item-avatar-text {
font-size: 14px;
line-height: 20px;
font-weight: 600;
color: #2C66F7;
}
.customer-item-body {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
gap: 6px;
}
.customer-item-row {
display: flex;
align-items: center;
width: 100%;
min-width: 0;
&--name {
gap: 6px;
}
&--meta {
gap: 8px;
align-items: flex-start;
}
&--group {
align-items: flex-start;
}
}
.customer-item-name {
font-size: 16px;
line-height: 22px;
font-weight: 500;
color: #1A1A2E;
flex-shrink: 0;
}
.customer-item-car-tag {
padding: 3px 8px;
border: 1px solid #DCE1E6;
border-radius: 4px;
flex-shrink: 0;
}
.customer-item-car-text {
font-size: 13px;
line-height: 18px;
color: #6C6F75;
}
.customer-item-meta {
font-size: 13px;
line-height: 18px;
color: #999EA8;
flex-shrink: 0;
}
.customer-item-divider {
width: 1px;
height: 14px;
background: #999EA8;
flex-shrink: 0;
margin-top: 2px;
}
.customer-item-group {
flex: 1;
min-width: 0;
font-size: 13px;
line-height: 18px;
color: #999EA8;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.customer-item-side {
align-self: stretch;
display: flex;
flex-direction: column;
align-items: flex-end;
justify-content: space-between;
flex-shrink: 0;
}
.customer-item-status {
padding: 0 8px;
border-radius: 4px;
background: #FDECE9;
&--warning {
background: #FDECE9;
.customer-item-status-text {
color: #F24724;
}
}
}
.customer-item-status-text {
font-size: 12px;
line-height: 22px;
}
.customer-item-arrow {
width: 16px;
height: 16px;
display: flex;
align-items: center;
justify-content: center;
.icon-arrow-right {
width: 16px !important;
height: 16px !important;
}
}
}
}
</style>
...@@ -104,14 +104,15 @@ ...@@ -104,14 +104,15 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 限时产品活动 -->
<view v-show="homeContentTabIndex === 1" class="right-content-box flex right-content-box-scene1"> <view v-show="homeContentTabIndex === 1" class="right-content-box flex right-content-box-scene1">
<view class="tab-container"> <view class="tab-container">
<ActivityTime @entranceClick="entranceClick" /> <ActivityTime @entranceClick="entranceClick" />
<view class="container-right"> <view class="line"></view>
客户档案 <CustomerSide />
</view>
</view> </view>
</view> </view>
<!-- 挖掘潜客机会 -->
<view v-show="homeContentTabIndex === 2" class="right-content-box flex right-content-box-scene1"> <view v-show="homeContentTabIndex === 2" class="right-content-box flex right-content-box-scene1">
<view class="home-tab-panel__placeholder">挖掘潜客机会</view> <view class="home-tab-panel__placeholder">挖掘潜客机会</view>
</view> </view>
...@@ -263,6 +264,7 @@ import ActivityPopup from './components/ActivityPopup.vue' ...@@ -263,6 +264,7 @@ import ActivityPopup from './components/ActivityPopup.vue'
import ErrorOrderPopup from '@/components/ErrorOrderPopup.vue' import ErrorOrderPopup from '@/components/ErrorOrderPopup.vue'
import { FileUploadManager } from '@/utils/recordManager/index.js' import { FileUploadManager } from '@/utils/recordManager/index.js'
import ActivityTime from './components/ActivityTime/index.vue' import ActivityTime from './components/ActivityTime/index.vue'
import CustomerSide from './components/CustomerSide/index.vue'
export default { export default {
// mixins: [recorder, uploader, timeout, versionCheck, merge, interceptionMixin], // mixins: [recorder, uploader, timeout, versionCheck, merge, interceptionMixin],
mixins: [ recorder, versionCheck, interceptionMixin, merge], mixins: [ recorder, versionCheck, interceptionMixin, merge],
...@@ -296,7 +298,8 @@ export default { ...@@ -296,7 +298,8 @@ export default {
ActivityCenter, ActivityCenter,
ActivityPopup, ActivityPopup,
ErrorOrderPopup, ErrorOrderPopup,
ActivityTime ActivityTime,
CustomerSide
}, },
props: { props: {
id: [String, Number], id: [String, Number],
...@@ -1247,15 +1250,20 @@ export default { ...@@ -1247,15 +1250,20 @@ export default {
.tab-container { .tab-container {
width: 100%; width: 100%;
height: 100%; height: 100%;
background-color: aqua;
display: flex; display: flex;
align-items: center; align-items: stretch;
justify-content: space-between; }
.line {
width: 1px;
flex-shrink: 0;
margin: 0 20px;
background-color: #F5F7FA;
} }
.container-left { .container-left {
width: toRpx(1138); width: toRpx(1138);
height: 100%; height: 100%;
background-color: #ebf7a6; // background-color: #ebf7a6;
.type-box { .type-box {
height: 62px; height: 62px;
...@@ -1296,11 +1304,6 @@ export default { ...@@ -1296,11 +1304,6 @@ export default {
} }
} }
} }
.container-right {
width: calc(100% - #{toRpx(1138)});
height: 100%;
background-color: #f7dda6;
}
} }
.app-content-box { .app-content-box {
width: 100%; width: 100%;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!