diff --git a/androidPrivacy.json b/androidPrivacy.json
index 6e900af..3e91c29 100644
--- a/androidPrivacy.json
+++ b/androidPrivacy.json
@@ -2,7 +2,7 @@
"version" : "1",
"prompt" : "template",
"title" : "服务协议和隐私政策",
- "message" : " 请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。
你可阅读《服务协议》和《隐私政策》了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
+ "message" : " 请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。
你可阅读《服务协议》和《隐私政策》了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
"buttonAccept" : "同意并接受",
"buttonRefuse" : "暂不同意",
"hrefLoader" : "system",
diff --git a/api/6170/callPolice.js b/api/6170/callPolice.js
index 88a5e01..ccbac70 100644
--- a/api/6170/callPolice.js
+++ b/api/6170/callPolice.js
@@ -6,4 +6,8 @@ export function deviceSendAlarmMessage(data) {
method: 'post',
data: data
})
+}
+
+export function deviceDefaultAlarm(data){
+ return Promise.reject(data);
}
\ No newline at end of file
diff --git a/components/MessagePopup/MessagePopup.vue b/components/MessagePopup/MessagePopup.vue
index 46291b3..8f3a628 100644
--- a/components/MessagePopup/MessagePopup.vue
+++ b/components/MessagePopup/MessagePopup.vue
@@ -48,7 +48,7 @@
diff --git a/components/MsgBox/MsgBox.vue b/components/MsgBox/MsgBox.vue
new file mode 100644
index 0000000..77e99f1
--- /dev/null
+++ b/components/MsgBox/MsgBox.vue
@@ -0,0 +1,187 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/config/index.js b/config/index.js
index 31d9e3c..d8101c0 100644
--- a/config/index.js
+++ b/config/index.js
@@ -2,7 +2,7 @@
const config = {
// 开发环境
development: {
- BASE_URL: 'http://192.168.2.34:8000',//http://139.224.253.23:8000
+ BASE_URL: 'http://192.168.110.172:8000',//http://139.224.253.23:8000
API_PREFIX: '',
// MQTT 配置
MQTT_HOST: '47.120.79.150',
diff --git a/manifest.json b/manifest.json
index d9ccd8e..0e8e898 100644
--- a/manifest.json
+++ b/manifest.json
@@ -2,7 +2,7 @@
"name" : "星汉物联",
"appid" : "__UNI__A21EF43",
"description" : "设备管控",
- "versionName" : "1.0.15",
+ "versionName" : "1.0.17",
"versionCode" : "100",
"transformPx" : false,
/* 5+App特有相关 */
diff --git a/pages.json b/pages.json
index 8ee4097..9b578b8 100644
--- a/pages.json
+++ b/pages.json
@@ -414,6 +414,14 @@
{
"navigationBarTitleText" : "录制语音"
}
+ },
+ {
+ "path" : "pages/common/addScan/ScanEquip",
+ "style" :
+ {
+ "navigationBarTitleText" : "扫码",
+ "navigationStyle": "custom"
+ }
}
diff --git a/pages/018A/HBY018A.vue b/pages/018A/HBY018A.vue
index bcb5419..3d5fb41 100644
--- a/pages/018A/HBY018A.vue
+++ b/pages/018A/HBY018A.vue
@@ -505,7 +505,11 @@
return;
}
if (res.deviceId == these.formData.deviceId) {
- this.formData.bleStatu = false;
+ if(res.device){
+ these.formData.bleStatu = 'connecting';
+ }else{
+ this.formData.bleStatu = false;
+ }
setTimeout(() => {
hideLoading(these, 1000);
});
diff --git a/pages/100/HBY100.vue b/pages/100/HBY100.vue
index eff28dd..ea99012 100644
--- a/pages/100/HBY100.vue
+++ b/pages/100/HBY100.vue
@@ -57,9 +57,9 @@
蓝牙名称
{{device.bluetoothName}}
-
+
蓝牙状态
- {{formData.bleStatu?'已连接':'未连接'}}
+ {{getbleStatu}}
@@ -58,9 +55,9 @@
蓝牙名称
{{device.bluetoothName}}
-
+
蓝牙状态
- {{formData.bleStatu?'已连接':'未连接'}}
+ {{getbleStatu}}
设备状态
@@ -550,7 +547,8 @@
these.formData['imei'] = these.device.deviceImei;
}
these.getDetail();
- these.formData.bleStatu = false;
+
+ these.formData.bleStatu='connecting';
ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => {
these.formData.bleStatu = true;
});
@@ -567,9 +565,49 @@
ble.removeReceiveCallback(pagePath);
},
computed: {
-
+ getbleStatu(){
+ if(this.formData.bleStatu===true){
+ return '已连接';
+ }
+ if(this.formData.bleStatu==='connecting'){
+ return '连接中';
+ }
+ if(this.formData.bleStatu==='dicconnect'){
+ return '正在断开';
+ }
+ if(this.formData.bleStatu==='err'){
+ return '连接异常';
+ }
+ return '未连接';
+ }
},
methods: {
+ bleStatuToggle(){
+ let f=this.getDevice();
+ if(!f){
+ this.showBleUnConnect();
+ return;
+ }
+ if(this.formData.bleStatu===true){
+ this.formData.bleStatu='dicconnect';
+ ble.disconnectDevice(f.deviceId).finally(r=>{
+ this.formData.bleStatu=false;
+ });
+ return;
+ }
+
+ if(this.formData.bleStatu===false || this.formData.bleStatu==='err'){
+ this.formData.bleStatu='connecting';
+ ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => {
+ these.formData.bleStatu = true;
+ }).catch(ex=>{
+ these.formData.bleStatu = 'err';
+ });
+ return;
+ }
+
+
+ },
prevPage() {
uni.navigateBack({
@@ -596,7 +634,11 @@
return;
}
if (res.deviceId == these.formData.deviceId) {
- this.formData.bleStatu = false;
+ if(res.device){
+ these.formData.bleStatu = 'connecting';
+ }else{
+ this.formData.bleStatu = false;
+ }
setTimeout(() => {
hideLoading(these, 1000);
});
@@ -629,6 +671,7 @@
showLoading(this, {
text: "蓝牙恢复可用,正在连接设备"
});
+ this.formData.bleStatu='connecting';
ble.LinkBlue(these.formData.deviceId).then(() => {
these.formData.bleStatu = true;
updateLoading(these, {
@@ -1848,7 +1891,7 @@
these.Status.BottomMenu.show = false;
these.picPath = data.picPath;
- these.rgb565Data = ble.convertToRGB565(data.piexls);
+ these.rgb565Data = Common.convertToRGB565(data.piexls);
setTimeout(function() {
sendImagePackets().catch(() => {
diff --git a/pages/7305/BJQ7305.vue b/pages/7305/BJQ7305.vue
index 924123d..24d67ff 100644
--- a/pages/7305/BJQ7305.vue
+++ b/pages/7305/BJQ7305.vue
@@ -9,16 +9,16 @@
-
+
{{item.math>9?'9+':item.math}}
-
+
-
+
-
+
@@ -60,9 +60,9 @@
-
+
蓝牙状态
- {{formData.bleStatu?'已连接':'未连接'}}
+ {{getbleStatu}}
@@ -182,7 +182,7 @@
updateLoading
} from '@/utils/loading.js'
import BleReceive from '@/utils/BleReceive';
-import Common from '@/utils/Common.js';
+ import Common from '@/utils/Common.js';
var ble = null;
var these = null;
@@ -201,10 +201,10 @@ import Common from '@/utils/Common.js';
icons: [{
src: '/static/images/common/shape.png',
callback: this.gotoShare,
- apiType:'listA'
+ apiType: 'listA'
}],
title: 'BJQ6155'
-
+
},
pageHide: false,
Pop: {
@@ -320,8 +320,8 @@ import Common from '@/utils/Common.js';
let device = data.data;
these.device = device;
-these.Status.apiType = data.apiType;
- these.Status.navbar.title=device.deviceName;
+ 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) {
@@ -358,7 +358,7 @@ these.Status.apiType = data.apiType;
these.formData.id = device.id;
these.formData.deviceId = f.deviceId;
- these.formData.bleStatu = false;
+ these.formData.bleStatu = 'connecting';
ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => {
console.log("连接成功")
these.formData.bleStatu = true;
@@ -378,21 +378,20 @@ these.Status.apiType = data.apiType;
this.Status.pageHide = false;
},
computed: {
- RSSIRemark: function() {
- let remark = '极弱';
- if (this.formData.RSSI <= 0 && this.formData.RSSI >= -30) {
- remark = '强';
+ getbleStatu() {
+ if (this.formData.bleStatu === true) {
+ return '已连接';
}
-
- if (this.formData.RSSI < -30 && this.formData.RSSI >= -60) {
- remark = '一般';
+ if (this.formData.bleStatu === 'connecting') {
+ return '连接中';
}
- if (this.formData.RSSI < -60 && this.formData.RSSI >= -85) {
- remark = '弱';
+ if (this.formData.bleStatu === 'dicconnect') {
+ return '正在断开';
}
- if (this.formData.RSSI < -85 && this.formData.RSSI >= -100) {
- remark = '微弱';
+ if (this.formData.bleStatu === 'err') {
+ return '连接异常';
}
+ return '未连接';
},
getMode() {
let txt = "关闭";
@@ -425,6 +424,32 @@ these.Status.apiType = data.apiType;
}
},
methods: {
+ bleStatuToggle() {
+ let f = this.getDevice();
+ if (!f) {
+ this.showBleUnConnect();
+ return;
+ }
+ if (this.formData.bleStatu === true) {
+ this.formData.bleStatu = 'dicconnect';
+ ble.disconnectDevice(f.deviceId).finally(r => {
+ this.formData.bleStatu = false;
+ });
+ return;
+ }
+
+ if (this.formData.bleStatu === false || this.formData.bleStatu === 'err') {
+ these.formData.bleStatu = 'connecting';
+ ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => {
+ these.formData.bleStatu = true;
+ }).catch(ex => {
+ these.formData.bleStatu = 'err';
+ });
+ return;
+ }
+
+
+ },
handleRightClick(item, s) {
if (item && item.callback) {
item.callback(item, s);
@@ -432,7 +457,7 @@ these.Status.apiType = data.apiType;
uni.showModal({
content: '敬请期待'
})
-
+
}
},
navigatorBack() {
@@ -477,7 +502,12 @@ these.Status.apiType = data.apiType;
return;
}
if (res.deviceId == these.formData.deviceId) {
- this.formData.bleStatu = false;
+ if (res.device) {
+ these.formData.bleStatu = 'connecting';
+ } else {
+ this.formData.bleStatu = false;
+ }
+
// 断开连接时先将充电状态复位,避免保持旧值
this.formData.statu = '未充电';
this.setBleFormData();
@@ -513,6 +543,7 @@ these.Status.apiType = data.apiType;
showLoading(this, {
text: "蓝牙恢复可用,正在连接设备"
});
+ these.formData.bleStatu = 'connecting';
ble.LinkBlue(these.formData.deviceId).then(() => {
these.formData.bleStatu = true;
updateLoading(these, {
@@ -554,9 +585,9 @@ these.Status.apiType = data.apiType;
if (this.Status.pageHide) {
return;
}
-
+
let json = recei.ReceiveData(receive, device, path, recArr);
- console.log("收到消息:",receive.hexs);
+ console.log("收到消息:", receive.hexs);
if (!json) {
return;
}
@@ -590,7 +621,7 @@ these.Status.apiType = data.apiType;
proParam: function() {
uni.navigateTo({
- url: '/pages/common/productDes/index?id=' + this.formData.id,
+ url: '/pages/common/productDes/index?id=' + this.device.id,
success(ev) {
}
@@ -598,7 +629,7 @@ these.Status.apiType = data.apiType;
},
handRemark: function() {
uni.navigateTo({
- url: '/pages/common/operatingInstruct/index?id=' + this.formData.id,
+ url: '/pages/common/operatingInstruct/index?id=' + this.device.id,
success(ev) {
}
@@ -606,7 +637,7 @@ these.Status.apiType = data.apiType;
},
handVideo: function() {
uni.navigateTo({
- url: '/pages/common/operationVideo/index?id=' + this.formData.id,
+ url: '/pages/common/operationVideo/index?id=' + this.device.id,
success(ev) {
}
@@ -887,7 +918,7 @@ these.Status.apiType = data.apiType;
},
UploadOpenImg: function() {
if (!this.permissions.includes('3') && this.Status.apiType !== 'listA') {
-
+
this.showPop({
message: '无操作权限',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
@@ -898,7 +929,7 @@ these.Status.apiType = data.apiType;
})
return;
}
-
+
//上传开机画面
this.Status.BottomMenu.menuItems = [];
this.Status.BottomMenu.title = "上传开机画面";
@@ -906,7 +937,7 @@ these.Status.apiType = data.apiType;
this.Status.BottomMenu.show = true;
},
ModeSetting: function(type) {
-if (!this.permissions.includes('1') && this.Status.apiType !== 'listA') {
+ if (!this.permissions.includes('1') && this.Status.apiType !== 'listA') {
this.showPop({
message: '无操作权限',
@@ -1151,7 +1182,7 @@ if (!this.permissions.includes('1') && this.Status.apiType !== 'listA') {
},
sendUsr() {
if (!this.permissions.includes('4') && this.Status.apiType !== 'listA') {
-
+
this.showPop({
message: '无操作权限',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
@@ -1366,7 +1397,7 @@ if (!this.permissions.includes('1') && this.Status.apiType !== 'listA') {
//给蓝牙设备发送信号更新亮度
BrighInteval = setTimeout(() => {
if (!this.permissions.includes('1') && this.Status.apiType !== 'listA') {
-
+
this.showPop({
message: '无操作权限',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
@@ -1377,7 +1408,7 @@ if (!this.permissions.includes('1') && this.Status.apiType !== 'listA') {
})
return;
}
-
+
this.sendBrightness();
this.setBleFormData();
}, 100);
@@ -1896,27 +1927,27 @@ if (!this.permissions.includes('1') && this.Status.apiType !== 'listA') {
left: -99999rpx;
visibility: hidden;
}
-
-
+
+
.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;
@@ -1932,33 +1963,33 @@ if (!this.permissions.includes('1') && this.Status.apiType !== 'listA') {
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;
diff --git a/pages/common/addBLE/addEquip.vue b/pages/common/addBLE/addEquip.vue
index 9d89df0..371aca4 100644
--- a/pages/common/addBLE/addEquip.vue
+++ b/pages/common/addBLE/addEquip.vue
@@ -481,7 +481,10 @@
}
plus.android.requestPermissions(
- ['android.permission.BLUETOOTH','android.permission.BLUETOOTH_ADMIN','android.permission.ACCESS_FINE_LOCATION','android.permission.ACCESS_COARSE_LOCATION'],
+ ['android.permission.BLUETOOTH', 'android.permission.BLUETOOTH_ADMIN',
+ 'android.permission.ACCESS_FINE_LOCATION',
+ 'android.permission.ACCESS_COARSE_LOCATION'
+ ],
(result) => {
if (result.granted && result.granted.length > 0) {
console.log('定位权限已授予');
@@ -533,22 +536,24 @@
return;
}
}
- showLoading(these,{text:'正在刷新'})
+ showLoading(these, {
+ text: '正在刷新'
+ })
let time = null;
let startSearch = () => {
-
- if(time!==null){
- clearTimeout(time);
+
+ if (time !== null) {
+ clearTimeout(time);
}
-
+
time = setTimeout(() => {
these.EquipMents = [];
these.PairEquip = [];
ble.StartSearch().then(result => {
- console.log("开始搜索成功",result);
-
- }).catch(err => {
+ console.log("开始搜索成功", result);
+
+ }).catch(err => {
console.error("开始搜索失败:", err);
if (err.code === 10001) {
these.showOpenSetting();
@@ -557,9 +562,9 @@
title: '提示',
content: '出现错误:' + err.msg
});
-
+
}
- }).finally(()=>{
+ }).finally(() => {
hideLoading(these);
});
}, 200);
@@ -905,11 +910,11 @@
position: absolute;
border-radius: 50%;
background-color: #bbe60033;
- animation: expand 4s infinite ease-out;
+
display: inline-block;
transform: translate(-50%, -50%);
border: 1rpx solid #bbe6003d;
- animation: expand 5s infinite ease-in-out;
+ animation: expand 4s infinite ease-in-out;
}
.circle:nth-child(2) {
@@ -927,17 +932,16 @@
opacity: 0.8;
}
- 80% {
- width: 18.75rem;
- height: 18.75rem;
- opacity: 0.2;
+ 90% {
+ width: 18rem;
+ height: 18rem;
+ opacity: 0;
}
100% {
-
- width: 0.5rem;
- height: 0.5rem;
- opacity: 0.5;
+ width: 0rem;
+ height: 0rem;
+ opacity: 0;
}
}
diff --git a/pages/common/addScan/ScanEquip.vue b/pages/common/addScan/ScanEquip.vue
new file mode 100644
index 0000000..aa323f8
--- /dev/null
+++ b/pages/common/addScan/ScanEquip.vue
@@ -0,0 +1,396 @@
+
+
+
+
+
+
+
+ {{Status.navbar.title}}
+
+
+
+
+
+ {{item.math>9?'9+':item.math}}
+
+
+
+
+
+
+
+
+
+
+
+
+ 对准二维码进行扫描
+
+
+
+
+
+
+ 确定
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/common/allShare/index.vue b/pages/common/allShare/index.vue
index 5da6725..02ff8d3 100644
--- a/pages/common/allShare/index.vue
+++ b/pages/common/allShare/index.vue
@@ -147,7 +147,7 @@
// 页面跳转成功后的回调函数
res.eventChannel.emit('detailData', {
data: item,
- apiType: 'listB' // 自定义标识 // 自定义标识,详情哪里根据这个参数不同信息
+ apiType:this.activeTab===0?'listA':'listB' // 自定义标识 // 自定义标识,详情哪里根据这个参数不同信息
});
}
})
diff --git a/pages/common/audioManager/AudioList.vue b/pages/common/audioManager/AudioList.vue
index 883141f..1015b47 100644
--- a/pages/common/audioManager/AudioList.vue
+++ b/pages/common/audioManager/AudioList.vue
@@ -91,9 +91,9 @@
-
+
@@ -216,16 +216,16 @@
statu: "", //状态,是否公开
isApply: "" //是否使用中
- },
- cPlay: {
- Id: "", //编号
- name: "", //名称
- createTime: "", //创建时间
- localPath: "", //本地地址
- webPath: "", //网络地址
- statu: "", //状态,是否公开
- isApply: "" //是否使用中
- }
+ }//,
+ // cPlay: {
+ // Id: "", //编号
+ // name: "", //名称
+ // createTime: "", //创建时间
+ // localPath: "", //本地地址
+ // webPath: "", //网络地址
+ // statu: "", //状态,是否公开
+ // isApply: "" //是否使用中
+ // }
}
},
onLoad() {
diff --git a/pages/common/index/index.vue b/pages/common/index/index.vue
index 4db99e0..e44cf0a 100644
--- a/pages/common/index/index.vue
+++ b/pages/common/index/index.vue
@@ -497,54 +497,57 @@ import BleReceive from '@/utils/BleReceive';
switch (item.action) {
case 'scan':
// 扫一扫
- uni.scanCode({
- autoDecodeCharset:true,
- autoZoom:true,
- barCodeInput:true,
- success: (res) => {
- console.log('条码内容:', res);
- // 清除之前的数据
- this.previousScanResult = null;
- // 处理新的扫码结果
- const cleanedResult = res.result.trim();
- console.log('扫码结果:', cleanedResult);
- let url =
- `/pages/common/qrcode/qrcode?deviceId=${encodeURIComponent(cleanedResult)}`;
- try {
- let json = JSON.parse(cleanedResult);
- if ('imei' in json) {
- url =
- `/pages/common/qrcode/qrcode?deviceId=${encodeURIComponent(json.imei)}`;
- } else if ('blue' in json || 'ble' in json) {
- if(json.ble){
- json.blue=json.ble;
- }
- if(json.blue){
- if (!json.blue.includes(':')) {
- json.blue = json.blue.replace(
- /(.{2})/g, '$1:')
- .slice(0, -1)
- }
- }
-
- url =`/pages/common/addBLE/LinkBle?mac=${encodeURIComponent(json.blue)}`;
- }
- } catch (ex) {
-
- }
- // 跳转并传递扫描结果
- uni.navigateTo({
- url: url
- });
- },
- fail: (err) => {
- console.log('扫码失败', err);
- uni.showToast({
- title: '扫码失败',
- icon: 'none'
- });
- }
+ uni.navigateTo({
+ url:'/pages/common/addScan/ScanEquip'
});
+ // uni.scanCode({
+ // autoDecodeCharset:true,
+ // autoZoom:true,
+ // barCodeInput:true,
+ // success: (res) => {
+ // console.log('条码内容:', res);
+ // // 清除之前的数据
+ // this.previousScanResult = null;
+ // // 处理新的扫码结果
+ // const cleanedResult = res.result.trim();
+ // console.log('扫码结果:', cleanedResult);
+ // let url =
+ // `/pages/common/qrcode/qrcode?deviceId=${encodeURIComponent(cleanedResult)}`;
+ // try {
+ // let json = JSON.parse(cleanedResult);
+ // if ('imei' in json) {
+ // url =
+ // `/pages/common/qrcode/qrcode?deviceId=${encodeURIComponent(json.imei)}`;
+ // } else if ('blue' in json || 'ble' in json) {
+ // if(json.ble){
+ // json.blue=json.ble;
+ // }
+ // if(json.blue){
+ // if (!json.blue.includes(':')) {
+ // json.blue = json.blue.replace(
+ // /(.{2})/g, '$1:')
+ // .slice(0, -1)
+ // }
+ // }
+
+ // url =`/pages/common/addBLE/LinkBle?mac=${encodeURIComponent(json.blue)}`;
+ // }
+ // } catch (ex) {
+
+ // }
+ // // 跳转并传递扫描结果
+ // uni.navigateTo({
+ // url: url
+ // });
+ // },
+ // fail: (err) => {
+ // console.log('扫码失败', err);
+ // uni.showToast({
+ // title: '扫码失败',
+ // icon: 'none'
+ // });
+ // }
+ // });
break;
case 'bluetooth':
uni.navigateTo({
diff --git a/pages/common/shareDevices/index.vue b/pages/common/shareDevices/index.vue
index a994a7b..55bbeca 100644
--- a/pages/common/shareDevices/index.vue
+++ b/pages/common/shareDevices/index.vue
@@ -147,6 +147,19 @@
});
return false;
}
+ else{
+ let phone= uni.getStorageSync('phone');
+ if(phone==phoneNumber){
+ uni.showToast({
+ title: '手机号不能是自己账号',
+ icon: 'none',
+ duration: 1000
+ });
+ return false;
+ }
+ }
+
+
try {
await deviceShareCode({
phonenumber: this.phone
diff --git a/static/images/common/scan.png b/static/images/common/scan.png
index 93e40fe..591d48f 100644
Binary files a/static/images/common/scan.png and b/static/images/common/scan.png differ
diff --git a/static/images/common/warning.png b/static/images/common/warning.png
new file mode 100644
index 0000000..fd4fce9
Binary files /dev/null and b/static/images/common/warning.png differ
diff --git a/utils/BleHelper.js b/utils/BleHelper.js
index 49fcec1..c127d69 100644
--- a/utils/BleHelper.js
+++ b/utils/BleHelper.js
@@ -779,23 +779,23 @@ class BleHelper {
str: str,
hexs: hexs
};
- console.log("监听到特征值:" + JSON.stringify(recData));
+ // console.log("监听到特征值:",recData);
if (this.cfg.receivDataCallback) {
if (this.cfg.receivDataCallback.length > 0) {
- // console.log("有人订阅消息")
+ // console.log("有人订阅消息")
this.cfg.receivDataCallback.forEach((
rec) => {
- // console.log("有人订阅消息111", )
+ // console.log("有人订阅消息111", )
if (rec.callback) {
try {
- // console.log("正在处理订阅消息",rec);
+ // console.log("正在处理订阅消息",rec);
rec.callback(recData, f,
rec.key, this.cfg
.receivDataCallback
);
- // console.log("处理订阅消息完毕");
+ // console.log("处理订阅消息完毕");
} catch (err) {
console.error(
"订阅消息出现异常",
@@ -2030,29 +2030,7 @@ class BleHelper {
}
- //将点阵数据转换成RGB565
- convertToRGB565(pixels, type) {
- if (!type) {
- type = 'rgb';
- }
- const result = new Uint16Array(pixels.length / 4);
- let index = 0;
- for (let i = 0; i < pixels.length; i += 4) {
- let r = pixels[i];
- let g = pixels[i + 1];
- let b = pixels[i + 2];
- let a = pixels[i + 3];
-
- if (type == 'bgr') {
- result[index++] = ((b & 0xF8) << 8) | ((g & 0xFC) << 3) | (r >> 3);
- } else {
- result[index++] = ((r & 0xF8) << 8) | ((g & 0xFC) << 3) | (b >> 3);
- }
-
- }
-
- return result;
- }
+
diff --git a/utils/BleReceive.js b/utils/BleReceive.js
index b31a44b..e4a7caf 100644
--- a/utils/BleReceive.js
+++ b/utils/BleReceive.js
@@ -37,6 +37,7 @@ class BleReceive {
});
uni.setStorageSync(this.StorageKey, linkedList);
+ return true;
}
});
}
@@ -49,20 +50,20 @@ class BleReceive {
let handler = null;
let keys = Object.keys(this.HandlerMap);
let devKey = f.device.detailPageUrl ? f.device.detailPageUrl.replace(/\//g, '').toLowerCase() : '';
- // console.log("查找handler - detailPageUrl:", f.device.detailPageUrl, "转换后:", devKey);
+
for (let index = 0; index < keys.length; index++) {
let devKey = f.device.detailPageUrl ? f.device.detailPageUrl.replace(/\//g, "").toLowerCase() : '';
let key = keys[index].replace(/\//g, '').toLowerCase();
if (key == devKey) {
handler = this.HandlerMap[keys[index]];
- // console.log("找到匹配的handler:", keys[index]);
+
break;
}
}
if (handler) {
- let data = handler(receive, f, path, recArr);
- // console.log("设备"+f.device.deviceName+"收到消息,数据:", data);
+ let data = handler(receive, f, path, recArr);
+ this.setBleFormData(data, f);
return data;
} else {
console.error("已收到消息,但无指定处理程序, deviceUrl:", f.device.detailPageUrl, "可用handlers:", keys);
@@ -159,7 +160,7 @@ class BleReceive {
formData.modeCurr = modeCurr;
formData.warnLevel = warn;
formData.iswarn = iswarn;
- this.setBleFormData(formData, f);
+
let recCnt = recArr.find(v => {
return v.key.replace(/\//g, "").toLowerCase() == f.device.detailPageUrl
@@ -208,7 +209,7 @@ class BleReceive {
if (str.indexOf('mac address:') == 0) {
let formData = {};
formData.macAddress = str.split(':')[1];
- this.setBleFormData(formData, f);
+
return formData;
} else {
let receiveData = {
@@ -327,7 +328,7 @@ class BleReceive {
receiveData.fourGStrenth = fourGStrenth;
receiveData.SOS = sosTxt;
receiveData.qzwarn = sosTxt === 'sg';
- this.setBleFormData(receiveData, f);
+
console.log("recArr=", recArr);
let recCnt = recArr.find(v => {
return v.key.replace(/\//g, "").toLowerCase() == f.device.detailPageUrl
@@ -415,8 +416,7 @@ class BleReceive {
console.log('将数据转文本失败', ex);
}
}
- // console.log("todo",receiveData);
- this.setBleFormData(receiveData, f);
+
return receiveData;
}
@@ -503,8 +503,6 @@ class BleReceive {
}
}
-
- this.setBleFormData(formData, f);
return formData;
} catch (error) {
console.log('7305数据解析错误:', error);
@@ -605,8 +603,6 @@ class BleReceive {
}
}
-
- this.setBleFormData(formData, f);
return formData;
} catch (error) {
console.log('7305数据解析错误:', error);
diff --git a/utils/Common.js b/utils/Common.js
index 756a443..3570666 100644
--- a/utils/Common.js
+++ b/utils/Common.js
@@ -462,5 +462,30 @@ export default {
url='https://www.pgyer.com/xhwl';
}
return {os:os,url:url};
+ },
+
+
+ //将点阵数据转换成RGB565
+ convertToRGB565(pixels, type) {
+ if (!type) {
+ type = 'rgb';
+ }
+ const result = new Uint16Array(pixels.length / 4);
+ let index = 0;
+ for (let i = 0; i < pixels.length; i += 4) {
+ let r = pixels[i];
+ let g = pixels[i + 1];
+ let b = pixels[i + 2];
+ let a = pixels[i + 3];
+
+ if (type == 'bgr') {
+ result[index++] = ((b & 0xF8) << 8) | ((g & 0xFC) << 3) | (r >> 3);
+ } else {
+ result[index++] = ((r & 0xF8) << 8) | ((g & 0xFC) << 3) | (b >> 3);
+ }
+
+ }
+
+ return result;
}
}
\ No newline at end of file
diff --git a/utils/MsgPops.js b/utils/MsgPops.js
new file mode 100644
index 0000000..295ba05
--- /dev/null
+++ b/utils/MsgPops.js
@@ -0,0 +1,162 @@
+var MsgType = {
+ error: "error",
+ succ: "succ",
+ warn: "warn"
+}
+var time = null;
+// 显示成功
+export const MsgSuccess = (msg, btnTxt, ev) => {
+
+ if (!ev) {
+
+ return null;
+ }
+ if (!ev.$refs.msgPop) {
+
+ return null;
+ }
+ let option = ev.$refs.msgPop.showMsg(msg, btnTxt, MsgType.succ);
+
+ createClear(ev);
+ return option;
+}
+//显示失败
+export const MsgError = (msg, btnTxt, ev) => {
+
+ if (!ev) {
+
+ return null;
+ }
+ if (!ev.$refs.msgPop) {
+
+ return null;
+ }
+
+ let option = ev.$refs.msgPop.showMsg(msg, btnTxt, MsgType.error);
+ createClear(ev);
+ return option;
+}
+//显示警告
+export const MsgWarning = (msg, btnTxt, ev, isClear) => {
+ if (!ev) {
+
+ return null;
+ }
+ if (!ev.$refs.msgPop) {
+
+ return null;
+ }
+ let option = ev.$refs.msgPop.showMsg(msg, btnTxt, MsgType.warn);
+ if (isClear === undefined || isClear) {
+ createClear(ev);
+ }
+
+ return option;
+
+
+}
+
+
+// 隐藏loading
+export const MsgClose = (options, ev) => {
+
+
+ if (!ev) {
+
+ return;
+ }
+ if (!ev.$refs.msgPop) {
+
+ return;
+ }
+ if (typeof(options) == 'string') {
+ options = {
+ key: options
+ }
+ }
+ ev.$refs.msgPop.closePop(options);
+
+}
+
+
+
+export const showPop = (options, ev, isClear) => {
+
+
+ if (!ev) {
+
+ return null;
+ }
+ if (!ev.$refs.msgPop) {
+
+ return null;
+ }
+ let option = ev.$refs.msgPop.showPop(options);
+
+ if (isClear === undefined || isClear) {
+ createClear(ev);
+ }
+
+ return option;
+}
+
+const createClear = (ev) => {
+ let cnt = getPops(ev);
+ if (cnt >= 5) {
+ clearTimeout(time);
+ time = setTimeout(() => {
+ let key = new Date().getTime();
+ showPop({
+ key: key,
+ message: "消息太多, 是否全部关闭",
+ iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
+ borderColor: "#e034344d",
+ buttonBgColor: "#E03434",
+ buttonText: '全部关闭',
+ buttonTextColor: '#232323de',
+ showCancel: true,
+ buttonCancelText: "取消",
+ cancelCallback: () => {
+
+ MsgClose(key, ev);
+ },
+ okCallback: function() {
+
+ MsgClear(ev);
+ }
+
+ }, ev, false);
+ }, 500);
+
+
+ }
+}
+
+//获取当前弹窗数量
+export const getPops = (ev) => {
+ if (!ev) {
+
+ return null;
+ }
+ if (!ev.$refs.msgPop) {
+
+ return null;
+ }
+ return ev.$refs.msgPop.getPops();
+
+}
+
+
+//清空所有弹窗
+export const MsgClear = (ev) => {
+ if (!ev) {
+
+ return null;
+ }
+ if (!ev.$refs.msgPop) {
+
+ return null;
+ }
+ return ev.$refs.msgPop.clearPops();
+
+}
\ No newline at end of file