670小问题修复
This commit is contained in:
3
App.vue
3
App.vue
@ -30,8 +30,9 @@
|
|||||||
|
|
||||||
uni.getSystemInfo({success:function(res){
|
uni.getSystemInfo({success:function(res){
|
||||||
if(res.uniPlatform=='app'){
|
if(res.uniPlatform=='app'){
|
||||||
upgrade.checkAndUpdateWgt();
|
|
||||||
bleTool.getBleTool();
|
bleTool.getBleTool();
|
||||||
|
upgrade.checkAndUpdateWgt();
|
||||||
|
|
||||||
}
|
}
|
||||||
}});
|
}});
|
||||||
},
|
},
|
||||||
|
|||||||
@ -406,7 +406,7 @@
|
|||||||
rgb565Data: [],
|
rgb565Data: [],
|
||||||
videoHexArray: [],
|
videoHexArray: [],
|
||||||
picPath: "",
|
picPath: "",
|
||||||
permissions:[]//权限列表
|
permissions: [] //权限列表
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@ -438,11 +438,11 @@
|
|||||||
var device = data.data;
|
var device = data.data;
|
||||||
these.Status.apiType = data.apiType;
|
these.Status.apiType = data.apiType;
|
||||||
these.device = device;
|
these.device = device;
|
||||||
if(data.apiType!=='listA'){
|
if (data.apiType !== 'listA') {
|
||||||
Common.getdeviceShareId(data.data.id).then(res=>{
|
Common.getdeviceShareId(data.data.id).then(res => {
|
||||||
if(res.code==200){
|
if (res.code == 200) {
|
||||||
if(res.data.permission){
|
if (res.data.permission) {
|
||||||
these.permissions=res.data.permission.split(',');
|
these.permissions = res.data.permission.split(',');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -611,10 +611,12 @@
|
|||||||
},
|
},
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
debugger;
|
debugger;
|
||||||
let json={persissonType:'670'};
|
let json = {
|
||||||
Object.assign(json,this.device);
|
persissonType: '670'
|
||||||
|
};
|
||||||
|
Object.assign(json, this.device);
|
||||||
res.eventChannel.emit('share', {
|
res.eventChannel.emit('share', {
|
||||||
data:json
|
data: json
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -863,7 +865,7 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
lightSetting: function(type) {
|
lightSetting: function(type) {
|
||||||
if(!this.permissions.includes('1') && this.Status.apiType!=='listA'){
|
if (!this.permissions.includes('1') && this.Status.apiType !== 'listA') {
|
||||||
|
|
||||||
this.showPop({
|
this.showPop({
|
||||||
message: '无操作权限',
|
message: '无操作权限',
|
||||||
@ -1050,8 +1052,8 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
sosSetting: function(type) {
|
sosSetting: function(type) {
|
||||||
|
debugger;
|
||||||
if(!this.permissions.includes('42') && this.Status.apiType!=='listA'){
|
if (!this.permissions.includes('42') && this.Status.apiType !== 'listA') {
|
||||||
|
|
||||||
this.showPop({
|
this.showPop({
|
||||||
message: '无操作权限',
|
message: '无操作权限',
|
||||||
@ -1187,11 +1189,11 @@
|
|||||||
let sendRb = () => {
|
let sendRb = () => {
|
||||||
this.formData.SOS = type;
|
this.formData.SOS = type;
|
||||||
bleSendCmd();
|
bleSendCmd();
|
||||||
these.formData.qzwarn=false;
|
these.formData.qzwarn = false;
|
||||||
this.Status.staticWarn.time=0;
|
this.Status.staticWarn.time = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (these.formData.qzwarn) {
|
if (these.formData.qzwarn && these.Status.staticWarn.inteval) {
|
||||||
console.log("222222");
|
console.log("222222");
|
||||||
these.showQzWarn(sendRb);
|
these.showQzWarn(sendRb);
|
||||||
} else {
|
} else {
|
||||||
@ -1212,7 +1214,7 @@
|
|||||||
return;
|
return;
|
||||||
} else if (type == 'close') {
|
} else if (type == 'close') {
|
||||||
|
|
||||||
if (this.formData.SOS = 'sg') { //解除声光报警
|
if (this.formData.SOS = 'sg' && this.Status.staticWarn.inteval) { //解除声光报警
|
||||||
this.CloseWarn(true);
|
this.CloseWarn(true);
|
||||||
} else {
|
} else {
|
||||||
this.formData.SOS = type;
|
this.formData.SOS = type;
|
||||||
@ -1227,7 +1229,7 @@
|
|||||||
setTimeout(task, 0);
|
setTimeout(task, 0);
|
||||||
},
|
},
|
||||||
GearSetting: function(type) { //档位设置
|
GearSetting: function(type) { //档位设置
|
||||||
if(!this.permissions.includes('41') && this.Status.apiType!=='listA'){
|
if (!this.permissions.includes('41') && this.Status.apiType !== 'listA') {
|
||||||
|
|
||||||
this.showPop({
|
this.showPop({
|
||||||
message: '无操作权限',
|
message: '无操作权限',
|
||||||
@ -1323,8 +1325,8 @@
|
|||||||
|
|
||||||
setTimeout(task, 0);
|
setTimeout(task, 0);
|
||||||
},
|
},
|
||||||
proDetail:function(type){
|
proDetail: function(type) {
|
||||||
if(!this.permissions.includes('41') && this.Status.apiType!=='listA'){
|
if (!this.permissions.includes('41') && this.Status.apiType !== 'listA') {
|
||||||
|
|
||||||
this.showPop({
|
this.showPop({
|
||||||
message: '无操作权限',
|
message: '无操作权限',
|
||||||
@ -1337,7 +1339,7 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/common/'+type+'/index?id=' + this.device.id,
|
url: '/pages/common/' + type + '/index?id=' + this.device.id,
|
||||||
success(ev) {
|
success(ev) {
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1881,7 +1883,7 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
ShowUpload: function() {
|
ShowUpload: function() {
|
||||||
if(!this.permissions.includes('3') && this.Status.apiType!=='listA'){
|
if (!this.permissions.includes('3') && this.Status.apiType !== 'listA') {
|
||||||
|
|
||||||
this.showPop({
|
this.showPop({
|
||||||
message: '无操作权限',
|
message: '无操作权限',
|
||||||
@ -1988,7 +1990,7 @@
|
|||||||
},
|
},
|
||||||
sendUsr: function(ReSendNo) {
|
sendUsr: function(ReSendNo) {
|
||||||
|
|
||||||
if(!this.permissions.includes('4') && this.Status.apiType!=='listA'){
|
if (!this.permissions.includes('4') && this.Status.apiType !== 'listA') {
|
||||||
|
|
||||||
this.showPop({
|
this.showPop({
|
||||||
message: '无操作权限',
|
message: '无操作权限',
|
||||||
@ -2195,7 +2197,7 @@
|
|||||||
},
|
},
|
||||||
sendUrgent(type) {
|
sendUrgent(type) {
|
||||||
|
|
||||||
if(!this.permissions.includes('5') && this.Status.apiType!=='listA'){
|
if (!this.permissions.includes('5') && this.Status.apiType !== 'listA') {
|
||||||
|
|
||||||
this.showPop({
|
this.showPop({
|
||||||
message: '无操作权限',
|
message: '无操作权限',
|
||||||
|
|||||||
@ -152,6 +152,7 @@
|
|||||||
these = this;
|
these = this;
|
||||||
this.EquipMents = [];
|
this.EquipMents = [];
|
||||||
ble = bleTool.getBleTool();
|
ble = bleTool.getBleTool();
|
||||||
|
|
||||||
ble.addDeviceFound((arr) => {
|
ble.addDeviceFound((arr) => {
|
||||||
|
|
||||||
arr = arr.devices;
|
arr = arr.devices;
|
||||||
@ -201,7 +202,10 @@
|
|||||||
|
|
||||||
// this.EquipMents = [];
|
// this.EquipMents = [];
|
||||||
this.PairEquip = [];
|
this.PairEquip = [];
|
||||||
ble && ble.StartSearch().catch((ex) => {
|
ble && ble.StartSearch().then(res=>{
|
||||||
|
console.log("开始搜索成功",res);
|
||||||
|
}).catch((ex) => {
|
||||||
|
console.log("开始搜索出现异常",ex);
|
||||||
if (ex.code == 10001) {
|
if (ex.code == 10001) {
|
||||||
these.showOpenSetting();
|
these.showOpenSetting();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -200,13 +200,13 @@
|
|||||||
const selectedPermissions = this.permissions.filter(permission => permission.checked).map(
|
const selectedPermissions = this.permissions.filter(permission => permission.checked).map(
|
||||||
permission =>
|
permission =>
|
||||||
permission.value);
|
permission.value);
|
||||||
// const res = await deviceShareAdd({
|
const res = await deviceShareAdd({
|
||||||
// phonenumber: this.phone,
|
phonenumber: this.phone,
|
||||||
// smsCode: this.code,
|
smsCode: this.code,
|
||||||
// deviceId: this.itemInfo.id,
|
deviceId: this.itemInfo.id,
|
||||||
// permission: selectedPermissions.join(',')
|
permission: selectedPermissions.join(',')
|
||||||
// })
|
})
|
||||||
let res={code:200};
|
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
this.shareShow = true
|
this.shareShow = true
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
|
|||||||
@ -1,16 +1,17 @@
|
|||||||
import receivTool from "@/utils/BleReceive.js"
|
import receivTool from "@/utils/BleReceive.js"
|
||||||
var recei = null;
|
var recei = null;
|
||||||
const serviceDic = [ //合作供应商的蓝牙主服务
|
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",
|
"serviceId": "0000AE30-0000-1000-8000-00805F9B34FB",
|
||||||
"writeId": "0000AE03-0000-1000-8000-00805F9B34FB",
|
"writeId": "0000AE03-0000-1000-8000-00805F9B34FB",
|
||||||
"notifyId": "0000AE02-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 {
|
class BleHelper {
|
||||||
@ -39,7 +40,10 @@ class BleHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
this.OpenBlue().then(()=>{
|
||||||
this.linkAllDevices();
|
this.linkAllDevices();
|
||||||
|
});
|
||||||
|
|
||||||
}, 10);
|
}, 10);
|
||||||
this.data = {
|
this.data = {
|
||||||
isOpenBlue: false, //蓝牙模块是否开启
|
isOpenBlue: false, //蓝牙模块是否开启
|
||||||
@ -185,7 +189,7 @@ class BleHelper {
|
|||||||
key = new Date().getTime();
|
key = new Date().getTime();
|
||||||
}
|
}
|
||||||
if (key) {
|
if (key) {
|
||||||
console.log("key=" + key);
|
// console.log("key=" + key);
|
||||||
let f = this.cfg.onDeviceFound.findIndex((v) => {
|
let f = this.cfg.onDeviceFound.findIndex((v) => {
|
||||||
return v.key == key;
|
return v.key == key;
|
||||||
});
|
});
|
||||||
@ -366,6 +370,7 @@ class BleHelper {
|
|||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
if (this.data.available) {
|
if (this.data.available) {
|
||||||
|
console.log("蓝牙模块是可用状态");
|
||||||
resolve({
|
resolve({
|
||||||
available: this.data.available,
|
available: this.data.available,
|
||||||
discovering: this.data.discovering
|
discovering: this.data.discovering
|
||||||
@ -373,6 +378,7 @@ class BleHelper {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!this.data.isOpenBlue) {
|
if (!this.data.isOpenBlue) {
|
||||||
|
console.log("蓝牙模块未打开");
|
||||||
resolve({
|
resolve({
|
||||||
available: false,
|
available: false,
|
||||||
discovering: false
|
discovering: false
|
||||||
@ -381,12 +387,13 @@ class BleHelper {
|
|||||||
}
|
}
|
||||||
uni.getBluetoothAdapterState({
|
uni.getBluetoothAdapterState({
|
||||||
success: (info) => {
|
success: (info) => {
|
||||||
|
console.log("蓝牙状态获取成功,",info)
|
||||||
this.data.available = info.available;
|
this.data.available = info.available;
|
||||||
this.data.discovering = info.discovering;
|
this.data.discovering = info.discovering;
|
||||||
resolve(info);
|
resolve(info);
|
||||||
},
|
},
|
||||||
fail: (ex1) => {
|
fail: (ex1) => {
|
||||||
////console.log("ex1", ex1);
|
console.log("蓝牙状态获取失败", ex1);
|
||||||
let res1 = {
|
let res1 = {
|
||||||
available: false,
|
available: false,
|
||||||
discovering: false
|
discovering: false
|
||||||
@ -472,7 +479,7 @@ class BleHelper {
|
|||||||
});
|
});
|
||||||
|
|
||||||
uni.onBluetoothDeviceFound((devices) => {
|
uni.onBluetoothDeviceFound((devices) => {
|
||||||
// console.log("发现新设备:" + JSON.stringify(devices));
|
console.log("发现新设备:" + JSON.stringify(devices));
|
||||||
this.data.searchList = this.data.searchList.concat(
|
this.data.searchList = this.data.searchList.concat(
|
||||||
devices);
|
devices);
|
||||||
if (this.cfg.onDeviceFound) {
|
if (this.cfg.onDeviceFound) {
|
||||||
@ -706,6 +713,7 @@ class BleHelper {
|
|||||||
// for (let i = 0; i < serviceIds.length; i++) {
|
// for (let i = 0; i < serviceIds.length; i++) {
|
||||||
|
|
||||||
// promises.push(RunSearch(serviceIds[i]));
|
// promises.push(RunSearch(serviceIds[i]));
|
||||||
|
|
||||||
// }
|
// }
|
||||||
promises.push(RunSearch());
|
promises.push(RunSearch());
|
||||||
Promise.all(promises).then(resolve).catch(reject);
|
Promise.all(promises).then(resolve).catch(reject);
|
||||||
|
|||||||
@ -257,7 +257,7 @@ export default {
|
|||||||
value: "42",
|
value: "42",
|
||||||
label: "SOS",
|
label: "SOS",
|
||||||
checked: false,
|
checked: false,
|
||||||
type: ['210', '6170', '670']
|
type: ['670']
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import config from '../config/index.js';
|
import config from '../config/index.js';
|
||||||
const env = 'production'; //production development //开发of线上 改这里就行
|
const env = 'development'; //production development //开发of线上 改这里就行
|
||||||
const BASE = config[env];
|
const BASE = config[env];
|
||||||
const request = (options) => {
|
const request = (options) => {
|
||||||
console.log("options"+JSON.stringify(options),BASE.BASE_URL)
|
console.log("options"+JSON.stringify(options),BASE.BASE_URL)
|
||||||
|
|||||||
Reference in New Issue
Block a user