From 2df906a447195f9786dd468512ea895d6cc18532 Mon Sep 17 00:00:00 2001 From: YYC <1833023622@qq.com> Date: 星期四, 15 五月 2025 14:53:54 +0800 Subject: [PATCH] APP3.5开发 --- igds-app/js/admin/device-temp.js | 63 ++++++++++++++++--------------- 1 files changed, 33 insertions(+), 30 deletions(-) diff --git a/igds-app/js/admin/device-temp.js b/igds-app/js/admin/device-temp.js index a8c837a..e5c1b10 100644 --- a/igds-app/js/admin/device-temp.js +++ b/igds-app/js/admin/device-temp.js @@ -9,6 +9,7 @@ "reqDateTime": new Date(), "tokenAuth": "", "data": { + "deviceId":"", "deptId": "", "depotId": "", "type": "05", @@ -37,7 +38,7 @@ var user = JSON.parse(localStorage.getItem('user')); var selectDeptId = JSON.parse(localStorage.getItem('selectDeptId')); - url = user.url + "/api-phone/v35/gateway"; + url = user.url + "/api/phone/v35/gateway"; data.tokenAuth = user.tokenAuth; data.data.deptId = user.deptId; data1.tokenAuth = user.tokenAuth; @@ -48,6 +49,7 @@ data1.data.depotId = self.depotId // depotType = self.depotType // depotName = self.depotName + getDeviceList(); } //鑾峰彇璁惧鍒楄〃锛堢┖璋冿級 @@ -61,8 +63,10 @@ success: function(result) { if (result.code == "0000") { deviceData = result.data; + renderDevice(); } else { mui.toast(result.msg); + renderDevice(); } }, error: function() { @@ -119,37 +123,34 @@ html += '<div class="m-tf"><div class="g-tittf1">浠撳簱姝i潰</div><ul class="ul-listmana1 ullisttf1">'; $.each(frontList, function(index, item) { targetStatus = item.status - html += '<li><div class="con myfancy" passCode="' + item.passCode + '" serId="' + + html += '<li><div class="con myfancy" deviceId="'+item.id+'" passCode="' + item.passCode + '" serId="' + item.serId + '" targetStatus="' + item.status + '" name="' + item.name + '" data-win="#win_kt"><div class="pic pic2"><img src="images/e1.png"></div>'; if (targetStatus == 'OPEN') { html += '<div class="info out" style="background-image: url(images/e8.png);">' + - item.name + '</div>' + item.name + '</div></div></li>' } else { html += '<div class="info out" style="background-image: url(images/e9.png);">' + - item.name + '</div>' + item.name + '</div></div></li>' } - html += '</div></div></li>' - }) html += '</ul></div>' } if (backList && backList.length > 0) { + console.log("backList") html += '<div class="m-tf"><div class="g-tittf1">浠撳簱鍙嶉潰</div><ul class="ul-listmana1 ullisttf1">'; $.each(backList, function(index, item) { targetStatus = item.status - html += '<li><div class="con myfancy" passCode="' + item.passCode + '" serId="' + + html += '<li><div class="con myfancy" deviceId="'+item.id+'" passCode="' + item.passCode + '" serId="' + item.serId + '" targetStatus="' + item.status + '" name="' + item.name + '" data-win="#win_kt"><div class="pic pic2"><img src="images/e1.png"></div>'; if (targetStatus == 'OPEN') { html += '<div class="info out" style="background-image: url(images/e8.png);">' + - item.name + '</div>' + item.name + '</div></div></li>' } else { html += '<div class="info out" style="background-image: url(images/e9.png);">' + - item.name + '</div>' + item.name + '</div></div></li>' } - html += '</div></div></li>' - }) html += '</ul></div>' } @@ -157,49 +158,44 @@ html += '<div class="m-tf"><div class="g-tittf1">浠撳簱宸︿晶闈�</div><ul class="ul-listmana1 ullisttf1">'; $.each(leftList, function(index, item) { targetStatus = item.status - html += '<li><div class="con myfancy" passCode="' + item.passCode + '" serId="' + + html += '<li><div class="con myfancy" deviceId="'+item.id+'" passCode="' + item.passCode + '" serId="' + item.serId + '" targetStatus="' + item.status + '" name="' + item.name + '" data-win="#win_kt"><div class="pic pic2"><img src="images/e1.png"></div>'; if (targetStatus == 'OPEN') { html += '<div class="info out" style="background-image: url(images/e8.png);">' + - item.name + '</div>' + item.name + '</div></div></li>' } else { html += '<div class="info out" style="background-image: url(images/e9.png);">' + - item.name + '</div>' + item.name + '</div></div></li>' } - html += '</div></div></li>' - }) html += '</ul></div>' } if (rightList && rightList.length > 0) { + console.log("rightList") html += '<div class="m-tf"><div class="g-tittf1">浠撳簱鍙充晶闈�</div><ul class="ul-listmana1 ullisttf1">'; $.each(rightList, function(index, item) { targetStatus = item.status - html += '<li><div class="con myfancy" passCode="' + item.passCode + '" serId="' + + html += '<li><div class="con myfancy" deviceId="'+item.id+'" passCode="' + item.passCode + '" serId="' + item.serId + '" targetStatus="' + item.status + '" name="' + item.name + '" data-win="#win_kt"><div class="pic pic2"><img src="images/e1.png"></div>'; if (targetStatus == 'OPEN') { html += '<div class="info out" style="background-image: url(images/e8.png);">' + - item.name + '</div>' + item.name + '</div></div></li>' } else { html += '<div class="info out" style="background-image: url(images/e9.png);">' + - item.name + '</div>' + item.name + '</div></div></li>' } - html += '</div></div></li>' - }) html += '</ul></div>' } } else { - html += - '<div class="m-tf"><div class="g-tittf1" style="text-align: center;font-size: 20px;color:#dd524d>鏆傛棤鏁版嵁</div>'; + html += '<div class="m-tf"><div class="g-tittf1" style="text-align: center;font-size: 20px;color:#dd524d">鏆傛棤鏁版嵁</div></div>'; } } else { - html += - '<div class="m-tf"><div class="g-tittf1" style="text-align: center;font-size: 20px;color:#dd524d>鏆傛棤鏁版嵁</div>'; +html += '<div class="m-tf"><div class="g-tittf1" style="text-align: center;font-size: 20px;color:#dd524d">鏆傛棤鏁版嵁</div></div>'; } - // $("#recordList").html(html); + $("#recordList").html(html); } var slider = mui(".mui-slider"); @@ -230,21 +226,24 @@ mui(".mui-scroll-wrapper").on("tap", ".m-tf ul li .con", function() { targetStatus = this.getAttribute("targetStatus") - data.data.targetStatus = targetStatus + data.data.targetStatus = targetStatus; + console.log(targetStatus) var html = ''; if (targetStatus == 'OPEN') { document.getElementById("vibrationSwitch").classList.add('mui-active'); - $('.mui-switch-handle').css("-webkit-transform" , "translate3d(16px, 0, 0)"); + $('.mui-switch-handle').css("-webkit-transform", "translate3d(16px, 0, 0)"); console.log("寮�") } else if (targetStatus == 'CLOSE') { document.getElementById("vibrationSwitch").classList.remove('mui-active'); - $('.mui-switch-handle').css("-webkit-transform" , "translate3d(0, 0, 0)"); + $('.mui-switch-handle').css("-webkit-transform", "translate3d(0, 0, 0)"); console.log("鍏�") } - + + var deviceId = this.getAttribute("deviceId"); var passCode = this.getAttribute("passCode"); var serId = this.getAttribute("serId"); var name = this.getAttribute("name"); + data.data.deviceId = deviceId data.data.passCode = passCode; data.data.serId = serId; data.data.name = name; @@ -281,6 +280,10 @@ data.data.targetTemp = targetTemp setTemp(); closePop(); + document.getElementById("range").value = 17 + $('.subbar').css({ + width: ((17 - 9) / 16) * 100 + '%' + }) }); //鍏抽棴寮圭獥 function closePop() { -- Gitblit v1.9.3