优化店务小程序我的页信息卡片

This commit is contained in:
2026-07-22 18:03:28 +08:00
parent b9989f8344
commit ab008a351f
3 changed files with 214 additions and 41 deletions
+34 -9
View File
@@ -1,16 +1,39 @@
<view class="page">
<view class="card profile-card">
<view class="profile-main">
<view wx:if="{{shopCoverImage || userInfo.displayAvatar}}" class="shop-logo image-avatar">
<image src="{{shopCoverImage || userInfo.displayAvatar}}" mode="aspectFill"></image>
<view class="profile-card-head">
<view wx:if="{{userInfo.displayAvatar || shopCoverImage}}" class="shop-logo image-avatar">
<image src="{{userInfo.displayAvatar || shopCoverImage}}" mode="aspectFill"></image>
</view>
<view wx:else class="shop-logo">店</view>
<view wx:else class="shop-logo">我</view>
<view class="profile-copy">
<text class="shop-name">{{shopName}}</text>
<text class="phone">{{phone}}</text>
<view class="profile-title-row">
<text class="profile-name">{{userInfo.nickname || shopName}}</text>
<text class="role-badge">{{roleText}}</text>
</view>
<view class="profile-meta-row">
<text class="profile-meta-label">登录账号</text>
<text class="profile-meta-value">{{userInfo.account || '未设置'}}</text>
</view>
<view class="profile-meta-row">
<text class="profile-meta-label">手机号</text>
<text class="profile-meta-value">{{userInfo.phone || userInfo.contactPhone || phone || '未绑定'}}</text>
</view>
</view>
<view class="shop-summary">
<text>当前所属店铺</text>
<view>{{shopName}}</view>
</view>
</view>
<view class="profile-summary-grid">
<view class="profile-summary-item">
<text>身份</text>
<view>{{roleText}}</view>
</view>
<view class="profile-summary-item">
<text>店铺</text>
<view>{{shopName}}</view>
</view>
</view>
<text class="role-badge">{{roleText}}</text>
</view>
<view class="section menu-list card">
@@ -35,8 +58,10 @@
<text class="profile-avatar-name">{{profileForm.nickname || userInfo.nickname || '个人头像'}}</text>
<text class="profile-avatar-desc">这里只修改个人资料头像</text>
</view>
<button class="avatar-btn" loading="{{avatarUploading}}" bindtap="chooseProfileAvatar">上传</button>
<button wx:if="{{profileForm.avatar}}" class="avatar-remove" bindtap="removeProfileAvatar">移除</button>
<view class="profile-avatar-actions">
<button class="avatar-btn" loading="{{avatarUploading}}" bindtap="chooseProfileAvatar">{{avatarUploading ? '上传中' : profileForm.avatar ? '更换头像' : '上传头像'}}</button>
<button wx:if="{{profileForm.avatar}}" class="avatar-remove" bindtap="removeProfileAvatar">移除</button>
</view>
</view>
<view class="profile-info-grid">
<view class="profile-info-item">
+172 -32
View File
@@ -1,19 +1,20 @@
.profile-card {
display: flex;
align-items: center;
justify-content: space-between;
gap: 20rpx;
flex-direction: column;
gap: 24rpx;
padding: 28rpx;
}
.profile-main {
.profile-card-head {
display: flex;
align-items: center;
align-items: stretch;
min-width: 0;
gap: 20rpx;
width: 100%;
gap: 18rpx;
}
.profile-copy {
flex: 1;
min-width: 0;
}
@@ -22,13 +23,14 @@
align-items: center;
justify-content: center;
flex-shrink: 0;
width: 96rpx;
height: 96rpx;
width: 90rpx;
height: 90rpx;
overflow: hidden;
border-radius: 24rpx;
background: #6f8f83;
color: #fff;
font-size: 40rpx;
border: 2rpx solid #dce8e1;
border-radius: 22rpx;
background: #edf5ef;
color: #638978;
font-size: 38rpx;
font-weight: 900;
}
@@ -37,36 +39,141 @@
height: 100%;
}
.shop-name,
.phone {
.profile-title-row,
.profile-meta-row,
.profile-name,
.profile-meta-label,
.profile-meta-value {
display: block;
min-width: 0;
}
.shop-name {
font-size: 34rpx;
font-weight: 800;
.profile-title-row {
display: flex;
align-items: center;
gap: 14rpx;
margin-top: 2rpx;
}
.profile-name {
color: #2d2621;
font-size: 32rpx;
font-weight: 900;
line-height: 1.2;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.phone {
.profile-meta-row {
display: flex;
align-items: center;
gap: 8rpx;
margin-top: 8rpx;
color: #91897f;
color: #6d6258;
font-size: 24rpx;
line-height: 1.2;
}
.profile-meta-label {
flex-shrink: 0;
color: #9a9086;
}
.profile-meta-value {
overflow: hidden;
color: #4e7165;
text-overflow: ellipsis;
white-space: nowrap;
}
.role-badge {
flex-shrink: 0;
padding: 8rpx 18rpx;
padding: 7rpx 16rpx;
border-radius: 999rpx;
background: #e5eee9;
color: #4e7165;
font-size: 23rpx;
font-size: 22rpx;
font-weight: 800;
line-height: 1.2;
}
.shop-summary {
display: flex;
flex-direction: column;
justify-content: center;
flex: 0 0 184rpx;
min-width: 0;
padding: 18rpx;
border-radius: 22rpx;
background: #f7efe7;
}
.shop-summary text,
.shop-summary view {
display: block;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.shop-summary text {
color: #94877b;
font-size: 19rpx;
line-height: 1.2;
}
.shop-summary view {
margin-top: 10rpx;
color: #2c2722;
font-size: 26rpx;
font-weight: 900;
line-height: 1.2;
}
.profile-summary-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 20rpx;
width: 100%;
}
.profile-summary-item {
display: flex;
align-items: center;
min-width: 0;
min-height: 56rpx;
gap: 14rpx;
padding: 0 20rpx;
border-radius: 18rpx;
background: #f7efe7;
}
.profile-summary-item text,
.profile-summary-item view {
display: block;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.profile-summary-item text {
flex-shrink: 0;
color: #94877b;
font-size: 21rpx;
line-height: 1.2;
}
.profile-summary-item view {
flex: 1;
color: #2c2722;
font-size: 25rpx;
font-weight: 900;
line-height: 1.2;
}
.menu-list {
overflow: hidden;
}
@@ -223,17 +330,24 @@
font-size: 22rpx;
}
.profile-avatar-actions {
display: flex;
flex-direction: column;
flex: 0 0 auto;
gap: 14rpx;
width: 150rpx;
}
.avatar-btn {
display: flex;
align-items: center;
justify-content: center;
flex: 0 0 auto;
min-width: 104rpx;
min-height: 58rpx;
padding: 0 18rpx;
width: 100%;
min-height: 60rpx;
padding: 0 14rpx;
border-radius: 16rpx;
background: #fffdf8;
color: #72553b;
background: #6f8f83;
color: #fffdf8;
font-size: 24rpx;
font-weight: 900;
}
@@ -242,17 +356,43 @@
display: flex;
align-items: center;
justify-content: center;
flex: 0 0 auto;
min-width: 76rpx;
min-height: 58rpx;
padding: 0 16rpx;
width: 100%;
min-height: 54rpx;
padding: 0 14rpx;
border-radius: 16rpx;
background: #f0e5dc;
background: #f4e8e0;
color: #9a5f43;
font-size: 24rpx;
font-weight: 900;
}
@media (max-width: 340px) {
.profile-card-head {
flex-wrap: wrap;
}
.profile-copy {
flex: 1 1 0;
}
.shop-summary {
flex: 1 1 100%;
}
.profile-summary-grid {
grid-template-columns: 1fr;
}
.profile-avatar-row {
flex-wrap: wrap;
}
.profile-avatar-actions {
flex-direction: row;
width: 100%;
}
}
.profile-info-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
+8
View File
@@ -233,6 +233,14 @@
- 以后避免:弹窗底部有两个以上操作按钮时,必须同时设计最小触控宽度和窄屏换行策略,不只依赖 rpx 等分列。
- 验证方式:运行 `git diff --check`;在窄屏模拟中确认两枚按钮不重叠,宽度不足时上下排列。
## 2026-07-22 小程序自动化截图通道超时应改用结构断言兜底
- 问题:店务小程序页面已能导航并渲染,但 `mp_screenshot` 返回 `SCREENSHOT_TIMEOUT`,截图文件未生成。
- 原因:自动化连接、WebSocket 和页面路由均正常,只有截图通道降级;继续重连或重复截图会浪费时间。
- 处理方式:先运行 `mp_healthCheck`,当 `needsRecovery=false` 且仅 `lastScreenshotOk=false` 时,不调用恢复连接,改用页面结构、文本、可见性、元素尺寸和页面数据断言验证页面。
- 以后避免:小程序 UI 验证不要把截图作为唯一通过条件;截图通道降级时用结构断言兜底,并在最终回复说明截图不可用原因。
- 验证方式:页面路由、关键选择器、关键文案和元素尺寸断言通过;截图文件不存在时不误报已截图。
## 2026-07-21 SQL 变更任务收尾必须提醒执行
- 问题:SQL 迁移文件存在但提交信息和最终回复没有突出执行提醒时,发布或目标库更新容易漏执行迁移。