diff --git a/api/home.js b/api/home.js index ffcfdce..7353cdf 100644 --- a/api/home.js +++ b/api/home.js @@ -18,6 +18,8 @@ const listMqttEvent = (params) => { }; // 智能排风远程开关 const controlSocket = (data) => { + console.log(data,'controlSocket==>'); + const payload = { devEui: data.devEui, deviceId: data.deviceId, diff --git a/api/uniqueCode.js b/api/uniqueCode.js index 3a7d498..b855061 100644 --- a/api/uniqueCode.js +++ b/api/uniqueCode.js @@ -24,7 +24,7 @@ const delUniqueCode = (params) => { const detailUniqueCode = (params) => { return request(`/unique/code/${params.id}`, params, 'GET'); }; -// 详情:通过唯一码获取物料信息 +// 扫码:通过唯一码获取物料信息 const getMaterialUnique = (params) => { return request(`/unique/code/materialInfo/${params.code}`, params, 'GET'); }; diff --git a/pages.json b/pages.json index a545814..d84e89e 100644 --- a/pages.json +++ b/pages.json @@ -26,13 +26,47 @@ }, { "path": "pages/intelligent/index", - "style": { "navigationBarTitleText": "智能" } + "style": { "navigationBarTitleText": "智能", "navigationStyle": "custom" } }, { "path": "pages/my/index", "style": { "navigationBarTitleText": "我的" } }, + // 综合模式评估 recycling + { + "path": "pages/recycling/integratedModeAssessment/valueEvaluation", + "style": { "navigationBarTitleText": "危险废弃物回收多元价值评估" } + }, + { + "path": "pages/recycling/integratedModeAssessment/results", + "style": { "navigationBarTitleText": "危险废弃物回收多元价值评估结果" } + }, + // 智能处置 + { + "path": "pages/recycling/leadBatteryCascadeUse/conditionAssessment", + "style": { "navigationBarTitleText": "状态评估" } + }, + { + "path": "pages/recycling/leadBatteryCascadeUse/activationRecovery", + "style": { "navigationBarTitleText": "活化恢复" } + }, + // 废物云控体系 + { + "path": "pages/recycling/carbonFootprint/wasteCloudControl", + "style": { "navigationBarTitleText": "废物云控体系" } + }, + // 危废碳足迹 + { + "path": "pages/recycling/carbonFootprint/wasteCarbonFootprint", + "style": { "navigationBarTitleText": "危废碳足迹" } + }, + // 铅蓄智修样机 + { + "path": "pages/recycling/leadBatterySmartRepair/index", + "style": { "navigationBarTitleText": "铅蓄智修样机" } + }, + { "path": "pages/warehousing/uniqueCode/issueUniqueCode/index", "style": { diff --git a/pages/components/EquipmentInfo.vue b/pages/components/EquipmentInfo.vue index a4be363..81861d3 100644 --- a/pages/components/EquipmentInfo.vue +++ b/pages/components/EquipmentInfo.vue @@ -43,12 +43,9 @@ + @change="(e) => handleSocketControl1(item, e)" /> - + @@ -56,19 +53,20 @@ - {{ item.summary }}| + {{ item.summary }} + | {{ item.onlineText }} - + @@ -235,31 +233,47 @@ function patchRealtimeState(prev, next) { if (socket != null) res.switchStatus = res.socket_status = res.socketStatus = socket return res } - -async function handleSocketControl(e, item) { - console.log(e, item, '111'); - const action = e ? 'on' : 'off' - console.log(action, '111'); - if (action) { - const deviceId = item.id || item.deviceId - const devEui = item.devEui || item.devEUI || item.dev_eui - console.log('devEui', devEui); - - if (!devEui) return uni.showToast({ title: '未找到设备', icon: 'none' }) - const k = item.cardKey || String(deviceId) - if (controlLoadingMap[k]) return - controlLoadingMap[k] = true - try { - const status = action === 'on' ? 1 : 0 - console.log(status, action, 'status'); - - await controlSocket({ devEui, deviceId, status }) - syncSocketLocalState(item, status) - uni.showToast({ title: '指令已发送', icon: 'success' }) - } finally { - controlLoadingMap[k] = false - } +async function handleSocketControl(item, action) { + console.log(action, controlLoadingMap, 'action111'); + console.log(item, 'item111'); + const deviceId = item.id || item.deviceId + const devEui = item.devEui || item.devEUI || item.dev_eui + if (!devEui) return uni.showToast({ title: '未找到设备', icon: 'none' }) + const k = item.cardKey || String(deviceId) + console.log('devEui1', controlLoadingMap, k, controlLoadingMap[k]); + if (controlLoadingMap[k]) return + controlLoadingMap[k] = true + try { + const status = action === 'on' ? 1 : 0 + await controlSocket({ devEui, deviceId, status }) + syncSocketLocalState(item, status) + uni.showToast({ title: '指令已发送', icon: 'success' }) + } finally { + controlLoadingMap[k] = false } +} +async function handleSocketControl1(item, e) { + const action = e ? 'on' : 'off' + console.log(action, controlLoadingMap, 'action11133'); + console.log(item, 'item11133'); + const deviceId = item.id || item.deviceId + const devEui = item.devEui || item.devEUI || item.dev_eui + if (!devEui) return uni.showToast({ title: '未找到设备', icon: 'none' }) + const k = item.cardKey || String(deviceId) + console.log('devEui', controlLoadingMap, k, controlLoadingMap[k]); + if (controlLoadingMap[k]) return + console.log('controlLoadingMap[k]', controlLoadingMap[k]); + controlLoadingMap[k] = true + try { + const status = action === 'on' ? 1 : 0 + console.log(status, action, 'status===>'); + await controlSocket({ devEui, deviceId, status }) + syncSocketLocalState(item, status) + uni.showToast({ title: '指令已发送', icon: 'success' }) + } finally { + controlLoadingMap[k] = false + } + } @@ -709,10 +723,15 @@ onBeforeUnmount(() => { } .location { - font-size: 16px; + font-size: 14px; color: #666; } +.text { + font-size: 14px; + +} + .type-name { font-size: 16px; font-weight: 600; @@ -732,7 +751,7 @@ onBeforeUnmount(() => { display: flex; justify-content: space-between; gap: 16rpx; - margin-top: 10px; + margin-top: 20rpx; } .switch-actions { @@ -833,7 +852,7 @@ onBeforeUnmount(() => { .summary-card { - padding: 18px 20px; + padding: 36rpx 40rpx; border-radius: 18px; position: relative; overflow: hidden; @@ -844,7 +863,7 @@ onBeforeUnmount(() => { font-size: 13px; font-weight: 500; color: #334155; - margin-bottom: 6px; + margin-bottom: 12rpx; } .value { diff --git a/pages/components/ProjectOverView.vue b/pages/components/ProjectOverView.vue index 49c4a36..3b3e2c7 100644 --- a/pages/components/ProjectOverView.vue +++ b/pages/components/ProjectOverView.vue @@ -23,7 +23,6 @@ getMyWarehouseList()