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

View File

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