diff --git a/pages.json b/pages.json index 16a4efc..b79a3a0 100644 --- a/pages.json +++ b/pages.json @@ -65,6 +65,12 @@ "navigationStyle": "custom" } }, + { + "path": "pages/210/deviceControl/index", + "style": { + "navigationStyle": "custom" + } + }, { "path": "pages/common/operationVideo/index", "style": { diff --git a/pages/210/deviceControl/index.vue b/pages/210/deviceControl/index.vue new file mode 100644 index 0000000..c212ba5 --- /dev/null +++ b/pages/210/deviceControl/index.vue @@ -0,0 +1,1222 @@ + + + + + \ No newline at end of file diff --git a/pages/6170/deviceControl/index.vue b/pages/6170/deviceControl/index.vue index 7517bc3..8b1f1ba 100644 --- a/pages/6170/deviceControl/index.vue +++ b/pages/6170/deviceControl/index.vue @@ -18,14 +18,14 @@ - 90% + {{deviceInfo.batteryPercentage}}% 电量 - 1小时 + {{deviceInfo.batteryRemainingTime || '0分钟'}} 续航时间 @@ -42,7 +42,7 @@ 设备状态 - 运行中 + {{deviceInfo.onlineStatus===0?'离线':'在线'}} 定位信息 @@ -316,7 +316,7 @@ console.log('这是我滑动的吗'); this.sliderValue = e.detail.value; let data = { - deviceld: this.deviceID, + deviceId: this.deviceID, instructValue: this.sliderValue + '.00' } lightBrightnessSettings(data).then((res) => { @@ -392,7 +392,7 @@ // 修正这里的赋值错误,应该保存索引而不是文本 this.selectedItemIndex = this.selectedItemIndex; let data = { - deviceld: this.deviceID, + deviceId: this.deviceID, instructValue: selectedItem.instructValue } lightModeSettings(data).then((res) => { @@ -417,7 +417,7 @@ // 激光确认框提交 handleBtn() { let data = { - deviceld: this.deviceID, + deviceId: this.deviceID, instructValue: 1 } laserModeSettings(data).then((res) => { @@ -465,7 +465,7 @@ } this.selectedImage = res.tempFilePaths[0]; console.log('选择的图片:', res); - this.file = res.tempFiles[0].file + //this.file = res.tempFiles[0].file }, fail: (err) => { console.error('选择图片失败:', err); @@ -485,10 +485,16 @@ }); return; } + // 显示上传中加载提示 + uni.showLoading({ + title: '上传中...', + mask: true + }); + uni.uploadFile({ url: baseURL + '/app/device/uploadLogo', filePath: this.selectedImage, - name: this.file, + name: 'file', formData: { deviceId: this.deviceID, }, @@ -524,7 +530,6 @@ } } }) - }, // 分享 shareUp() { diff --git a/pages/common/index/index.vue b/pages/common/index/index.vue index 75ec93c..b33a3bd 100644 --- a/pages/common/index/index.vue +++ b/pages/common/index/index.vue @@ -41,8 +41,13 @@ ID:{{item.deviceImei}} ID:{{item.deviceMac}} - 在线 - 电量:90% + + 在线 + + 离线 + 电量:{{item.battery || '0'}}% @@ -423,7 +428,7 @@ handleFile(item) { //console.log('item' + JSON.stringify(item)); // communicationMode 0是4G 1是蓝牙 - if (item.communicationMode == 0) { + if (item.typeName == 'BJQ6170') { uni.navigateTo({ url: "/pages/6170/deviceControl/index", events: { @@ -437,6 +442,19 @@ }); } }) + } else if (item.typeName == 'HBY210') { + uni.navigateTo({ + url: "/pages/210/deviceControl/index", + events: { + ack: function(data) {} + }, + success: (res) => { + // 页面跳转成功后的回调函数 + res.eventChannel.emit('deviceControl', { + data: item, + }); + } + }) } if (item.typeName == '6155') { uni.navigateTo({ @@ -460,7 +478,7 @@ updateDeviceStatus(data) { // 只更新 communicationMode == 0 的设备 this.deviceList = this.deviceList.map(item => { - console.log(item,'item2222'); + console.log(item, 'item2222'); if (item.communicationMode === 0) { // 这里根据消息内容更新设备状态 // 示例:如果消息包含特定字段,则更新设备状态 @@ -703,6 +721,19 @@ top: 20rpx; left: -20rpx } + .offlines{ + position: relative; + } + .offlines::before { + content: ''; + position: absolute; + width: 15rpx; + height: 15rpx; + background: rgba(255, 255, 255, 0.4); + border-radius: 50%; + top: 20rpx; + left: -20rpx + } .line { width: 2rpx; diff --git a/pages/common/login/index.vue b/pages/common/login/index.vue index e13a2f0..828101e 100644 --- a/pages/common/login/index.vue +++ b/pages/common/login/index.vue @@ -61,7 +61,7 @@ data() { return { showView: false, - phone: '13800138001', //手机号码 + phone: '13800138002', //手机号码 code: "", //验证码 agreed: false, isCounting: false, diff --git a/pages/common/send/index.vue b/pages/common/send/index.vue index 3e85cb9..67e10cc 100644 --- a/pages/common/send/index.vue +++ b/pages/common/send/index.vue @@ -16,19 +16,16 @@ 设备:{{item.deviceName}} - ID:{{item.deviceImei}} - - ID:{{item.deviceMac}} - - 离线 - 电量:90% + ID:{{item.deviceImei}} + 在线 + + 离线 + 电量:{{item.battery || '0'}}% - - 已连接 - 未连接 -