小程序适配

feasure
lld 2026-02-22 22:41:43 +08:00
parent 9aa917022d
commit 551a21c7c2
1 changed files with 24 additions and 147 deletions

View File

@ -14,31 +14,33 @@
<tn-switch
v-model="currentMode"
:size="60"
@change="confirmSwitch"
/>
<text class="modal-text">自动</text>
</view>
</template>
</uni-section>
<uni-divider margin="10rpx 0"></uni-divider>
<!-- 把解析好的完整数据传给子组件 -->
<auto-page
v-if="currentMode === true"
value="0"
/>
<manual-page
ref="manualPage"
v-else-if="currentMode === false"
:liveData="liveData"
:show="show"
:status="status"
:dtu_remark="dtu_remark"
:selectedText="selectedText"
:value="value"
:agriId="agriId"
@publicMsg="publishMessage"
@getRemark="getRemarkByImei"
/>
<uni-divider margin="10rpx 0"></uni-divider>
<!-- 把解析好的完整数据传给子组件 -->
<auto-page
v-if="currentMode === true"
value="0"
/>
<manual-page
ref="manualPage"
v-else-if="currentMode === false"
:liveData="liveData"
:show="show"
:status="status"
:dtu_remark="dtu_remark"
:selectedText="selectedText"
:value="value"
:agriId="agriId"
@publicMsg="publishMessage"
@getRemark="getRemarkByImei"
/>
</uni-section>
</view>
</z-paging>
</view>
@ -435,7 +437,9 @@ export default {
//
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
},
confirmSwitch(e) {
}
},
onHide() {
mqttUtil.removeOnMessageCallback();
@ -456,134 +460,7 @@ export default {
overflow: hidden;
}
/* 控制设置标题 */
.control-title {
font-size: 32rpx;
font-weight: 500;
text-align: center;
margin-bottom: 30rpx;
color: #333;
}
/* 2列栅格布局 */
.card-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 20rpx;
padding: 20rpx;
}
/* 卡片样式 */
.control-card {
background-color: #fff;
border-radius: 16rpx;
padding: 30rpx 20rpx;
display: flex;
justify-content: space-between;
align-items: center;
box-shadow: 0 2rpx 8rpx #bfbec1;
}
/* 卡片文字区域 */
.card-text {
display: flex;
flex-direction: column;
gap: 8rpx;
}
.card-main {
font-size: 30rpx;
color: #333;
font-weight: 500;
}
.card-sub {
font-size: 24rpx;
color: #999;
}
/* 保留原有样式,仅修改/新增以下部分 */
.card-sub-wrapper {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
gap: 10rpx;
/* 新增:给容器加最小宽度,确保所有卡片一致 */
min-width: 0;
}
.limit-time {
font-size: 24rpx;
color: #999;
/* 可选:加固定左边距,确保和暂停的间距统一 */
margin-left: 0rpx;
}
/* 卡片图标容器 */
.card-icon {
width: 48rpx;
height: 48rpx;
border-radius: 50%;
background-color: #e5e5e5;
display: flex;
align-items: center;
justify-content: center;
}
/* 激活状态(运行) */
.card-icon.active {
background-color: #007aff;
}
.uni-px-5 {
padding-left: 20rpx;
padding-right: 20rpx;
}
.uni-pb-5 {
padding-bottom: 15rpx;
}
.text {
width: 50rpx;
margin: 10rpx 10rpx 8rpx 0;
padding: 0;
height: 70rpx;
line-height: 70rpx;
text-align: center;
font-size: 26rpx;
box-shadow: 0 2rpx 8rpx #bfbec1
}
.tempStyle,.humiStyle {
display: inline-block;
font-size: 12px;
}
.text:first-child {
margin-left: 10rpx;
}
.uni-view {
-webkit-flex: 1;
flex: 1;
height: 150rpx;
-webkit-justify-content: center;
justify-content: center;
-webkit-align-items: center;
align-items: center;
}
.data {
font-size: 13px;
display: inline-block;
line-height: 23px;
color: #3a3a3a;
}
.data:nth-child(even) {
font-size: 12px;
margin-top: 3px;
color: #9c9c9c;
}
/deep/ .uni-section-header__slot-right {
color: green;
}