分享管理修复bug,210历史记录功能开发

This commit is contained in:
fengerli
2025-08-09 17:59:09 +08:00
parent c0bb2bcd9c
commit 0d13f84744
9 changed files with 70 additions and 37 deletions

View File

@ -48,7 +48,6 @@
white-space: nowrap;
overflow: hidden;
position: relative;
}
.tab-container {
@ -56,14 +55,12 @@
cursor: pointer;
margin-bottom: 40rpx;
justify-content: space-between;
}
.tab-item {
font-size: 28rpx;
padding: 0 30rpx;
text-align: center;
}
.active {

View File

@ -17,7 +17,7 @@
<text>{{
tabs[activeTab].name === '我的分享'
? `分享给“${group.sharedTo}”的设备`
: `来自“${group.sharedTo}”分享的设备`
: `来自“${group.othersharedTo}”分享的设备`
}}</text>
<text class="edit-btn"
@click="toggleEdit(groupIndex)">{{editingGroup === groupIndex ? '完成' : '编辑'}}</text>
@ -41,11 +41,9 @@
<view class="ID">
ID:{{item.deviceImei}}</view>
<!-- 在线状态 -->
<view class="onlines"
v-if="item.onlineStatus==1">在线</view>
<view class="onlines" v-if="item.onlineStatus==1">在线</view>
<!-- 离线状态 -->
<view class="offlines"
v-if="item.onlineStatus==0">离线</view>
<view class="offlines" v-if="item.onlineStatus==0">离线</view>
<view>电量{{item.battery || '0'}}%</view>
</view>
</view>
@ -54,11 +52,6 @@
</view>
</block>
</view>
<!-- 加载状态提示 -->
<!-- <view class="loading-status">
<text v-if="loading">加载中...</text>
<text v-if="finished">没有更多数据了</text>
</view> -->
</view>
<view v-else class="noDATA">
<view>
@ -122,10 +115,12 @@
const groups = {};
this.deviceList.forEach(device => {
// 这里假设device.sharedTo是分享目标的手机号
const key = device.sharedTo || '未分享';
const key = this.activeTab === 0 ? device.phonenumber : device.otherPhonenumber;
const displayName = this.activeTab === 0 ? device.phonenumber : device.otherPhonenumber;
if (!groups[key]) {
groups[key] = {
sharedTo: key,
sharedTo: displayName, // 显示用名称
othersharedTo: displayName, // 显示用名称
devices: []
};
}
@ -218,7 +213,8 @@
const newDevices = res.rows.map(device => ({
...device,
showConfirm: false,
sharedTo: device.phonenumber || '未分享'
sharedTo: device.phonenumber,
othersharedTo: device.otherPhonenumber
}));
// 分页处理
if (this.page === 1) {

View File

@ -67,7 +67,7 @@
</view>
</view>
<view class="callpolice" v-if="deviceInfo.onlineStatus==1">
<view class="callpolice" v-if="deviceInfo.onlineStatus==0">
<view class="">设备强制报警中</view>
<view>
<uni-icons type="closeempty" size="15" color="rgba(255, 255, 255, 0.9)"
@ -271,7 +271,21 @@
@confirm="onPopupConfirmPolice" confirmBtnBg="rgba(224, 52, 52, 1)" confirmBtnColor="#fff" />
</view>
<!-- ===============进度条============== -->
<Progress :config="Progress"></Progress>
<view
v-if="Progress.show"
@click="closeProgress"
:style="{
position: 'fixed',
top: 0,
left: 0,
right: 0,
bottom: 0,
backgroundColor: Progress.maskBgColor,
zIndex: 999
}"
>
<Progress :config="Progress" @click.stop />
</view>
</view>
</template>
@ -285,7 +299,6 @@
lightModeSettings, //灯光模式设置
laserModeSettings, //激光模式设置
lightBrightnessSettings, //灯光亮度设置
mapReverseGeocoding //地图逆解析
} from '@/api/6170/deviceControl.js'
import {
baseURL,
@ -379,6 +392,9 @@
this.lightModeB = false;
this.lightModeC = false;
},
closeProgress() {
this.Progress.show = false; // 直接关闭进度条
},
// *******定位******
gpsPosition(item) {
// 添加调试日志
@ -409,7 +425,6 @@
cardTouchMove(e) {
if (!this.cardRect || e.touches.length === 0) return;
const deltaX = e.touches[0].clientX - this.touchStartX;
const deltaY = e.touches[0].clientY - this.touchStartY;

View File

@ -86,7 +86,7 @@
},
getData(val) {
let data = {
deviceid: val
deviceId: val
}
deviceShareList(data).then((res) => {
if (res.code == 200) {

View File

@ -31,7 +31,7 @@
<block v-for="(item, index) in deviceList" :key="index" :ref="'swipeItem_' + index">
<uni-swipe-action-item :right-options="Options"
@click="handleSwipeClick($event, item, index)" class="device-card"
:style="{ border: item.communicationMode==0 && item.onlineStatus==1 ? '1px solid rgba(224, 52, 52, 1)' : 'none' }">
:style="{ border: item.communicationMode==0 && item.onlineStatus==0 ? '1px solid rgba(224, 52, 52, 1)' : 'none' }">
<view @click.stop="handleFile(item)">
<view class="device-header">
<view class="deviceIMG">
@ -54,7 +54,7 @@
</view>
</view>
<view class="device-callpolice"
v-if="item.communicationMode==0 && item.onlineStatus==1">报警中</view>
v-if="item.communicationMode==0 && item.onlineStatus==0">报警中</view>
<view v-if="item.communicationMode==1">
<view class="device-status online">已连接</view>
<view class="device-status unline">未连接</view>
@ -78,7 +78,7 @@
</scroll-view>
</view>
<!-- 删除弹框 -->
<view class="agreement-mask" v-if="deleteShow" @click="closePopup('delete')">
<view class="agreement-mask" v-if="deleteShow" @click="closePopup('delete')" catchtouchmove="true">
<view class="agreement-popupC" @click.stop>
<view class="popup-content">
<image src="/static/images/common/dell.png" mode="" class="svg"></image>
@ -94,7 +94,7 @@
</view>
</view>
<!-- =========重命名============== -->
<view class="agreement-mask" v-if="RenameModel" @click="closePopup('rename')">
<view class="agreement-mask" v-if="RenameModel" @click="closePopup('rename')" catchtouchmove="true">
<view class="agreement-popupD" @click.stop>
<view class="popup-content">
<view>
@ -112,9 +112,9 @@
</view>
</view>
<!-- 小提示框 -->
<view class="tooltip-box" v-if="showTooltip">
<view class="tooltip-box" v-if="showTooltip" @click="closePopupTooltip" catchtouchmove="true">
<view class="tooltip-arrow"></view>
<view class="tooltip-content">
<view class="tooltip-content" @click.stop>
<view class="tooltip-item" v-for="(item, index) in menuItems" :key="index"
@click="handleMenuClick(item)">
<image :src="item.icon" class="item-icon" />
@ -123,9 +123,9 @@
</view>
</view>
<!-- ====分享类型提示框==== -->
<view class="tooltip-share" v-if="showshare">
<view class="tooltip-share" v-if="showshare" @click="closePopupTooltip" catchtouchmove="true">
<view class="tooltip-arrow"></view>
<view class="tooltip-content">
<view class="tooltip-content" @click.stop>
<view class="tooltip-item" v-for="(item, index) in shareItems" :key="index"
@click="handleshareClick(item)">
<image :src="item.icon" class="item-icon" />
@ -304,13 +304,34 @@
scan() {
this.showTooltip = !this.showTooltip;
},
closePopupTooltip() {
this.showTooltip = !this.showTooltip
this.showshare = !this.showshare
},
// 添加设备,扫一扫,蓝牙
handleMenuClick(item) {
this.showTooltip = false; // 关闭弹窗
switch (item.action) {
case 'scan':
uni.navigateTo({
url: '/pages/common/scan/scan'
// uni.navigateTo({
// url: '/pages/common/scan/scan'
// });
// 扫一扫
uni.scanCode({
success: (res) => {
console.log('条码内容:' + res.result);
// 跳转并传递扫描结果
uni.navigateTo({
url: `/pages/common/qrcode/qrcode?deviceId=${encodeURIComponent(res.result)}`
});
},
fail: (err) => {
console.log('扫码失败', err);
uni.showToast({
title: '扫码失败',
icon: 'none'
});
}
});
break;
case 'bluetooth':
@ -519,7 +540,7 @@
return item; // 解析失败则返回原 item
}
const [deviceId, onlineStatus, battery] = messageData.state || [];
console.log('我收到消息了没',item.battery);
console.log('我收到消息了没', item.battery);
return {
...item,
battery: battery ?? item.battery,

View File

@ -49,7 +49,6 @@
</view>
</view>
</view>
</template>
<script>

View File

@ -9,9 +9,13 @@
<!-- 连接中状态 -->
<view class="connecting-container" v-else>
<view class="device-info">
<view>
<image src="/static/images/bip.6.png" class="bip"></image>
<view class="">
<image src="/static/images/common/svg.png" class="svg"></image>
</view>
<!-- <view>
<image src="/static/images/bip.6.png" class="bip"></image>
</view> -->
<text class="device-name">设备名{{deviceId}}</text>
<text class="device-model1">ID:{{deviceId}}</text>
</view>

View File

@ -6,7 +6,7 @@
<image src="/static/images/common/logo.png" class="logo"></image>
</view>
<view class="user-right">
<view class="user-title">星汉研创</view>
<view class="user-title">富源晟科技</view>
<view class="ID">ID:123456</view>
</view>
</view>

View File

@ -191,7 +191,8 @@ class MqttClient {
try {
const connectOptions = {
timeout: 4,
timeout: 10, // 增加连接超时时间,应对网络波动
keepAliveInterval: 30, // 明确设置心跳间隔为30秒
userName: this.options.username,
password: this.options.password,
useSSL: false,