分享设备相关的功能

This commit is contained in:
fengerli
2025-07-22 17:47:38 +08:00
parent 1663ae75e4
commit 864f7f58a0
19 changed files with 1360 additions and 307 deletions

View File

@ -12,8 +12,11 @@
{{tab.typeName}}
</view>
</view>
<view class="uniui-more" >
<image @click="allMore" src="/static/images/more.png" mode="" class="more"></image>
</view>
</scroll-view>
<view class="sendFlex" v-if="activeTab && activeTab.id !== ''">
<view class="sendFlex" v-if="activeTab && activeTab.id !== '' ||activeTab.communicationMode==0">
<view class="callpolice">报警</view>
<view class="Sendmessage" @click="location">位置</view>
<view class="Sendmessage" @click="handleSend">发送信息</view>
@ -109,6 +112,17 @@
</view>
</view>
</view>
<!-- ====分享类型提示框==== -->
<view class="tooltip-share" v-if="showshare">
<view class="tooltip-arrow"></view>
<view class="tooltip-content">
<view class="tooltip-item" v-for="(item, index) in shareItems" :key="index"
@click="handleshareClick(item)">
<image :src="item.icon" class="item-icon" />
<text>{{ item.text }}</text>
</view>
</view>
</view>
</view>
</template>
@ -127,6 +141,7 @@
tabs: [],
activeTab: 0,
showTooltip: false,
showshare: false,
Options: [{
text: '重命名',
style: {
@ -158,6 +173,17 @@
action: 'bluetooth'
}
],
shareItems: [{
text: '所有类型',
icon: '/static/images/type.png',
action: 'type'
},
{
text: '所有分享',
icon: '/static/images/share.png',
action: 'share'
}
],
page: 1, // 当前页码
size: 10, // 每页条数
total: 0, // 总数据量
@ -168,6 +194,26 @@
}
},
methods: {
// 更多
allMore(){
this.showshare = !this.showshare;
},
// 所有分享,所有类型
handleshareClick(item){
this.showshare = false; // 关闭弹窗
switch (item.action) {
case 'type':
uni.navigateTo({
url: '/pages/common/allType/index'
});
break;
case 'share':
uni.navigateTo({
url: "/pages/6170/allShare/index"
})
break;
}
},
// 点击弹框外的区域关闭
closePopup(type) {
if (type === 'delete') {
@ -208,7 +254,6 @@
const deviceType = tab.id === '' ? undefined : tab.id;
this.getData(deviceType);
},
// 获取设备列表
getData(deviceType = '') {
if (this.loading || this.finished) return;
@ -243,10 +288,11 @@
onScrollToLower() {
this.getData();
},
// 添加扫一三图标
scan() {
this.showTooltip = !this.showTooltip;
},
// 添加设备,扫一扫,蓝牙
handleMenuClick(item) {
this.showTooltip = false; // 关闭弹窗
switch (item.action) {
@ -256,15 +302,6 @@
});
break;
case 'bluetooth':
// uni.navigateTo({
// url: 'pages/common/addBLE/AddDevice',
// success:(res)=>{
// res.eventChannel.emit('key', { data: 'data from starter page' })
// },fail: (ex) => {
// console.log("跳转失败了",JSON.stringify(ex));
// }
// });
uni.navigateTo({
url: "/pages/common/addBLE/addEquip"
})
@ -391,7 +428,8 @@
success: (res) => {
// 页面跳转成功后的回调函数
res.eventChannel.emit('deviceControl', {
data: item
data: item,
apiType: 'listA' // 自定义标识,详情哪里根据这个参数不同信息
});
}
})
@ -454,6 +492,7 @@
white-space: nowrap;
/* 禁止换行 */
overflow: hidden;
position: relative;
}
@ -491,6 +530,21 @@
font-size: 28rpx;
}
.uniui-more {
position: relative;
width: 100%;
}
.more {
width: 40rpx;
height: 8rpx;
/* position: absolute; */
/* right: 0rpx;
z-index: 100; */
float: right;
top: -95rpx
}
.gprs {
width: 28rpx;
height: 35rpx;
@ -634,10 +688,11 @@
padding: 20rpx;
font-size: 22rpx;
}
.noDATA{
.noDATA {
text-align: center;
color: rgba(255, 255, 255, 0.87);
transform: translate(-0%,100%);
transform: translate(-0%, 100%);
}
/* 遮罩层 */
@ -757,6 +812,13 @@
/* 根据导航栏高度调整 */
z-index: 9999;
}
.tooltip-share{
position: fixed;
right: 18rpx;
top: 230rpx;
/* 根据导航栏高度调整 */
z-index: 9999;
}
.tooltip-arrow {
width: 0;