This commit is contained in:
LINCE 2025-08-05 19:55:07 +08:00
parent d25b3ab954
commit 8904046329
3 changed files with 105 additions and 195 deletions

View File

@ -8,6 +8,13 @@
"enableShareAppMessage": true "enableShareAppMessage": true
} }
}, },
{
"path": "pages/deviceManage/index",
"style": {
"navigationBarTitleText": "设备管理",
"navigationStyle": "custom"
}
},
{ {
"path": "pages/mine/index", "path": "pages/mine/index",
"style": { "style": {
@ -44,13 +51,6 @@
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
{
"path": "pages/deviceManage/index",
"style": {
"navigationBarTitleText": "设备管理",
"navigationStyle": "custom"
}
},
{ {
"path": "pages/privacy/index", "path": "pages/privacy/index",
"style": { "style": {
@ -92,4 +92,4 @@
] ]
}, },
"uniIdRouter": {} "uniIdRouter": {}
} }

View File

@ -32,26 +32,11 @@
</view> </view>
<!-- 媒体内容 --> <!-- 媒体内容 -->
<video <video class="img_video_warp" :src="socketData.videoUrl" v-if="socketData.videoUrl"
class="img_video_warp" @loadedmetadata="handleMediaLoaded" @error="handleMediaError"></video>
:src="socketData.videoUrl" <image class="img_video_warp" :src="socketData.imageUrl" v-else-if="socketData.imageUrl"
v-if="socketData.videoUrl" @load="handleMediaLoaded" @error="handleMediaError"></image>
@loadedmetadata="handleMediaLoaded" <image class="img_video_warp" :src="TOPBG" v-else mode="aspectFill" />
@error="handleMediaError"
></video>
<image
class="img_video_warp"
:src="socketData.imageUrl"
v-else-if="socketData.imageUrl"
@load="handleMediaLoaded"
@error="handleMediaError"
></image>
<image
class="img_video_warp"
:src="TOPBG"
v-else
mode="aspectFill"
/>
</view> </view>
<!-- 设备状态选择 --> <!-- 设备状态选择 -->
@ -60,9 +45,9 @@
<view class="select_device_item device_model" :class="{ device_active: deviceType == 1 }" <view class="select_device_item device_model" :class="{ device_active: deviceType == 1 }"
@click="deviceType = 1">设备状态 @click="deviceType = 1">设备状态
</view> </view>
<view class="select_device_item device_model" :class="{ device_active: deviceType == 2 }" <!-- <view class="select_device_item device_model" :class="{ device_active: deviceType == 2 }"
@click="deviceType = 2">设备日志 @click="deviceType = 2">设备日志
</view> </view> -->
<view class="select_device_item device_model" :class="{ device_active: deviceType == 3 }" <view class="select_device_item device_model" :class="{ device_active: deviceType == 3 }"
@click="deviceType = 3">设备控制 @click="deviceType = 3">设备控制
</view> </view>
@ -188,7 +173,7 @@
<!--继续打印--> <!--继续打印-->
<view class="device_operation_btn" @click="operationData('CONTINUE')" <view class="device_operation_btn" @click="operationData('CONTINUE')"
:style="{ backgroundColor: deviceDetail.status === 0 || printInfo.status !== 6 ? '#cccccc' : '#ffffff' }"> :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 class="operation_btn_icon" src="https://online.totustec.com/upload/deviceManage/print_status3.png">
</image> </image>
<view class="operation_btn_txt" <view class="operation_btn_txt"
:style="{ color: deviceDetail.status === 0 || printInfo.status !== 6 ? '#ece8e8' : '#333333' }">继续打印 :style="{ color: deviceDetail.status === 0 || printInfo.status !== 6 ? '#ece8e8' : '#333333' }">继续打印
@ -202,7 +187,7 @@
? '#ffffff' ? '#ffffff'
: '#cccccc', : '#cccccc',
}"> }">
<image class="operation_btn_icon" src="https://online.totustec.com/upload/deviceManage/print_status1.png"> <image class="operation_btn_icon" src="https://online.totustec.com/upload/deviceManage/print_status4.png">
</image> </image>
<view class="operation_btn_txt" :style="{ <view class="operation_btn_txt" :style="{
color: color:
@ -215,7 +200,7 @@
backgroundColor: backgroundColor:
deviceDetail.status != 0 && deviceDetail.status != -1 ? '#ffffff' : '#cccccc', deviceDetail.status != 0 && deviceDetail.status != -1 ? '#ffffff' : '#cccccc',
}"> }">
<image class="operation_btn_icon" src="https://online.totustec.com/upload/deviceManage/print_status1.png"> <image class="operation_btn_icon" src="https://online.totustec.com/upload/deviceManage/print_status5.png">
</image> </image>
<view class="operation_btn_txt" :style="{ <view class="operation_btn_txt" :style="{
color: deviceDetail.status != 0 && deviceDetail.status != -1 ? '#333333' : '#ece8e8', color: deviceDetail.status != 0 && deviceDetail.status != -1 ? '#333333' : '#ece8e8',
@ -231,7 +216,7 @@
<view class="operation_btn_txt">报警继续</view> <view class="operation_btn_txt">报警继续</view>
</view> </view>
<view class="device_operation_btn" @click="sendWsCommand('ALARM_EXIT')"> <view class="device_operation_btn" @click="sendWsCommand('ALARM_EXIT')">
<image class="operation_btn_icon" src="https://online.totustec.com/upload/deviceManage/print_status2.png"> <image class="operation_btn_icon" src="https://online.totustec.com/upload/deviceManage/print_status6.png">
</image> </image>
<view class="operation_btn_txt">报警退出</view> <view class="operation_btn_txt">报警退出</view>
</view> </view>
@ -249,7 +234,7 @@ import {
export default { export default {
data () { data () {
return { return {
TOPBG:BASE_IMG_URL + "/minePage/top.jpg", TOPBG: BASE_IMG_URL + "/minePage/top.jpg",
isMediaLoading: false, isMediaLoading: false,
deviceName: "", deviceName: "",
title: "Hello", title: "Hello",
@ -1102,7 +1087,8 @@ export default {
<style scoped> <style scoped>
.device_model { .device_model {
width: 33%; /* width: 33%; */
width: 50%;
} }
.img_video_warp { .img_video_warp {

View File

@ -13,7 +13,7 @@
<view class="middle_area_warp"> <view class="middle_area_warp">
<!-- 设备状态 --> <!-- 设备状态 -->
<view class="device_area_warp"> <!-- <view class="device_area_warp">
<view class="device_top"> <view class="device_top">
<view class="device_top_left"> <view class="device_top_left">
<image class="top_left_img1" src="https://online.totustec.com/upload/indexPage/top_left_img1.png"></image> <image class="top_left_img1" src="https://online.totustec.com/upload/indexPage/top_left_img1.png"></image>
@ -66,53 +66,7 @@
<view class="data_dline_css"></view> <view class="data_dline_css"></view>
</view> </view>
</view> </view>
<!-- 以下是演示数据对接数据时删除 -->
<!-- <view class="table_data_item">
<view class="data_display_warp">
<view class="data_item_line" style="padding-left: 27rpx">16628096</view>
<view class="data_item_line" style="width: 301rpx">调试二号机</view>
<view class="data_item_line" style="width: 200rpx">
<view class="label_warp">
<view class="label_icon" style="background: #00abff"></view>
<view class="label_text" style="color: #00abff">准备中</view>
</view>
</view>
</view>
<view class="data_dline_warp">
<view class="data_dline_css"></view>
</view>
</view>
<view class="table_data_item">
<view class="data_display_warp">
<view class="data_item_line" style="padding-left: 27rpx">16628096</view>
<view class="data_item_line" style="width: 301rpx">调试三号机</view>
<view class="data_item_line" style="width: 200rpx">
<view class="label_warp">
<view class="label_icon" style="background: #00d195"></view>
<view class="label_text" style="color: #00d195">打印中</view>
</view>
</view>
</view>
<view class="data_dline_warp">
<view class="data_dline_css"></view>
</view>
</view>
<view class="table_data_item">
<view class="data_display_warp">
<view class="data_item_line" style="padding-left: 27rpx">16628096</view>
<view class="data_item_line" style="width: 301rpx">调试四号机</view>
<view class="data_item_line" style="width: 200rpx">
<view class="label_warp">
<view class="label_icon" style="background: #fdcb3b"></view>
<view class="label_text" style="color: #fdcb3b">铲件中</view>
</view>
</view>
</view>
</view> -->
</view> </view>
<!-- 暂无数据 -->
<view class="table_nodata_area" v-else> <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_img1.png">
</image> </image>
@ -120,10 +74,10 @@
</view> </view>
</view> </view>
</view> </view>
</view> </view> -->
<!-- 设备预警 --> <!-- 设备预警 -->
<view class="device_area_warp" style="margin-top: 56rpx"> <!-- <view class="device_area_warp" style="margin-top: 56rpx">
<view class="device_top"> <view class="device_top">
<view class="device_top_left"> <view class="device_top_left">
<image class="top_left_img1" src="https://online.totustec.com/upload/indexPage/top_left_img2.png"></image> <image class="top_left_img1" src="https://online.totustec.com/upload/indexPage/top_left_img2.png"></image>
@ -142,14 +96,8 @@
<view class="data_display_warp"> <view class="data_display_warp">
<view class="data_item_line" style="padding-left: 27rpx">{{ item.deviceCode }}</view> <view class="data_item_line" style="padding-left: 27rpx">{{ item.deviceCode }}</view>
<view class="data_item_line" style="flex: 1"> <view class="data_item_line" style="flex: 1">
<!-- <view class="label_warp2">
<view class="label_icon" style="background: #00d195"></view>
<view class="label_text label_text2" style="color: #00d195">空闲</view>
</view> -->
<view class="label_warp2"> <view class="label_warp2">
<!-- 状态图标颜色映射 -->
<view class="label_icon" :style="{ background: getStatusColor(item.errorStatus) }"></view> <view class="label_icon" :style="{ background: getStatusColor(item.errorStatus) }"></view>
<!-- 状态文字条件渲染 -->
<view class="label_text label_text2" :style="{ color: getStatusColor(item.errorStatus) }"> <view class="label_text label_text2" :style="{ color: getStatusColor(item.errorStatus) }">
{{ getStatusText(item.errorStatus) }} {{ getStatusText(item.errorStatus) }}
</view> </view>
@ -161,108 +109,6 @@
<view class="data_dline_css"></view> <view class="data_dline_css"></view>
</view> </view>
</view> </view>
<!-- 以下是演示数据对接数据时删除 -->
<!-- <view class="table_data_item">
<view class="data_display_warp">
<view class="data_item_line" style="padding-left: 27rpx">16628096</view>
<view class="data_item_line" style="flex: 1">
<view class="label_warp2">
<view class="label_icon" style="background: #ff0000"></view>
<view class="label_text label_text2">文件校验失败</view>
</view>
</view>
</view>
<view class="data_dline_warp">
<view class="data_dline_css"></view>
</view>
</view>
<view class="table_data_item">
<view class="data_display_warp">
<view class="data_item_line" style="padding-left: 27rpx">16628096</view>
<view class="data_item_line" style="flex: 1">
<view class="label_warp2">
<view class="label_icon" style="background: #ff0000"></view>
<view class="label_text label_text2">设备出错</view>
</view>
</view>
</view>
<view class="data_dline_warp">
<view class="data_dline_css"></view>
</view>
</view>
<view class="table_data_item">
<view class="data_display_warp">
<view class="data_item_line" style="padding-left: 27rpx">16628096</view>
<view class="data_item_line" style="flex: 1">
<view class="label_warp2">
<view class="label_icon" style="background: #ff0000"></view>
<view class="label_text label_text2">准备过程出错</view>
</view>
</view>
</view>
<view class="data_dline_warp">
<view class="data_dline_css"></view>
</view>
</view>
<view class="table_data_item">
<view class="data_display_warp">
<view class="data_item_line" style="padding-left: 27rpx">16628096</view>
<view class="data_item_line" style="flex: 1">
<view class="label_warp2">
<view class="label_icon" style="background: #ff0000"></view>
<view class="label_text label_text2">打印出错</view>
</view>
</view>
</view>
<view class="data_dline_warp">
<view class="data_dline_css"></view>
</view>
</view>
<view class="table_data_item">
<view class="data_display_warp">
<view class="data_item_line" style="padding-left: 27rpx">16628096</view>
<view class="data_item_line" style="flex: 1">
<view class="label_warp2">
<view class="label_icon" style="background: #ff0000"></view>
<view class="label_text label_text2">加液失败</view>
</view>
</view>
</view>
<view class="data_dline_warp">
<view class="data_dline_css"></view>
</view>
</view>
<view class="table_data_item">
<view class="data_display_warp">
<view class="data_item_line" style="padding-left: 27rpx">16628096</view>
<view class="data_item_line" style="flex: 1">
<view class="label_warp2">
<view class="label_icon" style="background: #ff0000"></view>
<view class="label_text label_text2">铲件失败</view>
</view>
</view>
</view>
<view class="data_dline_warp">
<view class="data_dline_css"></view>
</view>
</view>
<view class="table_data_item">
<view class="data_display_warp">
<view class="data_item_line" style="padding-left: 27rpx">16628096</view>
<view class="data_item_line" style="flex: 1">
<view class="label_warp2">
<view class="label_icon" style="background: #ff0000"></view>
<view class="label_text label_text2">图片异物</view>
</view>
</view>
</view>
</view> -->
</view> </view>
<view class="table_nodata_area" v-else> <view class="table_nodata_area" v-else>
<image class="table_nodata_img" src="https://online.totustec.com/upload/indexPage/table_nodata_img2.png"> <image class="table_nodata_img" src="https://online.totustec.com/upload/indexPage/table_nodata_img2.png">
@ -271,9 +117,25 @@
</view> </view>
</view> </view>
</view> </view>
</view> -->
<!-- 轮播图 -->
<view class="carousel_image_warp">
<!-- 轮播图组件 -->
<swiper class="carousel_swiper" indicator-dots indicator-active-color="#0095de" autoplay interval="3000"
duration="500" circular>
<swiper-item class="carousel_item" v-for="(item, index) in carouselimageList" :key="index">
<image class="carousel_img" :src="'https://online.totustec.com/upload' + item" mode="widthFix"></image>
</swiper-item>
</swiper>
</view> </view>
<view style="height: 100rpx"></view> <view class="use_wizard_warp">
<image class="use_wizard_img" src="https://online.totustec.com/upload/indexPage/use_wizard_img.png"></image>
</view>
<!-- <view style="height: 100rpx"></view> -->
</view> </view>
</view> </view>
</template> </template>
@ -303,6 +165,7 @@ export default {
6: { text: '铲件失败', color: '#ff9800' }, 6: { text: '铲件失败', color: '#ff9800' },
7: { text: '图片异物', color: '#ff0000' } 7: { text: '图片异物', color: '#ff0000' }
}, },
carouselimageList: [],
// WebSocket // WebSocket
socketTask: null, // uni-app WebSocket socketTask: null, // uni-app WebSocket
@ -325,6 +188,7 @@ export default {
} = systemInfo; } = systemInfo;
this.statusBarHeight = statusBarHeight; this.statusBarHeight = statusBarHeight;
this.connectWebSocket(); // WebSocket this.connectWebSocket(); // WebSocket
this.getCarouselimageList();
}, },
onShow () { onShow () {
this.getDeviceList(); // this.getDeviceList(); //
@ -429,11 +293,71 @@ export default {
} }
}, },
async getCarouselimageList () {
try {
//
const userInfo = uni.getStorageSync("userInfo") || {};
const res = await uni.request({
url: BASE_API_URL + "/api/front/carousel",
method: "GET",
data: this.searchList,
header: {
"Content-Type": "application/x-www-form-urlencoded", //
"Authorization": userInfo.token || ""
},
});
if (res.statusCode == 200) {
this.carouselimageList = res.data
console.log('1111', this.carouselimageList);
}
} catch (error) {
console.log('请求接口失败', error);
}
},
}, },
}; };
</script> </script>
<!-- 临时样式 --> <!-- 临时样式 -->
<style scoped> <style scoped>
.use_wizard_img {
width: 100%;
height: 172rpx;
}
.use_wizard_warp {
padding: 24rpx;
}
.carousel_swiper {
width: 100%;
height: 100%;
}
.carousel_item {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
.carousel_img {
width: 100%;
height: 100%;
object-fit: cover;
/* 图片自适应填充,保持比例不拉伸 */
border-radius: 16rpx;
/* 轻微圆角,提升美观度 */
}
.carousel_image_warp {
width: 100%;
height: 820rpx;
}
.label_icon { .label_icon {
width: 18rpx; width: 18rpx;
height: 18rpx; height: 18rpx;
@ -633,7 +557,7 @@ export default {
.middle_area_warp { .middle_area_warp {
width: 100%; width: 100%;
background: #f1f6fc; background: #f1f6fc;
border-radius: 30rpx 30rpx 0rpx 0rpx; /* border-radius: 30rpx 30rpx 0rpx 0rpx; */
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin-top: -28rpx; margin-top: -28rpx;