|
|
@@ -18,12 +18,12 @@
|
|
|
></image>
|
|
|
</view>
|
|
|
<view class="info-item">
|
|
|
- <text class="info-label">设备位置</text>
|
|
|
- <text class="info-value">{{ deviceInfo.address }}</text>
|
|
|
- </view>
|
|
|
- <view class="info-item">
|
|
|
<text class="info-label">上报时间</text>
|
|
|
<text class="info-value">{{ formatTimestamp(deviceInfo.uptime) }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="info-item">
|
|
|
+ <text class="info-label">设备位置</text>
|
|
|
+ <text class="info-value">{{ deviceInfo.address }}</text>
|
|
|
</view>
|
|
|
<view class="dev-status">{{
|
|
|
deviceInfo.devStatus == '1' ? '在线' : '离线'
|
|
|
@@ -97,10 +97,11 @@
|
|
|
<!-- 设备参数 -->
|
|
|
<view class="device-params">
|
|
|
<view class="device-control">
|
|
|
- <!-- <view class="control-left">
|
|
|
- <view>2025-12-28 08:00:00</view>
|
|
|
- <u-icon name="reload" class="reload-img"></u-icon>
|
|
|
- </view> -->
|
|
|
+ <view class="control-left">
|
|
|
+ <view>{{formatTimestamp(deviceInfo.uptime)}}</view>
|
|
|
+ <u-icon name="reload" color="#0BBC58" style="margin-left: 12rpx" @click="refreshData"></u-icon>
|
|
|
+ </view>
|
|
|
+ <!-- {{formatDate(deviceInfo.uptime)}} -->
|
|
|
<view class="control-right">
|
|
|
<image
|
|
|
class="control-img"
|
|
|
@@ -260,6 +261,22 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
|
+ async refreshData(){
|
|
|
+ //api/api_gateway?method=qxz.device.control
|
|
|
+ await this.$myRequest({
|
|
|
+ url: '/api/api_gateway?method=qxz.device.control',
|
|
|
+ data: {
|
|
|
+ device_id: this.deviceInfo.devBid,
|
|
|
+ cmd: 'READ',
|
|
|
+ },
|
|
|
+ });
|
|
|
+ //弹框提示
|
|
|
+ uni.showToast({
|
|
|
+ title: '刷新成功',
|
|
|
+ icon: 'success',
|
|
|
+ });
|
|
|
+ this.getDeviceData();
|
|
|
+ },
|
|
|
formatTimestamp(timestamp) {
|
|
|
if (!timestamp) return '';
|
|
|
const date = new Date(Number(timestamp) * 1000);
|
|
|
@@ -675,13 +692,12 @@ export default {
|
|
|
border-radius: 16rpx;
|
|
|
padding: 32rpx;
|
|
|
margin-bottom: 24rpx;
|
|
|
- height: 400rpx;
|
|
|
.device-control {
|
|
|
position: relative;
|
|
|
z-index: 3;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
- justify-content: flex-end;
|
|
|
+ justify-content: space-between;
|
|
|
margin-bottom: 24rpx;
|
|
|
.control-left {
|
|
|
color: #999999;
|