修正开关判断逻辑
This commit is contained in:
parent
bd42b3e2b1
commit
000395a22a
|
|
@ -327,7 +327,7 @@ export default {
|
||||||
// 延迟跳转,让用户看到成功提示
|
// 延迟跳转,让用户看到成功提示
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/page_user/luru/controlDevice?sn=${encodeURIComponent(this.mac)}`,
|
url: `/page_user/luru/controlDevice?mac=${encodeURIComponent(this.mac)}`,
|
||||||
});
|
});
|
||||||
}, 2000);
|
}, 2000);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -297,7 +297,7 @@ export default {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await sendCommand({
|
const res = await sendCommand({
|
||||||
command: "11open",
|
command: "open",
|
||||||
mac: this.mac,
|
mac: this.mac,
|
||||||
tryCount: "2",
|
tryCount: "2",
|
||||||
timeout: "10",
|
timeout: "10",
|
||||||
|
|
@ -307,7 +307,8 @@ export default {
|
||||||
console.log("open-res", res);
|
console.log("open-res", res);
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
|
|
||||||
if (res.code === 200) {
|
if (res.code === 200 && res.data.code === "0") {
|
||||||
|
//0表示成功
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "开启成功",
|
title: "开启成功",
|
||||||
icon: "success",
|
icon: "success",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user