fix: 测试问题修复,提交代码,页面定时任务,控制器界面展示。

This commit is contained in:
tianyongbao
2026-03-27 22:19:16 +08:00
parent 359842fad8
commit eed1e5c994
3 changed files with 31 additions and 14 deletions

View File

@@ -58,7 +58,7 @@
正常</nut-tag
>
<nut-tag class="tagErr font_28 m_r_15" v-else-if="item.status == 2">
{{ item.warnCodeInfo?.warnDescription }}</nut-tag
{{ item.warnCodeInfo.warnDescription }}</nut-tag
>
<nut-tag
class="font_28 m_r_15"
@@ -444,11 +444,16 @@
>
<!-- 控制器标题行 -->
<nut-col :span="24">
<view class="controller-header">
<view class="controller-header" :style="{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }">
<view class="controller-name">
<text class="controller-title">{{ item.deviceName }}</text>
<view class="error-tag" v-if="item.errorMessage">{{ item.errorMessage }}</view>
</view>
<view
class="font_28 c_1589E9"
:style="{ color: '#1589E9', fontSize: '28rpx' }"
@click="setParamsCtr(item.id)"
>参数设置</view>
</view>
</nut-col>
@@ -877,11 +882,9 @@ Taro.useDidHide(() => {
function startRefreshTimer() {
// 先清除已有的定时器
stopRefreshTimer();
// 每10秒刷新一次
// 每10秒刷新一次设备状态(包括在线状态和开关状态)
refreshTimer.value = setInterval(() => {
if (controlList.value.length > 0) {
getDeviceList();
}
getDeviceList();
}, 10000);
}
@@ -903,9 +906,11 @@ watch(
);
// 获取塘口下的设备列表
function getDeviceList() {
console.log('========== getDeviceList 被调用 ==========');
emit("render", "");
const id = props.modelValue;
if (!id) {
console.log('没有id直接返回');
return;
}
// 查询塘口下设备列表
@@ -954,10 +959,10 @@ function getDeviceList() {
item.num = num;
item.status = Number(item.deviceCount) == 0 ? 0 : msg ? 2 : 1;
// 判断设备是否离线,异常、断电 0 6 15
const code0 = alarmJudgeCode(item.warnCodeInfo?.warnCode, 0);
const code6 = alarmJudgeCode(item.warnCodeInfo?.warnCode, 6);
const code11 = alarmJudgeCode(item.warnCodeInfo?.warnCode, 15);
const code17 = alarmJudgeCode(item.warnCodeInfo?.warnCode, 17);
const code0 = alarmJudgeCode(item.warnCodeInfo.warnCode, 0);
const code6 = alarmJudgeCode(item.warnCodeInfo.warnCode, 6);
const code11 = alarmJudgeCode(item.warnCodeInfo.warnCode, 15);
const code17 = alarmJudgeCode(item.warnCodeInfo.warnCode, 17);
item.up = true;
if (code0 || code6 || code11 || code17) {
item.up = false;
@@ -1780,7 +1785,7 @@ function changeAllSwitch(e) {
// 设置控制器
function setParamsCtr(id) {
Taro.navigateTo({
url: `/home/ctr?id=${id}&page=home`,
url: `/home/ctr?id=${id}&page=home&hideSwitch=1`,
});
}
function switchRes(list, index, type) {

View File

@@ -103,7 +103,7 @@
</nut-cell>
</nut-col>
<!-- 开关配置区域 -->
<nut-col :span="24" v-if="!section">
<nut-col :span="24" v-if="!section && !hideSwitch">
<nut-cell class="ctr_body">
<nut-row>
<!-- <nut-col :span="24" class="view_f_between">
@@ -756,6 +756,7 @@ const id = instance.router.params.id;
const name = instance.router.params.name;
const page = instance.router.params.page;
const section = instance.router.params.section; // 获取区域参数
const hideSwitch = instance.router.params.hideSwitch === '1'; // 是否隐藏开关配置
const r_v = `${imgUrl}r_v.png`;
// const id = 5
// const name = undefined

View File

@@ -475,7 +475,6 @@ function wxpay() {
payId: reType.value,
listDeviceId: rechargeList.value,
};
console.log(data)
// 创建订单
createOrder(data).then((res: any) => {
if (res.code == 200) {
@@ -507,14 +506,26 @@ function wxpay() {
},
fail: function (res) {
devOpen.value = false;
state.msg = "续费异常,请稍后再试";
state.msg = res.errMsg || "续费异常,请稍后再试";
state.show = true;
loading.value = false;
console.error("支付失败:", res);
},
});
} else {
loading.value = false;
state.msg = res.msg || "创建订单失败";
state.show = true;
}
}).catch((err) => {
loading.value = false;
state.msg = "网络异常,请稍后再试";
state.show = true;
});
} else {
loading.value = false;
state.msg = "获取登录信息失败";
state.show = true;
}
},
fail: function () {