蓝牙设备添加分享功能
This commit is contained in:
@ -1,5 +1,26 @@
|
||||
<template>
|
||||
<view class="content contentBg">
|
||||
<uni-nav-bar class="nvbar" leftIcon="left" @clickLeft="navigatorBack">
|
||||
<view slot="left">
|
||||
<uni-icons type="back" size="23" color="#FFFFFF"></uni-icons>
|
||||
</view>
|
||||
<view slot="default" class="center uninavebartext">
|
||||
{{Status.navbar.title}}
|
||||
</view>
|
||||
<view slot="right">
|
||||
<view class="navbarRight center">
|
||||
<view class="imgContent" :class="{'visibilityHidden':Status.apiType!=item.apiType}"
|
||||
@click.stop="handleRightClick(item,index)" v-for="item,index in Status.navbar.icons">
|
||||
<image class="img" :src="item.src" mode="aspectFit"></image>
|
||||
<view class="baber" v-if="item.math">{{item.math>9?'9+':item.math}}</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
</uni-nav-bar>
|
||||
|
||||
<view class="eq">
|
||||
<view class="leftImg" @click.stop="previewImg(device.devicePic?device.devicePic:formData.img)">
|
||||
<image class="img" :src="device.devicePic?device.devicePic:formData.img" mode="aspectFit"></image>
|
||||
@ -184,6 +205,7 @@
|
||||
import gbk from '@/utils/gbk.js'
|
||||
import BleTool from '@/utils/BleHelper.js'
|
||||
import BleReceive from '@/utils/BleReceive';
|
||||
import Common from '@/utils/Common.js'
|
||||
import {
|
||||
showLoading,
|
||||
hideLoading,
|
||||
@ -201,6 +223,16 @@ import request, { baseURL } from '@/utils/request.js';
|
||||
data() {
|
||||
return {
|
||||
Status: {
|
||||
apiType: '',
|
||||
navbar: {
|
||||
icons: [{
|
||||
src: '/static/images/common/shape.png',
|
||||
callback: this.gotoShare,
|
||||
apiType: 'listA'
|
||||
}],
|
||||
title: 'HBY650'
|
||||
|
||||
},
|
||||
pageHide: false,
|
||||
Pop: {
|
||||
showPop: false, //是否显示弹窗
|
||||
@ -282,6 +314,7 @@ import request, { baseURL } from '@/utils/request.js';
|
||||
},
|
||||
rgb565Data: [],
|
||||
videoHexArray: [],
|
||||
permissions: [],
|
||||
device: {
|
||||
id: "",
|
||||
deviceName: "",
|
||||
@ -328,6 +361,17 @@ import request, { baseURL } from '@/utils/request.js';
|
||||
// console.log("收到父页面的参数:" + JSON.stringify(data));
|
||||
var device = data.data;
|
||||
these.device = device;
|
||||
these.Status.apiType = data.apiType;
|
||||
these.Status.navbar.title = device.deviceName;
|
||||
if (data.apiType !== 'listA') {
|
||||
Common.getdeviceShareId(data.data.id).then(res => {
|
||||
if (res.code == 200) {
|
||||
if (res.data.permission) {
|
||||
these.permissions = res.data.permission.split(',');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
let f = ble.data.LinkedList.find((v) => {
|
||||
if (v.macAddress == device.deviceMac) {
|
||||
// console.log("找到设备了", v);
|
||||
@ -393,6 +437,36 @@ import request, { baseURL } from '@/utils/request.js';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleRightClick(item, s) {
|
||||
if (item && item.callback) {
|
||||
item.callback(item, s);
|
||||
} else {
|
||||
uni.showModal({
|
||||
content: '敬请期待'
|
||||
})
|
||||
|
||||
}
|
||||
},
|
||||
navigatorBack() {
|
||||
uni.navigateBack();
|
||||
},
|
||||
gotoShare(item, s) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/common/share/index',
|
||||
events: {
|
||||
ack: function(data) {}
|
||||
},
|
||||
success: (res) => {
|
||||
let json = {
|
||||
persissonType: '650'
|
||||
};
|
||||
Object.assign(json, this.device);
|
||||
res.eventChannel.emit('share', {
|
||||
data: json
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
deviceRecovry(res) {
|
||||
if (this.Status.pageHide) {
|
||||
return;
|
||||
@ -616,6 +690,20 @@ import request, { baseURL } from '@/utils/request.js';
|
||||
uni.setStorageSync(ble.StorageKey, ble.data.LinkedList);
|
||||
},
|
||||
MainModeSetting: function(type, byteType) {
|
||||
|
||||
if (!this.permissions.includes('41') && this.Status.apiType !== 'listA') {
|
||||
|
||||
this.showPop({
|
||||
message: '无操作权限',
|
||||
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
|
||||
borderColor: "#e034344d",
|
||||
buttonBgColor: "#E03434",
|
||||
okCallback: null,
|
||||
buttonText: "确定"
|
||||
})
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.formData.modeCurr == type) {
|
||||
type = 'close';
|
||||
}
|
||||
@ -741,7 +829,18 @@ import request, { baseURL } from '@/utils/request.js';
|
||||
});
|
||||
},
|
||||
LampToggle: function() {
|
||||
if (!this.permissions.includes('1') && this.Status.apiType !== 'listA') {
|
||||
|
||||
this.showPop({
|
||||
message: '无操作权限',
|
||||
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
|
||||
borderColor: "#e034344d",
|
||||
buttonBgColor: "#E03434",
|
||||
okCallback: null,
|
||||
buttonText: "确定"
|
||||
})
|
||||
return;
|
||||
}
|
||||
this.formData.cMode = !this.formData.cMode;
|
||||
this.MainModeSetting(this.formData.cMode, "lamp");
|
||||
},
|
||||
@ -1238,6 +1337,19 @@ import request, { baseURL } from '@/utils/request.js';
|
||||
|
||||
},
|
||||
ShowUpload: function() {
|
||||
|
||||
if (!this.permissions.includes('3') && this.Status.apiType !== 'listA') {
|
||||
|
||||
this.showPop({
|
||||
message: '无操作权限',
|
||||
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
|
||||
borderColor: "#e034344d",
|
||||
buttonBgColor: "#E03434",
|
||||
okCallback: null,
|
||||
buttonText: "确定"
|
||||
})
|
||||
return;
|
||||
}
|
||||
//上传开机画面
|
||||
this.Status.BottomMenu.menuItems = [];
|
||||
this.Status.BottomMenu.title = "上传开机画面";
|
||||
@ -1345,7 +1457,18 @@ import request, { baseURL } from '@/utils/request.js';
|
||||
},
|
||||
sendUsr: function(ReSendNo) {
|
||||
|
||||
if (!this.permissions.includes('4') && this.Status.apiType !== 'listA') {
|
||||
|
||||
this.showPop({
|
||||
message: '无操作权限',
|
||||
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
|
||||
borderColor: "#e034344d",
|
||||
buttonBgColor: "#E03434",
|
||||
okCallback: null,
|
||||
buttonText: "确定"
|
||||
})
|
||||
return;
|
||||
}
|
||||
|
||||
var textLines = [
|
||||
this.formData.company,
|
||||
@ -2111,4 +2234,71 @@ import request, { baseURL } from '@/utils/request.js';
|
||||
.net.active {
|
||||
background: #FFFFFF !important;
|
||||
}
|
||||
|
||||
|
||||
.navbarRight {
|
||||
width: 40px;
|
||||
height: 100%;
|
||||
|
||||
}
|
||||
|
||||
.navbarRight .imgContent {
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.navbarRight .imgContent:first-child {
|
||||
|
||||
width: 38rpx !important;
|
||||
height: 38rpx !important;
|
||||
margin-top: -2rpx;
|
||||
}
|
||||
|
||||
.navbarRight .imgContent .baber {
|
||||
position: absolute;
|
||||
z-index: 100;
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
line-height: 30rpx;
|
||||
right: -15rpx;
|
||||
top: -15rpx;
|
||||
border-radius: 50%;
|
||||
background: #f12828;
|
||||
color: #ffffff;
|
||||
font-family: 'PingFang SC';
|
||||
font-style: Regular;
|
||||
font-size: 20rpx;
|
||||
font-weight: 400;
|
||||
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
|
||||
}
|
||||
|
||||
.navbarRight .imgContent .img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.navbarRight .imgContent .img:last-child {
|
||||
padding: 1rpx;
|
||||
}
|
||||
|
||||
.nvbar {
|
||||
top: 0px;
|
||||
}
|
||||
|
||||
/deep/ .uni-navbar--fixed {
|
||||
top: 0px;
|
||||
}
|
||||
|
||||
.uninavebartext {
|
||||
width: 100%;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user