fastbee/yack-mini/miniprogram/pages/device/detail/detail.wxss
2026-09-27 14:46:05 +08:00

377 lines
6.7 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* 设备详情页:上部信息区(可滚动) + 底部固定收发控制台 */
.page {
display: flex;
flex-direction: column;
height: 100vh;
}
/* ===== 上半屏:信息与配置 ===== */
.body-scroll {
flex: 1;
min-height: 0; /* flex 子项允许收缩,滚动由 scroll-view 内部接管 */
padding: 20rpx 20rpx 0;
box-sizing: border-box;
}
.device-info {
margin-bottom: 16rpx;
}
.info-row {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
padding: 12rpx 0;
border-bottom: 1rpx solid #f5f5f5;
}
.info-row:last-child {
border-bottom: none;
}
.info-label {
font-size: 26rpx;
color: #666;
}
.info-value {
font-size: 26rpx;
color: #333;
}
/* 测点与模式 */
.measure-card {
margin-bottom: 16rpx;
}
.measure-item {
display: flex;
align-items: center;
padding: 14rpx 0;
border-bottom: 1rpx solid #f5f5f5;
}
.measure-label {
width: 150rpx;
font-size: 26rpx;
color: #666;
flex-shrink: 0;
}
.measure-input {
flex: 1;
font-size: 26rpx;
color: #333;
}
.measure-input.invalid {
color: #ff4d4f;
border-color: #ff4d4f;
}
.mode-group {
display: flex;
align-items: center;
gap: 30rpx;
}
.mode-option {
display: flex;
align-items: center;
font-size: 26rpx;
color: #333;
margin-right: 30rpx;
}
.mode-option radio {
transform: scale(0.8);
}
.measure-hint {
padding-top: 12rpx;
font-size: 22rpx;
color: #999;
}
.measure-hint.error {
color: #ff4d4f;
}
/* ===== 底部:固定收发区 ===== */
.console {
flex-shrink: 0;
height: 58vh;
display: flex;
flex-direction: column;
background: #fff;
border-top: 1rpx solid #e8e8e8;
padding: 16rpx 20rpx;
padding-bottom: calc(16rpx + env(safe-area-inset-bottom));
box-sizing: border-box;
}
.notice-text {
font-size: 22rpx;
color: #ff4d4f;
padding-bottom: 8rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.console-header {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: 5rpx 0;
}
.console-title {
flex-shrink: 0;
font-size: 28rpx;
font-weight: 600;
color: #333;
}
/* 接收行工具区:清空 / 滚动 / Hex / 上传离线 四项同排,
间距收到 16rpx 且整体不收缩 → 4 项在 750rpx 内排得下且末位不被挤出屏幕 */
.console-tools {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-end;
gap: 16rpx;
flex-shrink: 0;
}
.btn-clear-mini {
flex-shrink: 0;
white-space: nowrap;
height: 52rpx;
line-height: 52rpx;
padding: 0 16rpx;
margin: 0;
font-size: 22rpx;
color: #fff;
background: #07c160;
border-radius: 8rpx;
border: none;
}
.btn-clear-mini::after {
border: none;
}
/* 离线补传(接收行末位):与「清空」同高 52rpx,同排不参差 */
.btn-flush {
flex-shrink: 0;
white-space: nowrap;
display: flex;
align-items: center;
justify-content: center;
height: 52rpx;
line-height: 1;
padding: 0 16rpx;
margin: 0;
font-size: 22rpx;
color: #fff;
background-color: #722ed1;
border-radius: 8rpx;
border: none;
}
.btn-flush::after {
border: none;
}
/* ⚠️ 基础库对 button 带一条高优先级默认样式,普通类名压不住,必须提权:
* wx-button:not([size=mini]) { margin-left:auto; margin-right:auto; width:184px } ← 特性 (0,1,1)
* → .btn-xxx{width:...}(0,1,0) 完全无效:三个按钮都被强制成 184px,
* 接收行被撑爆,上传离线被挤出屏幕右侧(实测右边界超出容器 178px)。
* 禁用态同理:wx-button[disabled]:not([type])(0,2,1) 压掉 .btn-x.is-disabled(0,2,0)。
* 解法:用「父容器 + 类名」(0,2,0) 覆盖 width/margin,禁用态用 (0,3,0)。
* 不要用 size="mini" 绕:那会引入 wx-button[size=mini] 的 font-size/line-height/padding(0,1,1)。
*
* 下面两条与上面 .btn-xxx 里的 width/margin 取值相同,**只为补权重**,
* 不是冗余也勿删(删了按钮立刻回到 184px)。
*/
.console-tools .btn-clear-mini,
.console-tools .btn-flush,
.send-row .btn-send {
margin: 0; /* 压掉基础库的 margin-left/right: auto */
}
.console-tools .btn-clear-mini,
.console-tools .btn-flush {
width: auto; /* 压掉基础库强制的 184px,回到内容宽度 */
}
.console-tools .btn-flush.is-disabled {
background-color: #d3adf7;
color: #fff;
}
.chk-item {
flex-shrink: 0;
display: flex;
flex-direction: row;
align-items: center;
font-size: 24rpx;
color: #333;
}
.chk-box {
transform: scale(0.8);
}
/* 接收日志:固定高度内部滚动,最新在后 */
.log-wrap {
position: relative;
flex: 1;
min-height: 0;
}
.log-scroll {
height: 100%;
background: #f5f5f5;
border-radius: 8rpx;
padding: 12rpx 16rpx;
box-sizing: border-box;
}
.log-line {
display: flex;
flex-direction: row;
align-items: flex-start;
padding: 6rpx 0;
}
.log-text {
flex: 1;
font-size: 24rpx;
line-height: 1.5;
color: #333;
font-family: Menlo, Consolas, monospace;
word-break: break-all;
}
.log-flag {
flex-shrink: 0;
margin-left: 12rpx;
font-size: 20rpx;
line-height: 1.7;
}
.log-flag.uploaded {
color: #52c41a;
}
.log-flag.cached {
color: #999;
}
.log-flag.confirmed {
color: #fa8c16;
}
.log-flag.pending {
color: #bbb;
}
.log-flag.confirm-btn {
color: #1890ff;
font-weight: 600;
padding: 0 12rpx;
border: 1rpx solid #1890ff;
border-radius: 6rpx;
}
.log-empty {
padding: 40rpx 0;
text-align: center;
font-size: 26rpx;
color: #999;
}
/* 手动上翻回看时的回底部浮标 */
.follow-btn {
position: absolute;
right: 20rpx;
bottom: 16rpx;
padding: 8rpx 20rpx;
background: rgba(0, 0, 0, 0.55);
color: #fff;
font-size: 22rpx;
border-radius: 28rpx;
}
/* 统计行 */
.console-stats {
display: flex;
flex-direction: row;
gap: 24rpx;
padding: 10rpx 4rpx;
}
.stat-chip {
font-size: 22rpx;
color: #888;
}
/* 发送区 */
.send-header {
padding-top: 10rpx;
}
.send-row {
display: flex;
flex-direction: row;
align-items: center;
gap: 16rpx;
}
.send-input {
flex: 1;
height: 72rpx;
background: #f5f5f5;
border-radius: 8rpx;
padding: 0 20rpx;
font-size: 26rpx;
font-family: Menlo, Consolas, monospace;
}
.send-placeholder {
color: #bbb;
}
.btn-send {
flex-shrink: 0;
width: 110rpx;
height: 72rpx;
line-height: 72rpx;
padding: 0;
margin: 0;
font-size: 28rpx;
color: #fff;
background: #07c160;
border-radius: 8rpx;
border: none;
}
.btn-send::after {
border: none;
}
/* 发送按钮宽度同样按 (0,2,0) 覆盖,否则被基础库的 184px 顶掉(见接收行上方说明) */
.send-row .btn-send {
width: 110rpx;
}
.send-row .btn-send.is-disabled {
background: #a8dcbf;
color: #fff;
}