wui-components-v2 1.2.45 → 1.2.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -145,20 +145,14 @@ const listenDuration = ref(2) // 单次听音时长,默认2秒
|
|
|
145
145
|
const sensor = ref(0) // 传感器在线状态 1:在线 0:离线
|
|
146
146
|
// 传感器编号:优先外部传入 prop,其次本地缓存 sensorCode,再尝试从 userInfo 缓存读取
|
|
147
147
|
const sensorCode = ref(
|
|
148
|
-
props.sensorCode ||
|
|
149
|
-
uni.getStorageSync('sensorCode') ||
|
|
150
|
-
uni.getStorageSync('userInfo')?.sensorCode ||
|
|
151
|
-
''
|
|
148
|
+
props.sensorCode || uni.getStorageSync('sensorCode') || uni.getStorageSync('userInfo')?.sensorCode || ''
|
|
152
149
|
)
|
|
153
150
|
|
|
154
151
|
onShow(() => {
|
|
155
152
|
// 组件内部获取用户信息(租户名称等),保持独立
|
|
156
153
|
fetchUserInfo()
|
|
157
154
|
if (!props.sensorCode) {
|
|
158
|
-
sensorCode.value =
|
|
159
|
-
uni.getStorageSync('sensorCode') ||
|
|
160
|
-
uni.getStorageSync('userInfo')?.sensorCode ||
|
|
161
|
-
''
|
|
155
|
+
sensorCode.value = uni.getStorageSync('sensorCode') || uni.getStorageSync('userInfo')?.sensorCode || ''
|
|
162
156
|
}
|
|
163
157
|
// 进入页面时查询传感器在线状态
|
|
164
158
|
getSensorInfo()
|
|
@@ -290,7 +284,7 @@ function saveSensorConfig() {
|
|
|
290
284
|
</view>
|
|
291
285
|
|
|
292
286
|
<!-- 传感器状态卡片 -->
|
|
293
|
-
<view v-if="
|
|
287
|
+
<view v-if="isYunyin" class="card-box">
|
|
294
288
|
<view class="card" :class="{ 'card-dark': isDark }">
|
|
295
289
|
<view class="item">
|
|
296
290
|
<text class="label">租户名称</text>
|