|
@@ -59,7 +59,7 @@ Page({
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{ 'R1_RelayStatus':13,'Reflash':3})
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{ 'R1_RelayStatus':13,'Reflash':3})
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
- control.newSwitch({deviceId:id,relayIds:"1",operation:1})
|
|
|
|
|
|
+ control.newSwitch({deviceId:id,relayId:1,operation:1})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (opens == 2 && loops >= 2) {
|
|
else if (opens == 2 && loops >= 2) {
|
|
@@ -67,7 +67,7 @@ Page({
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{ 'R2_RelayStatus':13,'Reflash':3})
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{ 'R2_RelayStatus':13,'Reflash':3})
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
- control.newSwitch({deviceId:id,relayIds:"2",operation:1})
|
|
|
|
|
|
+ control.newSwitch({deviceId:id,relayId:2,operation:1})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (opens == 3 && loops >= 3) {
|
|
else if (opens == 3 && loops >= 3) {
|
|
@@ -75,7 +75,7 @@ Page({
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{ 'R3_RelayStatus':13,'Reflash':3})
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{ 'R3_RelayStatus':13,'Reflash':3})
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
- control.newSwitch({deviceId:id,relayIds:"3",operation:1})
|
|
|
|
|
|
+ control.newSwitch({deviceId:id,relayId:3,operation:1})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (opens == 4 && loops >= 4) {
|
|
else if (opens == 4 && loops >= 4) {
|
|
@@ -83,7 +83,7 @@ Page({
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{ 'R4_RelayStatus':13,'Reflash':3})
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{ 'R4_RelayStatus':13,'Reflash':3})
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
- control.newSwitch({deviceId:id,relayIds:"4",operation:1})
|
|
|
|
|
|
+ control.newSwitch({deviceId:id,relayId:4,operation:1})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (opens == 5 && loops >= "5") {
|
|
else if (opens == 5 && loops >= "5") {
|
|
@@ -91,7 +91,7 @@ Page({
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{ 'R5_RelayStatus':13,'Reflash':3})
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{ 'R5_RelayStatus':13,'Reflash':3})
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
- control.newSwitch({deviceId:id,relayIds:"5",operation:1})
|
|
|
|
|
|
+ control.newSwitch({deviceId:id,relayId:5,operation:1})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (opens == 6 && loops >= "6") {
|
|
else if (opens == 6 && loops >= "6") {
|
|
@@ -99,7 +99,7 @@ Page({
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{ 'R6_RelayStatus':13,'Reflash':3})
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{ 'R6_RelayStatus':13,'Reflash':3})
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
- control.newSwitch({deviceId:id,relayIds:"6",operation:1})
|
|
|
|
|
|
+ control.newSwitch({deviceId:id,relayId:6,operation:1})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (opens == 7 && loops >= "7") {
|
|
else if (opens == 7 && loops >= "7") {
|
|
@@ -107,7 +107,7 @@ Page({
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{ 'R7_RelayStatus':13,'Reflash':3})
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{ 'R7_RelayStatus':13,'Reflash':3})
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
- control.newSwitch({deviceId:id,relayIds:"7",operation:1})
|
|
|
|
|
|
+ control.newSwitch({deviceId:id,relayId:7,operation:1})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (opens == 8 && loops >= "8") {
|
|
else if (opens == 8 && loops >= "8") {
|
|
@@ -115,7 +115,7 @@ Page({
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{ 'R8_RelayStatus':13,'Reflash':3})
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{ 'R8_RelayStatus':13,'Reflash':3})
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
- control.newSwitch({deviceId:id,relayIds:"8",operation:1})
|
|
|
|
|
|
+ control.newSwitch({deviceId:id,relayId:8,operation:1})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (opens == 9 && loops >= "9") {
|
|
else if (opens == 9 && loops >= "9") {
|
|
@@ -123,7 +123,7 @@ Page({
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{ 'R9_RelayStatus':13,'Reflash':3})
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{ 'R9_RelayStatus':13,'Reflash':3})
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
- control.newSwitch({deviceId:id,relayIds:"9",operation:1})
|
|
|
|
|
|
+ control.newSwitch({deviceId:id,relayId:9,operation:1})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (opens == 10 && loops >= "10") {
|
|
else if (opens == 10 && loops >= "10") {
|
|
@@ -131,7 +131,7 @@ Page({
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{ 'R10_RelayStatus':13,'Reflash':3})
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{ 'R10_RelayStatus':13,'Reflash':3})
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
- control.newSwitch({deviceId:id,relayIds:"10",operation:1})
|
|
|
|
|
|
+ control.newSwitch({deviceId:id,relayId:10,operation:1})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (opens == 11 && loops >= "11") {
|
|
else if (opens == 11 && loops >= "11") {
|
|
@@ -139,7 +139,7 @@ Page({
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{ 'R11_RelayStatus':13,'Reflash':3})
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{ 'R11_RelayStatus':13,'Reflash':3})
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
- control.newSwitch({deviceId:id,relayIds:"11",operation:1})
|
|
|
|
|
|
+ control.newSwitch({deviceId:id,relayId:11,operation:1})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (opens == 12 && loops >= "12") {
|
|
else if (opens == 12 && loops >= "12") {
|
|
@@ -147,7 +147,7 @@ Page({
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{ 'R12_RelayStatus':13,'Reflash':3})
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{ 'R12_RelayStatus':13,'Reflash':3})
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
- control.newSwitch({deviceId:id,relayIds:"12",operation:1})
|
|
|
|
|
|
+ control.newSwitch({deviceId:id,relayId:12,operation:1})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
setTimeout(function(){
|
|
setTimeout(function(){
|
|
@@ -226,7 +226,7 @@ Page({
|
|
that.setData({lamp:wx.getStorageSync('lamp')})
|
|
that.setData({lamp:wx.getStorageSync('lamp')})
|
|
},500)
|
|
},500)
|
|
}
|
|
}
|
|
- },2000)
|
|
|
|
|
|
+ },3000)
|
|
},
|
|
},
|
|
//回路关
|
|
//回路关
|
|
Shut(e){
|
|
Shut(e){
|
|
@@ -244,7 +244,7 @@ Page({
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{'R1_RelayStatus':12,'Reflash':3})
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{'R1_RelayStatus':12,'Reflash':3})
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
- control.newSwitch({deviceId:id,relayIds:"1",operation:0})
|
|
|
|
|
|
+ control.newSwitch({deviceId:id,relayId:1,operation:0})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (shuts == 2 && loops >= 2) {
|
|
else if (shuts == 2 && loops >= 2) {
|
|
@@ -252,7 +252,7 @@ Page({
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{'R2_RelayStatus':12,'Reflash':3})
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{'R2_RelayStatus':12,'Reflash':3})
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
- control.newSwitch({deviceId:id,relayIds:"2",operation:0})
|
|
|
|
|
|
+ control.newSwitch({deviceId:id,relayId:2,operation:0})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (shuts == 3 && loops >= 3) {
|
|
else if (shuts == 3 && loops >= 3) {
|
|
@@ -260,7 +260,7 @@ Page({
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{'R3_RelayStatus':12,'Reflash':3})
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{'R3_RelayStatus':12,'Reflash':3})
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
- control.newSwitch({deviceId:id,relayIds:"3",operation:0})
|
|
|
|
|
|
+ control.newSwitch({deviceId:id,relayId:3,operation:0})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (shuts == 4 && loops >= 4) {
|
|
else if (shuts == 4 && loops >= 4) {
|
|
@@ -268,7 +268,7 @@ Page({
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{'R4_RelayStatus':12,'Reflash':3})
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{'R4_RelayStatus':12,'Reflash':3})
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
- control.newSwitch({deviceId:id,relayIds:"4",operation:0})
|
|
|
|
|
|
+ control.newSwitch({deviceId:id,relayId:4,operation:0})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (shuts == 5 && loops >= 5) {
|
|
else if (shuts == 5 && loops >= 5) {
|
|
@@ -276,7 +276,7 @@ Page({
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{'R5_RelayStatus':12,'Reflash':3})
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{'R5_RelayStatus':12,'Reflash':3})
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
- control.newSwitch({deviceId:id,relayIds:"5",operation:0})
|
|
|
|
|
|
+ control.newSwitch({deviceId:id,relayId:5,operation:0})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (shuts == 6 && loops >= 6) {
|
|
else if (shuts == 6 && loops >= 6) {
|
|
@@ -284,7 +284,7 @@ Page({
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{'R6_RelayStatus':12,'Reflash':3})
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{'R6_RelayStatus':12,'Reflash':3})
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
- control.newSwitch({deviceId:id,relayIds:"6",operation:0})
|
|
|
|
|
|
+ control.newSwitch({deviceId:id,relayId:6,operation:0})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (shuts == 7 && loops >= 7) {
|
|
else if (shuts == 7 && loops >= 7) {
|
|
@@ -292,7 +292,7 @@ Page({
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{'R7_RelayStatus':12,'Reflash':3})
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{'R7_RelayStatus':12,'Reflash':3})
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
- control.newSwitch({deviceId:id,relayIds:"7",operation:0})
|
|
|
|
|
|
+ control.newSwitch({deviceId:id,relayId:7,operation:0})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (shuts == 8 && loops >= 8) {
|
|
else if (shuts == 8 && loops >= 8) {
|
|
@@ -300,7 +300,7 @@ Page({
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{'R8_RelayStatus':12,'Reflash':3})
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{'R8_RelayStatus':12,'Reflash':3})
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
- control.newSwitch({deviceId:id,relayIds:"8",operation:0})
|
|
|
|
|
|
+ control.newSwitch({deviceId:id,relayId:8,operation:0})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (shuts == 9 && loops >= 9) {
|
|
else if (shuts == 9 && loops >= 9) {
|
|
@@ -308,7 +308,7 @@ Page({
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{'R9_RelayStatus':12,'Reflash':3})
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{'R9_RelayStatus':12,'Reflash':3})
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
- control.newSwitch({deviceId:id,relayIds:"9",operation:0})
|
|
|
|
|
|
+ control.newSwitch({deviceId:id,relayId:9,operation:0})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (shuts == 10 && loops >= 10) {
|
|
else if (shuts == 10 && loops >= 10) {
|
|
@@ -316,7 +316,7 @@ Page({
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{'R10_RelayStatus':12,'Reflash':3})
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{'R10_RelayStatus':12,'Reflash':3})
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
- control.newSwitch({deviceId:id,relayIds:"10",operation:0})
|
|
|
|
|
|
+ control.newSwitch({deviceId:id,relayId:10,operation:0})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (shuts == 11 && loops >= 11) {
|
|
else if (shuts == 11 && loops >= 11) {
|
|
@@ -324,15 +324,15 @@ Page({
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{'R11_RelayStatus':12,'Reflash':3})
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{'R11_RelayStatus':12,'Reflash':3})
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
- control.newSwitch({deviceId:id,relayIds:"11",operation:0})
|
|
|
|
|
|
+ control.newSwitch({deviceId:id,relayId:11,operation:0})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- else if (shuts == 12 && loops >= "12") {
|
|
|
|
|
|
+ else if (shuts == 12 && loops >= 12) {
|
|
if(moudule == 0){
|
|
if(moudule == 0){
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{'R12_RelayStatus':12,'Reflash':3})
|
|
control.Switch(that.data.deviceId,that.data.deviceKey,{'R12_RelayStatus':12,'Reflash':3})
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
- control.newSwitch({deviceId:id,relayIds:"12",operation:0})
|
|
|
|
|
|
+ control.newSwitch({deviceId:id,relayId:12,operation:0})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
setTimeout(function(){
|
|
setTimeout(function(){
|
|
@@ -342,40 +342,40 @@ Page({
|
|
if(bind.data.errno == 0){
|
|
if(bind.data.errno == 0){
|
|
for(let r1 = 0;r1 < Bind.length;r1++){
|
|
for(let r1 = 0;r1 < Bind.length;r1++){
|
|
if(Bind[r1].id == 'R1_RelayStatus'){
|
|
if(Bind[r1].id == 'R1_RelayStatus'){
|
|
- var switchReal = control.SwitchReal(Bind[r1].current_value,lamp,0)
|
|
|
|
|
|
+ var switchReal = control.switchReal(Bind[r1].current_value,lamp,0)
|
|
}
|
|
}
|
|
else if(Bind[r1].id == 'R2_RelayStatus'){
|
|
else if(Bind[r1].id == 'R2_RelayStatus'){
|
|
- var switchReal = control.SwitchReal(Bind[r1].current_value,lamp,1)
|
|
|
|
|
|
+ var switchReal = control.switchReal(Bind[r1].current_value,lamp,1)
|
|
}
|
|
}
|
|
else if(Bind[r1].id == 'R3_RelayStatus'){
|
|
else if(Bind[r1].id == 'R3_RelayStatus'){
|
|
- var switchReal = control.SwitchReal(Bind[r1].current_value,lamp,2)
|
|
|
|
|
|
+ var switchReal = control.switchReal(Bind[r1].current_value,lamp,2)
|
|
}
|
|
}
|
|
else if(Bind[r1].id == 'R4_RelayStatus'){
|
|
else if(Bind[r1].id == 'R4_RelayStatus'){
|
|
- var switchReal = control.SwitchReal(Bind[r1].current_value,lamp,3)
|
|
|
|
|
|
+ var switchReal = control.switchReal(Bind[r1].current_value,lamp,3)
|
|
}
|
|
}
|
|
else if(Bind[r1].id == 'R5_RelayStatus'){
|
|
else if(Bind[r1].id == 'R5_RelayStatus'){
|
|
- var switchReal = control.SwitchReal(Bind[r1].current_value,lamp,4)
|
|
|
|
|
|
+ var switchReal = control.switchReal(Bind[r1].current_value,lamp,4)
|
|
}
|
|
}
|
|
else if(Bind[r1].id == 'R6_RelayStatus'){
|
|
else if(Bind[r1].id == 'R6_RelayStatus'){
|
|
- var switchReal = control.SwitchReal(Bind[r1].current_value,lamp,5)
|
|
|
|
|
|
+ var switchReal = control.switchReal(Bind[r1].current_value,lamp,5)
|
|
}
|
|
}
|
|
else if(Bind[r1].id == 'R7_RelayStatus'){
|
|
else if(Bind[r1].id == 'R7_RelayStatus'){
|
|
- var switchReal = control.SwitchReal(Bind[r1].current_value,lamp,6)
|
|
|
|
|
|
+ var switchReal = control.switchReal(Bind[r1].current_value,lamp,6)
|
|
}
|
|
}
|
|
else if(Bind[r1].id == 'R8_RelayStatus'){
|
|
else if(Bind[r1].id == 'R8_RelayStatus'){
|
|
- var switchReal = control.SwitchReal(Bind[r1].current_value,lamp,7)
|
|
|
|
|
|
+ var switchReal = control.switchReal(Bind[r1].current_value,lamp,7)
|
|
}
|
|
}
|
|
else if(Bind[r1].id == 'R9_RelayStatus'){
|
|
else if(Bind[r1].id == 'R9_RelayStatus'){
|
|
- var switchReal = control.SwitchReal(Bind[r1].current_value,lamp,8)
|
|
|
|
|
|
+ var switchReal = control.switchReal(Bind[r1].current_value,lamp,8)
|
|
}
|
|
}
|
|
else if(Bind[r1].id == 'R10_RelayStatus'){
|
|
else if(Bind[r1].id == 'R10_RelayStatus'){
|
|
- var switchReal = control.SwitchReal(Bind[r1].current_value,lamp,9)
|
|
|
|
|
|
+ var switchReal = control.switchReal(Bind[r1].current_value,lamp,9)
|
|
}
|
|
}
|
|
else if(Bind[r1].id == 'R11_RelayStatus'){
|
|
else if(Bind[r1].id == 'R11_RelayStatus'){
|
|
- var switchReal = control.SwitchReal(Bind[r1].current_value,lamp,10)
|
|
|
|
|
|
+ var switchReal = control.switchReal(Bind[r1].current_value,lamp,10)
|
|
}
|
|
}
|
|
else if(Bind[r1].id == 'R12_RelayStatus'){
|
|
else if(Bind[r1].id == 'R12_RelayStatus'){
|
|
- var switchReal = control.SwitchReal(Bind[r1].current_value,lamp,11)
|
|
|
|
|
|
+ var switchReal = control.switchReal(Bind[r1].current_value,lamp,11)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
wx.setStorageSync('lamp',switchReal)
|
|
wx.setStorageSync('lamp',switchReal)
|
|
@@ -408,7 +408,7 @@ Page({
|
|
that.setData({lamp:wx.getStorageSync('lamp')})
|
|
that.setData({lamp:wx.getStorageSync('lamp')})
|
|
},500)
|
|
},500)
|
|
}
|
|
}
|
|
- },2000)
|
|
|
|
|
|
+ },3000)
|
|
},
|
|
},
|
|
//回路名称调整
|
|
//回路名称调整
|
|
loopname(e){
|
|
loopname(e){
|
|
@@ -1182,7 +1182,6 @@ Page({
|
|
'R5_RelayStatus':12,'R6_RelayStatus':12,'R7_RelayStatus':12,'R8_RelayStatus':12,'R9_RelayStatus':12,
|
|
'R5_RelayStatus':12,'R6_RelayStatus':12,'R7_RelayStatus':12,'R8_RelayStatus':12,'R9_RelayStatus':12,
|
|
'R10_RelayStatus':12,'R11_RelayStatus':12,'R12_RelayStatus':12,'Reflash':3}
|
|
'R10_RelayStatus':12,'R11_RelayStatus':12,'R12_RelayStatus':12,'Reflash':3}
|
|
postData(that.data.deviceId,that.data.deviceKey,obj).then(res => {
|
|
postData(that.data.deviceId,that.data.deviceKey,obj).then(res => {
|
|
- console.log(res)
|
|
|
|
if(res.data.errno == 0){
|
|
if(res.data.errno == 0){
|
|
wx.setStorageSync('lamp', [])
|
|
wx.setStorageSync('lamp', [])
|
|
var lamp = wx.getStorageSync('lamp')
|
|
var lamp = wx.getStorageSync('lamp')
|
|
@@ -1525,7 +1524,6 @@ Page({
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
- console.log('主页分组下拉到没有设备的工程')
|
|
|
|
wx.showModal({
|
|
wx.showModal({
|
|
title:'提示',
|
|
title:'提示',
|
|
content:'工程中不存在设备',
|
|
content:'工程中不存在设备',
|
|
@@ -1814,7 +1812,6 @@ Page({
|
|
var deviceId = that.data.deviceId
|
|
var deviceId = that.data.deviceId
|
|
var deviceKey = that.data.deviceKey
|
|
var deviceKey = that.data.deviceKey
|
|
postData(deviceId,deviceKey,{'ManualStatus':1,'Reflash':3}).then(res => {
|
|
postData(deviceId,deviceKey,{'ManualStatus':1,'Reflash':3}).then(res => {
|
|
- console.log(res.data)
|
|
|
|
if(res.data.errno == 0){
|
|
if(res.data.errno == 0){
|
|
that.setData({Modecontrol:'手动'})
|
|
that.setData({Modecontrol:'手动'})
|
|
}
|
|
}
|
|
@@ -1888,7 +1885,6 @@ Page({
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
- console.log('添加分组下标')
|
|
|
|
wx.setStorageSync('groupName',that.data.groupName[that.data.groupIndex])
|
|
wx.setStorageSync('groupName',that.data.groupName[that.data.groupIndex])
|
|
}
|
|
}
|
|
//获取设备下拉
|
|
//获取设备下拉
|
|
@@ -2146,9 +2142,9 @@ Page({
|
|
})
|
|
})
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- loopSwitchstate(id,'1,2,3,4,5,6,7,8').then(res=>{
|
|
|
|
- if(res.data.code == 0){
|
|
|
|
- var relay = res.data.data
|
|
|
|
|
|
+ loopSwitchstate(id,'1,2,3,4,5,6,7,8').then(ret=>{
|
|
|
|
+ if(ret.data.code == 0){
|
|
|
|
+ var relay = ret.data.data
|
|
for(let e = 0;e < relay.length;e++){
|
|
for(let e = 0;e < relay.length;e++){
|
|
if(relay[e].status == 1){
|
|
if(relay[e].status == 1){
|
|
lamp[e] = 'https://cloud.long-chi.com/resource/miniprogram-lightcontrol/image/lamp1.png'
|
|
lamp[e] = 'https://cloud.long-chi.com/resource/miniprogram-lightcontrol/image/lamp1.png'
|
|
@@ -2164,7 +2160,7 @@ Page({
|
|
else{
|
|
else{
|
|
wx.showModal({
|
|
wx.showModal({
|
|
title:'错误',
|
|
title:'错误',
|
|
- content:res.data.msg,
|
|
|
|
|
|
+ content:ret.data.msg,
|
|
showCancel:false
|
|
showCancel:false
|
|
})
|
|
})
|
|
}
|
|
}
|