670小问题修复

This commit is contained in:
liub
2025-09-23 16:57:31 +08:00
parent 2546287bb4
commit ab696c3076
7 changed files with 84 additions and 69 deletions

View File

@ -30,8 +30,9 @@
uni.getSystemInfo({success:function(res){
if(res.uniPlatform=='app'){
upgrade.checkAndUpdateWgt();
bleTool.getBleTool();
upgrade.checkAndUpdateWgt();
}
}});
},

View File

@ -406,7 +406,7 @@
rgb565Data: [],
videoHexArray: [],
picPath: "",
permissions:[]//权限列表
permissions: [] //权限列表
}
},
created() {
@ -438,11 +438,11 @@
var device = data.data;
these.Status.apiType = data.apiType;
these.device = device;
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(',');
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(',');
}
}
});
@ -611,10 +611,12 @@
},
success: (res) => {
debugger;
let json={persissonType:'670'};
Object.assign(json,this.device);
let json = {
persissonType: '670'
};
Object.assign(json, this.device);
res.eventChannel.emit('share', {
data:json
data: json
});
}
})
@ -863,7 +865,7 @@
},
lightSetting: function(type) {
if(!this.permissions.includes('1') && this.Status.apiType!=='listA'){
if (!this.permissions.includes('1') && this.Status.apiType !== 'listA') {
this.showPop({
message: '无操作权限',
@ -1050,8 +1052,8 @@
});
},
sosSetting: function(type) {
if(!this.permissions.includes('42') && this.Status.apiType!=='listA'){
debugger;
if (!this.permissions.includes('42') && this.Status.apiType !== 'listA') {
this.showPop({
message: '无操作权限',
@ -1183,16 +1185,16 @@
if (type == 'rb') { //红蓝报警
console.log("11111");
console.log("11111");
let sendRb = () => {
this.formData.SOS = type;
bleSendCmd();
these.formData.qzwarn=false;
this.Status.staticWarn.time=0;
these.formData.qzwarn = false;
this.Status.staticWarn.time = 0;
return;
}
if (these.formData.qzwarn) {
console.log("222222");
if (these.formData.qzwarn && these.Status.staticWarn.inteval) {
console.log("222222");
these.showQzWarn(sendRb);
} else {
sendRb();
@ -1212,7 +1214,7 @@
return;
} else if (type == 'close') {
if (this.formData.SOS = 'sg') { //解除声光报警
if (this.formData.SOS = 'sg' && this.Status.staticWarn.inteval) { //解除声光报警
this.CloseWarn(true);
} else {
this.formData.SOS = type;
@ -1227,7 +1229,7 @@
setTimeout(task, 0);
},
GearSetting: function(type) { //档位设置
if(!this.permissions.includes('41') && this.Status.apiType!=='listA'){
if (!this.permissions.includes('41') && this.Status.apiType !== 'listA') {
this.showPop({
message: '无操作权限',
@ -1323,21 +1325,21 @@
setTimeout(task, 0);
},
proDetail:function(type){
if(!this.permissions.includes('41') && this.Status.apiType!=='listA'){
proDetail: function(type) {
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;
}
this.showPop({
message: '无操作权限',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: null,
buttonText: "确定"
})
return;
}
uni.navigateTo({
url: '/pages/common/'+type+'/index?id=' + this.device.id,
url: '/pages/common/' + type + '/index?id=' + this.device.id,
success(ev) {
}
@ -1881,7 +1883,7 @@
},
ShowUpload: function() {
if(!this.permissions.includes('3') && this.Status.apiType!=='listA'){
if (!this.permissions.includes('3') && this.Status.apiType !== 'listA') {
this.showPop({
message: '无操作权限',
@ -1988,7 +1990,7 @@
},
sendUsr: function(ReSendNo) {
if(!this.permissions.includes('4') && this.Status.apiType!=='listA'){
if (!this.permissions.includes('4') && this.Status.apiType !== 'listA') {
this.showPop({
message: '无操作权限',
@ -2195,7 +2197,7 @@
},
sendUrgent(type) {
if(!this.permissions.includes('5') && this.Status.apiType!=='listA'){
if (!this.permissions.includes('5') && this.Status.apiType !== 'listA') {
this.showPop({
message: '无操作权限',

View File

@ -152,6 +152,7 @@
these = this;
this.EquipMents = [];
ble = bleTool.getBleTool();
ble.addDeviceFound((arr) => {
arr = arr.devices;
@ -201,7 +202,10 @@
// this.EquipMents = [];
this.PairEquip = [];
ble && ble.StartSearch().catch((ex) => {
ble && ble.StartSearch().then(res=>{
console.log("开始搜索成功",res);
}).catch((ex) => {
console.log("开始搜索出现异常",ex);
if (ex.code == 10001) {
these.showOpenSetting();
}

View File

@ -200,13 +200,13 @@
const selectedPermissions = this.permissions.filter(permission => permission.checked).map(
permission =>
permission.value);
// const res = await deviceShareAdd({
// phonenumber: this.phone,
// smsCode: this.code,
// deviceId: this.itemInfo.id,
// permission: selectedPermissions.join(',')
// })
let res={code:200};
const res = await deviceShareAdd({
phonenumber: this.phone,
smsCode: this.code,
deviceId: this.itemInfo.id,
permission: selectedPermissions.join(',')
})
if (res.code == 200) {
this.shareShow = true
uni.hideLoading()

View File

@ -1,16 +1,17 @@
import receivTool from "@/utils/BleReceive.js"
var recei = null;
const serviceDic = [ //合作供应商的蓝牙主服务
{
"serviceId": "0000FFE0-0000-1000-8000-00805F9B34FB",
"writeId": "0000FFE1-0000-1000-8000-00805F9B34FB",
"notifyId": "0000FFE2-0000-1000-8000-00805F9B34FB"
},
{
"serviceId": "0000AE30-0000-1000-8000-00805F9B34FB",
"writeId": "0000AE03-0000-1000-8000-00805F9B34FB",
"notifyId": "0000AE02-0000-1000-8000-00805F9B34FB"
},
{
"serviceId": "0000FFE0-0000-1000-8000-00805F9B34FB",
"writeId": "0000FFE1-0000-1000-8000-00805F9B34FB",
"notifyId": "0000FFE2-0000-1000-8000-00805F9B34FB"
}
];
class BleHelper {
@ -39,7 +40,10 @@ class BleHelper {
}
setTimeout(() => {
this.linkAllDevices();
this.OpenBlue().then(()=>{
this.linkAllDevices();
});
}, 10);
this.data = {
isOpenBlue: false, //蓝牙模块是否开启
@ -185,7 +189,7 @@ class BleHelper {
key = new Date().getTime();
}
if (key) {
console.log("key=" + key);
// console.log("key=" + key);
let f = this.cfg.onDeviceFound.findIndex((v) => {
return v.key == key;
});
@ -366,6 +370,7 @@ class BleHelper {
return new Promise((resolve, reject) => {
if (this.data.available) {
console.log("蓝牙模块是可用状态");
resolve({
available: this.data.available,
discovering: this.data.discovering
@ -373,6 +378,7 @@ class BleHelper {
return;
}
if (!this.data.isOpenBlue) {
console.log("蓝牙模块未打开");
resolve({
available: false,
discovering: false
@ -381,12 +387,13 @@ class BleHelper {
}
uni.getBluetoothAdapterState({
success: (info) => {
console.log("蓝牙状态获取成功,",info)
this.data.available = info.available;
this.data.discovering = info.discovering;
resolve(info);
},
fail: (ex1) => {
////console.log("ex1", ex1);
console.log("蓝牙状态获取失败", ex1);
let res1 = {
available: false,
discovering: false
@ -472,7 +479,7 @@ class BleHelper {
});
uni.onBluetoothDeviceFound((devices) => {
// console.log("发现新设备:" + JSON.stringify(devices));
console.log("发现新设备:" + JSON.stringify(devices));
this.data.searchList = this.data.searchList.concat(
devices);
if (this.cfg.onDeviceFound) {
@ -706,8 +713,9 @@ class BleHelper {
// for (let i = 0; i < serviceIds.length; i++) {
// promises.push(RunSearch(serviceIds[i]));
// }
promises.push(RunSearch());
promises.push(RunSearch());
Promise.all(promises).then(resolve).catch(reject);
});

View File

@ -257,7 +257,7 @@ export default {
value: "42",
label: "SOS",
checked: false,
type: ['210', '6170', '670']
type: ['670']
}
]

View File

@ -1,5 +1,5 @@
import config from '../config/index.js';
const env = 'production'; //production development //开发of线上 改这里就行
const env = 'development'; //production development //开发of线上 改这里就行
const BASE = config[env];
const request = (options) => {
console.log("options"+JSON.stringify(options),BASE.BASE_URL)