自动化页面简写

feasure
lld 2026-02-26 17:57:04 +08:00
parent adc5a2e41f
commit c3b30deadb
2 changed files with 12 additions and 27 deletions

View File

@ -7,34 +7,17 @@
</template>
<view>
<!-- 优化度卡片循环渲染 -->
<view class="uni-flex_control uni-row">
<!-- 优化湿度卡片循环渲染 -->
<view class="uni-flex_control uni-row" v-for="data in dataType" :key="data.name">
<view
class="text uni-flex_control_one uni-view"
v-for="item in sensorCards.temp"
:class="['text', `uni-flex_control_${data.name}`,'uni-view']"
v-for="item in sensorCards[data.name]"
:key="item.key"
@click="openDataModal(item)"
>
<text class="data" :style="fontStyle">
{{ liveData[item.key] }}
<text v-if="isEffectiveValue(liveData[item.key])" class="tempStyle"></text>
</text>
<text class="data" v-if="dtu_remark[item.key]">{{ dtu_remark[item.key] }}</text>
<text class="data" v-else>{{ item.label }}</text>
</view>
</view>
<!-- 优化湿度卡片循环渲染 -->
<view class="uni-flex_control uni-row">
<view
class="text uni-flex_control_two uni-view"
v-for="item in sensorCards.humi"
:key="item.key"
@click="openDataModal(item)"
>
<text class="data" :style="fontStyle">
{{ liveData[item.key] }}
<text v-if="isEffectiveValue(liveData[item.key])" class="humiStyle"> %RH</text>
<text v-if="isEffectiveValue(liveData[item.key])" class="dataStyle">{{data.unit}}</text>
</text>
<text class="data" v-if="dtu_remark[item.key]">{{ dtu_remark[item.key] }}</text>
<text class="data" v-else>{{ item.label }}</text>
@ -201,6 +184,7 @@ export default {
//
if (newVal) {
this.imei = this.value
console.info(this.liveData)
}
}
}
@ -253,7 +237,7 @@ export default {
imei: '',
// 湿1234湿1234
sensorCard:{},
dataType: ["temp", "humi"]
dataType: [{name:"temp", unit: "℃"}, {name:"humi", unit: "%RH"}]
};
},
@ -638,7 +622,7 @@ export default {
box-shadow: 0 2rpx 8rpx #bfbec1
}
.tempStyle, .humiStyle {
.dataStyle {
display: inline-block;
font-size: 12px;
}

View File

@ -25,15 +25,16 @@ form {
flex-direction: column;
}
.uni-flex_control_one {
.uni-flex_control_temp {
display: flex;
flex-direction: column;
background: radial-gradient(circle at bottom right, #faf1f1 40%, #F8FCFE 100%);
}
.uni-flex_control_two {
.uni-flex_control_humi {
display: flex;
flex-direction: column;
background: radial-gradient(circle at top left, #E8F4F8 40%, #F8FCFE 100%);
background: radial-gradient(circle at top left, #E8F4F8 40%,
#F8FCFE 100%);
}
.uni-flex-item {