修改了样式
This commit is contained in:
@@ -59,23 +59,33 @@ Page({
|
||||
const profile = item.profile || {}
|
||||
const health = item.health || {}
|
||||
|
||||
// 元信息行只收非空项(空值连同分隔线一起消失,不留「未填写」噪音),
|
||||
// 顺序:出生年月 → 联系电话 → 证件号(脱敏)
|
||||
const metaList = []
|
||||
if (profile.birth) {
|
||||
metaList.push(profile.birth)
|
||||
}
|
||||
if (profile.mobile) {
|
||||
metaList.push(profile.mobile)
|
||||
}
|
||||
if (profile.idnumber) {
|
||||
metaList.push(this.maskIdNumber(profile.idnumber))
|
||||
}
|
||||
|
||||
return {
|
||||
_id: item._id,
|
||||
// 首字牌取姓氏首字;无姓名时 wxml 退到 user 图标
|
||||
initial: (profile.name || '').slice(0, 1),
|
||||
name: profile.name || '未命名',
|
||||
sexText: profile.sex === 'male' ? '男' : (profile.sex === 'female' ? '女' : ''),
|
||||
birth: profile.birth || '',
|
||||
mobile: profile.mobile || '',
|
||||
idnumberText: this.maskIdNumber(profile.idnumber),
|
||||
metaList,
|
||||
remark: health.remark || ''
|
||||
}
|
||||
},
|
||||
|
||||
// 证件号脱敏:仅保留前 4 位与后 4 位
|
||||
// 证件号脱敏:仅保留前 4 位与后 4 位(只在有值时调用)
|
||||
maskIdNumber(idnumber) {
|
||||
const value = String(idnumber || '')
|
||||
if (!value) {
|
||||
return '未填写'
|
||||
}
|
||||
if (value.length <= 8) {
|
||||
return value
|
||||
}
|
||||
|
||||
@@ -8,44 +8,39 @@
|
||||
</view>
|
||||
|
||||
<!-- 就诊人列表:一卡一人(白面 + 2rpx 发丝边 + 28rpx 圆角 + 中性紧阴影),
|
||||
与预约记录卡同一配方,卡间留出 24rpx 纸面。
|
||||
卡面走「身份牌」结构,与订单详情页的就诊人卡同一套语言:
|
||||
首字牌定位「是谁」→ 姓名 + 性别签 → 一行竖线分隔的元信息(空值整项剔除)→ 备注省略行。
|
||||
每条主体可点进编辑,点击暗示由按下态承担(hover-class="profile-main-hover");
|
||||
删除动作另起一行、与主体隔一条发丝线,走 --muted -->
|
||||
删除收在卡片右上角、走 --muted 图标(catchtap 不冒泡,不触发整卡进编辑) -->
|
||||
<view class="profile-list" wx:if="{{profiles.length > 0}}">
|
||||
<view
|
||||
class="profile-card"
|
||||
wx:for="{{profiles}}"
|
||||
wx:key="_id"
|
||||
>
|
||||
<!-- 删除:右上角安静图标(catchtap 不冒泡,点它不会触发整卡进编辑);
|
||||
确认弹窗仍兜底防误触。不再单设动作行——孤零零一个删除撑不满一行,
|
||||
只会把身份牌拉高、显得头轻脚重 -->
|
||||
<view class="profile-delete" catchtap="onDelete" data-id="{{item._id}}">
|
||||
<t-icon name="delete" size="32rpx" color="#6F655C" />
|
||||
</view>
|
||||
<view class="profile-main" data-id="{{item._id}}" bindtap="onEdit" hover-class="profile-main-hover">
|
||||
<view class="profile-mark">
|
||||
<text wx:if="{{item.initial}}" class="profile-mark-text">{{item.initial}}</text>
|
||||
<t-icon wx:else name="user" size="44rpx" color="#9B4508" />
|
||||
</view>
|
||||
<view class="profile-info">
|
||||
<view class="profile-top">
|
||||
<text class="profile-name">{{item.name}}</text>
|
||||
<text class="sex-tag" wx:if="{{item.sexText}}">{{item.sexText}}</text>
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text class="info-label">出生年月</text>
|
||||
<text class="info-value">{{item.birth || '未填写'}}</text>
|
||||
<view class="meta-list" wx:if="{{item.metaList.length > 0}}">
|
||||
<block wx:for="{{item.metaList}}" wx:for-item="meta" wx:key="*this">
|
||||
<view class="meta-sep" wx:if="{{index > 0}}"></view>
|
||||
<text class="meta-item">{{meta}}</text>
|
||||
</block>
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text class="info-label">联系电话</text>
|
||||
<text class="info-value">{{item.mobile || '未填写'}}</text>
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text class="info-label">证件号</text>
|
||||
<text class="info-value">{{item.idnumberText}}</text>
|
||||
</view>
|
||||
<view class="info-row" wx:if="{{item.remark}}">
|
||||
<text class="info-label">健康备注</text>
|
||||
<text class="info-value">{{item.remark}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="profile-actions">
|
||||
<view class="profile-action" data-id="{{item._id}}" bindtap="onDelete">
|
||||
<t-icon name="delete" class="profile-action-icon" size="32rpx" />
|
||||
<text class="profile-action-text">删除</text>
|
||||
<text class="profile-remark" wx:if="{{item.remark}}">健康备注 {{item.remark}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -47,6 +47,7 @@ page {
|
||||
}
|
||||
|
||||
.profile-card {
|
||||
position: relative;
|
||||
padding: 28rpx 28rpx 24rpx;
|
||||
border-radius: 28rpx;
|
||||
background: var(--white);
|
||||
@@ -60,28 +61,70 @@ page {
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
|
||||
/* 主体整块可点进编辑。chevron 已去掉,点击暗示由按下态(.profile-main-hover)承担 */
|
||||
/* 主体整块可点进编辑。chevron 已去掉,点击暗示由按下态(.profile-main-hover)承担:
|
||||
transform: scale(0.99)——与记录卡(recordlist .record-card:active)同一套按压语言 */
|
||||
.profile-main {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
transition: transform 0.15s ease;
|
||||
}
|
||||
|
||||
.profile-main-hover {
|
||||
opacity: 0.7;
|
||||
transform: scale(0.99);
|
||||
}
|
||||
|
||||
/* 首字牌:浅橙衬底 + --brand-line 描边,与订单详情页就诊人身份牌同源
|
||||
(88rpx、24rpx 圆角、40rpx/700 暖橙姓氏首字;无姓名退到 user 图标) */
|
||||
.profile-mark {
|
||||
box-sizing: border-box;
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 88rpx;
|
||||
height: 88rpx;
|
||||
border: 2rpx solid var(--brand-line);
|
||||
border-radius: 24rpx;
|
||||
background: var(--brand-soft);
|
||||
}
|
||||
|
||||
.profile-mark-text {
|
||||
font-size: 40rpx;
|
||||
font-weight: 700;
|
||||
color: var(--brand-ink);
|
||||
letter-spacing: 1rpx;
|
||||
}
|
||||
|
||||
.profile-info {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
|
||||
/* 删除:右上角安静图标。56rpx 热区 + 12rpx 内缩,不压卡边;
|
||||
图标走 --muted 档(#6F655C 与令牌同步),按下整粒变淡作反馈 */
|
||||
.profile-delete {
|
||||
position: absolute;
|
||||
top: 8rpx;
|
||||
right: 8rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 56rpx;
|
||||
height: 56rpx;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
|
||||
.profile-delete:active {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.profile-top {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 12rpx;
|
||||
/* 右侧给删除图标留位,长姓名 + 性别签不被压住 */
|
||||
padding-right: 64rpx;
|
||||
}
|
||||
|
||||
/* 姓名是本页最重的字,走 --ink 700(标题档) */
|
||||
@@ -92,68 +135,52 @@ page {
|
||||
}
|
||||
|
||||
/* 性别签:浅橙衬底档(--brand-soft + 2rpx --brand-line + --brand-ink),
|
||||
圆角 10rpx 与记录页状态胶囊同一族(徽章/标签圆角规范值),
|
||||
字号 24rpx 是中文最小字号下限,不得再小 */
|
||||
.sex-tag {
|
||||
margin-left: 16rpx;
|
||||
padding: 4rpx 12rpx;
|
||||
border-radius: 6rpx;
|
||||
padding: 4rpx 14rpx;
|
||||
border-radius: 10rpx;
|
||||
background: var(--brand-soft);
|
||||
border: 2rpx solid var(--brand-line);
|
||||
font-size: 24rpx;
|
||||
color: var(--brand-ink);
|
||||
}
|
||||
|
||||
/* 标签走 --muted、值走 --ink-2:只表示文字层级,不给可点性上色 */
|
||||
.info-row {
|
||||
/* 元信息行:出生年月 | 电话 | 证件号,空值在 JS 里整项剔除(连同分隔线),
|
||||
竖线 2rpx×20rpx 取 --sep——与订单详情页 meta 行同一套写法 */
|
||||
.meta-list {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
align-items: center;
|
||||
margin-top: 12rpx;
|
||||
}
|
||||
|
||||
.info-row + .info-row {
|
||||
margin-top: 8rpx;
|
||||
.meta-item {
|
||||
font-size: 24rpx;
|
||||
color: var(--muted);
|
||||
letter-spacing: 1rpx;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.info-label {
|
||||
.meta-sep {
|
||||
flex-shrink: 0;
|
||||
width: 140rpx;
|
||||
font-size: 26rpx;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.info-value {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
font-size: 28rpx;
|
||||
color: var(--ink-2);
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
/* 卡片操作行:与主体隔一条发丝线,删除靠右排(与「邮寄地址」卡同一位置) */
|
||||
.profile-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
margin-top: 24rpx;
|
||||
padding-top: 20rpx;
|
||||
border-top: 2rpx solid var(--line);
|
||||
}
|
||||
|
||||
/* 文字只有 26rpx 高,用 padding 撑热区、等量负外边距抵消,不改变行高 */
|
||||
.profile-action {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 16rpx 0;
|
||||
margin: -16rpx 0;
|
||||
}
|
||||
|
||||
.profile-action-icon {
|
||||
margin-right: 10rpx;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.profile-action-text {
|
||||
font-size: 26rpx;
|
||||
width: 2rpx;
|
||||
height: 20rpx;
|
||||
margin: 0 14rpx;
|
||||
background: var(--sep);
|
||||
}
|
||||
|
||||
/* 健康备注:单行省略——列表只做提示,全文进编辑页看 */
|
||||
.profile-remark {
|
||||
display: block;
|
||||
margin-top: 8rpx;
|
||||
font-size: 24rpx;
|
||||
color: var(--muted);
|
||||
letter-spacing: 1rpx;
|
||||
line-height: 1.6;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* ===== 空态 ===== */
|
||||
|
||||
Reference in New Issue
Block a user