This commit is contained in:
LINCE 2025-07-20 22:41:10 +08:00
parent bb3e6c69fe
commit 7509335cf0
3 changed files with 130 additions and 80 deletions

View File

@ -23,7 +23,6 @@
"navigationStyle": "custom"
}
},
{
"path": "pages/deviceBind/index",
"style": {
@ -38,7 +37,6 @@
"navigationStyle": "custom"
}
},
{
"path": "pages/device/index",
"style": {
@ -65,7 +63,8 @@
"selectedColor": "#007AFF",
"backgroundColor": "#FFFFFF",
"borderStyle": "black",
"list": [{
"list": [
{
"pagePath": "pages/index/index",
"text": "首页",
"iconPath": "static/tabbar/index.png",

View File

@ -32,11 +32,16 @@
</view>
<!-- 媒体内容 -->
<video class="img_video_warp" :src="socketData.videoUrl" v-if="socketData.videoUrl"
<!-- <video class="img_video_warp" :src="socketData.videoUrl" v-if="socketData.videoUrl"
@loadedmetadata="isMediaLoading = false" @error="isMediaLoading = false"></video>
<image class="img_video_warp" v-else :src="socketData.imageUrl" @load="isMediaLoading = false"
@error="isMediaLoading = false"></image>
@error="isMediaLoading = false"></image> -->
<video class="img_video_warp" :src="socketData.videoUrl" v-if="socketData.videoUrl"
@loadedmetadata="handleMediaLoaded" @error="handleMediaError"></video>
<image class="img_video_warp" v-else :src="socketData.imageUrl" @load="handleMediaLoaded"
@error="handleMediaError"></image>
</view>
<!-- 设备状态选择 -->
@ -138,8 +143,8 @@
<view class="device_status_warp" v-if="deviceType == 2">
<view class="empty_state_warp">
<image class="empty_state_icon"
src="https://online.totustec.com/upload/deviceManage/empty_log_icon.png"></image>
<image class="empty_state_icon" src="https://online.totustec.com/upload/deviceManage/empty_log_icon.png">
</image>
<view class="empty_state_title">暂无日志数据</view>
<!-- <view class="empty_state_desc">设备运行日志将在这里显示</view> -->
</view>
@ -161,28 +166,23 @@
<view class="deviceN_input_tip">文件位置桌面File文件夹内</view>
<view class="device_operation_warp">
<!--只有主状态等于0时候开始打印才能点击其他都不能点击-->
<view class="device_operation_btn"
@click="operationData('PRINT')"
:style="{backgroundColor:deviceDetail.status === 0? '#ffffff':'#cccccc'}
<view class="device_operation_btn" @click="operationData('PRINT')" :style="{ backgroundColor: deviceDetail.status === 0 ? '#ffffff' : '#cccccc' }
">
<image class="operation_btn_icon"
src="https://online.totustec.com/upload/deviceManage/print_status1.png"></image>
<view class="operation_btn_txt"
:style="{
color:deviceDetail.status === 0 ?'#333333':'#ece8e8' ,}"
>开始打印</view>
<image class="operation_btn_icon" src="https://online.totustec.com/upload/deviceManage/print_status1.png">
</image>
<view class="operation_btn_txt" :style="{
color: deviceDetail.status === 0 ? '#333333' : '#ece8e8',
}">开始打印</view>
</view>
<!--继续打印-->
<view class="device_operation_btn"
@click="operationData('CONTINUE')"
:style="{backgroundColor:deviceDetail.status === 0 || printInfo.status !== 6? '#cccccc': '#ffffff'}"
>
<view class="device_operation_btn" @click="operationData('CONTINUE')"
:style="{ backgroundColor: deviceDetail.status === 0 || printInfo.status !== 6 ? '#cccccc' : '#ffffff' }">
<image class="operation_btn_icon" src="https://online.totustec.com/upload/deviceManage/print_status1.png">
</image>
<view class="operation_btn_txt"
:style="{color:deviceDetail.status === 0 || printInfo.status !== 6? '#ece8e8': '#333333'}"
>继续打印</view>
:style="{ color: deviceDetail.status === 0 || printInfo.status !== 6 ? '#ece8e8' : '#333333' }">继续打印
</view>
</view>
</view>
<!--暂停打印 退出打印-->
@ -198,8 +198,7 @@
color:
printInfo.status !== 6 && deviceDetail.status !== 0
? '#333333' : '#ece8e8',
}"
>暂停打印</view>
}">暂停打印</view>
</view>
<view class="device_operation_btn" @click="operationData('EXIT')" :style="{
@ -208,11 +207,9 @@
}">
<image class="operation_btn_icon" src="https://online.totustec.com/upload/deviceManage/print_status1.png">
</image>
<view class="operation_btn_txt"
:style="{
<view class="operation_btn_txt" :style="{
color: deviceDetail.status != 0 && deviceDetail.status != -1 ? '#333333' : '#ece8e8',
}"
>退出打印</view>
}">退出打印</view>
</view>
</view>
@ -403,6 +400,7 @@ export default {
reconnectTimer: null, //
reconnectInterval: 5000, // 5
socketData: {},
isMediaRequesting: false, //
};
},
onLoad (options) {
@ -427,6 +425,17 @@ export default {
this.closeWebSocket(); //
},
methods: {
//
handleMediaLoaded () {
this.isMediaLoading = false;
this.isMediaRequesting = false; //
},
//
handleMediaError () {
this.isMediaLoading = false;
this.isMediaRequesting = false; //
},
@ -635,13 +644,54 @@ export default {
}
}
},
// getVideoImg (type) {
// this.isMediaLoading = true;
// if (!this.isMediaLoading) {
// if (type == "img") {
// uni.showToast({
// title: "",
// icon: "none"
// });
// } else {
// uni.showToast({
// title: "",
// icon: "none"
// });
// }
// return
// }
// if (type == "img") {
// this.getType = "img";
// this.sendWsCommand("IMAGE");
// } else {
// this.getType = "video";
// this.sendWsCommand("OPEN_VIDEO");
// }
// },
getVideoImg (type) {
//
if (this.isMediaRequesting) {
const tipText = this.getType === "img"
? "请等待图片获取完毕再切换"
: "请等待视频获取完毕再切换";
uni.showToast({
title: tipText,
icon: "none",
duration: 2000
});
return;
}
//
this.isMediaRequesting = true;
this.isMediaLoading = true;
if (type == "img") {
this.getType = "img";
this.getType = type;
//
if (type === "img") {
this.sendWsCommand("IMAGE");
} else {
this.getType = "video";
this.sendWsCommand("OPEN_VIDEO");
}
},
@ -896,7 +946,8 @@ export default {
}
.deviceN_input {
width: 419rpx;
/* width: 419rpx; */
width: 347rpx;
height: 74rpx;
background: #ffffff;
border-radius: 10rpx;
@ -904,6 +955,7 @@ export default {
font-weight: 400;
font-size: 28rpx;
color: #666666;
padding-right: 72rpx;
}
.label_text {
@ -1044,10 +1096,9 @@ export default {
.img_video_warp {
width: 100%;
height: 321;
height: 321px;
background: rgba(0, 0, 0, 0.3);
border-radius: 20rpx;
margin: 22rpx 0 32rpx 0;
}
.back_button_icon {

View File

@ -265,7 +265,7 @@
</view> -->
</view>
<view class="table_nodata_area" v-else>
<image class="table_nodata_img" src="https://online.totustec.com/upload/indexPage/table_nodata_img1.png">
<image class="table_nodata_img" src="https://online.totustec.com/upload/indexPage/table_nodata_img2.png">
</image>
<view class="table_nodata_text">暂无设备预警</view>
</view>