fix:样式修复

This commit is contained in:
Jafeng 2026-01-30 10:45:36 +08:00
parent 6a16ce1bbb
commit 4e0bbbf3e3
2 changed files with 190 additions and 111 deletions

View File

@ -91,10 +91,9 @@
<view class="card2"> <view class="card2">
<view v-if="r.executeTeamName" class="trow"><text class="tlabel">转入团队:</text>{{ r.executeTeamName }}</view> <view v-if="r.executeTeamName" class="trow"><text class="tlabel">转入团队:</text>{{ r.executeTeamName }}</view>
<view v-if="r.eventTypeName" class="trow"><text class="tlabel">转入方式:</text>{{ r.eventTypeName }}</view> <view v-if="r.eventTypeName" class="trow"><text class="tlabel">转入方式:</text>{{ r.eventTypeName }}</view>
<view v-if="r.creatorUserId" class="trow"> <view v-if="r.creatorUserName" class="trow">
<text class="tlabel">操作人:</text> <text class="tlabel">操作人:</text>
<text v-if="r.creatorUserId === 'system'">系统自动建档</text> <text>{{ r.creatorUserName }}</text>
<text v-else>{{ r.creatorUserId }}</text>
</view> </view>
</view> </view>
</view> </view>
@ -271,6 +270,7 @@ function scrollToAnchor(key) {
const transferPopupRef = ref(null); const transferPopupRef = ref(null);
const transferRecords = ref([]); const transferRecords = ref([]);
const latestTransferRecord = computed(() => transferRecords.value[0]); const latestTransferRecord = computed(() => transferRecords.value[0]);
const userNameMap = ref({});
const CURRENT_TEAM_STORAGE_KEY = 'ykt_case_current_team'; const CURRENT_TEAM_STORAGE_KEY = 'ykt_case_current_team';
@ -281,18 +281,55 @@ function getCorpId() {
return String(d.corpId || a.corpId || team.corpId || '') || ''; return String(d.corpId || a.corpId || team.corpId || '') || '';
} }
async function loadTeamMembers() {
const corpId = getCorpId();
const team = uni.getStorageSync(CURRENT_TEAM_STORAGE_KEY) || {};
const teamId = team?.teamId ? String(team.teamId) : '';
if (!corpId || !teamId) return;
if (Object.keys(userNameMap.value || {}).length > 0) return;
try {
const res = await api('getTeamData', { corpId, teamId });
if (!res?.success) return;
const t = res?.data && typeof res.data === 'object' ? res.data : {};
const members = Array.isArray(t.memberList) ? t.memberList : [];
userNameMap.value = members.reduce((acc, m) => {
const uid = String(m?.userid || '');
if (!uid) return acc;
acc[uid] = String(m?.anotherName || m?.name || m?.userid || '') || uid;
return acc;
}, {});
} catch (e) {
console.error('获取团队成员失败', e);
}
}
function resolveUserName(userId) {
const id = String(userId || '');
if (!id) return '';
const map = userNameMap.value || {};
return String(map[id] || id) || id;
}
const ServiceType = { const ServiceType = {
remindFiling: '自主开拓', remindFiling: '自主开拓',
adminTransferTeams: '团队流转', adminTransferTeams: '团队流转',
adminRemoveTeams: '移出团队', adminRemoveTeams: '移出团队',
systemAutoDistribute: '系统分配', systemAutoDistribute: '系统分配',
bindWechatCustomer: '绑定企业微信', bindWechatCustomer: '绑定企业微信',
share: '共享',
transfer: '转移',
importCustomer: '导入客户',
addCustomer: '新增客户',
}; };
async function fetchTransferRecords() { async function fetchTransferRecords() {
const customerId = props.data?._id; const customerId = props.data?._id;
if (!customerId) return; if (!customerId) return;
//
await loadTeamMembers();
try { try {
const res = await api('customerTransferRecord', { customerId }); const res = await api('customerTransferRecord', { customerId });
if (res?.success && res.list) { if (res?.success && res.list) {
@ -302,6 +339,7 @@ async function fetchTransferRecords() {
record.createTime = dayjs(item.createTime).format('YYYY-MM-DD HH:mm:ss'); record.createTime = dayjs(item.createTime).format('YYYY-MM-DD HH:mm:ss');
record.executeTeamName = allTeams.find((team) => team.teamId === item.executeTeamId)?.name || item.executeTeamName; record.executeTeamName = allTeams.find((team) => team.teamId === item.executeTeamId)?.name || item.executeTeamName;
record.eventTypeName = ServiceType[item.eventType] || item.eventType; record.eventTypeName = ServiceType[item.eventType] || item.eventType;
record.creatorUserName = item.creatorUserId === 'system' ? '系统自动建档' : resolveUserName(item.creatorUserId);
if (item.transferToTeamIds && Array.isArray(item.transferToTeamIds)) { if (item.transferToTeamIds && Array.isArray(item.transferToTeamIds)) {
record.teamName = item.transferToTeamIds.map((teamId) => allTeams.find((team) => team.teamId === teamId)?.name).join('、'); record.teamName = item.transferToTeamIds.map((teamId) => allTeams.find((team) => team.teamId === teamId)?.name).join('、');
} }
@ -337,48 +375,48 @@ watch(() => props.data?._id, () => {
<style scoped> <style scoped>
.wrap { .wrap {
padding: 12px 0 96px; padding: 24rpx 0 192rpx;
} }
.card { .card {
background: #fff; background: #fff;
margin-top: 10px; margin-top: 20rpx;
} }
.section-title { .section-title {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: 12px 14px; padding: 24rpx 28rpx;
font-size: 15px; font-size: 30rpx;
font-weight: 600; font-weight: 600;
color: #333; color: #333;
border-bottom: 1px solid #f2f2f2; border-bottom: 2rpx solid #f2f2f2;
} }
.pen { .pen {
width: 18px; width: 36rpx;
height: 18px; height: 36rpx;
} }
.rows { .rows {
padding: 2px 14px; padding: 4rpx 28rpx;
} }
.row { .row {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 12px 0; padding: 24rpx 0;
border-bottom: 1px solid #f6f6f6; border-bottom: 2rpx solid #f6f6f6;
} }
.row:last-child { .row:last-child {
border-bottom: none; border-bottom: none;
} }
.label { .label {
width: 90px; width: 180rpx;
font-size: 14px; font-size: 28rpx;
color: #666; color: #666;
} }
.val { .val {
flex: 1; flex: 1;
text-align: right; text-align: right;
font-size: 14px; font-size: 28rpx;
color: #333; color: #333;
} }
.val.link { .val.link {
@ -386,13 +424,13 @@ watch(() => props.data?._id, () => {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
align-items: center; align-items: center;
gap: 6px; gap: 12rpx;
} }
.input, .input,
.picker { .picker {
flex: 1; flex: 1;
text-align: right; text-align: right;
font-size: 14px; font-size: 28rpx;
color: #333; color: #333;
} }
@ -401,18 +439,18 @@ watch(() => props.data?._id, () => {
left: 0; left: 0;
right: 0; right: 0;
background: #fff; background: #fff;
padding: 12px 14px; padding: 24rpx 28rpx;
display: flex; display: flex;
gap: 12px; gap: 24rpx;
box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06); box-shadow: 0 -8rpx 24rpx rgba(0, 0, 0, 0.06);
z-index: 30; z-index: 30;
} }
.btn { .btn {
flex: 1; flex: 1;
height: 44px; height: 88rpx;
line-height: 44px; line-height: 88rpx;
border-radius: 6px; border-radius: 12rpx;
font-size: 15px; font-size: 30rpx;
} }
.btn::after { .btn::after {
border: none; border: none;
@ -420,7 +458,7 @@ watch(() => props.data?._id, () => {
.btn.plain { .btn.plain {
background: #fff; background: #fff;
color: #4f6ef7; color: #4f6ef7;
border: 1px solid #4f6ef7; border: 2rpx solid #4f6ef7;
} }
.btn.primary { .btn.primary {
background: #4f6ef7; background: #4f6ef7;
@ -429,24 +467,24 @@ watch(() => props.data?._id, () => {
.popup { .popup {
background: #fff; background: #fff;
border-top-left-radius: 10px; border-top-left-radius: 20rpx;
border-top-right-radius: 10px; border-top-right-radius: 20rpx;
overflow: hidden; overflow: hidden;
} }
.popup-title { .popup-title {
position: relative; position: relative;
padding: 14px; padding: 28rpx;
border-bottom: 1px solid #f0f0f0; border-bottom: 2rpx solid #f0f0f0;
} }
.popup-title-text { .popup-title-text {
text-align: center; text-align: center;
font-size: 16px; font-size: 32rpx;
font-weight: 600; font-weight: 600;
color: #333; color: #333;
} }
.popup-close { .popup-close {
position: absolute; position: absolute;
right: 12px; right: 24rpx;
top: 0; top: 0;
height: 100%; height: 100%;
display: flex; display: flex;
@ -457,57 +495,63 @@ watch(() => props.data?._id, () => {
} }
.timeline { .timeline {
position: relative; position: relative;
padding: 14px 14px 18px; padding: 40rpx 28rpx 36rpx 28rpx;
} }
.line { .line {
position: absolute; position: absolute;
left: 22px; left: 48rpx;
top: 18px; top: 56rpx;
bottom: 18px; bottom: 36rpx;
width: 2px; width: 4rpx;
background: #4f6ef7; background: #4f6ef7;
} }
.item { .item {
position: relative; position: relative;
padding-left: 32px; padding-left: 80rpx;
margin-bottom: 14px; margin-bottom: 40rpx;
}
.item:last-child {
margin-bottom: 0;
} }
.dot { .dot {
position: absolute; position: absolute;
left: 16px; left: 6rpx;
top: 6px; top: 8rpx;
width: 10px; width: 24rpx;
height: 10px; height: 24rpx;
border-radius: 50%; border-radius: 50%;
background: #4f6ef7; background: #4f6ef7;
border: 4rpx solid #fff;
box-shadow: 0 0 0 4rpx #4f6ef7;
} }
.time { .time {
font-size: 12px; font-size: 24rpx;
color: #999; color: #999;
margin-bottom: 8px; margin-bottom: 16rpx;
} }
.card2 { .card2 {
border: 1px solid #f0f0f0; border: 2rpx solid #f0f0f0;
border-radius: 8px; border-radius: 16rpx;
padding: 10px; padding: 24rpx;
background: #fafafa;
} }
.trow { .trow {
font-size: 14px; font-size: 28rpx;
color: #333; color: #333;
line-height: 20px; line-height: 40rpx;
} }
.tlabel { .tlabel {
color: #666; color: #666;
margin-right: 6px; margin-right: 12rpx;
} }
.empty-state { .empty-state {
padding: 40px 20px; padding: 80rpx 40rpx;
text-align: center; text-align: center;
} }
.empty-text { .empty-text {
font-size: 14px; font-size: 28rpx;
color: #999; color: #999;
} }
</style> </style>

View File

@ -85,7 +85,7 @@
<view class="card-row-bottom"> <view class="card-row-bottom">
<template v-if="currentTabKey === 'new'"> <!-- New Patient Tab --> <template v-if="currentTabKey === 'new'"> <!-- New Patient Tab -->
<text class="record-text"> <text class="record-text">
{{ patient.createTime || '-' }} / {{ patient.creator || '-' }} {{ patient.createTime || '-' }} / {{ resolveCreatorName(patient) || '-' }}
</text> </text>
</template> </template>
<template v-else> <template v-else>
@ -99,7 +99,7 @@
</view> </view>
</view> </view>
<!-- Bottom padding for tabbar --> <!-- Bottom padding for tabbar -->
<view style="height: 100px;"></view> <!-- Increased padding --> <view style="height: 200rpx;"></view> <!-- Increased padding -->
</scroll-view> </scroll-view>
<!-- Sidebar Index --> <!-- Sidebar Index -->
@ -163,6 +163,9 @@ const tabs = computed(() => {
const isBatchMode = ref(false); const isBatchMode = ref(false);
const selectedItems = ref([]); // Stores patient phone or unique ID const selectedItems = ref([]); // Stores patient phone or unique ID
// Team Members Map
const userNameMap = ref({});
// //
const managedArchiveCountAllTeams = ref(0); // const managedArchiveCountAllTeams = ref(0); //
const verifyStatus = ref(''); // unverified | verifying | verified | failed const verifyStatus = ref(''); // unverified | verifying | verified | failed
@ -221,6 +224,35 @@ function getTeamId() {
return String(currentTeam.value?.teamId || '') || ''; return String(currentTeam.value?.teamId || '') || '';
} }
async function loadTeamMembers() {
const corpId = getCorpId();
const teamId = getTeamId();
if (!corpId || !teamId) return;
try {
const res = await api('getTeamData', { corpId, teamId });
if (!res?.success) return;
const t = res?.data && typeof res.data === 'object' ? res.data : {};
const members = Array.isArray(t.memberList) ? t.memberList : [];
// Update map
members.forEach(m => {
const uid = String(m?.userid || '');
if (uid) {
userNameMap.value[uid] = String(m?.anotherName || m?.name || m?.userid || '') || uid;
}
});
} catch (e) {
console.error('获取团队成员失败', e);
}
}
function resolveCreatorName(patient) {
const val = patient.creator;
if (!val) return '';
return userNameMap.value[val] || val;
}
function applyVerifyStatus(status, reason) { function applyVerifyStatus(status, reason) {
verifyStatus.value = status || ''; verifyStatus.value = status || '';
isVerified.value = verifyStatus.value === 'verified'; isVerified.value = verifyStatus.value === 'verified';
@ -570,6 +602,7 @@ const toggleTeamPopup = () => {
if (currentTeam.value) uni.setStorageSync(CURRENT_TEAM_STORAGE_KEY, currentTeam.value); if (currentTeam.value) uni.setStorageSync(CURRENT_TEAM_STORAGE_KEY, currentTeam.value);
currentTabKey.value = 'all'; currentTabKey.value = 'all';
loadGroups(); loadGroups();
loadTeamMembers();
reload(true); reload(true);
} }
}); });
@ -770,6 +803,7 @@ onLoad(async () => {
await loadTeams(); await loadTeams();
if (currentTeam.value) { if (currentTeam.value) {
await loadGroups(); await loadGroups();
loadTeamMembers();
await reload(true); await reload(true);
} }
await refreshVerifyStatus(); await refreshVerifyStatus();
@ -793,6 +827,7 @@ onShow(async () => {
} else { } else {
await loadGroups(); await loadGroups();
} }
loadTeamMembers();
await refreshVerifyStatus(); await refreshVerifyStatus();
}); });
@ -808,7 +843,7 @@ onShow(async () => {
// Padding for batch footer // Padding for batch footer
/* &.is-batch { /* &.is-batch {
padding-bottom: 50px; padding-bottom: 100rpx;
} */ } */
// We can't use &.is-batch because scoped style and root element is tricky depending on uni-app version/style // We can't use &.is-batch because scoped style and root element is tricky depending on uni-app version/style
// Instead we handle it in content-body or separate view // Instead we handle it in content-body or separate view
@ -818,30 +853,30 @@ onShow(async () => {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding: 10px 15px; padding: 20rpx 30rpx;
background-color: #fff; background-color: #fff;
border-bottom: 1px solid #f0f0f0; border-bottom: 2rpx solid #f0f0f0;
.team-selector { .team-selector {
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 32rpx; /* 16px */ font-size: 32rpx;
font-weight: bold; font-weight: bold;
color: #333; color: #333;
.team-name { .team-name {
margin-right: 5px; margin-right: 10rpx;
} }
.team-icon { .team-icon {
font-size: 32rpx; /* 16px */ font-size: 32rpx;
color: #333; color: #333;
} }
} }
.header-actions { .header-actions {
display: flex; display: flex;
gap: 15px; gap: 30rpx;
.action-item { .action-item {
display: flex; display: flex;
@ -850,9 +885,9 @@ onShow(async () => {
justify-content: center; justify-content: center;
.action-text { .action-text {
font-size: 20rpx; /* 10px */ font-size: 20rpx;
color: #333; color: #333;
margin-top: 2px; margin-top: 4rpx;
} }
} }
} }
@ -862,8 +897,8 @@ onShow(async () => {
display: flex; display: flex;
align-items: center; align-items: center;
background-color: #f5f7fa; background-color: #f5f7fa;
border-bottom: 1px solid #eee; border-bottom: 2rpx solid #eee;
padding-right: 15px; // Padding for the count padding-right: 30rpx; // Padding for the count
.tabs-scroll { .tabs-scroll {
flex: 1; flex: 1;
@ -872,15 +907,15 @@ onShow(async () => {
.tabs-container { .tabs-container {
display: flex; display: flex;
padding: 10px 15px; padding: 20rpx 30rpx;
.tab-item { .tab-item {
padding: 5px 15px; padding: 10rpx 30rpx;
margin-right: 10px; margin-right: 20rpx;
font-size: 28rpx; /* 14px */ font-size: 28rpx;
color: #666; color: #666;
background-color: #fff; background-color: #fff;
border-radius: 4px; border-radius: 8rpx;
flex-shrink: 0; flex-shrink: 0;
&.active { &.active {
@ -893,11 +928,11 @@ onShow(async () => {
} }
.total-count-inline { .total-count-inline {
font-size: 24rpx; /* 12px */ font-size: 24rpx;
color: #666; color: #666;
white-space: nowrap; white-space: nowrap;
flex-shrink: 0; flex-shrink: 0;
min-width: 50px; min-width: 100rpx;
text-align: right; text-align: right;
} }
} }
@ -916,22 +951,22 @@ onShow(async () => {
} }
.group-title { .group-title {
padding: 5px 15px; padding: 10rpx 30rpx;
font-size: 28rpx; /* 14px */ font-size: 28rpx;
color: #333; color: #333;
} }
.patient-card { .patient-card {
display: flex; display: flex;
background-color: #fff; background-color: #fff;
padding: 15px; padding: 30rpx;
margin-bottom: 1px; // Separator line margin-bottom: 2rpx; // Separator line
border-bottom: 1px solid #f0f0f0; border-bottom: 2rpx solid #f0f0f0;
.checkbox-area { .checkbox-area {
display: flex; display: flex;
align-items: center; align-items: center;
margin-right: 10px; margin-right: 20rpx;
} }
.card-content { .card-content {
@ -941,46 +976,46 @@ onShow(async () => {
.card-row-top { .card-row-top {
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 8px; margin-bottom: 16rpx;
flex-wrap: wrap; flex-wrap: wrap;
.patient-info { .patient-info {
display: flex; display: flex;
align-items: flex-end; align-items: flex-end;
margin-right: 10px; margin-right: 20rpx;
.patient-name { .patient-name {
font-size: 32rpx; /* 16px */ font-size: 32rpx;
font-weight: bold; font-weight: bold;
color: #333; color: #333;
margin-right: 8px; margin-right: 16rpx;
} }
.patient-meta { .patient-meta {
font-size: 24rpx; /* 12px */ font-size: 24rpx;
color: #999; color: #999;
margin-bottom: 2px; margin-bottom: 4rpx;
} }
} }
.patient-tags { .patient-tags {
display: flex; display: flex;
gap: 5px; gap: 10rpx;
.tag { .tag {
font-size: 20rpx; /* 10px */ font-size: 20rpx;
color: #5d8aff; color: #5d8aff;
border: 1px solid #5d8aff; border: 2rpx solid #5d8aff;
padding: 0 4px; padding: 0 8rpx;
border-radius: 8px; border-radius: 16rpx;
height: 16px; height: 32rpx;
line-height: 14px; line-height: 28rpx;
} }
} }
} }
.card-row-bottom { .card-row-bottom {
font-size: 28rpx; /* 14px */ font-size: 28rpx;
.record-text { .record-text {
color: #666; color: #666;
@ -1005,39 +1040,39 @@ onShow(async () => {
bottom: 0; bottom: 0;
left: 0; left: 0;
right: 0; right: 0;
height: 50px; height: 100rpx;
background-color: #fff; background-color: #fff;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: 0 15px; padding: 0 30rpx;
box-shadow: 0 -2px 10px rgba(0,0,0,0.05); box-shadow: 0 -4rpx 20rpx rgba(0,0,0,0.05);
z-index: 99; z-index: 99;
.left-action { .left-action {
display: flex; display: flex;
align-items: center; align-items: center;
.footer-text { .footer-text {
margin-left: 5px; margin-left: 10rpx;
font-size: 28rpx; /* 14px */ font-size: 28rpx;
color: #333; color: #333;
} }
} }
.right-actions { .right-actions {
display: flex; display: flex;
gap: 10px; gap: 20rpx;
.footer-btn { .footer-btn {
font-size: 28rpx; /* 14px */ font-size: 28rpx;
padding: 0 15px; padding: 0 30rpx;
height: 32px; height: 64rpx;
line-height: 32px; line-height: 64rpx;
margin: 0; margin: 0;
border-radius: 4px; border-radius: 8rpx;
&.plain { &.plain {
border: 1px solid #ddd; border: 2rpx solid #ddd;
background-color: #fff; background-color: #fff;
color: #666; color: #666;
} }
@ -1056,11 +1091,11 @@ onShow(async () => {
} }
.sidebar-index { .sidebar-index {
width: 20px; width: 40rpx;
position: absolute; position: absolute;
right: 0; right: 0;
top: 20px; top: 40rpx;
bottom: 20px; bottom: 40rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
@ -1069,10 +1104,10 @@ onShow(async () => {
z-index: 10; z-index: 10;
.index-item { .index-item {
font-size: 20rpx; /* 10px */ font-size: 20rpx;
color: #555; color: #555;
padding: 2px 0; padding: 4rpx 0;
width: 20px; width: 40rpx;
text-align: center; text-align: center;
font-weight: 500; font-weight: 500;
} }