@ -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 ,