diff --git a/config.js b/config.js index 09777d6..e3cbc51 100644 --- a/config.js +++ b/config.js @@ -1,9 +1,18 @@ // 后端接口 export const BASE_API_URL = "https://online.totustec.com/api"; - - // 静态数据 export const BASE_IMG_URL = "https://online.totustec.com/upload"; +export const BASE_STOKECT_URL = "wss://online.totustec.com/webSocket/vue" -export const BASE_STOKECT_URL = "wss://online.totustec.com/webSocket/vue" \ No newline at end of file +// 打印状态颜色以及对应编号 +export const DEVICE_STATUS_MAP={ + 0: { color: '#999999', text: '空闲' }, + 1: { color: '#00d195', text: '打印中' }, + 2: { color: '#00abff', text: '准备中' }, + 3: { color: '#FDCB3B', text: '铲件中' }, + 4: { color: '#FDCB3B', text: '暂停' }, + 5: { color: '#4CAF50', text: '打印完成' }, + 6: { color: '#18a2af', text: '报警' }, + '-1': { color: '#999999', text: '断开' } +} diff --git a/pages/device/index.vue b/pages/device/index.vue index 3538d50..c08b0db 100644 --- a/pages/device/index.vue +++ b/pages/device/index.vue @@ -24,36 +24,33 @@ 机器序号 - 机器描述 - 设备运行状态 + 机器描述 + 运行状态 + 设备控制 - + {{ item.deviceCode }} - {{ item.brand }} - - - - 空闲 - - - - 准备中 - - - - 打印中 - - - - 铲件中 - - - - 断开 + {{ item.brand }} + + + + + {{ getStatusConfig(item.status).text }} + + + + @@ -74,20 +71,19 @@ - - + + + - + diff --git a/pages/deviceBind/index.vue b/pages/deviceBind/index.vue index 4a0a648..409dc6f 100644 --- a/pages/deviceBind/index.vue +++ b/pages/deviceBind/index.vue @@ -129,7 +129,6 @@ export default { "Authorization": uni.getStorageSync("userInfo")?.token || "" } }); - uni.showModal({ title: '提示', content: res.data.message, // 直接显示完整文本 @@ -139,16 +138,16 @@ export default { if (res.statusCode === 200) { uni.showToast({ title: "绑定成功", - icon: "success", // 可选,增加成功图标 - duration: 1500 // 1.5秒后自动关闭 + icon: "success", + duration: 1500, + success: () => { + setTimeout(() => { + uni.switchTab({ + url: "/pages/device/index" + }); + }, 1500); + } }); - - // 1.5秒后跳转到设备页面 - setTimeout(() => { - uni.navigateTo({ - url: "/pages/device/index" - }); - }, 1500); } } catch (error) { console.error("设备绑定失败:", error); diff --git a/pages/deviceManage/index.vue b/pages/deviceManage/index.vue index 74f9cbe..b370527 100644 --- a/pages/deviceManage/index.vue +++ b/pages/deviceManage/index.vue @@ -16,11 +16,17 @@ + @click="getVideoImg('video')"> 获取视频 - - 获取图片 + + + 获取铲件图片 + + + 获取监控图片 @@ -30,45 +36,49 @@ - + class="img_video_warp" + :src="socketData.chipImageUrl" + v-else-if="getType === 'chip' && socketData.chipImageUrl" + @load="handleMediaLoaded" + @error="handleMediaError" + /> + - 设备状态 + @click="deviceType = 1">设备状态 - 设备日志 - + --> 设备控制 + @click="deviceType = 3">设备控制 - @@ -78,26 +88,9 @@ @@ -139,7 +132,12 @@ {{ field.label }} - {{ printInfo[field.key] }} + + @@ -150,25 +148,27 @@ - + 暂无日志数据 - + 设备运行日志将在这里显示 - - + 打印文件名称: - + + src="https://online.totustec.com/upload/deviceManage/clear_deviceN_icon.png"> @@ -187,11 +187,11 @@ + :style="{ backgroundColor: deviceDetail.status === 0 || printInfo.status !== 6 ? '#cccccc' : '#ffffff' }"> 继续打印 + :style="{ color: deviceDetail.status === 0 || printInfo.status !== 6 ? '#ece8e8' : '#333333' }">继续打印 @@ -222,7 +222,6 @@ }">退出打印 - @@ -243,19 +242,19 @@