Compare commits
35 Commits
8d97dcf121
...
c9996748eb
Author | SHA1 | Date | |
---|---|---|---|
c9996748eb | |||
b1ba355cb2 | |||
2c2a75aa02 | |||
295f904b10 | |||
7f4fd00937 | |||
bbf55c58f0 | |||
793fe7132b | |||
585bd76a0a | |||
96acaa5d94 | |||
5e5bde6934 | |||
76329756c9 | |||
535f4728ea | |||
e95b2466e1 | |||
6ef2bb08b9 | |||
4df8330738 | |||
84c0a6ae18 | |||
ceafd10b72 | |||
6b4d47828e | |||
6650334525 | |||
958a74101e | |||
1ed6ca4828 | |||
e39356bbe0 | |||
5eea3a0fff | |||
d9a28d0345 | |||
47a9dace85 | |||
4ab10bb251 | |||
ca844723fa | |||
b3c0b74628 | |||
a3865e2f26 | |||
4ebdec8dac | |||
e5e2aca0c4 | |||
40639d2bad | |||
3c0bf2f770 | |||
0ac0d1998a | |||
e470726fbd |
6
.gitignore
vendored
@ -1,5 +1 @@
|
||||
*node_modules/*
|
||||
*dist/*
|
||||
*unpackage/*
|
||||
|
||||
|
||||
unpackage/
|
16
App.vue
@ -1,11 +1,16 @@
|
||||
<script>
|
||||
import request from '@/utils/request.js';
|
||||
import bleTool from '@/utils/BleHelper.js';
|
||||
import upgrade from '@/utils/update.js'
|
||||
export default {
|
||||
|
||||
|
||||
onLaunch: function() {
|
||||
|
||||
// uni.clearStorageSync();
|
||||
var ble = bleTool.getBleTool();
|
||||
},
|
||||
onShow: function() {
|
||||
console.log('App Show')
|
||||
console.log('App Show');
|
||||
upgrade.checkAndUpdateWgt("http://114.55.111.217/app/CheckUpdate");
|
||||
},
|
||||
onHide: function() {
|
||||
console.log('App Hide')
|
||||
@ -54,4 +59,9 @@
|
||||
.uni-picker-view-wrapper{
|
||||
background: rgba(42, 42, 42, 1);
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "PingFang SC";
|
||||
src: url("~@/static/fonts/PingFangSC.ttf") format("opentype");
|
||||
}
|
||||
</style>
|
||||
|
@ -1,6 +1,6 @@
|
||||
export default {
|
||||
featrueValueCallback: null,//蓝牙特征变化回调
|
||||
BleChangeCallback:null,//蓝牙状态变化回调
|
||||
featrueValueCallback: null, //蓝牙特征变化回调
|
||||
BleChangeCallback: null, //蓝牙状态变化回调
|
||||
//引导用户打开蓝牙
|
||||
showBluetoothGuide: function(showTip) {
|
||||
let platform = process.env.UNI_PLATFORM;
|
||||
@ -89,7 +89,7 @@ export default {
|
||||
uni.getBluetoothAdapterState({
|
||||
success(res1) {
|
||||
|
||||
console.log("当前蓝牙适配器状态:" + JSON.stringify(res1))
|
||||
//console.log("当前蓝牙适配器状态:" + JSON.stringify(res1))
|
||||
if (callback) {
|
||||
callback(res1);
|
||||
}
|
||||
@ -126,8 +126,8 @@ export default {
|
||||
callback();
|
||||
}
|
||||
uni.onBluetoothAdapterStateChange(function(state) {
|
||||
console.log('蓝牙状态发生变化:' + JSON.stringify(state));
|
||||
if(this.BleChangeCallback){
|
||||
//console.log('蓝牙状态发生变化:' + JSON.stringify(state));
|
||||
if (this.BleChangeCallback) {
|
||||
this.BleChangeCallback()
|
||||
}
|
||||
})
|
||||
@ -232,7 +232,7 @@ export default {
|
||||
StopSearch: function() {
|
||||
uni.stopBluetoothDevicesDiscovery({
|
||||
success: (res) => {
|
||||
console.log("停止搜索蓝牙设备成功")
|
||||
//console.log("停止搜索蓝牙设备成功")
|
||||
},
|
||||
fail() {
|
||||
console.log("无法停止蓝牙搜索")
|
||||
@ -241,8 +241,7 @@ export default {
|
||||
},
|
||||
//获取已连接的设备
|
||||
getLinkBlue: function(callback) {
|
||||
uni.getConnectedBluetoothDevices({
|
||||
services: ["0xFFE0"],
|
||||
uni.getConnectedBluetoothDevices({
|
||||
success: (res) => {
|
||||
if (callback) {
|
||||
callback(res);
|
||||
@ -250,7 +249,7 @@ export default {
|
||||
}
|
||||
},
|
||||
fail: function(ex) {
|
||||
console.log("获取已连接设备异常");
|
||||
console.log("获取已连接设备异常",ex);
|
||||
if (callback) {
|
||||
callback({
|
||||
devices: []
|
||||
@ -261,7 +260,7 @@ export default {
|
||||
},
|
||||
//连接某个设备
|
||||
LinkBlue: function(deviceId, callback, error) {
|
||||
|
||||
//console.log("deviceId="+deviceId)
|
||||
this.StopSearch();
|
||||
var these = this;
|
||||
let key = "linkedDevices";
|
||||
@ -274,54 +273,58 @@ export default {
|
||||
var str = uni.getStorageSync(key);
|
||||
if (str) {
|
||||
linkedDevices = JSON.parse(str);
|
||||
}else{
|
||||
linkedDevices=[];
|
||||
} else {
|
||||
linkedDevices = [];
|
||||
}
|
||||
|
||||
}
|
||||
//连接成功的回调
|
||||
var lindedCallback = function () {
|
||||
var lindedCallback = function(id,flag) {
|
||||
|
||||
let c = linkedDevices.find(function (v) {
|
||||
let c = linkedDevices.find(function(v) {
|
||||
return v.deviceId == deviceId;
|
||||
});
|
||||
|
||||
if (c) {
|
||||
console.log("连接成功开始监听特征变化")
|
||||
if (c && !flag) {
|
||||
console.log("连接成功开始监听特征变化,deviceid="+deviceId+',serviceId='+c.notifyServiceid+',characteristicId='+c.notifyCharactId)
|
||||
//监听设备的特征变化
|
||||
uni.notifyBLECharacteristicValueChange({
|
||||
deviceId: deviceId,
|
||||
serviceId: c.notifyServiceid,
|
||||
characteristicId: c.notifyCharactId,
|
||||
state: true,
|
||||
success: function (res) {
|
||||
console.log("开始监听成功。。。。")
|
||||
if(res.errCode=='0'){
|
||||
//订阅特征值
|
||||
uni.onBLECharacteristicValueChange(function(data){
|
||||
// data.characteristicId
|
||||
// data.deviceId
|
||||
// data.serviceId
|
||||
// data.value
|
||||
console.log("监听到特征值:"+JSON.stringify(data));
|
||||
setTimeout(()=>{
|
||||
uni.notifyBLECharacteristicValueChange({
|
||||
deviceId: deviceId,
|
||||
serviceId: c.notifyServiceid,
|
||||
characteristicId: c.notifyCharactId,
|
||||
state: true,
|
||||
success: function(res) {
|
||||
console.log("开始监听成功。。。。",res)
|
||||
//订阅特征值
|
||||
|
||||
if(these.featrueValueCallback){
|
||||
these.featrueValueCallback(data);
|
||||
}
|
||||
});
|
||||
uni.onBLECharacteristicValueChange(function(data) {
|
||||
// data.characteristicId
|
||||
// data.deviceId
|
||||
// data.serviceId
|
||||
// data.value
|
||||
console.log("监听到特征值:" + JSON.stringify(data));
|
||||
|
||||
if (these.featrueValueCallback) {
|
||||
these.featrueValueCallback(data);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
},1000);
|
||||
|
||||
}
|
||||
|
||||
if (callback) {
|
||||
callback(deviceId);
|
||||
callback(deviceId,flag);
|
||||
}
|
||||
}
|
||||
|
||||
var linkState = function(res) {
|
||||
console.log("获取已连接的设备回调" + JSON.stringify(res))
|
||||
//console.log("获取已连接的设备回调" + JSON.stringify(res))
|
||||
let flag = res.devices.find(function(v) {
|
||||
if (v.deviceId == deviceId) {
|
||||
return true;
|
||||
@ -329,82 +332,97 @@ export default {
|
||||
return false;
|
||||
});
|
||||
if (flag) {
|
||||
console.log("设备状态已连接");
|
||||
|
||||
lindedCallback(deviceId);
|
||||
|
||||
//console.log("设备状态已连接");
|
||||
|
||||
lindedCallback(deviceId,true);
|
||||
|
||||
return;
|
||||
} else {
|
||||
console.log("设备未连接");
|
||||
console.log("设备未连接:"+deviceId);
|
||||
linkDevice(deviceId);
|
||||
}
|
||||
}
|
||||
|
||||
var linkDevice = function(id) {
|
||||
console.log("正在连接"+id);
|
||||
var linkDevice = function() {
|
||||
console.log("正在连接" + deviceId);
|
||||
uni.createBLEConnection({
|
||||
deviceId: id,
|
||||
deviceId: deviceId,
|
||||
timeout: 30000,
|
||||
success: function(info) {
|
||||
|
||||
console.log("连接成功");
|
||||
|
||||
uni.setBLEMTU({
|
||||
deviceId: id,
|
||||
mtu: 512,
|
||||
success: () => {
|
||||
console.log("mtu设置成功");
|
||||
if(linkedDevices){
|
||||
console.log("11111"+JSON.stringify(linkedDevices));
|
||||
f = linkedDevices.find(function (v) {
|
||||
return v.deviceId == id;
|
||||
});
|
||||
}else{
|
||||
console.log("22222")
|
||||
f=null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!f) {
|
||||
console.log("缓存中没有找到该设备")
|
||||
|
||||
these.getLinkBlue(function (res) {
|
||||
if (res.devices && res.devices.length) {
|
||||
let f = res.devices.find(function (v) {
|
||||
return v.deviceId == id;
|
||||
});
|
||||
linkedDevices.push(f);
|
||||
uni.setStorageSync(key, JSON.stringify(linkedDevices));
|
||||
|
||||
getService(id);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
} else {
|
||||
console.log("缓存中已连接过");
|
||||
if (!f.services) {
|
||||
getService(id);
|
||||
} else {
|
||||
|
||||
lindedCallback(id);
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: function() {
|
||||
console.log("mtu设置失败")
|
||||
var call = () => {
|
||||
if (linkedDevices) {
|
||||
console.log("11111" + JSON.stringify(linkedDevices));
|
||||
f = linkedDevices.find(function(v) {
|
||||
return v.deviceId == deviceId;
|
||||
});
|
||||
} else {
|
||||
console.log("22222")
|
||||
f = null;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
if (!f) {
|
||||
console.log("缓存中没有找到该设备")
|
||||
|
||||
these.getLinkBlue(function(res) {
|
||||
if (res.devices && res.devices.length) {
|
||||
let f = res.devices.find(function(v) {
|
||||
return v.deviceId == deviceId;
|
||||
});
|
||||
linkedDevices.push(f);
|
||||
uni.setStorageSync(key, JSON.stringify(
|
||||
linkedDevices));
|
||||
|
||||
getService(deviceId);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
} else {
|
||||
console.log("缓存中已连接过");
|
||||
if (!f.services) {
|
||||
getService(deviceId);
|
||||
} else {
|
||||
|
||||
lindedCallback(deviceId,false);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
let os = uni.getSystemInfoSync().osName;
|
||||
if (os == 'android') {
|
||||
uni.setBLEMTU({
|
||||
deviceId: deviceId,
|
||||
mtu: 512,
|
||||
success: () => {
|
||||
//console.log("mtu设置成功");
|
||||
},
|
||||
fail: function() {
|
||||
console.log("mtu设置失败")
|
||||
},
|
||||
complete: function() {
|
||||
call();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
call();
|
||||
}
|
||||
|
||||
},
|
||||
fail: function(ex) {
|
||||
if (error) {
|
||||
console.log("蓝牙连接失败" + JSON.stringify(error));
|
||||
error(ex);
|
||||
if (ex) {
|
||||
console.log("蓝牙连接失败" + JSON.stringify(ex));
|
||||
if(error){
|
||||
error(ex);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -435,9 +453,9 @@ export default {
|
||||
Promise.all(promises)
|
||||
.then(results => {
|
||||
console.log('所有操作成功完成', results);
|
||||
|
||||
lindedCallback(id);
|
||||
|
||||
|
||||
lindedCallback(id,false);
|
||||
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('至少一个操作失败', error);
|
||||
@ -447,9 +465,9 @@ export default {
|
||||
} else {
|
||||
repeatCnt++;
|
||||
if (repeatCnt > 5) {
|
||||
|
||||
lindedCallback(id);
|
||||
|
||||
|
||||
lindedCallback(id,false);
|
||||
|
||||
return;
|
||||
}
|
||||
setTimeout(function() {
|
||||
@ -498,10 +516,14 @@ export default {
|
||||
if (notiChar) {
|
||||
v.notifyServiceid = serviceId;
|
||||
v.notifyCharactId = notiChar.uuid;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
uni.setStorageSync(key, JSON.stringify(linkedDevices));
|
||||
resolve(res);
|
||||
},
|
||||
@ -522,9 +544,9 @@ export default {
|
||||
}
|
||||
});
|
||||
|
||||
console.log("正在获取蓝牙适配器状态")
|
||||
//console.log("正在获取蓝牙适配器状态")
|
||||
this.CheckBlue((res) => {
|
||||
console.log("蓝牙状态:" + JSON.stringify(res));
|
||||
//console.log("蓝牙状态:" + JSON.stringify(res));
|
||||
if (res.available) {
|
||||
this.getLinkBlue(linkState);
|
||||
} else {
|
||||
@ -580,13 +602,13 @@ export default {
|
||||
reject(`deviceid为空,请输入要发送的设备`);
|
||||
return;
|
||||
}
|
||||
console.log("准备发送数据包");
|
||||
console.log("准备发送数据包");
|
||||
let key = "linkedDevices";
|
||||
var store = uni.getStorageInfoSync();
|
||||
var f = store.keys.find(function(v) {
|
||||
return v == key;
|
||||
});
|
||||
console.log("倒计时:5");
|
||||
console.log("倒计时:5");
|
||||
var linkedDevices = [];
|
||||
if (f) {
|
||||
var str = uni.getStorageSync(key);
|
||||
@ -595,35 +617,19 @@ export default {
|
||||
}
|
||||
|
||||
}
|
||||
console.log("倒计时:4");
|
||||
console.log("倒计时:4");
|
||||
if (linkedDevices && linkedDevices.length && linkedDevices.length > 0) {
|
||||
console.log("倒计时:3");
|
||||
console.log("倒计时:3");
|
||||
f = linkedDevices.find(function(v) {
|
||||
return v.deviceId == deviceid;
|
||||
|
||||
});
|
||||
console.log("f=" + JSON.stringify(f));
|
||||
// console.log("deviceid=" + deviceid);
|
||||
console.log("倒计时:2");
|
||||
console.log("倒计时:2");
|
||||
if (f) {
|
||||
console.log("倒计时:1");
|
||||
uni.writeBLECharacteristicValue({
|
||||
deviceId: f.deviceId,
|
||||
serviceId: f.writeServiceId,
|
||||
characteristicId: f.wirteCharactId,
|
||||
value: buffer,
|
||||
success: () => {
|
||||
console.log("发送数据成功");
|
||||
resolve();
|
||||
},
|
||||
fail: (err) => {
|
||||
console.log("发送数据失败" + JSON.stringify(err));
|
||||
reject(`发送数据失败: ${err.errMsg}`);
|
||||
},
|
||||
complete: function() {
|
||||
console.log("发送数据complete");
|
||||
}
|
||||
});
|
||||
console.log("倒计时:1");
|
||||
these.sendDataNew(f.deviceId,f.writeServiceId,f.wirteCharactId,buffer).then(succ).catch(err);
|
||||
} else {
|
||||
reject(`已连接设备中无法找到此设备`);
|
||||
// console.log("警报:已连接设备中无法找到此设备")
|
||||
@ -636,36 +642,67 @@ export default {
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
sendDataNew: function(deviceid, serviceId, characteristicId, buffer) {
|
||||
|
||||
console.log("准备向设备发送数据,deviceid=" + deviceid);
|
||||
//console.log("准备向设备发送数据,deviceid=" + deviceid+',serviceId='+serviceId+',characteristicId='+characteristicId);
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.writeBLECharacteristicValue({
|
||||
deviceId: deviceid,
|
||||
serviceId: serviceId,
|
||||
characteristicId: characteristicId,
|
||||
value: buffer,
|
||||
success: () => {
|
||||
console.log("发送数据成功");
|
||||
resolve();
|
||||
},
|
||||
fail: (err) => {
|
||||
console.log("发送数据失败" + JSON.stringify(err));
|
||||
reject(`发送数据失败: ${err.errMsg}`);
|
||||
},
|
||||
complete: function() {
|
||||
console.log("发送数据complete");
|
||||
}
|
||||
let promise = new Promise((succ, err) => {
|
||||
uni.writeBLECharacteristicValue({
|
||||
deviceId: deviceid,
|
||||
serviceId: serviceId,
|
||||
characteristicId: characteristicId,
|
||||
value: buffer,
|
||||
success: () => {
|
||||
//console.log("发送数据成功");
|
||||
succ();
|
||||
},
|
||||
fail: (ex) => {
|
||||
console.log("发送数据失败" + JSON.stringify(ex));
|
||||
err(ex);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
if (uni.getSystemInfoSync().osName.toLowerCase() == 'ios') {
|
||||
|
||||
//专业给IOS填坑,uni.writeBLECharacteristicValue在IOS上不进入任何回调
|
||||
|
||||
function timeout(ms) {
|
||||
return new Promise((_, err) => {
|
||||
setTimeout(() => {
|
||||
err({
|
||||
code: -1,
|
||||
errMsg: '超时了'
|
||||
})
|
||||
}, ms);
|
||||
});
|
||||
}
|
||||
|
||||
Promise.race([promise, timeout(50)]).then(resolve).catch((ex) => {
|
||||
console.log("ex=", ex);
|
||||
if (ex.code == -1) {
|
||||
resolve();
|
||||
} else {
|
||||
reject(ex);
|
||||
}
|
||||
|
||||
}).finally(() => {
|
||||
console.log("完成了")
|
||||
});
|
||||
} else {
|
||||
promise.then(resolve).catch(reject);
|
||||
}
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -61,13 +61,4 @@ export function mapReverseGeocoding(data) {
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 或者设备状态
|
||||
export function deviceRealTimeStatus(params) {
|
||||
return request({
|
||||
url: `/app/device/realTimeStatus`,
|
||||
method: 'get',
|
||||
data:params
|
||||
})
|
||||
}
|
||||
}
|
@ -2,17 +2,14 @@
|
||||
<view class="message-popup" :class="{ 'show': config.show }">
|
||||
|
||||
<view class="mask" @click="closeMenu" :class="{ 'show': config.show }"
|
||||
:style="{backgroundColor:config.maskBgColor,display:(config.showMask?'':'none')}"
|
||||
>
|
||||
:style="{backgroundColor:config.maskBgColor,display:(config.showMask?'':'none')}">
|
||||
|
||||
</view>
|
||||
<view class="bottom-slide-menu" :style="{ backgroundColor: config.bgColor }" :class="{ 'show': config.show }"
|
||||
@touchmove.stop.prevent>
|
||||
<view class="menu-header" :class="config.showHeader?'':'displayNone'">
|
||||
<view class="title" :style="{ color: config.textColor}">{{ config.title }}</view>
|
||||
<view class="close-icon" @click="closeMenu"
|
||||
:style="{display:(config.showClose?'':'none')}"
|
||||
>
|
||||
<view class="close-icon" @click="closeMenu" :style="{display:(config.showClose?'':'none')}">
|
||||
<image src="/static/Images/public/close.png" mode="aspectFit"></image>
|
||||
</view>
|
||||
</view>
|
||||
@ -29,7 +26,13 @@
|
||||
<view class="p100" :style="{backgroundColor:config.activeIndex==index?config.itemBgColor:'',
|
||||
justifyContent:config.textAlign
|
||||
}">
|
||||
<image v-if="item.icon" :src="item.icon" mode="aspectFit"></image>
|
||||
<view class="imgContent" :style="{
|
||||
height:config.itemHeight,
|
||||
width:config.itemHeight
|
||||
}">
|
||||
<image v-if="item.icon" :src="item.icon" mode="aspectFit"></image>
|
||||
</view>
|
||||
|
||||
<text>{{ item.text }}</text>
|
||||
</view>
|
||||
|
||||
@ -61,34 +64,34 @@
|
||||
config: {
|
||||
type: Object,
|
||||
default: () => ({
|
||||
show: false,//是否显示
|
||||
showHeader: false,//是否显示标头
|
||||
showMask:true,//是否显示mask
|
||||
showDivider: false,//是否在两个项之间显示分隔线
|
||||
showBtn: false,//是否显示底部按钮
|
||||
showClose:false,//是否显示右上角关闭按钮
|
||||
maskBgColor:'',//mask的颜色
|
||||
menuItems: [],//菜单项 包含icon text
|
||||
activeIndex: -1,//当前已选中的项编号
|
||||
bgColor: '#2a2a2a',//主体背景
|
||||
itemBgColor: '#3a3a3a',//各项被选中后的背景
|
||||
textColor: '#ffffffde',//各项的文字颜色
|
||||
textAlign: 'flex-start',//各项的文字居中方式
|
||||
title: '',//header的文字
|
||||
dividerColor: '#00000000',//分隔线颜色
|
||||
dividerThickness: '0rpx',//分隔线宽度
|
||||
dividerMargin: '10rpx',//分隔线距离两边的宽度
|
||||
itemHeight: '80rpx',//各项的调试
|
||||
btnBgColor: "#bbe600",//按钮颜色
|
||||
btnText: "确定",//按钮文字
|
||||
btnTextColor: "#000000",//按钮文字颜色
|
||||
|
||||
show: false, //是否显示
|
||||
showHeader: false, //是否显示标头
|
||||
showMask: true, //是否显示mask
|
||||
showDivider: false, //是否在两个项之间显示分隔线
|
||||
showBtn: false, //是否显示底部按钮
|
||||
showClose: false, //是否显示右上角关闭按钮
|
||||
maskBgColor: '', //mask的颜色
|
||||
menuItems: [], //菜单项 包含icon text
|
||||
activeIndex: -1, //当前已选中的项编号
|
||||
bgColor: '#2a2a2a', //主体背景
|
||||
itemBgColor: '#3a3a3a', //各项被选中后的背景
|
||||
textColor: '#ffffffde', //各项的文字颜色
|
||||
textAlign: 'flex-start', //各项的文字居中方式
|
||||
title: '', //header的文字
|
||||
dividerColor: '#00000000', //分隔线颜色
|
||||
dividerThickness: '0rpx', //分隔线宽度
|
||||
dividerMargin: '10rpx', //分隔线距离两边的宽度
|
||||
itemHeight: '80rpx', //各项的调试
|
||||
btnBgColor: "#bbe600", //按钮颜色
|
||||
btnText: "确定", //按钮文字
|
||||
btnTextColor: "#000000", //按钮文字颜色
|
||||
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
|
||||
|
||||
methods: {
|
||||
closeMenu() {
|
||||
|
||||
@ -100,19 +103,18 @@
|
||||
this.$emit('itemClick', item, index);
|
||||
},
|
||||
btnClick() {
|
||||
|
||||
|
||||
let item = null;
|
||||
let index = null;
|
||||
if (this.config.activeIndex > -1) {
|
||||
item = this.config.menuItems[this.config.activeIndex];
|
||||
}
|
||||
index = this.config.activeIndex;
|
||||
this.$emit('btnClick', item, index);
|
||||
this.$emit('btnClick', item, index);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style>
|
||||
@ -126,7 +128,7 @@
|
||||
}
|
||||
|
||||
.p100 {
|
||||
width: 100%;
|
||||
width: calc(100% - 20rpx);
|
||||
height: 100%;
|
||||
border-radius: 8rpx;
|
||||
display: flex;
|
||||
@ -136,7 +138,8 @@
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
padding: 0rpx 20rpx;
|
||||
padding: 0rpx 20rpx 0rpx 0rpx;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
|
||||
.displayNone {
|
||||
@ -151,7 +154,7 @@
|
||||
z-index: 9999;
|
||||
transition: transform 0.3s ease-out;
|
||||
transform: translateY(100%);
|
||||
border-radius: 16rpx 16rpx 0 0;
|
||||
border-radius: 32rpx 32rpx 0 0;
|
||||
box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
@ -217,11 +220,24 @@
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.menu-item image {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
|
||||
}
|
||||
|
||||
.imgContent {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
align-content: center;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background: #4a4a4a;
|
||||
border-radius: 10rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
|
194
components/TextToHex/TextToHex.vue
Normal file
@ -0,0 +1,194 @@
|
||||
<template>
|
||||
<view>
|
||||
<canvas type="2d" canvas-id="reusableCanvas" :width="currentCanvasWidth" :height="currentCanvasHeight"
|
||||
class="offscreen-canvas"></canvas>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "TextToHexV1",
|
||||
props: {
|
||||
txts: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
validator: (value) => value.every(item => typeof item === 'string')
|
||||
},
|
||||
fontSize: {
|
||||
type: Number,
|
||||
default: 16,
|
||||
validator: (value) => value > 0 && value <= 100
|
||||
},
|
||||
bgColor: {
|
||||
type: String,
|
||||
default: "#ffffff"
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
default: "#000000"
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 当前Canvas的宽高(动态调整)
|
||||
currentCanvasWidth: 0,
|
||||
currentCanvasHeight: 0,
|
||||
// Canvas上下文(复用)
|
||||
ctx: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
validTxts() {
|
||||
return this.txts.filter(line => line.trim() !== '');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// 初始化Canvas上下文(只创建一次)
|
||||
this.ctx = uni.createCanvasContext('reusableCanvas', this);
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 估算单行文本所需的Canvas宽度
|
||||
*/
|
||||
calcLineWidth(textLine) {
|
||||
return textLine.length * this.fontSize;
|
||||
},
|
||||
|
||||
/**
|
||||
* 清除Canvas内容
|
||||
*/
|
||||
clearCanvas() {
|
||||
this.ctx.setFillStyle(this.bgColor);
|
||||
this.ctx.fillRect(0, 0, this.currentCanvasWidth, this.currentCanvasHeight);
|
||||
},
|
||||
|
||||
/**
|
||||
* 复用单个Canvas处理所有文本行
|
||||
*/
|
||||
async drawAndGetPixels() {
|
||||
|
||||
let convertCharToMatrix=function(imageData) {
|
||||
// console.log("imgData=",imageData)
|
||||
let matrix = [];
|
||||
|
||||
// 逐行处理
|
||||
for (let y = 0; y < 16; y++) {
|
||||
let byte1 = 0,
|
||||
byte2 = 0;
|
||||
|
||||
// 每行16个像素,分为两个字节
|
||||
for (let x = 0; x < 16; x++) {
|
||||
// 计算像素在imageData中的索引 (RGBA格式)
|
||||
let index = (y * 16 + x) * 4;
|
||||
let red = imageData[index];
|
||||
|
||||
// 黑色像素(R值较低)视为1,白色视为0
|
||||
let isBlack = red < 128;
|
||||
|
||||
if (x < 8) {
|
||||
// 第一个字节(左8位)
|
||||
if (isBlack) {
|
||||
byte1 |= 0x80 >> x; // 从左到右设置位
|
||||
}
|
||||
} else {
|
||||
// 第二个字节(右8位)
|
||||
if (isBlack) {
|
||||
byte2 |= 0x80 >> (x - 8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 将字节转换为两位十六进制字符串
|
||||
matrix.push('0x' + byte1.toString(16).padStart(2, '0').toUpperCase());
|
||||
matrix.push('0x' + byte2.toString(16).padStart(2, '0').toUpperCase());
|
||||
}
|
||||
|
||||
return matrix;
|
||||
}
|
||||
|
||||
let drawTxt=async (textLine)=> {
|
||||
let result = {};
|
||||
let ctx = this.ctx;
|
||||
|
||||
// 1. 动态调整Canvas尺寸
|
||||
this.currentCanvasWidth = this.calcLineWidth(textLine);
|
||||
this.currentCanvasHeight = this.fontSize;
|
||||
|
||||
// 2. 清空Canvas(绘制背景)
|
||||
this.clearCanvas();
|
||||
|
||||
// 3. 设置文字样式
|
||||
ctx.setFillStyle(this.color);
|
||||
ctx.setTextBaseline('middle');
|
||||
ctx.setFontSize(this.fontSize);
|
||||
ctx.font = `${this.fontSize}px "PingFang SC", PingFang SC, Arial, sans-serif`;
|
||||
|
||||
// 4. 绘制当前行文本
|
||||
let currentX = 0;
|
||||
let currentY = this.fontSize / 2;
|
||||
for (let j = 0; j < textLine.length; j++) {
|
||||
let char = textLine[j];
|
||||
ctx.fillText(char, currentX, currentY);
|
||||
// 按实际字符宽度计算间距
|
||||
let charWidth = ctx.measureText(char).width;
|
||||
currentX += charWidth;
|
||||
}
|
||||
|
||||
// 5. 异步绘制并获取像素数据(串行处理避免冲突)
|
||||
await new Promise((resolve, reject) => {
|
||||
ctx.draw(false, () => {
|
||||
uni.canvasGetImageData({
|
||||
canvasId: 'reusableCanvas',
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: this.currentCanvasWidth,
|
||||
height: this.currentCanvasHeight,
|
||||
success: res => {
|
||||
|
||||
result={
|
||||
line: textLine,
|
||||
pixelData: res.data,
|
||||
width: this.currentCanvasWidth,
|
||||
height: this.currentCanvasHeight
|
||||
};
|
||||
resolve();
|
||||
},
|
||||
fail: err => {
|
||||
// console.error(`处理第${i+1}行失败:`, err);
|
||||
reject(err)
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
let arr = [];
|
||||
// 循环处理每行文本
|
||||
for (let i = 0; i < this.validTxts.length; i++) {
|
||||
|
||||
let linePixls = [];
|
||||
let item = this.validTxts[i];
|
||||
console.log("item=",item);
|
||||
for (var j = 0; j < item.length; j++) {
|
||||
let result = await drawTxt(item[j]);
|
||||
linePixls.push(convertCharToMatrix(result.pixelData));
|
||||
}
|
||||
console.log("hexs=",linePixls.join(","));
|
||||
arr.push(linePixls);
|
||||
}
|
||||
|
||||
return arr;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.offscreen-canvas {
|
||||
position: fixed;
|
||||
left: -9999px;
|
||||
top: -9999px;
|
||||
visibility: hidden;
|
||||
}
|
||||
</style>
|
194
components/TextToHex/TextToHexV1.vue
Normal file
@ -0,0 +1,194 @@
|
||||
<template>
|
||||
<view>
|
||||
<canvas type="2d" canvas-id="reusableCanvas" :width="currentCanvasWidth" :height="currentCanvasHeight"
|
||||
class="offscreen-canvas"></canvas>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "TextToHexV1",
|
||||
props: {
|
||||
txts: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
validator: (value) => value.every(item => typeof item === 'string')
|
||||
},
|
||||
fontSize: {
|
||||
type: Number,
|
||||
default: 16,
|
||||
validator: (value) => value > 0 && value <= 100
|
||||
},
|
||||
bgColor: {
|
||||
type: String,
|
||||
default: "#ffffff"
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
default: "#000000"
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 当前Canvas的宽高(动态调整)
|
||||
currentCanvasWidth: 0,
|
||||
currentCanvasHeight: 0,
|
||||
// Canvas上下文(复用)
|
||||
ctx: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
validTxts() {
|
||||
return this.txts.filter(line => line.trim() !== '');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// 初始化Canvas上下文(只创建一次)
|
||||
this.ctx = uni.createCanvasContext('reusableCanvas', this);
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 估算单行文本所需的Canvas宽度
|
||||
*/
|
||||
calcLineWidth(textLine) {
|
||||
return textLine.length * this.fontSize;
|
||||
},
|
||||
|
||||
/**
|
||||
* 清除Canvas内容
|
||||
*/
|
||||
clearCanvas() {
|
||||
this.ctx.setFillStyle(this.bgColor);
|
||||
this.ctx.fillRect(0, 0, this.currentCanvasWidth, this.currentCanvasHeight);
|
||||
},
|
||||
|
||||
/**
|
||||
* 复用单个Canvas处理所有文本行
|
||||
*/
|
||||
async drawAndGetPixels() {
|
||||
|
||||
let convertCharToMatrix=function(imageData) {
|
||||
// console.log("imgData=",imageData)
|
||||
let matrix = [];
|
||||
|
||||
// 逐行处理
|
||||
for (let y = 0; y < 16; y++) {
|
||||
let byte1 = 0,
|
||||
byte2 = 0;
|
||||
|
||||
// 每行16个像素,分为两个字节
|
||||
for (let x = 0; x < 16; x++) {
|
||||
// 计算像素在imageData中的索引 (RGBA格式)
|
||||
let index = (y * 16 + x) * 4;
|
||||
let red = imageData[index];
|
||||
|
||||
// 黑色像素(R值较低)视为1,白色视为0
|
||||
let isBlack = red < 128;
|
||||
|
||||
if (x < 8) {
|
||||
// 第一个字节(左8位)
|
||||
if (isBlack) {
|
||||
byte1 |= 0x80 >> x; // 从左到右设置位
|
||||
}
|
||||
} else {
|
||||
// 第二个字节(右8位)
|
||||
if (isBlack) {
|
||||
byte2 |= 0x80 >> (x - 8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 将字节转换为两位十六进制字符串
|
||||
matrix.push('0x' + byte1.toString(16).padStart(2, '0').toUpperCase());
|
||||
matrix.push('0x' + byte2.toString(16).padStart(2, '0').toUpperCase());
|
||||
}
|
||||
|
||||
return matrix;
|
||||
}
|
||||
|
||||
let drawTxt=async (textLine)=> {
|
||||
let result = {};
|
||||
let ctx = this.ctx;
|
||||
|
||||
// 1. 动态调整Canvas尺寸
|
||||
this.currentCanvasWidth = this.calcLineWidth(textLine);
|
||||
this.currentCanvasHeight = this.fontSize;
|
||||
|
||||
// 2. 清空Canvas(绘制背景)
|
||||
this.clearCanvas();
|
||||
|
||||
// 3. 设置文字样式
|
||||
ctx.setFillStyle(this.color);
|
||||
ctx.setTextBaseline('middle');
|
||||
ctx.setFontSize(this.fontSize);
|
||||
ctx.font = `${this.fontSize}px "PingFang SC", PingFang SC, Arial, sans-serif`;
|
||||
|
||||
// 4. 绘制当前行文本
|
||||
let currentX = 0;
|
||||
let currentY = this.fontSize / 2;
|
||||
for (let j = 0; j < textLine.length; j++) {
|
||||
let char = textLine[j];
|
||||
ctx.fillText(char, currentX, currentY);
|
||||
// 按实际字符宽度计算间距
|
||||
let charWidth = ctx.measureText(char).width;
|
||||
currentX += charWidth;
|
||||
}
|
||||
|
||||
// 5. 异步绘制并获取像素数据(串行处理避免冲突)
|
||||
await new Promise((resolve, reject) => {
|
||||
ctx.draw(false, () => {
|
||||
uni.canvasGetImageData({
|
||||
canvasId: 'reusableCanvas',
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: this.currentCanvasWidth,
|
||||
height: this.currentCanvasHeight,
|
||||
success: res => {
|
||||
|
||||
result={
|
||||
line: textLine,
|
||||
pixelData: res.data,
|
||||
width: this.currentCanvasWidth,
|
||||
height: this.currentCanvasHeight
|
||||
};
|
||||
resolve();
|
||||
},
|
||||
fail: err => {
|
||||
// console.error(`处理第${i+1}行失败:`, err);
|
||||
reject(err)
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
let arr = [];
|
||||
// 循环处理每行文本
|
||||
for (let i = 0; i < this.validTxts.length; i++) {
|
||||
|
||||
let linePixls = [];
|
||||
let item = this.validTxts[i];
|
||||
console.log("item=",item);
|
||||
for (var j = 0; j < item.length; j++) {
|
||||
let result = await drawTxt(item[j]);
|
||||
linePixls.push(convertCharToMatrix(result.pixelData));
|
||||
}
|
||||
console.log("hexs=",linePixls.join(","));
|
||||
arr.push(linePixls);
|
||||
}
|
||||
|
||||
return arr;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.offscreen-canvas {
|
||||
position: fixed;
|
||||
left: -9999px;
|
||||
top: -9999px;
|
||||
visibility: hidden;
|
||||
}
|
||||
</style>
|
199
components/global-loading/global-loading.vue
Normal file
@ -0,0 +1,199 @@
|
||||
<template>
|
||||
<view v-if="visible" class="loading-container" @touchmove.stop.prevent="handleTouchMove">
|
||||
<view class="loading-content">
|
||||
<!-- 刻度点容器 -->
|
||||
<view class="clock-container">
|
||||
<view v-for="(dot, index) in dots" :key="index" class="clock-dot" :style="{
|
||||
transform: `rotate(${index * angle}deg) translateY(-${radius}px)`,
|
||||
backgroundColor: getDotColor(index),
|
||||
animationDuration: `${duration}ms`,
|
||||
animationDelay: `${index * (duration / dotsCount)}ms`
|
||||
}"></view>
|
||||
</view>
|
||||
|
||||
<!-- 提示文本 -->
|
||||
<text class="loading-text" :class="text?'':'displayNone'" :style="{ color: textColor }">{{ text }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
dotsCount: 12,
|
||||
dotColors: ['#CEF231'],
|
||||
text: '请稍候...',//文本文字
|
||||
textColor: '#FFFFFFde',//文本颜色
|
||||
radius: 32,//圆的半径
|
||||
duration: 1200,//动画的播放速度
|
||||
colorIndex: 0
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 计算每个点之间的角度
|
||||
angle() {
|
||||
return 360 / this.dotsCount
|
||||
},
|
||||
// 生成刻度点数组
|
||||
dots() {
|
||||
return Array.from({
|
||||
length: this.dotsCount
|
||||
})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 获取刻度点颜色(实现无限循环变色)
|
||||
getDotColor(index) {
|
||||
// 根据当前颜色索引和刻度点位置计算颜色
|
||||
const colorIndex = (index + this.colorIndex) % this.dotColors.length
|
||||
return this.dotColors[colorIndex]
|
||||
},
|
||||
|
||||
// 更新颜色索引(实现循环变色)
|
||||
updateColorIndex() {
|
||||
this.colorIndex = (this.colorIndex + 1) % this.dotColors.length
|
||||
},
|
||||
|
||||
// 显示loading
|
||||
show(options) {
|
||||
|
||||
if(!options){
|
||||
options={};
|
||||
}
|
||||
|
||||
this.update(options)
|
||||
this.visible = true
|
||||
|
||||
// 启动颜色循环
|
||||
if (!this.colorTimer) {
|
||||
this.colorTimer = setInterval(() => {
|
||||
this.updateColorIndex()
|
||||
}, this.duration / this.dotColors.length)
|
||||
}
|
||||
},
|
||||
|
||||
// 隐藏loading
|
||||
hide() {
|
||||
|
||||
this.visible = false
|
||||
// 清除颜色循环定时器
|
||||
if (this.colorTimer) {
|
||||
clearInterval(this.colorTimer)
|
||||
this.colorTimer = null
|
||||
}
|
||||
},
|
||||
|
||||
// 更新loading配置
|
||||
update(options) {
|
||||
if(!options){
|
||||
options={a:1};
|
||||
}
|
||||
Object.keys(options).forEach(key => {
|
||||
if (this[key] !== undefined) {
|
||||
this[key] = options[key]
|
||||
}
|
||||
})
|
||||
|
||||
// 如果更新了颜色数组,重置颜色索引
|
||||
if (options.dotColors) {
|
||||
this.colorIndex = 0
|
||||
}
|
||||
},
|
||||
|
||||
// 阻止触摸移动事件
|
||||
handleTouchMove() {}
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
// 组件销毁前清除定时器
|
||||
if (this.colorTimer) {
|
||||
clearInterval(this.colorTimer)
|
||||
this.colorTimer = null
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 全屏遮罩层 */
|
||||
.loading-container {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: #000000c2;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 99999999999;
|
||||
pointer-events: auto;
|
||||
box-sizing: border-box;
|
||||
padding-bottom: 70%;
|
||||
}
|
||||
|
||||
/* 内容居中 */
|
||||
.loading-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transform: translateZ(0);
|
||||
/* 启用GPU加速 */
|
||||
margin-top: -150rpx;
|
||||
}
|
||||
|
||||
/* 刻度容器 */
|
||||
.clock-container {
|
||||
position: relative;
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
|
||||
}
|
||||
|
||||
/* 单个刻度点 */
|
||||
.clock-dot {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 6rpx;
|
||||
height: 30rpx;
|
||||
border-radius: 12rpx;
|
||||
/* margin-top: -4rpx;
|
||||
margin-left: -4rpx; */
|
||||
transform-origin: 0 0;
|
||||
animation: colorScale infinite ease-in-out;
|
||||
box-shadow: 0 0 8rpx rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
/* 刻度点动画 - 颜色和大小变化 */
|
||||
@keyframes colorScale {
|
||||
0% {
|
||||
opacity: 0.05;
|
||||
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/* 提示文本 */
|
||||
.loading-text {
|
||||
font-size: 32rpx;
|
||||
font-weight: 400;
|
||||
letter-spacing: 1.4rpx;
|
||||
text-align: center;
|
||||
max-width: 80vw;
|
||||
|
||||
|
||||
font-family: 'PingFang SC';
|
||||
}
|
||||
|
||||
.displayNone{
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
@ -2,21 +2,21 @@
|
||||
const config = {
|
||||
// 开发环境
|
||||
development: {
|
||||
BASE_URL: 'http://192.168.2.34:8000',
|
||||
BASE_URL: 'http://192.168.110.54:8000',
|
||||
API_PREFIX: '',
|
||||
// MQTT 配置
|
||||
MQTT_HOST: '47.120.79.150',
|
||||
MQTT_PORT: 9083,
|
||||
MQTT_PORT: 8083,
|
||||
MQTT_USERNAME: 'admin',
|
||||
MQTT_PASSWORD: '#YtvpSfCNG'
|
||||
},
|
||||
// 生产环境
|
||||
production: {
|
||||
BASE_URL: 'http://47.120.79.150/backend', // https://fuyuanshen.com/backend
|
||||
BASE_URL: 'http://192.168.110.54:8000', // https://fuyuanshen.com/backend
|
||||
API_PREFIX: '',
|
||||
// MQTT 配置
|
||||
MQTT_HOST: '47.120.79.150',
|
||||
MQTT_PORT: 9083,
|
||||
MQTT_PORT: 8083,
|
||||
MQTT_USERNAME: 'admin',
|
||||
MQTT_PASSWORD: '#YtvpSfCNG'
|
||||
}
|
||||
|
6
main.js
@ -2,14 +2,14 @@ import App from './App'
|
||||
|
||||
// 引入 uView UI
|
||||
import uView from 'vk-uview-ui';
|
||||
import bleTool from '@/store/BLETools.js';
|
||||
|
||||
|
||||
// #ifndef VUE3
|
||||
import Vue from 'vue'
|
||||
import store from './store/store';
|
||||
import './uni.promisify.adaptor'
|
||||
Vue.config.productionTip = false
|
||||
Vue.prototype.$bleTool = bleTool;
|
||||
|
||||
App.mpType = 'app'
|
||||
const app = new Vue({
|
||||
store,
|
||||
@ -25,7 +25,7 @@ import {
|
||||
} from 'vue'
|
||||
export function createApp() {
|
||||
const app = createSSRApp(App)
|
||||
app.config.globalProperties.$bleTool = bleTool;
|
||||
|
||||
// 使用 uView UI
|
||||
app.use(uView)
|
||||
return {
|
||||
|
@ -1,8 +1,8 @@
|
||||
{
|
||||
"name" : "JingQuan",
|
||||
"name" : "晶全-物联",
|
||||
"appid" : "__UNI__A21EF43",
|
||||
"description" : "设备管控",
|
||||
"versionName" : "1.0.0",
|
||||
"versionName" : "1.0.8",
|
||||
"versionCode" : "100",
|
||||
"transformPx" : false,
|
||||
/* 5+App特有相关 */
|
||||
@ -21,8 +21,8 @@
|
||||
"Bluetooth" : {},
|
||||
"Barcode" : {},
|
||||
"Camera" : {},
|
||||
"Maps" : {},
|
||||
"OAuth" : {},
|
||||
"Record" : {},
|
||||
"VideoPlayer" : {},
|
||||
"Geolocation" : {}
|
||||
},
|
||||
/* 应用发布信息 */
|
||||
@ -85,7 +85,7 @@
|
||||
"appkey_ios" : "065c43f02c7b627a74ad7dd23b16bb4f",
|
||||
"appkey_android" : "d7d852dbda2b95f6f796fb9a711a9fee"
|
||||
},
|
||||
"customStyle": true
|
||||
"customStyle" : true
|
||||
},
|
||||
"oauth" : {},
|
||||
"push" : {}
|
||||
@ -157,5 +157,8 @@
|
||||
"enable" : false
|
||||
},
|
||||
"vueVersion" : "2",
|
||||
"locale" : "auto"
|
||||
"locale" : "zh-Hans",
|
||||
"fallbackLocale" : "zh-Hans"
|
||||
}
|
||||
/* 5+App特有相关 */
|
||||
|
||||
|
311
node_modules/.package-lock.json
generated
vendored
Normal file
@ -0,0 +1,311 @@
|
||||
{
|
||||
"name": "APP-main",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"node_modules/asynckit": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
||||
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
|
||||
},
|
||||
"node_modules/axios": {
|
||||
"version": "1.9.0",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.9.0.tgz",
|
||||
"integrity": "sha512-re4CqKTJaURpzbLHtIi6XpDv20/CnpXOtjRY5/CU32L8gU8ek9UIivcfvSWvmKEngmVbrUtPpdDwWDWL7DNHvg==",
|
||||
"dependencies": {
|
||||
"follow-redirects": "^1.15.6",
|
||||
"form-data": "^4.0.0",
|
||||
"proxy-from-env": "^1.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/call-bind-apply-helpers": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
|
||||
"integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0",
|
||||
"function-bind": "^1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/combined-stream": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
|
||||
"dependencies": {
|
||||
"delayed-stream": "~1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/cordova-sqlite-storage": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/cordova-sqlite-storage/-/cordova-sqlite-storage-7.0.0.tgz",
|
||||
"integrity": "sha512-BV1KCNtHnFD37ZQmhztStKsaNxniGlLcUSiQ9wieWH2PpZ0gH/tuWeINrrXGKIt9teTukYRnxFyerQ/Lc9x41A==",
|
||||
"dependencies": {
|
||||
"cordova-sqlite-storage-dependencies": "5.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/cordova-sqlite-storage-dependencies": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/cordova-sqlite-storage-dependencies/-/cordova-sqlite-storage-dependencies-5.0.0.tgz",
|
||||
"integrity": "sha512-WjWm1QX+2JyLxjaNmYX2kNzmhrRk8q6n4GQ1PkUc79xR2bmJeO/m3koSuPemnWJdLdlsqDz8dCEHmgQSxhYjcg=="
|
||||
},
|
||||
"node_modules/delayed-stream": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
||||
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
|
||||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/dunder-proto": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
|
||||
"integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
|
||||
"dependencies": {
|
||||
"call-bind-apply-helpers": "^1.0.1",
|
||||
"es-errors": "^1.3.0",
|
||||
"gopd": "^1.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/es-define-property": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
|
||||
"integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/es-errors": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
|
||||
"integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/es-object-atoms": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz",
|
||||
"integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/es-set-tostringtag": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz",
|
||||
"integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0",
|
||||
"get-intrinsic": "^1.2.6",
|
||||
"has-tostringtag": "^1.0.2",
|
||||
"hasown": "^2.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/follow-redirects": {
|
||||
"version": "1.15.9",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz",
|
||||
"integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "individual",
|
||||
"url": "https://github.com/sponsors/RubenVerborgh"
|
||||
}
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=4.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"debug": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/form-data": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.2.tgz",
|
||||
"integrity": "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==",
|
||||
"dependencies": {
|
||||
"asynckit": "^0.4.0",
|
||||
"combined-stream": "^1.0.8",
|
||||
"es-set-tostringtag": "^2.1.0",
|
||||
"mime-types": "^2.1.12"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/function-bind": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
|
||||
"integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/get-intrinsic": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
|
||||
"integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
|
||||
"dependencies": {
|
||||
"call-bind-apply-helpers": "^1.0.2",
|
||||
"es-define-property": "^1.0.1",
|
||||
"es-errors": "^1.3.0",
|
||||
"es-object-atoms": "^1.1.1",
|
||||
"function-bind": "^1.1.2",
|
||||
"get-proto": "^1.0.1",
|
||||
"gopd": "^1.2.0",
|
||||
"has-symbols": "^1.1.0",
|
||||
"hasown": "^2.0.2",
|
||||
"math-intrinsics": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/get-proto": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
|
||||
"integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
|
||||
"dependencies": {
|
||||
"dunder-proto": "^1.0.1",
|
||||
"es-object-atoms": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/gopd": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
|
||||
"integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/has-symbols": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
|
||||
"integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/has-tostringtag": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz",
|
||||
"integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==",
|
||||
"dependencies": {
|
||||
"has-symbols": "^1.0.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/hasown": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
|
||||
"integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
|
||||
"dependencies": {
|
||||
"function-bind": "^1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/iconv-lite": {
|
||||
"version": "0.6.3",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
|
||||
"integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
|
||||
"dependencies": {
|
||||
"safer-buffer": ">= 2.1.2 < 3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/math-intrinsics": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
|
||||
"integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/mime-db": {
|
||||
"version": "1.52.0",
|
||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
|
||||
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/mime-types": {
|
||||
"version": "2.1.35",
|
||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
|
||||
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
|
||||
"dependencies": {
|
||||
"mime-db": "1.52.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/paho-mqtt": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/paho-mqtt/-/paho-mqtt-1.1.0.tgz",
|
||||
"integrity": "sha512-KPbL9KAB0ASvhSDbOrZBaccXS+/s7/LIofbPyERww8hM5Ko71GUJQ6Nmg0BWqj8phAIT8zdf/Sd/RftHU9i2HA==",
|
||||
"license": "EPL-1.0"
|
||||
},
|
||||
"node_modules/proxy-from-env": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
|
||||
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
|
||||
},
|
||||
"node_modules/safer-buffer": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
|
||||
},
|
||||
"node_modules/text-encoding": {
|
||||
"version": "0.7.0",
|
||||
"resolved": "https://registry.npmjs.org/text-encoding/-/text-encoding-0.7.0.tgz",
|
||||
"integrity": "sha512-oJQ3f1hrOnbRLOcwKz0Liq2IcrvDeZRHXhd9RgLrsT+DjWY/nty1Hi7v3dtkaEYbPYe0mUoOfzRrMwfXXwgPUA==",
|
||||
"deprecated": "no longer maintained"
|
||||
},
|
||||
"node_modules/vk-uview-ui": {
|
||||
"version": "1.5.2",
|
||||
"resolved": "https://registry.npmjs.org/vk-uview-ui/-/vk-uview-ui-1.5.2.tgz",
|
||||
"integrity": "sha512-RRZgiEAc8qaUerSi7lSbrkCoLBgRUwFQHwP1V44pJO7Js+7HeHFEkkpPrtkOi14hl4CntR4qIhIDvaKmIJqVsw==",
|
||||
"engines": {
|
||||
"HBuilderX": "^3.1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
2
node_modules/paho-mqtt/.npm/_cacache/index-v5/42/e8/733f84666bf8ae51438746731476ab9b2f309ff6f8ebeda2a8ff3fe11009
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
|
||||
ee3f3ed558ef2238c94265495ea3b8bb50a47e26 {"key":"make-fetch-happen:request-cache:https://registry.npmjs.org/-/v1/login","integrity":null,"time":1542887192495}
|
2
node_modules/paho-mqtt/.npm/_cacache/index-v5/b1/39/f91af860e5eb9058d952996c11e90a1562eb56cad7626fc0934b688247da
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
|
||||
b956bf3f77cdaa5f7fb17a650168422dd0676fbc {"key":"make-fetch-happen:request-cache:https://registry.npmjs.org/-/user/org.couchdb.user:jpwsutton","integrity":null,"time":1542887232403}
|
78
node_modules/paho-mqtt/.npm/_logs/2018-11-22T11_46_27_151Z-debug.log
generated
vendored
Normal file
@ -0,0 +1,78 @@
|
||||
0 info it worked if it ends with ok
|
||||
1 verbose cli [ '/usr/local/Cellar/node/10.7.0/bin/node',
|
||||
1 verbose cli '/usr/local/bin/npm',
|
||||
1 verbose cli 'publish' ]
|
||||
2 info using npm@6.4.1
|
||||
3 info using node@v10.7.0
|
||||
4 verbose npm-session d96c0348a547f465
|
||||
5 verbose publish [ '.' ]
|
||||
6 info lifecycle paho-mqtt@1.1.0~prepublish: paho-mqtt@1.1.0
|
||||
7 info lifecycle paho-mqtt@1.1.0~prepare: paho-mqtt@1.1.0
|
||||
8 info lifecycle paho-mqtt@1.1.0~prepublishOnly: paho-mqtt@1.1.0
|
||||
9 info lifecycle paho-mqtt@1.1.0~prepack: paho-mqtt@1.1.0
|
||||
10 info lifecycle paho-mqtt@1.1.0~postpack: paho-mqtt@1.1.0
|
||||
11 notice
|
||||
12 notice 📦 paho-mqtt@1.1.0
|
||||
13 notice === Tarball Contents ===
|
||||
14 notice 606B package.json
|
||||
14 notice 1.6kB about.html
|
||||
14 notice 3.7kB CONTRIBUTING.md
|
||||
14 notice 1.6kB edl-v10
|
||||
14 notice 11.2kB epl-v10
|
||||
14 notice 32.2kB paho-mqtt-min.js
|
||||
14 notice 90.3kB paho-mqtt.js
|
||||
14 notice 4.7kB README.md
|
||||
15 notice === Tarball Details ===
|
||||
16 notice name: paho-mqtt
|
||||
16 notice version: 1.1.0
|
||||
16 notice package size: 37.2 kB
|
||||
16 notice unpacked size: 145.9 kB
|
||||
16 notice shasum: 140ae65f16b20f8622e6c68aac5774ea0b3609a3
|
||||
16 notice integrity: sha512-pRr2lCE2FciFP[...]B4f0UEsZJ594Q==
|
||||
16 notice total files: 8
|
||||
17 notice
|
||||
18 verbose getPublishConfig undefined
|
||||
19 silly mapToRegistry name paho-mqtt
|
||||
20 silly mapToRegistry using default registry
|
||||
21 silly mapToRegistry registry https://registry.npmjs.org/
|
||||
22 silly mapToRegistry data { type: 'tag',
|
||||
22 silly mapToRegistry registry: true,
|
||||
22 silly mapToRegistry where: undefined,
|
||||
22 silly mapToRegistry raw: 'paho-mqtt',
|
||||
22 silly mapToRegistry name: 'paho-mqtt',
|
||||
22 silly mapToRegistry escapedName: 'paho-mqtt',
|
||||
22 silly mapToRegistry scope: undefined,
|
||||
22 silly mapToRegistry rawSpec: '',
|
||||
22 silly mapToRegistry saveSpec: null,
|
||||
22 silly mapToRegistry fetchSpec: 'latest',
|
||||
22 silly mapToRegistry gitRange: undefined,
|
||||
22 silly mapToRegistry gitCommittish: undefined,
|
||||
22 silly mapToRegistry hosted: undefined }
|
||||
23 silly mapToRegistry uri https://registry.npmjs.org/paho-mqtt
|
||||
24 verbose publish registryBase https://registry.npmjs.org/
|
||||
25 silly publish uploading /var/folders/r7/47tnp9g16794rt7ff63tp2500000gn/T/npm-95867-c4ec80c4/tmp/fromDir-9f1696dc/package.tgz
|
||||
26 verbose stack Error: auth required for publishing
|
||||
26 verbose stack at RegClient.publish (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/publish.js:30:14)
|
||||
26 verbose stack at BB.fromNode (/usr/local/lib/node_modules/npm/lib/publish.js:187:16)
|
||||
26 verbose stack at tryCatcher (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
|
||||
26 verbose stack at Function.Promise.fromNode.Promise.fromCallback (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:180:30)
|
||||
26 verbose stack at BB.fromNode.spread (/usr/local/lib/node_modules/npm/lib/publish.js:186:15)
|
||||
26 verbose stack at tryCatcher (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
|
||||
26 verbose stack at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:509:35)
|
||||
26 verbose stack at Promise._settlePromise (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)
|
||||
26 verbose stack at Promise._settlePromiseCtx (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:606:10)
|
||||
26 verbose stack at Async._drainQueue (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:138:12)
|
||||
26 verbose stack at Async._drainQueues (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:143:10)
|
||||
26 verbose stack at Immediate.Async.drainQueues [as _onImmediate] (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:17:14)
|
||||
26 verbose stack at runCallback (timers.js:696:18)
|
||||
26 verbose stack at tryOnImmediate (timers.js:667:5)
|
||||
26 verbose stack at processImmediate (timers.js:649:5)
|
||||
27 verbose cwd /Users/jsutton/ibm/paho/git/npm/node_modules/paho-mqtt
|
||||
28 verbose Darwin 18.2.0
|
||||
29 verbose argv "/usr/local/Cellar/node/10.7.0/bin/node" "/usr/local/bin/npm" "publish"
|
||||
30 verbose node v10.7.0
|
||||
31 verbose npm v6.4.1
|
||||
32 error code ENEEDAUTH
|
||||
33 error need auth auth required for publishing
|
||||
34 error need auth You need to authorize this machine using `npm adduser`
|
||||
35 verbose exit [ 1, true ]
|
68
node_modules/paho-mqtt/CONTRIBUTING.md
generated
vendored
Normal file
@ -0,0 +1,68 @@
|
||||
# Contributing to Paho
|
||||
|
||||
Thanks for your interest in this project!
|
||||
|
||||
You can contribute bugfixes and new features by sending pull requests through GitHub.
|
||||
|
||||
## Legal
|
||||
|
||||
In order for your contribution to be accepted, it must comply with the Eclipse Foundation IP policy.
|
||||
|
||||
Please read the [Eclipse Foundation policy on accepting contributions via Git](http://wiki.eclipse.org/Development_Resources/Contributing_via_Git).
|
||||
|
||||
1. Sign the [Eclipse CLA](http://www.eclipse.org/legal/CLA.php)
|
||||
1. Register for an Eclipse Foundation User ID. You can register [here](https://dev.eclipse.org/site_login/createaccount.php).
|
||||
2. Log into the [Projects Portal](https://projects.eclipse.org/), and click on the '[Eclipse CLA](https://projects.eclipse.org/user/sign/cla)' link.
|
||||
2. Go to your [account settings](https://dev.eclipse.org/site_login/myaccount.php#open_tab_accountsettings) and add your GitHub username to your account.
|
||||
3. Make sure that you _sign-off_ your Git commits in the following format:
|
||||
``` Signed-off-by: John Smith <johnsmith@nowhere.com> ``` This is usually at the bottom of the commit message. You can automate this by adding the '-s' flag when you make the commits. e.g. ```git commit -s -m "Adding a cool feature"```
|
||||
4. Ensure that the email address that you make your commits with is the same one you used to sign up to the Eclipse Foundation website with.
|
||||
|
||||
## Contributing a change
|
||||
|
||||
## Contributing a change
|
||||
|
||||
1. [Fork the repository on GitHub](https://github.com/eclipse/paho.mqtt.javascript/fork)
|
||||
2. Clone the forked repository onto your computer: ``` git clone https://github.com/<your username>/paho.mqtt.javascript.git ```
|
||||
3. Create a new branch from the latest ```develop``` branch with ```git checkout -b YOUR_BRANCH_NAME origin/develop```
|
||||
4. Make your changes
|
||||
5. If developing a new feature, make sure to include JUnit tests.
|
||||
6. Ensure that all new and existing tests pass.
|
||||
7. Commit the changes into the branch: ``` git commit -s ``` Make sure that your commit message is meaningful and describes your changes correctly.
|
||||
8. If you have a lot of commits for the change, squash them into a single / few commits.
|
||||
9. Push the changes in your branch to your forked repository.
|
||||
10. Finally, go to [https://github.com/eclipse/paho.mqtt.javascript](https://github.com/eclipse/paho.mqtt.javascript) and create a pull request from your "YOUR_BRANCH_NAME" branch to the ```develop``` one to request review and merge of the commits in your pushed branch.
|
||||
|
||||
|
||||
What happens next depends on the content of the patch. If it is 100% authored
|
||||
by the contributor and is less than 1000 lines (and meets the needs of the
|
||||
project), then it can be pulled into the main repository. If not, more steps
|
||||
are required. These are detailed in the
|
||||
[legal process poster](http://www.eclipse.org/legal/EclipseLegalProcessPoster.pdf).
|
||||
|
||||
|
||||
|
||||
## Developer resources:
|
||||
|
||||
|
||||
Information regarding source code management, builds, coding standards, and more.
|
||||
|
||||
- [https://projects.eclipse.org/projects/iot.paho/developer](https://projects.eclipse.org/projects/iot.paho/developer)
|
||||
|
||||
Contact:
|
||||
--------
|
||||
|
||||
Contact the project developers via the project's development
|
||||
[mailing list](https://dev.eclipse.org/mailman/listinfo/paho-dev).
|
||||
|
||||
Search for bugs:
|
||||
----------------
|
||||
|
||||
This project uses GitHub Issues here: [github.com/eclipse/paho.mqtt.javascript/issues](https://github.com/eclipse/paho.mqtt.javascript/issues) to track ongoing development and issues.
|
||||
|
||||
Create a new bug:
|
||||
-----------------
|
||||
|
||||
Be sure to search for existing bugs before you create another one. Remember that contributions are always welcome!
|
||||
|
||||
- [Create new Paho bug](https://github.com/eclipse/paho.mqtt.javascript/issues/new)
|
107
node_modules/paho-mqtt/README.md
generated
vendored
Normal file
@ -0,0 +1,107 @@
|
||||
# Eclipse Paho JavaScript client
|
||||
|
||||
The Paho JavaScript Client is an MQTT browser-based client library written in Javascript that uses WebSockets to connect to an MQTT Broker.
|
||||
|
||||
## Project description:
|
||||
|
||||
The Paho project has been created to provide reliable open-source implementations of open and standard messaging protocols aimed at new, existing, and emerging applications for Machine-to-Machine (M2M) and Internet of Things (IoT).
|
||||
Paho reflects the inherent physical and cost constraints of device connectivity. Its objectives include effective levels of decoupling between devices and applications, designed to keep markets open and encourage the rapid growth of scalable Web and Enterprise middleware and applications.
|
||||
|
||||
## Links
|
||||
|
||||
- Project Website: [https://www.eclipse.org/paho](https://www.eclipse.org/paho)
|
||||
- Eclipse Project Information: [https://projects.eclipse.org/projects/iot.paho](https://projects.eclipse.org/projects/iot.paho)
|
||||
- Paho Javascript Client Page: [https://eclipse.org/paho/clients/js/](https://eclipse.org/paho/clients/js)
|
||||
- GitHub: [https://github.com/eclipse/paho.mqtt.javascript](https://github.com/eclipse/paho.mqtt.javascript)
|
||||
- Twitter: [@eclipsepaho](https://twitter.com/eclipsepaho)
|
||||
- Issues: [github.com/eclipse/paho.mqtt.javascript/issues](https://github.com/eclipse/paho.mqtt.javascript/issues)
|
||||
- Mailing-list: [https://dev.eclipse.org/mailman/listinfo/paho-dev](https://dev.eclipse.org/mailman/listinfo/paho-dev
|
||||
|
||||
|
||||
## Using the Paho Javascript Client
|
||||
|
||||
|
||||
### Downloading
|
||||
|
||||
A zip file containing the full and a minified version the Javascript client can be downloaded from the [Paho downloads page](https://projects.eclipse.org/projects/technology.paho/downloads)
|
||||
|
||||
Alternatively the Javascript client can be downloaded directly from the projects git repository: [https://raw.githubusercontent.com/eclipse/paho.mqtt.javascript/master/src/paho-mqtt.js](https://raw.githubusercontent.com/eclipse/paho.mqtt.javascript/master/src/paho-mqtt.js).
|
||||
|
||||
Please **do not** link directly to this url from your application.
|
||||
|
||||
### Building from source
|
||||
|
||||
There are two active branches on the Paho Java git repository, ```master``` which is used to produce stable releases, and ```develop``` where active development is carried out. By default cloning the git repository will download the ```master``` branch, to build from develop make sure you switch to the remote branch: ```git checkout -b develop remotes/origin/develop```
|
||||
|
||||
The project contains a maven based build that produces a minified version of the client, runs unit tests and generates it's documentation.
|
||||
|
||||
To run the build:
|
||||
|
||||
```
|
||||
$ mvn
|
||||
```
|
||||
|
||||
The output of the build is copied to the ```target``` directory.
|
||||
|
||||
### Tests
|
||||
|
||||
The client uses the [Jasmine](http://jasmine.github.io/) test framework. The tests for the client are in:
|
||||
|
||||
```
|
||||
src/tests
|
||||
```
|
||||
|
||||
To run the tests with maven, use the following command:
|
||||
```
|
||||
$ mvn test
|
||||
```
|
||||
The parameters passed in should be modified to match the broker instance being tested against.
|
||||
|
||||
### Documentation
|
||||
|
||||
Reference documentation is online at: [http://www.eclipse.org/paho/files/jsdoc/index.html](http://www.eclipse.org/paho/files/jsdoc/index.html)
|
||||
|
||||
### Compatibility
|
||||
|
||||
The client should work in any browser fully supporting WebSockets, [http://caniuse.com/websockets](http://caniuse.com/websockets) lists browser compatibility.
|
||||
|
||||
## Getting Started
|
||||
|
||||
The included code below is a very basic sample that connects to a server using WebSockets and subscribes to the topic ```World```, once subscribed, it then publishes the message ```Hello``` to that topic. Any messages that come into the subscribed topic will be printed to the Javascript console.
|
||||
|
||||
This requires the use of a broker that supports WebSockets natively, or the use of a gateway that can forward between WebSockets and TCP.
|
||||
|
||||
```JS
|
||||
// Create a client instance
|
||||
client = new Paho.MQTT.Client(location.hostname, Number(location.port), "clientId");
|
||||
|
||||
// set callback handlers
|
||||
client.onConnectionLost = onConnectionLost;
|
||||
client.onMessageArrived = onMessageArrived;
|
||||
|
||||
// connect the client
|
||||
client.connect({onSuccess:onConnect});
|
||||
|
||||
|
||||
// called when the client connects
|
||||
function onConnect() {
|
||||
// Once a connection has been made, make a subscription and send a message.
|
||||
console.log("onConnect");
|
||||
client.subscribe("World");
|
||||
message = new Paho.MQTT.Message("Hello");
|
||||
message.destinationName = "World";
|
||||
client.send(message);
|
||||
}
|
||||
|
||||
// called when the client loses its connection
|
||||
function onConnectionLost(responseObject) {
|
||||
if (responseObject.errorCode !== 0) {
|
||||
console.log("onConnectionLost:"+responseObject.errorMessage);
|
||||
}
|
||||
}
|
||||
|
||||
// called when a message arrives
|
||||
function onMessageArrived(message) {
|
||||
console.log("onMessageArrived:"+message.payloadString);
|
||||
}
|
||||
```
|
28
node_modules/paho-mqtt/about.html
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>About</title>
|
||||
</head>
|
||||
<body lang="EN-US">
|
||||
<h2>About This Content</h2>
|
||||
|
||||
<p><em>December 9, 2013</em></p>
|
||||
<h3>License</h3>
|
||||
|
||||
<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
|
||||
indicated below, the Content is provided to you under the terms and conditions of the
|
||||
Eclipse Public License Version 1.0 ("EPL") and Eclipse Distribution License Version 1.0 ("EDL").
|
||||
A copy of the EPL is available at
|
||||
<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
|
||||
and a copy of the EDL is available at
|
||||
<a href="http://www.eclipse.org/org/documents/edl-v10.php">http://www.eclipse.org/org/documents/edl-v10.php</a>.
|
||||
For purposes of the EPL, "Program" will mean the Content.</p>
|
||||
|
||||
<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
|
||||
being redistributed by another party ("Redistributor") and different terms and conditions may
|
||||
apply to your use of any object code in the Content. Check the Redistributor's license that was
|
||||
provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
|
||||
indicated below, the terms and conditions of the EPL still apply to any source code in the Content
|
||||
and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
|
||||
|
||||
</body></html>
|
15
node_modules/paho-mqtt/edl-v10
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
|
||||
Eclipse Distribution License - v 1.0
|
||||
|
||||
Copyright (c) 2007, Eclipse Foundation, Inc. and its licensors.
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
Neither the name of the Eclipse Foundation, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
70
node_modules/paho-mqtt/epl-v10
generated
vendored
Normal file
@ -0,0 +1,70 @@
|
||||
Eclipse Public License - v 1.0
|
||||
|
||||
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
|
||||
1. DEFINITIONS
|
||||
|
||||
"Contribution" means:
|
||||
|
||||
a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
|
||||
b) in the case of each subsequent Contributor:
|
||||
i) changes to the Program, and
|
||||
ii) additions to the Program;
|
||||
where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
|
||||
"Contributor" means any person or entity that distributes the Program.
|
||||
|
||||
"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
|
||||
|
||||
"Program" means the Contributions distributed in accordance with this Agreement.
|
||||
|
||||
"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
|
||||
|
||||
2. GRANT OF RIGHTS
|
||||
|
||||
a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
|
||||
b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
|
||||
c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
|
||||
d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
|
||||
3. REQUIREMENTS
|
||||
|
||||
A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
|
||||
|
||||
a) it complies with the terms and conditions of this Agreement; and
|
||||
b) its license agreement:
|
||||
i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
|
||||
ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
|
||||
iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
|
||||
iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
|
||||
When the Program is made available in source code form:
|
||||
|
||||
a) it must be made available under this Agreement; and
|
||||
b) a copy of this Agreement must be included with each copy of the Program.
|
||||
Contributors may not remove or alter any copyright notices contained within the Program.
|
||||
|
||||
Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
|
||||
|
||||
4. COMMERCIAL DISTRIBUTION
|
||||
|
||||
Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
|
||||
|
||||
For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
|
||||
|
||||
5. NO WARRANTY
|
||||
|
||||
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
|
||||
|
||||
6. DISCLAIMER OF LIABILITY
|
||||
|
||||
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
7. GENERAL
|
||||
|
||||
If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
|
||||
|
||||
If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
|
||||
|
||||
All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
|
||||
|
||||
Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
|
||||
|
||||
This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
|
26
node_modules/paho-mqtt/package.json
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "paho-mqtt",
|
||||
"version": "1.1.0",
|
||||
"description": "Eclipse Paho JavaScript MQTT client for Browsers",
|
||||
"main": "paho-mqtt.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/eclipse/paho.mqtt.javascript.git"
|
||||
},
|
||||
"keywords": [
|
||||
"mqtt",
|
||||
"paho",
|
||||
"eclipse",
|
||||
"iot",
|
||||
"m2m"
|
||||
],
|
||||
"author": "Andrew Banks (Initial Author)",
|
||||
"license": "EPL-1.0",
|
||||
"bugs": {
|
||||
"url": "https://github.com/eclipse/paho.mqtt.javascript/issues"
|
||||
},
|
||||
"homepage": "https://github.com/eclipse/paho.mqtt.javascript#readme"
|
||||
}
|
75
node_modules/paho-mqtt/paho-mqtt-min.js
generated
vendored
Normal file
@ -0,0 +1,75 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2013, 2016 IBM Corp.
|
||||
*
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* and Eclipse Distribution License v1.0 which accompany this distribution.
|
||||
*
|
||||
* The Eclipse Public License is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
* and the Eclipse Distribution License is available at
|
||||
* http://www.eclipse.org/org/documents/edl-v10.php.
|
||||
*
|
||||
*******************************************************************************/
|
||||
(function(t,q){"object"===typeof exports&&"object"===typeof module?module.exports=q():"function"===typeof define&&define.amd?define(q):"object"===typeof exports?exports=q():t.Paho=q()})(this,function(){return function(t){function q(a,b,c){b[c++]=a>>8;b[c++]=a%256;return c}function r(a,b,c,k){k=q(b,c,k);E(a,c,k);return k+b}function n(a){for(var b=0,c=0;c<a.length;c++){var k=a.charCodeAt(c);2047<k?(55296<=k&&56319>=k&&(c++,b++),b+=3):127<k?b+=2:b++}return b}function E(a,b,c){for(var k=0;k<a.length;k++){var e=
|
||||
a.charCodeAt(k);if(55296<=e&&56319>=e){var g=a.charCodeAt(++k);if(isNaN(g))throw Error(f(h.MALFORMED_UNICODE,[e,g]));e=(e-55296<<10)+(g-56320)+65536}127>=e?b[c++]=e:(2047>=e?b[c++]=e>>6&31|192:(65535>=e?b[c++]=e>>12&15|224:(b[c++]=e>>18&7|240,b[c++]=e>>12&63|128),b[c++]=e>>6&63|128),b[c++]=e&63|128)}return b}function F(a,b,c){for(var k="",e,g=b;g<b+c;){e=a[g++];if(!(128>e)){var m=a[g++]-128;if(0>m)throw Error(f(h.MALFORMED_UTF,[e.toString(16),m.toString(16),""]));if(224>e)e=64*(e-192)+m;else{var d=
|
||||
a[g++]-128;if(0>d)throw Error(f(h.MALFORMED_UTF,[e.toString(16),m.toString(16),d.toString(16)]));if(240>e)e=4096*(e-224)+64*m+d;else{var l=a[g++]-128;if(0>l)throw Error(f(h.MALFORMED_UTF,[e.toString(16),m.toString(16),d.toString(16),l.toString(16)]));if(248>e)e=262144*(e-240)+4096*m+64*d+l;else throw Error(f(h.MALFORMED_UTF,[e.toString(16),m.toString(16),d.toString(16),l.toString(16)]));}}}65535<e&&(e-=65536,k+=String.fromCharCode(55296+(e>>10)),e=56320+(e&1023));k+=String.fromCharCode(e)}return k}
|
||||
var s=t.localStorage||function(){var a={};return{setItem:function(b,c){a[b]=c},getItem:function(b){return a[b]},removeItem:function(b){delete a[b]}}}(),A=function(a,b){for(var c in a)if(a.hasOwnProperty(c))if(b.hasOwnProperty(c)){if(typeof a[c]!==b[c])throw Error(f(h.INVALID_TYPE,[typeof a[c],c]));}else{c="Unknown property, "+c+". Valid properties are:";for(var k in b)b.hasOwnProperty(k)&&(c=c+" "+k);throw Error(c);}},u=function(a,b){return function(){return a.apply(b,arguments)}},h={OK:{code:0,text:"AMQJSC0000I OK."},
|
||||
CONNECT_TIMEOUT:{code:1,text:"AMQJSC0001E Connect timed out."},SUBSCRIBE_TIMEOUT:{code:2,text:"AMQJS0002E Subscribe timed out."},UNSUBSCRIBE_TIMEOUT:{code:3,text:"AMQJS0003E Unsubscribe timed out."},PING_TIMEOUT:{code:4,text:"AMQJS0004E Ping timed out."},INTERNAL_ERROR:{code:5,text:"AMQJS0005E Internal error. Error Message: {0}, Stack trace: {1}"},CONNACK_RETURNCODE:{code:6,text:"AMQJS0006E Bad Connack return code:{0} {1}."},SOCKET_ERROR:{code:7,text:"AMQJS0007E Socket error:{0}."},SOCKET_CLOSE:{code:8,
|
||||
text:"AMQJS0008I Socket closed."},MALFORMED_UTF:{code:9,text:"AMQJS0009E Malformed UTF data:{0} {1} {2}."},UNSUPPORTED:{code:10,text:"AMQJS0010E {0} is not supported by this browser."},INVALID_STATE:{code:11,text:"AMQJS0011E Invalid state {0}."},INVALID_TYPE:{code:12,text:"AMQJS0012E Invalid type {0} for {1}."},INVALID_ARGUMENT:{code:13,text:"AMQJS0013E Invalid argument {0} for {1}."},UNSUPPORTED_OPERATION:{code:14,text:"AMQJS0014E Unsupported operation."},INVALID_STORED_DATA:{code:15,text:"AMQJS0015E Invalid data in local storage key\x3d{0} value\x3d{1}."},
|
||||
INVALID_MQTT_MESSAGE_TYPE:{code:16,text:"AMQJS0016E Invalid MQTT message type {0}."},MALFORMED_UNICODE:{code:17,text:"AMQJS0017E Malformed Unicode string:{0} {1}."},BUFFER_FULL:{code:18,text:"AMQJS0018E Message buffer is full, maximum buffer size: {0}."}},H={0:"Connection Accepted",1:"Connection Refused: unacceptable protocol version",2:"Connection Refused: identifier rejected",3:"Connection Refused: server unavailable",4:"Connection Refused: bad user name or password",5:"Connection Refused: not authorized"},
|
||||
f=function(a,b){var c=a.text;if(b)for(var k,e,g=0;g<b.length;g++)if(k="{"+g+"}",e=c.indexOf(k),0<e)var h=c.substring(0,e),c=c.substring(e+k.length),c=h+b[g]+c;return c},B=[0,6,77,81,73,115,100,112,3],C=[0,4,77,81,84,84,4],p=function(a,b){this.type=a;for(var c in b)b.hasOwnProperty(c)&&(this[c]=b[c])};p.prototype.encode=function(){var a=(this.type&15)<<4,b=0,c=[],k=0,e;void 0!==this.messageIdentifier&&(b+=2);switch(this.type){case 1:switch(this.mqttVersion){case 3:b+=B.length+3;break;case 4:b+=C.length+
|
||||
3}b+=n(this.clientId)+2;void 0!==this.willMessage&&(b+=n(this.willMessage.destinationName)+2,e=this.willMessage.payloadBytes,e instanceof Uint8Array||(e=new Uint8Array(h)),b+=e.byteLength+2);void 0!==this.userName&&(b+=n(this.userName)+2);void 0!==this.password&&(b+=n(this.password)+2);break;case 8:for(var a=a|2,g=0;g<this.topics.length;g++)c[g]=n(this.topics[g]),b+=c[g]+2;b+=this.requestedQos.length;break;case 10:a|=2;for(g=0;g<this.topics.length;g++)c[g]=n(this.topics[g]),b+=c[g]+2;break;case 6:a|=
|
||||
2;break;case 3:this.payloadMessage.duplicate&&(a|=8);a=a|=this.payloadMessage.qos<<1;this.payloadMessage.retained&&(a|=1);var k=n(this.payloadMessage.destinationName),h=this.payloadMessage.payloadBytes,b=b+(k+2)+h.byteLength;h instanceof ArrayBuffer?h=new Uint8Array(h):h instanceof Uint8Array||(h=new Uint8Array(h.buffer))}var f=b,g=Array(1),d=0;do{var z=f%128,f=f>>7;0<f&&(z|=128);g[d++]=z}while(0<f&&4>d);f=g.length+1;b=new ArrayBuffer(b+f);d=new Uint8Array(b);d[0]=a;d.set(g,1);if(3==this.type)f=r(this.payloadMessage.destinationName,
|
||||
k,d,f);else if(1==this.type){switch(this.mqttVersion){case 3:d.set(B,f);f+=B.length;break;case 4:d.set(C,f),f+=C.length}a=0;this.cleanSession&&(a=2);void 0!==this.willMessage&&(a=a|4|this.willMessage.qos<<3,this.willMessage.retained&&(a|=32));void 0!==this.userName&&(a|=128);void 0!==this.password&&(a|=64);d[f++]=a;f=q(this.keepAliveInterval,d,f)}void 0!==this.messageIdentifier&&(f=q(this.messageIdentifier,d,f));switch(this.type){case 1:f=r(this.clientId,n(this.clientId),d,f);void 0!==this.willMessage&&
|
||||
(f=r(this.willMessage.destinationName,n(this.willMessage.destinationName),d,f),f=q(e.byteLength,d,f),d.set(e,f),f+=e.byteLength);void 0!==this.userName&&(f=r(this.userName,n(this.userName),d,f));void 0!==this.password&&r(this.password,n(this.password),d,f);break;case 3:d.set(h,f);break;case 8:for(g=0;g<this.topics.length;g++)f=r(this.topics[g],c[g],d,f),d[f++]=this.requestedQos[g];break;case 10:for(g=0;g<this.topics.length;g++)f=r(this.topics[g],c[g],d,f)}return b};var G=function(a,b){this._client=
|
||||
a;this._keepAliveInterval=1E3*b;this.isReset=!1;var c=(new p(12)).encode(),k=function(a){return function(){return e.apply(a)}},e=function(){this.isReset?(this.isReset=!1,this._client._trace("Pinger.doPing","send PINGREQ"),this._client.socket.send(c),this.timeout=setTimeout(k(this),this._keepAliveInterval)):(this._client._trace("Pinger.doPing","Timed out"),this._client._disconnected(h.PING_TIMEOUT.code,f(h.PING_TIMEOUT)))};this.reset=function(){this.isReset=!0;clearTimeout(this.timeout);0<this._keepAliveInterval&&
|
||||
(this.timeout=setTimeout(k(this),this._keepAliveInterval))};this.cancel=function(){clearTimeout(this.timeout)}},v=function(a,b,c,f){b||(b=30);this.timeout=setTimeout(function(a,b,c){return function(){return a.apply(b,c)}}(c,a,f),1E3*b);this.cancel=function(){clearTimeout(this.timeout)}},d=function(a,b,c,d,e){if(!("WebSocket"in t&&null!==t.WebSocket))throw Error(f(h.UNSUPPORTED,["WebSocket"]));if(!("ArrayBuffer"in t&&null!==t.ArrayBuffer))throw Error(f(h.UNSUPPORTED,["ArrayBuffer"]));this._trace("Paho.Client",
|
||||
a,b,c,d,e);this.host=b;this.port=c;this.path=d;this.uri=a;this.clientId=e;this._wsuri=null;this._localKey=b+":"+c+("/mqtt"!=d?":"+d:"")+":"+e+":";this._msg_queue=[];this._buffered_msg_queue=[];this._sentMessages={};this._receivedMessages={};this._notify_msg_sent={};this._message_identifier=1;this._sequence=0;for(var g in s)0!==g.indexOf("Sent:"+this._localKey)&&0!==g.indexOf("Received:"+this._localKey)||this.restore(g)};d.prototype.host=null;d.prototype.port=null;d.prototype.path=null;d.prototype.uri=
|
||||
null;d.prototype.clientId=null;d.prototype.socket=null;d.prototype.connected=!1;d.prototype.maxMessageIdentifier=65536;d.prototype.connectOptions=null;d.prototype.hostIndex=null;d.prototype.onConnected=null;d.prototype.onConnectionLost=null;d.prototype.onMessageDelivered=null;d.prototype.onMessageArrived=null;d.prototype.traceFunction=null;d.prototype._msg_queue=null;d.prototype._buffered_msg_queue=null;d.prototype._connectTimeout=null;d.prototype.sendPinger=null;d.prototype.receivePinger=null;d.prototype._reconnectInterval=
|
||||
1;d.prototype._reconnecting=!1;d.prototype._reconnectTimeout=null;d.prototype.disconnectedPublishing=!1;d.prototype.disconnectedBufferSize=5E3;d.prototype.receiveBuffer=null;d.prototype._traceBuffer=null;d.prototype._MAX_TRACE_ENTRIES=100;d.prototype.connect=function(a){var b=this._traceMask(a,"password");this._trace("Client.connect",b,this.socket,this.connected);if(this.connected)throw Error(f(h.INVALID_STATE,["already connected"]));if(this.socket)throw Error(f(h.INVALID_STATE,["already connected"]));
|
||||
this._reconnecting&&(this._reconnectTimeout.cancel(),this._reconnectTimeout=null,this._reconnecting=!1);this.connectOptions=a;this._reconnectInterval=1;this._reconnecting=!1;a.uris?(this.hostIndex=0,this._doConnect(a.uris[0])):this._doConnect(this.uri)};d.prototype.subscribe=function(a,b){this._trace("Client.subscribe",a,b);if(!this.connected)throw Error(f(h.INVALID_STATE,["not connected"]));var c=new p(8);c.topics=a.constructor===Array?a:[a];void 0===b.qos&&(b.qos=0);c.requestedQos=[];for(var d=
|
||||
0;d<c.topics.length;d++)c.requestedQos[d]=b.qos;b.onSuccess&&(c.onSuccess=function(a){b.onSuccess({invocationContext:b.invocationContext,grantedQos:a})});b.onFailure&&(c.onFailure=function(a){b.onFailure({invocationContext:b.invocationContext,errorCode:a,errorMessage:f(a)})});b.timeout&&(c.timeOut=new v(this,b.timeout,b.onFailure,[{invocationContext:b.invocationContext,errorCode:h.SUBSCRIBE_TIMEOUT.code,errorMessage:f(h.SUBSCRIBE_TIMEOUT)}]));this._requires_ack(c);this._schedule_message(c)};d.prototype.unsubscribe=
|
||||
function(a,b){this._trace("Client.unsubscribe",a,b);if(!this.connected)throw Error(f(h.INVALID_STATE,["not connected"]));var c=new p(10);c.topics=a.constructor===Array?a:[a];b.onSuccess&&(c.callback=function(){b.onSuccess({invocationContext:b.invocationContext})});b.timeout&&(c.timeOut=new v(this,b.timeout,b.onFailure,[{invocationContext:b.invocationContext,errorCode:h.UNSUBSCRIBE_TIMEOUT.code,errorMessage:f(h.UNSUBSCRIBE_TIMEOUT)}]));this._requires_ack(c);this._schedule_message(c)};d.prototype.send=
|
||||
function(a){this._trace("Client.send",a);var b=new p(3);b.payloadMessage=a;if(this.connected)0<a.qos?this._requires_ack(b):this.onMessageDelivered&&(this._notify_msg_sent[b]=this.onMessageDelivered(b.payloadMessage)),this._schedule_message(b);else if(this._reconnecting&&this.disconnectedPublishing){if(Object.keys(this._sentMessages).length+this._buffered_msg_queue.length>this.disconnectedBufferSize)throw Error(f(h.BUFFER_FULL,[this.disconnectedBufferSize]));0<a.qos?this._requires_ack(b):(b.sequence=
|
||||
++this._sequence,this._buffered_msg_queue.unshift(b))}else throw Error(f(h.INVALID_STATE,["not connected"]));};d.prototype.disconnect=function(){this._trace("Client.disconnect");this._reconnecting&&(this._reconnectTimeout.cancel(),this._reconnectTimeout=null,this._reconnecting=!1);if(!this.socket)throw Error(f(h.INVALID_STATE,["not connecting or connected"]));var a=new p(14);this._notify_msg_sent[a]=u(this._disconnected,this);this._schedule_message(a)};d.prototype.getTraceLog=function(){if(null!==
|
||||
this._traceBuffer){this._trace("Client.getTraceLog",new Date);this._trace("Client.getTraceLog in flight messages",this._sentMessages.length);for(var a in this._sentMessages)this._trace("_sentMessages ",a,this._sentMessages[a]);for(a in this._receivedMessages)this._trace("_receivedMessages ",a,this._receivedMessages[a]);return this._traceBuffer}};d.prototype.startTrace=function(){null===this._traceBuffer&&(this._traceBuffer=[]);this._trace("Client.startTrace",new Date,"1.1.0-2018-11-22T11:35:36Z")};d.prototype.stopTrace=
|
||||
function(){delete this._traceBuffer};d.prototype._doConnect=function(a){this.connectOptions.useSSL&&(a=a.split(":"),a[0]="wss",a=a.join(":"));this._wsuri=a;this.connected=!1;this.socket=4>this.connectOptions.mqttVersion?new WebSocket(a,["mqttv3.1"]):new WebSocket(a,["mqtt"]);this.socket.binaryType="arraybuffer";this.socket.onopen=u(this._on_socket_open,this);this.socket.onmessage=u(this._on_socket_message,this);this.socket.onerror=u(this._on_socket_error,this);this.socket.onclose=u(this._on_socket_close,
|
||||
this);this.sendPinger=new G(this,this.connectOptions.keepAliveInterval);this.receivePinger=new G(this,this.connectOptions.keepAliveInterval);this._connectTimeout&&(this._connectTimeout.cancel(),this._connectTimeout=null);this._connectTimeout=new v(this,this.connectOptions.timeout,this._disconnected,[h.CONNECT_TIMEOUT.code,f(h.CONNECT_TIMEOUT)])};d.prototype._schedule_message=function(a){this._msg_queue.unshift(a);this.connected&&this._process_queue()};d.prototype.store=function(a,b){var c={type:b.type,
|
||||
messageIdentifier:b.messageIdentifier,version:1};switch(b.type){case 3:b.pubRecReceived&&(c.pubRecReceived=!0);c.payloadMessage={};for(var d="",e=b.payloadMessage.payloadBytes,g=0;g<e.length;g++)d=15>=e[g]?d+"0"+e[g].toString(16):d+e[g].toString(16);c.payloadMessage.payloadHex=d;c.payloadMessage.qos=b.payloadMessage.qos;c.payloadMessage.destinationName=b.payloadMessage.destinationName;b.payloadMessage.duplicate&&(c.payloadMessage.duplicate=!0);b.payloadMessage.retained&&(c.payloadMessage.retained=
|
||||
!0);0===a.indexOf("Sent:")&&(void 0===b.sequence&&(b.sequence=++this._sequence),c.sequence=b.sequence);break;default:throw Error(f(h.INVALID_STORED_DATA,[a+this._localKey+b.messageIdentifier,c]));}s.setItem(a+this._localKey+b.messageIdentifier,JSON.stringify(c))};d.prototype.restore=function(a){var b=s.getItem(a),c=JSON.parse(b),d=new p(c.type,c);switch(c.type){case 3:for(var b=c.payloadMessage.payloadHex,e=new ArrayBuffer(b.length/2),e=new Uint8Array(e),g=0;2<=b.length;){var m=parseInt(b.substring(0,
|
||||
2),16),b=b.substring(2,b.length);e[g++]=m}b=new w(e);b.qos=c.payloadMessage.qos;b.destinationName=c.payloadMessage.destinationName;c.payloadMessage.duplicate&&(b.duplicate=!0);c.payloadMessage.retained&&(b.retained=!0);d.payloadMessage=b;break;default:throw Error(f(h.INVALID_STORED_DATA,[a,b]));}0===a.indexOf("Sent:"+this._localKey)?(d.payloadMessage.duplicate=!0,this._sentMessages[d.messageIdentifier]=d):0===a.indexOf("Received:"+this._localKey)&&(this._receivedMessages[d.messageIdentifier]=d)};
|
||||
d.prototype._process_queue=function(){for(var a=null;a=this._msg_queue.pop();)this._socket_send(a),this._notify_msg_sent[a]&&(this._notify_msg_sent[a](),delete this._notify_msg_sent[a])};d.prototype._requires_ack=function(a){var b=Object.keys(this._sentMessages).length;if(b>this.maxMessageIdentifier)throw Error("Too many messages:"+b);for(;void 0!==this._sentMessages[this._message_identifier];)this._message_identifier++;a.messageIdentifier=this._message_identifier;this._sentMessages[a.messageIdentifier]=
|
||||
a;3===a.type&&this.store("Sent:",a);this._message_identifier===this.maxMessageIdentifier&&(this._message_identifier=1)};d.prototype._on_socket_open=function(){var a=new p(1,this.connectOptions);a.clientId=this.clientId;this._socket_send(a)};d.prototype._on_socket_message=function(a){this._trace("Client._on_socket_message",a.data);a=this._deframeMessages(a.data);for(var b=0;b<a.length;b+=1)this._handleMessage(a[b])};d.prototype._deframeMessages=function(a){a=new Uint8Array(a);var b=[];if(this.receiveBuffer){var c=
|
||||
new Uint8Array(this.receiveBuffer.length+a.length);c.set(this.receiveBuffer);c.set(a,this.receiveBuffer.length);a=c;delete this.receiveBuffer}try{for(c=0;c<a.length;){var d;a:{var e=a,g=c,m=g,n=e[g],l=n>>4,z=n&15,g=g+1,x=void 0,D=0,q=1;do{if(g==e.length){d=[null,m];break a}x=e[g++];D+=(x&127)*q;q*=128}while(0!==(x&128));x=g+D;if(x>e.length)d=[null,m];else{var y=new p(l);switch(l){case 2:e[g++]&1&&(y.sessionPresent=!0);y.returnCode=e[g++];break;case 3:var m=z>>1&3,s=256*e[g]+e[g+1],g=g+2,t=F(e,g,s),
|
||||
g=g+s;0<m&&(y.messageIdentifier=256*e[g]+e[g+1],g+=2);var r=new w(e.subarray(g,x));1==(z&1)&&(r.retained=!0);8==(z&8)&&(r.duplicate=!0);r.qos=m;r.destinationName=t;y.payloadMessage=r;break;case 4:case 5:case 6:case 7:case 11:y.messageIdentifier=256*e[g]+e[g+1];break;case 9:y.messageIdentifier=256*e[g]+e[g+1],g+=2,y.returnCode=e.subarray(g,x)}d=[y,x]}}var u=d[0],c=d[1];if(null!==u)b.push(u);else break}c<a.length&&(this.receiveBuffer=a.subarray(c))}catch(v){d="undefined"==v.hasOwnProperty("stack")?
|
||||
v.stack.toString():"No Error Stack Available";this._disconnected(h.INTERNAL_ERROR.code,f(h.INTERNAL_ERROR,[v.message,d]));return}return b};d.prototype._handleMessage=function(a){this._trace("Client._handleMessage",a);try{switch(a.type){case 2:this._connectTimeout.cancel();this._reconnectTimeout&&this._reconnectTimeout.cancel();if(this.connectOptions.cleanSession){for(var b in this._sentMessages){var c=this._sentMessages[b];s.removeItem("Sent:"+this._localKey+c.messageIdentifier)}this._sentMessages=
|
||||
{};for(b in this._receivedMessages){var d=this._receivedMessages[b];s.removeItem("Received:"+this._localKey+d.messageIdentifier)}this._receivedMessages={}}if(0===a.returnCode)this.connected=!0,this.connectOptions.uris&&(this.hostIndex=this.connectOptions.uris.length);else{this._disconnected(h.CONNACK_RETURNCODE.code,f(h.CONNACK_RETURNCODE,[a.returnCode,H[a.returnCode]]));break}a=[];for(var e in this._sentMessages)this._sentMessages.hasOwnProperty(e)&&a.push(this._sentMessages[e]);if(0<this._buffered_msg_queue.length)for(e=
|
||||
null;e=this._buffered_msg_queue.pop();)a.push(e),this.onMessageDelivered&&(this._notify_msg_sent[e]=this.onMessageDelivered(e.payloadMessage));a=a.sort(function(a,b){return a.sequence-b.sequence});e=0;for(var g=a.length;e<g;e++)if(c=a[e],3==c.type&&c.pubRecReceived){var m=new p(6,{messageIdentifier:c.messageIdentifier});this._schedule_message(m)}else this._schedule_message(c);if(this.connectOptions.onSuccess)this.connectOptions.onSuccess({invocationContext:this.connectOptions.invocationContext});
|
||||
c=!1;this._reconnecting&&(c=!0,this._reconnectInterval=1,this._reconnecting=!1);this._connected(c,this._wsuri);this._process_queue();break;case 3:this._receivePublish(a);break;case 4:if(c=this._sentMessages[a.messageIdentifier])if(delete this._sentMessages[a.messageIdentifier],s.removeItem("Sent:"+this._localKey+a.messageIdentifier),this.onMessageDelivered)this.onMessageDelivered(c.payloadMessage);break;case 5:if(c=this._sentMessages[a.messageIdentifier])c.pubRecReceived=!0,m=new p(6,{messageIdentifier:a.messageIdentifier}),
|
||||
this.store("Sent:",c),this._schedule_message(m);break;case 6:d=this._receivedMessages[a.messageIdentifier];s.removeItem("Received:"+this._localKey+a.messageIdentifier);d&&(this._receiveMessage(d),delete this._receivedMessages[a.messageIdentifier]);var n=new p(7,{messageIdentifier:a.messageIdentifier});this._schedule_message(n);break;case 7:c=this._sentMessages[a.messageIdentifier];delete this._sentMessages[a.messageIdentifier];s.removeItem("Sent:"+this._localKey+a.messageIdentifier);if(this.onMessageDelivered)this.onMessageDelivered(c.payloadMessage);
|
||||
break;case 9:if(c=this._sentMessages[a.messageIdentifier]){c.timeOut&&c.timeOut.cancel();if(128===a.returnCode[0]){if(c.onFailure)c.onFailure(a.returnCode)}else if(c.onSuccess)c.onSuccess(a.returnCode);delete this._sentMessages[a.messageIdentifier]}break;case 11:if(c=this._sentMessages[a.messageIdentifier])c.timeOut&&c.timeOut.cancel(),c.callback&&c.callback(),delete this._sentMessages[a.messageIdentifier];break;case 13:this.sendPinger.reset();break;case 14:this._disconnected(h.INVALID_MQTT_MESSAGE_TYPE.code,
|
||||
f(h.INVALID_MQTT_MESSAGE_TYPE,[a.type]));break;default:this._disconnected(h.INVALID_MQTT_MESSAGE_TYPE.code,f(h.INVALID_MQTT_MESSAGE_TYPE,[a.type]))}}catch(l){c="undefined"==l.hasOwnProperty("stack")?l.stack.toString():"No Error Stack Available",this._disconnected(h.INTERNAL_ERROR.code,f(h.INTERNAL_ERROR,[l.message,c]))}};d.prototype._on_socket_error=function(a){this._reconnecting||this._disconnected(h.SOCKET_ERROR.code,f(h.SOCKET_ERROR,[a.data]))};d.prototype._on_socket_close=function(){this._reconnecting||
|
||||
this._disconnected(h.SOCKET_CLOSE.code,f(h.SOCKET_CLOSE))};d.prototype._socket_send=function(a){if(1==a.type){var b=this._traceMask(a,"password");this._trace("Client._socket_send",b)}else this._trace("Client._socket_send",a);this.socket.send(a.encode());this.sendPinger.reset()};d.prototype._receivePublish=function(a){switch(a.payloadMessage.qos){case "undefined":case 0:this._receiveMessage(a);break;case 1:var b=new p(4,{messageIdentifier:a.messageIdentifier});this._schedule_message(b);this._receiveMessage(a);
|
||||
break;case 2:this._receivedMessages[a.messageIdentifier]=a;this.store("Received:",a);a=new p(5,{messageIdentifier:a.messageIdentifier});this._schedule_message(a);break;default:throw Error("Invaild qos\x3d"+a.payloadMessage.qos);}};d.prototype._receiveMessage=function(a){if(this.onMessageArrived)this.onMessageArrived(a.payloadMessage)};d.prototype._connected=function(a,b){if(this.onConnected)this.onConnected(a,b)};d.prototype._reconnect=function(){this._trace("Client._reconnect");this.connected||(this._reconnecting=
|
||||
!0,this.sendPinger.cancel(),this.receivePinger.cancel(),128>this._reconnectInterval&&(this._reconnectInterval*=2),this.connectOptions.uris?(this.hostIndex=0,this._doConnect(this.connectOptions.uris[0])):this._doConnect(this.uri))};d.prototype._disconnected=function(a,b){this._trace("Client._disconnected",a,b);if(void 0!==a&&this._reconnecting)this._reconnectTimeout=new v(this,this._reconnectInterval,this._reconnect);else if(this.sendPinger.cancel(),this.receivePinger.cancel(),this._connectTimeout&&
|
||||
(this._connectTimeout.cancel(),this._connectTimeout=null),this._msg_queue=[],this._buffered_msg_queue=[],this._notify_msg_sent={},this.socket&&(this.socket.onopen=null,this.socket.onmessage=null,this.socket.onerror=null,this.socket.onclose=null,1===this.socket.readyState&&this.socket.close(),delete this.socket),this.connectOptions.uris&&this.hostIndex<this.connectOptions.uris.length-1)this.hostIndex++,this._doConnect(this.connectOptions.uris[this.hostIndex]);else if(void 0===a&&(a=h.OK.code,b=f(h.OK)),
|
||||
this.connected){this.connected=!1;if(this.onConnectionLost)this.onConnectionLost({errorCode:a,errorMessage:b,reconnect:this.connectOptions.reconnect,uri:this._wsuri});a!==h.OK.code&&this.connectOptions.reconnect&&(this._reconnectInterval=1,this._reconnect())}else if(4===this.connectOptions.mqttVersion&&!1===this.connectOptions.mqttVersionExplicit)this._trace("Failed to connect V4, dropping back to V3"),this.connectOptions.mqttVersion=3,this.connectOptions.uris?(this.hostIndex=0,this._doConnect(this.connectOptions.uris[0])):
|
||||
this._doConnect(this.uri);else if(this.connectOptions.onFailure)this.connectOptions.onFailure({invocationContext:this.connectOptions.invocationContext,errorCode:a,errorMessage:b})};d.prototype._trace=function(){if(this.traceFunction){var a=Array.prototype.slice.call(arguments),b;for(b in a)"undefined"!==typeof a[b]&&a.splice(b,1,JSON.stringify(a[b]));b=a.join("");this.traceFunction({severity:"Debug",message:b})}if(null!==this._traceBuffer)for(b=0,a=arguments.length;b<a;b++)this._traceBuffer.length==
|
||||
this._MAX_TRACE_ENTRIES&&this._traceBuffer.shift(),0===b?this._traceBuffer.push(arguments[b]):"undefined"===typeof arguments[b]?this._traceBuffer.push(arguments[b]):this._traceBuffer.push(" "+JSON.stringify(arguments[b]))};d.prototype._traceMask=function(a,b){var c={},d;for(d in a)a.hasOwnProperty(d)&&(c[d]=d==b?"******":a[d]);return c};var w=function(a){var b;if("string"===typeof a||a instanceof ArrayBuffer||ArrayBuffer.isView(a)&&!(a instanceof DataView))b=a;else throw f(h.INVALID_ARGUMENT,[a,
|
||||
"newPayload"]);var c,d=0,e=!1,g=!1;Object.defineProperties(this,{payloadString:{enumerable:!0,get:function(){return"string"===typeof b?b:F(b,0,b.length)}},payloadBytes:{enumerable:!0,get:function(){if("string"===typeof b){var a=new ArrayBuffer(n(b)),a=new Uint8Array(a);E(b,a,0);return a}return b}},destinationName:{enumerable:!0,get:function(){return c},set:function(a){if("string"===typeof a)c=a;else throw Error(f(h.INVALID_ARGUMENT,[a,"newDestinationName"]));}},qos:{enumerable:!0,get:function(){return d},
|
||||
set:function(a){if(0===a||1===a||2===a)d=a;else throw Error("Invalid argument:"+a);}},retained:{enumerable:!0,get:function(){return e},set:function(a){if("boolean"===typeof a)e=a;else throw Error(f(h.INVALID_ARGUMENT,[a,"newRetained"]));}},topic:{enumerable:!0,get:function(){return c},set:function(a){c=a}},duplicate:{enumerable:!0,get:function(){return g},set:function(a){g=a}}})};return{Client:function(a,b,c,k){var e;if("string"!==typeof a)throw Error(f(h.INVALID_TYPE,[typeof a,"host"]));if(2==arguments.length){k=
|
||||
b;e=a;var g=e.match(/^(wss?):\/\/((\[(.+)\])|([^\/]+?))(:(\d+))?(\/.*)$/);if(g)a=g[4]||g[2],b=parseInt(g[7]),c=g[8];else throw Error(f(h.INVALID_ARGUMENT,[a,"host"]));}else{3==arguments.length&&(k=c,c="/mqtt");if("number"!==typeof b||0>b)throw Error(f(h.INVALID_TYPE,[typeof b,"port"]));if("string"!==typeof c)throw Error(f(h.INVALID_TYPE,[typeof c,"path"]));e="ws://"+(-1!==a.indexOf(":")&&"["!==a.slice(0,1)&&"]"!==a.slice(-1)?"["+a+"]":a)+":"+b+c}for(var m=g=0;m<k.length;m++){var n=k.charCodeAt(m);
|
||||
55296<=n&&56319>=n&&m++;g++}if("string"!==typeof k||65535<g)throw Error(f(h.INVALID_ARGUMENT,[k,"clientId"]));var l=new d(e,a,b,c,k);Object.defineProperties(this,{host:{get:function(){return a},set:function(){throw Error(f(h.UNSUPPORTED_OPERATION));}},port:{get:function(){return b},set:function(){throw Error(f(h.UNSUPPORTED_OPERATION));}},path:{get:function(){return c},set:function(){throw Error(f(h.UNSUPPORTED_OPERATION));}},uri:{get:function(){return e},set:function(){throw Error(f(h.UNSUPPORTED_OPERATION));
|
||||
}},clientId:{get:function(){return l.clientId},set:function(){throw Error(f(h.UNSUPPORTED_OPERATION));}},onConnected:{get:function(){return l.onConnected},set:function(a){if("function"===typeof a)l.onConnected=a;else throw Error(f(h.INVALID_TYPE,[typeof a,"onConnected"]));}},disconnectedPublishing:{get:function(){return l.disconnectedPublishing},set:function(a){l.disconnectedPublishing=a}},disconnectedBufferSize:{get:function(){return l.disconnectedBufferSize},set:function(a){l.disconnectedBufferSize=
|
||||
a}},onConnectionLost:{get:function(){return l.onConnectionLost},set:function(a){if("function"===typeof a)l.onConnectionLost=a;else throw Error(f(h.INVALID_TYPE,[typeof a,"onConnectionLost"]));}},onMessageDelivered:{get:function(){return l.onMessageDelivered},set:function(a){if("function"===typeof a)l.onMessageDelivered=a;else throw Error(f(h.INVALID_TYPE,[typeof a,"onMessageDelivered"]));}},onMessageArrived:{get:function(){return l.onMessageArrived},set:function(a){if("function"===typeof a)l.onMessageArrived=
|
||||
a;else throw Error(f(h.INVALID_TYPE,[typeof a,"onMessageArrived"]));}},trace:{get:function(){return l.traceFunction},set:function(a){if("function"===typeof a)l.traceFunction=a;else throw Error(f(h.INVALID_TYPE,[typeof a,"onTrace"]));}}});this.connect=function(a){a=a||{};A(a,{timeout:"number",userName:"string",password:"string",willMessage:"object",keepAliveInterval:"number",cleanSession:"boolean",useSSL:"boolean",invocationContext:"object",onSuccess:"function",onFailure:"function",hosts:"object",
|
||||
ports:"object",reconnect:"boolean",mqttVersion:"number",mqttVersionExplicit:"boolean",uris:"object"});void 0===a.keepAliveInterval&&(a.keepAliveInterval=60);if(4<a.mqttVersion||3>a.mqttVersion)throw Error(f(h.INVALID_ARGUMENT,[a.mqttVersion,"connectOptions.mqttVersion"]));void 0===a.mqttVersion?(a.mqttVersionExplicit=!1,a.mqttVersion=4):a.mqttVersionExplicit=!0;if(void 0!==a.password&&void 0===a.userName)throw Error(f(h.INVALID_ARGUMENT,[a.password,"connectOptions.password"]));if(a.willMessage){if(!(a.willMessage instanceof
|
||||
w))throw Error(f(h.INVALID_TYPE,[a.willMessage,"connectOptions.willMessage"]));a.willMessage.stringPayload=null;if("undefined"===typeof a.willMessage.destinationName)throw Error(f(h.INVALID_TYPE,[typeof a.willMessage.destinationName,"connectOptions.willMessage.destinationName"]));}"undefined"===typeof a.cleanSession&&(a.cleanSession=!0);if(a.hosts){if(!(a.hosts instanceof Array))throw Error(f(h.INVALID_ARGUMENT,[a.hosts,"connectOptions.hosts"]));if(1>a.hosts.length)throw Error(f(h.INVALID_ARGUMENT,
|
||||
[a.hosts,"connectOptions.hosts"]));for(var b=!1,d=0;d<a.hosts.length;d++){if("string"!==typeof a.hosts[d])throw Error(f(h.INVALID_TYPE,[typeof a.hosts[d],"connectOptions.hosts["+d+"]"]));if(/^(wss?):\/\/((\[(.+)\])|([^\/]+?))(:(\d+))?(\/.*)$/.test(a.hosts[d]))if(0===d)b=!0;else{if(!b)throw Error(f(h.INVALID_ARGUMENT,[a.hosts[d],"connectOptions.hosts["+d+"]"]));}else if(b)throw Error(f(h.INVALID_ARGUMENT,[a.hosts[d],"connectOptions.hosts["+d+"]"]));}if(b)a.uris=a.hosts;else{if(!a.ports)throw Error(f(h.INVALID_ARGUMENT,
|
||||
[a.ports,"connectOptions.ports"]));if(!(a.ports instanceof Array))throw Error(f(h.INVALID_ARGUMENT,[a.ports,"connectOptions.ports"]));if(a.hosts.length!==a.ports.length)throw Error(f(h.INVALID_ARGUMENT,[a.ports,"connectOptions.ports"]));a.uris=[];for(d=0;d<a.hosts.length;d++){if("number"!==typeof a.ports[d]||0>a.ports[d])throw Error(f(h.INVALID_TYPE,[typeof a.ports[d],"connectOptions.ports["+d+"]"]));var b=a.hosts[d],g=a.ports[d];e="ws://"+(-1!==b.indexOf(":")?"["+b+"]":b)+":"+g+c;a.uris.push(e)}}}l.connect(a)};
|
||||
this.subscribe=function(a,b){if("string"!==typeof a&&a.constructor!==Array)throw Error("Invalid argument:"+a);b=b||{};A(b,{qos:"number",invocationContext:"object",onSuccess:"function",onFailure:"function",timeout:"number"});if(b.timeout&&!b.onFailure)throw Error("subscribeOptions.timeout specified with no onFailure callback.");if("undefined"!==typeof b.qos&&0!==b.qos&&1!==b.qos&&2!==b.qos)throw Error(f(h.INVALID_ARGUMENT,[b.qos,"subscribeOptions.qos"]));l.subscribe(a,b)};this.unsubscribe=function(a,
|
||||
b){if("string"!==typeof a&&a.constructor!==Array)throw Error("Invalid argument:"+a);b=b||{};A(b,{invocationContext:"object",onSuccess:"function",onFailure:"function",timeout:"number"});if(b.timeout&&!b.onFailure)throw Error("unsubscribeOptions.timeout specified with no onFailure callback.");l.unsubscribe(a,b)};this.send=function(a,b,c,d){var e;if(0===arguments.length)throw Error("Invalid argument.length");if(1==arguments.length){if(!(a instanceof w)&&"string"!==typeof a)throw Error("Invalid argument:"+
|
||||
typeof a);e=a;if("undefined"===typeof e.destinationName)throw Error(f(h.INVALID_ARGUMENT,[e.destinationName,"Message.destinationName"]));}else e=new w(b),e.destinationName=a,3<=arguments.length&&(e.qos=c),4<=arguments.length&&(e.retained=d);l.send(e)};this.publish=function(a,b,c,d){var e;if(0===arguments.length)throw Error("Invalid argument.length");if(1==arguments.length){if(!(a instanceof w)&&"string"!==typeof a)throw Error("Invalid argument:"+typeof a);e=a;if("undefined"===typeof e.destinationName)throw Error(f(h.INVALID_ARGUMENT,
|
||||
[e.destinationName,"Message.destinationName"]));}else e=new w(b),e.destinationName=a,3<=arguments.length&&(e.qos=c),4<=arguments.length&&(e.retained=d);l.send(e)};this.disconnect=function(){l.disconnect()};this.getTraceLog=function(){return l.getTraceLog()};this.startTrace=function(){l.startTrace()};this.stopTrace=function(){l.stopTrace()};this.isConnected=function(){return l.connected}},Message:w}}("undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:
|
||||
{})});
|
2395
node_modules/paho-mqtt/paho-mqtt.js
generated
vendored
Normal file
6
package-lock.json
generated
@ -8,7 +8,6 @@
|
||||
"axios": "^1.9.0",
|
||||
"cordova-sqlite-storage": "^7.0.0",
|
||||
"iconv-lite": "^0.6.3",
|
||||
"mescroll-uni": "^1.3.7",
|
||||
"paho-mqtt": "^1.1.0",
|
||||
"text-encoding": "^0.7.0",
|
||||
"vk-uview-ui": "^1.5.2"
|
||||
@ -269,11 +268,6 @@
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/mescroll-uni": {
|
||||
"version": "1.3.7",
|
||||
"resolved": "https://registry.npmjs.org/mescroll-uni/-/mescroll-uni-1.3.7.tgz",
|
||||
"integrity": "sha512-1pQMtGA+iVRKhfJZZNXdBx05NnthIk6zm3hRbumswSA54eaKOMgpUDb9AQ2+rRdXmS6kLkEYSbW/fkb7/IyoAg=="
|
||||
},
|
||||
"node_modules/mime-db": {
|
||||
"version": "1.52.0",
|
||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
|
||||
|
@ -3,7 +3,6 @@
|
||||
"axios": "^1.9.0",
|
||||
"cordova-sqlite-storage": "^7.0.0",
|
||||
"iconv-lite": "^0.6.3",
|
||||
"mescroll-uni": "^1.3.7",
|
||||
"paho-mqtt": "^1.1.0",
|
||||
"text-encoding": "^0.7.0",
|
||||
"vk-uview-ui": "^1.5.2"
|
||||
|
440
pages.json
@ -1,222 +1,308 @@
|
||||
{
|
||||
"pages": [
|
||||
|
||||
"pages": [
|
||||
|
||||
{
|
||||
"path": "pages/common/login/index",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/common/login/index",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
"path" : "pages/BlueTooth/ModeSetting/index",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "设备类型"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "pages/common/index/index",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/common/user/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/common/scan/scan",
|
||||
"style": {
|
||||
"navigationBarTitleText": "扫描"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/common/qrcode/qrcode",
|
||||
"style": {
|
||||
"navigationBarTitleText": "扫描到的设备"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/common/send/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "发送信息",
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/common/userAgreement/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "用户协议"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/common/privacyAgreement/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "隐私协议"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/common/aboutUs/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "关于我们"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/6170/deviceControl/index",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/6170/callPolice/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "报警"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/210/deviceControl/index",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/common/operationVideo/index",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/common/addvideo/index",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
// 操作说明
|
||||
{
|
||||
"path": "pages/common/operatingInstruct/index",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
// 产品说明
|
||||
{
|
||||
"path": "pages/common/productDes/index",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/common/addBLE/addEquip",
|
||||
"style": {
|
||||
"navigationBarTitleText": "添加设备"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/common/addBLE/LinkBle",
|
||||
"style": {
|
||||
"navigationBarTitleText": "扫描到的设备"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/6155/deviceDetail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "HBY 6155"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/6155/ImgCrop",
|
||||
"style": {
|
||||
"navigationBarTitleText": "图像裁剪",
|
||||
"navigationStyle": "custom",
|
||||
"fullscreen": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/650/HBY650",
|
||||
"style": {
|
||||
"navigationBarTitleText": "HBY650"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/common/map/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "地图"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/common/allType/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "所有类型"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/6170/allShare/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "所有分享"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/6170/share/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "分享"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/6170/shareDevices/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "分享设备"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/6170/shareManagement/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "分享管理"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/210/onlineDevice/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "联机设备"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/210/addDevice/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "添加联机设备"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/210/historyRecords/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "历史记录"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/210/call/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "呼叫"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/670/HBY670",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "HBY670"
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
{
|
||||
"path": "pages/common/index/index",
|
||||
"path": "pages/BlueTooth/ModeSetting/VideoSend",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"enablePullDownRefresh": true
|
||||
"navigationBarTitleText": "发送视频"
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/common/user/index",
|
||||
"path": "pages/BlueTooth/ModeSetting/VideoSend_1",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的"
|
||||
"navigationBarTitleText": "发送视频"
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/common/scan/scan",
|
||||
"path": "pages/BlueTooth/ModeSetting/VideoSend_670",
|
||||
"style": {
|
||||
"navigationBarTitleText": "扫描"
|
||||
"navigationBarTitleText": "发送视频"
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/common/qrcode/qrcode",
|
||||
"path": "pages/BlueTooth/ModeSetting/HBY650",
|
||||
"style": {
|
||||
"navigationBarTitleText": "扫描到的设备"
|
||||
"navigationBarTitleText": "HBY650"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/common/send/index",
|
||||
"path": "pages/BlueTooth/ModeSetting/HBY650_1",
|
||||
"style": {
|
||||
"navigationBarTitleText": "发送信息",
|
||||
"enablePullDownRefresh": true
|
||||
"navigationBarTitleText": "HBY650"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/common/userAgreement/index",
|
||||
"path": "pages/BlueTooth/ModeSetting/ModeSetting",
|
||||
"style": {
|
||||
"navigationBarTitleText": "用户协议"
|
||||
"navigationBarTitleText": "7307-0.96TFT"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/common/privacyAgreement/index",
|
||||
"path": "pages/BlueTooth/ModeSetting/update",
|
||||
"style": {
|
||||
"navigationBarTitleText": "隐私协议"
|
||||
"navigationBarTitleText": "版本更新"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/common/aboutUs/index",
|
||||
"path": "pages/BlueTooth/ModeSetting/HBY6155",
|
||||
"style": {
|
||||
"navigationBarTitleText": "关于我们"
|
||||
"navigationBarTitleText": "HBY6155"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/6170/deviceControl/index",
|
||||
"path": "pages/BlueTooth/ModeSetting/HBY6155V1",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
"navigationBarTitleText": "HBY6155_V1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/6170/callPolice/index",
|
||||
"path": "pages/BlueTooth/ModeSetting/HBY670",
|
||||
"style": {
|
||||
"navigationBarTitleText": "报警",
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "pages/210/deviceControl/index",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/common/operationVideo/index",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/common/addvideo/index",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
// 操作说明
|
||||
{
|
||||
"path": "pages/common/operatingInstruct/index",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
// 产品说明
|
||||
{
|
||||
"path": "pages/common/productDes/index",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/common/addBLE/addEquip",
|
||||
"style": {
|
||||
"navigationBarTitleText": "添加设备"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/common/addBLE/LinkBle",
|
||||
"style": {
|
||||
"navigationBarTitleText": "扫描到的设备"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/6155/deviceDetail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "HBY 6155"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/6155/ImgCrop",
|
||||
"style": {
|
||||
"navigationBarTitleText": "图像裁剪",
|
||||
"navigationStyle": "custom",
|
||||
"fullscreen": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/common/map/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "地图"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/common/allType/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "所有类型"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/6170/allShare/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "所有分享"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "pages/6170/share/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "分享"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/6170/shareDevices/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "分享设备"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/6170/shareManagement/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "分享管理"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/210/onlineDevice/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "联机设备"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/210/addDevice/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "添加联机设备"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/210/historyRecords/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "历史记录"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/210/call/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "呼叫"
|
||||
"navigationBarTitleText": "HBY670"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
],
|
||||
"tabBar": {
|
||||
"color": "#fff",
|
||||
"selectedColor": "#BBE600",
|
||||
"backgroundColor": "#202020",
|
||||
"list": [{
|
||||
"pagePath": "pages/common/index/index",
|
||||
"text": "我的设备",
|
||||
"iconPath": "/static/tabs/device.png",
|
||||
"selectedIconPath": "/static/tabs/device-HL.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/common/user/index",
|
||||
"text": "我的",
|
||||
"iconPath": "/static/tabs/my.png",
|
||||
"selectedIconPath": "/static/tabs/my-HL.png"
|
||||
}
|
||||
]
|
||||
},
|
||||
"globalStyle": {
|
||||
"navigationBarTextStyle": "white",
|
||||
"navigationBarTitleText": "uni-app",
|
||||
"navigationBarBackgroundColor": "#121212",
|
||||
"backgroundColor": "#121212"
|
||||
},
|
||||
"uniIdRouter": {}
|
||||
|
||||
|
||||
],
|
||||
"tabBar": {
|
||||
"color": "#fff",
|
||||
"selectedColor": "#BBE600",
|
||||
"backgroundColor": "#202020",
|
||||
"list": [
|
||||
{
|
||||
"pagePath": "pages/common/index/index",
|
||||
"text": "我的设备",
|
||||
"iconPath": "/static/tabs/device.png",
|
||||
"selectedIconPath": "/static/tabs/device-HL.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/common/user/index",
|
||||
"text": "我的",
|
||||
"iconPath": "/static/tabs/my.png",
|
||||
"selectedIconPath": "/static/tabs/my-HL.png"
|
||||
}
|
||||
]
|
||||
},
|
||||
"globalStyle": {
|
||||
"navigationBarTextStyle": "white",
|
||||
"navigationBarTitleText": "uni-app",
|
||||
"navigationBarBackgroundColor": "#121212",
|
||||
"backgroundColor": "#121212"
|
||||
},
|
||||
"uniIdRouter": {}
|
||||
}
|
@ -1,311 +1,311 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<!-- 设备列表 -->
|
||||
<scroll-view class="device-list" scroll-y>
|
||||
<view class="device-card" v-for="(item, index) in deviceList" :key="index" @click="toggleSelect(index)">
|
||||
<!-- 复选框 -->
|
||||
<view class="checkbox" :class="{ checked: item.checked }">
|
||||
<uni-icons v-if="item.checked" type="checkmarkempty" size="18" color="rgb(0, 0, 0)"></uni-icons>
|
||||
</view>
|
||||
<!-- 设备信息 -->
|
||||
<view class="device-content">
|
||||
<view class="device-header">
|
||||
<view class="deviceIMG">
|
||||
<image :src="item.devicePic" class="IMG" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="device-name">
|
||||
<view>设备:{{item.deviceName}}</view>
|
||||
<view class="ID">
|
||||
<view class="ID">ID:{{item.deviceImei}}</view>
|
||||
<view class="onlines" v-if="item.onlineStatus==1">在线</view>
|
||||
<!-- 离线状态 -->
|
||||
<view class="unlines" v-if="item.onlineStatus==0">离线</view>
|
||||
<view>电量:{{item.battery || '0'}}%</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="editInfmation">
|
||||
<button class="login-btn" @click="callMessage">呼叫设备</button>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 成功提示弹框 -->
|
||||
<CustomPopup :show="showPopupFlag" :title="popupTitle" :message="popupMessage"
|
||||
icon="/static/images/common/bj_1.png" :confirm-text="popupConfirmText" :show-cancel="false"
|
||||
@confirm="onPopupConfirm" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CustomPopup from '@/components/CustomPopup/CustomPopup.vue'
|
||||
import {
|
||||
deviceInfo,
|
||||
} from '@/api/common/index.js'
|
||||
import {
|
||||
deviceSendMessage
|
||||
} from '@/api/6170/deviceControl.js'
|
||||
export default {
|
||||
components: {
|
||||
CustomPopup
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
deviceList: [],
|
||||
showPopupFlag: false,
|
||||
popupTitle: '',
|
||||
popupMessage: '确定要呼叫所选设备!',
|
||||
popupConfirmText: '确认'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
toggleSelect(index) {
|
||||
this.deviceList[index].checked = !this.deviceList[index].checked
|
||||
this.$forceUpdate()
|
||||
},
|
||||
// 获取设备列表
|
||||
getData(deviceType) {
|
||||
this.loading = true;
|
||||
let data = {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
deviceType: deviceType
|
||||
}
|
||||
deviceInfo(data).then((res) => {
|
||||
if (res.code == 200) {
|
||||
const newDevices = res.rows.map(device => ({
|
||||
...device,
|
||||
showConfirm: false,
|
||||
checked: false
|
||||
}));
|
||||
this.total = res.total;
|
||||
this.deviceList = newDevices
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
//确认呼叫设备
|
||||
callMessage() {
|
||||
const selectedDevices = this.deviceList.filter(item => item.checked)
|
||||
if (selectedDevices.length === 0) {
|
||||
uni.showToast({
|
||||
title: '请选择一个设备',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.showPopupFlag = true
|
||||
},
|
||||
//弹框确认
|
||||
onPopupConfirm() {
|
||||
const selectedDevices = this.deviceList.filter(item => item.checked)
|
||||
const deviceIds = selectedDevices.map(item => item.id);
|
||||
let data = {
|
||||
deviceIds: deviceIds
|
||||
}
|
||||
deviceSendMessage(data).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.showPopupFlag = false
|
||||
uni.navigateBack()
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
onLoad(options) {
|
||||
const eventChannel = this.getOpenerEventChannel();
|
||||
// 监听 'deviceSend' 事件,获取传过来的数据
|
||||
eventChannel.on('deviceCall', (data) => {
|
||||
console.log('Received detail data:', data);
|
||||
this.getData(data.data)
|
||||
});
|
||||
// 如果需要向调用页面返回数据,可以触发 'ack' 事件
|
||||
eventChannel.emit('ack', {})
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.container {
|
||||
min-height: 100vh;
|
||||
background-color: rgb(18, 18, 18);
|
||||
box-sizing: border-box;
|
||||
overflow-x: hidden;
|
||||
|
||||
}
|
||||
|
||||
.device-list {
|
||||
flex: 1;
|
||||
padding: 0 20rpx;
|
||||
|
||||
}
|
||||
|
||||
.device-card {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 95%;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.checkbox {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
border: 2rpx solid rgba(255, 255, 255, 0.5);
|
||||
margin-right: 20rpx;
|
||||
border-radius: 4rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.checkbox.checked {
|
||||
background-color: rgb(187, 230, 0);
|
||||
border-color: rgb(187, 230, 0);
|
||||
}
|
||||
|
||||
.device-content {
|
||||
background-color: rgb(26, 26, 26);
|
||||
border-radius: 16rpx;
|
||||
position: relative;
|
||||
/* display: flex; */
|
||||
align-items: center;
|
||||
padding: 20rpx;
|
||||
width: 95%;
|
||||
}
|
||||
|
||||
.device-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 15rpx;
|
||||
}
|
||||
|
||||
.device-name {
|
||||
font-size: 32rpx;
|
||||
color: rgba(255, 255, 255, 0.87);
|
||||
margin-left: 12rpx;
|
||||
line-height: 50rpx;
|
||||
width: 83%;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.ID {
|
||||
color: rgba(255, 255, 255, 0.6);
|
||||
font-size: 26rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.device-status {
|
||||
width: 122rpx;
|
||||
height: 52rpx;
|
||||
font-size: 26rpx;
|
||||
border-radius: 0px 8px 0px 8px;
|
||||
background-color: rgb(42, 42, 42);
|
||||
position: absolute;
|
||||
top: 0rpx;
|
||||
right: 0rpx;
|
||||
text-align: center;
|
||||
line-height: 52rpx;
|
||||
}
|
||||
|
||||
.online {
|
||||
color: rgb(187, 230, 0);
|
||||
}
|
||||
|
||||
.unline {
|
||||
color: rgba(255, 255, 255, 0.4);
|
||||
}
|
||||
|
||||
.device-info {
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
font-size: 26rpx;
|
||||
color: rgba(255, 255, 255, 0.87);
|
||||
padding-top: 10rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.deviceIMG {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
border-radius: 16rpx;
|
||||
position: relative;
|
||||
background-color: rgba(42, 42, 42, 0.6);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.IMG {
|
||||
width: 68rpx;
|
||||
height: 50rpx;
|
||||
margin-left: 17%;
|
||||
}
|
||||
|
||||
.onlines {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.onlines::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
width: 15rpx;
|
||||
height: 15rpx;
|
||||
background: rgb(0, 171, 103);
|
||||
border-radius: 50%;
|
||||
top: 20rpx;
|
||||
left: -20rpx
|
||||
}
|
||||
|
||||
.unlines {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.unlines::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
width: 15rpx;
|
||||
height: 15rpx;
|
||||
background: rgba(255, 255, 255, 0.4);
|
||||
border-radius: 50%;
|
||||
top: 20rpx;
|
||||
left: -20rpx
|
||||
}
|
||||
|
||||
.line {
|
||||
width: 2rpx;
|
||||
height: 24rpx;
|
||||
background: linear-gradient(90deg,
|
||||
rgba(0, 0, 0, 0) 0%,
|
||||
rgb(255, 255, 255) 50%,
|
||||
rgba(255, 255, 255, 0) 100%);
|
||||
margin-top: 12rpx;
|
||||
}
|
||||
|
||||
.ql-editor {
|
||||
color: rgba(255, 255, 255, 0.6);
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.editInfmation {
|
||||
padding: 20rpx;
|
||||
position: fixed;
|
||||
bottom: 50rpx;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.login-btn {
|
||||
margin-top: 30rpx;
|
||||
background-color: rgb(187, 230, 0);
|
||||
color: rgb(35, 35, 35);
|
||||
border-radius: 50rpx;
|
||||
width: 90%;
|
||||
}
|
||||
<template>
|
||||
<view class="container">
|
||||
<!-- 设备列表 -->
|
||||
<scroll-view class="device-list" scroll-y>
|
||||
<view class="device-card" v-for="(item, index) in deviceList" :key="index" @click="toggleSelect(index)">
|
||||
<!-- 复选框 -->
|
||||
<view class="checkbox" :class="{ checked: item.checked }">
|
||||
<uni-icons v-if="item.checked" type="checkmarkempty" size="18" color="rgb(0, 0, 0)"></uni-icons>
|
||||
</view>
|
||||
<!-- 设备信息 -->
|
||||
<view class="device-content">
|
||||
<view class="device-header">
|
||||
<view class="deviceIMG">
|
||||
<image :src="item.devicePic" class="IMG" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="device-name">
|
||||
<view>设备:{{item.deviceName}}</view>
|
||||
<view class="ID">
|
||||
<view class="ID">ID:{{item.deviceImei}}</view>
|
||||
<view class="onlines" v-if="item.onlineStatus==1">在线</view>
|
||||
<!-- 离线状态 -->
|
||||
<view class="unlines" v-if="item.onlineStatus==0">离线</view>
|
||||
<view>电量:{{item.battery || '0'}}%</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="editInfmation">
|
||||
<button class="login-btn" @click="callMessage">呼叫设备</button>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 成功提示弹框 -->
|
||||
<CustomPopup :show="showPopupFlag" :title="popupTitle" :message="popupMessage"
|
||||
icon="/static/images/common/bj_1.png" :confirm-text="popupConfirmText" :show-cancel="false"
|
||||
@confirm="onPopupConfirm" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CustomPopup from '@/components/CustomPopup/CustomPopup.vue'
|
||||
import {
|
||||
deviceInfo,
|
||||
} from '@/api/common/index.js'
|
||||
import {
|
||||
deviceSendMessage
|
||||
} from '@/api/6170/deviceControl.js'
|
||||
export default {
|
||||
components: {
|
||||
CustomPopup
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
deviceList: [],
|
||||
showPopupFlag: false,
|
||||
popupTitle: '',
|
||||
popupMessage: '确定要呼叫所选设备!',
|
||||
popupConfirmText: '确认'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
toggleSelect(index) {
|
||||
this.deviceList[index].checked = !this.deviceList[index].checked
|
||||
this.$forceUpdate()
|
||||
},
|
||||
// 获取设备列表
|
||||
getData(deviceType) {
|
||||
this.loading = true;
|
||||
let data = {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
deviceType: deviceType
|
||||
}
|
||||
deviceInfo(data).then((res) => {
|
||||
if (res.code == 200) {
|
||||
const newDevices = res.rows.map(device => ({
|
||||
...device,
|
||||
showConfirm: false,
|
||||
checked: false
|
||||
}));
|
||||
this.total = res.total;
|
||||
this.deviceList = newDevices
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
//确认呼叫设备
|
||||
callMessage() {
|
||||
const selectedDevices = this.deviceList.filter(item => item.checked)
|
||||
if (selectedDevices.length === 0) {
|
||||
uni.showToast({
|
||||
title: '请选择一个设备',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.showPopupFlag = true
|
||||
},
|
||||
//弹框确认
|
||||
onPopupConfirm() {
|
||||
const selectedDevices = this.deviceList.filter(item => item.checked)
|
||||
const deviceIds = selectedDevices.map(item => item.id);
|
||||
let data = {
|
||||
deviceIds: deviceIds
|
||||
}
|
||||
deviceSendMessage(data).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.showPopupFlag = false
|
||||
uni.navigateBack()
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
onLoad(options) {
|
||||
const eventChannel = this.getOpenerEventChannel();
|
||||
// 监听 'deviceSend' 事件,获取传过来的数据
|
||||
eventChannel.on('deviceCall', (data) => {
|
||||
console.log('Received detail data:', data);
|
||||
this.getData(data.data)
|
||||
});
|
||||
// 如果需要向调用页面返回数据,可以触发 'ack' 事件
|
||||
eventChannel.emit('ack', {})
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.container {
|
||||
min-height: 100vh;
|
||||
background-color: rgb(18, 18, 18);
|
||||
box-sizing: border-box;
|
||||
overflow-x: hidden;
|
||||
|
||||
}
|
||||
|
||||
.device-list {
|
||||
flex: 1;
|
||||
padding: 0 20rpx;
|
||||
|
||||
}
|
||||
|
||||
.device-card {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 95%;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.checkbox {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
border: 2rpx solid rgba(255, 255, 255, 0.5);
|
||||
margin-right: 20rpx;
|
||||
border-radius: 4rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.checkbox.checked {
|
||||
background-color: rgb(187, 230, 0);
|
||||
border-color: rgb(187, 230, 0);
|
||||
}
|
||||
|
||||
.device-content {
|
||||
background-color: rgb(26, 26, 26);
|
||||
border-radius: 16rpx;
|
||||
position: relative;
|
||||
/* display: flex; */
|
||||
align-items: center;
|
||||
padding: 20rpx;
|
||||
width: 95%;
|
||||
}
|
||||
|
||||
.device-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 15rpx;
|
||||
}
|
||||
|
||||
.device-name {
|
||||
font-size: 32rpx;
|
||||
color: rgba(255, 255, 255, 0.87);
|
||||
margin-left: 12rpx;
|
||||
line-height: 50rpx;
|
||||
width: 83%;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.ID {
|
||||
color: rgba(255, 255, 255, 0.6);
|
||||
font-size: 26rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.device-status {
|
||||
width: 122rpx;
|
||||
height: 52rpx;
|
||||
font-size: 26rpx;
|
||||
border-radius: 0px 8px 0px 8px;
|
||||
background-color: rgb(42, 42, 42);
|
||||
position: absolute;
|
||||
top: 0rpx;
|
||||
right: 0rpx;
|
||||
text-align: center;
|
||||
line-height: 52rpx;
|
||||
}
|
||||
|
||||
.online {
|
||||
color: rgb(187, 230, 0);
|
||||
}
|
||||
|
||||
.unline {
|
||||
color: rgba(255, 255, 255, 0.4);
|
||||
}
|
||||
|
||||
.device-info {
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
font-size: 26rpx;
|
||||
color: rgba(255, 255, 255, 0.87);
|
||||
padding-top: 10rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.deviceIMG {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
border-radius: 16rpx;
|
||||
position: relative;
|
||||
background-color: rgba(42, 42, 42, 0.6);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.IMG {
|
||||
width: 68rpx;
|
||||
height: 50rpx;
|
||||
margin-left: 17%;
|
||||
}
|
||||
|
||||
.onlines {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.onlines::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
width: 15rpx;
|
||||
height: 15rpx;
|
||||
background: rgb(0, 171, 103);
|
||||
border-radius: 50%;
|
||||
top: 20rpx;
|
||||
left: -20rpx
|
||||
}
|
||||
|
||||
.unlines {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.unlines::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
width: 15rpx;
|
||||
height: 15rpx;
|
||||
background: rgba(255, 255, 255, 0.4);
|
||||
border-radius: 50%;
|
||||
top: 20rpx;
|
||||
left: -20rpx
|
||||
}
|
||||
|
||||
.line {
|
||||
width: 2rpx;
|
||||
height: 24rpx;
|
||||
background: linear-gradient(90deg,
|
||||
rgba(0, 0, 0, 0) 0%,
|
||||
rgb(255, 255, 255) 50%,
|
||||
rgba(255, 255, 255, 0) 100%);
|
||||
margin-top: 12rpx;
|
||||
}
|
||||
|
||||
.ql-editor {
|
||||
color: rgba(255, 255, 255, 0.6);
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.editInfmation {
|
||||
padding: 20rpx;
|
||||
position: fixed;
|
||||
bottom: 50rpx;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.login-btn {
|
||||
margin-top: 30rpx;
|
||||
background-color: rgb(187, 230, 0);
|
||||
color: rgb(35, 35, 35);
|
||||
border-radius: 50rpx;
|
||||
width: 90%;
|
||||
}
|
||||
</style>
|
@ -128,9 +128,9 @@
|
||||
</view> -->
|
||||
<view class="mode-section">
|
||||
<view class="mode-buttons">
|
||||
<view v-for="(item, index) in modeItems" :key="index" class="mode-v1"
|
||||
:class="{ 'active-mode': selectedIndex === index }">
|
||||
<view class="mode-v2" @click="handleModeClick(index)">
|
||||
<view v-for="(item, index) in modeItems" :key="index" class="mode-v1" :class="{ 'active-mode': selectedIndex === index }">
|
||||
<view class="mode-v2"
|
||||
@click="handleModeClick(index)">
|
||||
<image :src="item.image" class="setIMG" mode="aspectFit"></image>
|
||||
<view>
|
||||
<view class="battery-v2">{{ item.title }}</view>
|
||||
@ -249,31 +249,23 @@
|
||||
<script>
|
||||
// 弹框配置中心
|
||||
const POPUP_CONFIGS = {
|
||||
// 人员信息发送
|
||||
person: {
|
||||
config: {
|
||||
icon: '/static/images/common/sendSucc.png',
|
||||
message: '信息发送成功',
|
||||
showCancel: false
|
||||
},
|
||||
confirm() {
|
||||
return true; // 直接关闭
|
||||
}
|
||||
|
||||
},
|
||||
// 上传开机log
|
||||
// 开机log
|
||||
logo: {
|
||||
config: {
|
||||
icon: '/static/images/common/upload.png',
|
||||
message: '上传成功',
|
||||
showCancel: false
|
||||
},
|
||||
confirm() {
|
||||
return true; // 直接关闭
|
||||
}
|
||||
|
||||
},
|
||||
// 电量低于20%.提示框
|
||||
bettery: {
|
||||
config: {
|
||||
title: '设备电量低于20%',
|
||||
@ -284,24 +276,24 @@
|
||||
confirmBtnBg: 'rgba(224, 52, 52, 1)',
|
||||
showCancel: true
|
||||
},
|
||||
confirm() {
|
||||
onConfirm() {
|
||||
console.log('确认按钮');
|
||||
return true; // 直接关闭
|
||||
}
|
||||
},
|
||||
// 解除报警关闭的那个提示
|
||||
|
||||
cancel: {
|
||||
config: {
|
||||
titleColor: 'rgba(224, 52, 52, 1)',
|
||||
icon: '/static/images/6170/svg.png',
|
||||
icon: '/static/images/common/svg.png',
|
||||
popupBorder: '1rpx solid rgba(224, 52, 52, 0.3)',
|
||||
confirmBtnBg: 'rgba(224, 52, 52, 1)',
|
||||
showCancel: true //取消按钮
|
||||
},
|
||||
confirm() {
|
||||
onConfirm() {
|
||||
console.log('解除报警确认');
|
||||
}
|
||||
},
|
||||
// 手动报警弹框
|
||||
del: {
|
||||
config: {
|
||||
message: '确定开启报警?',
|
||||
@ -310,26 +302,8 @@
|
||||
confirmBtnBg: 'rgba(255, 200, 78, 1)',
|
||||
showCancel: true
|
||||
},
|
||||
confirm() {
|
||||
return 'alarmCountdown'; //点击确认,再次弹框,解除报警,再次报警的类型
|
||||
}
|
||||
},
|
||||
// 手动报警再次弹框 再次报警,解除报警指令
|
||||
alarmCountdown: {
|
||||
config: {
|
||||
title: '报警倒计时',
|
||||
icon: '/static/images/6170/svg.png',
|
||||
message: '59秒',
|
||||
popupBorder: '1rpx solid rgba(224, 52, 52, 1)',
|
||||
confirmBtnBg: 'rgba(224, 52, 52, 1)',
|
||||
cancelBtnColor:"rgba(224, 52, 52, 1)",
|
||||
confirmBtnColor:"rgba(255, 255, 255, 0.87)",
|
||||
confirmText: '解除报警',
|
||||
cancelText:"再次报警",
|
||||
showCancel: true //取消按钮
|
||||
},
|
||||
confirm() {
|
||||
console.log('解除报警确认');
|
||||
onConfirm() {
|
||||
console.log('删除确认');
|
||||
}
|
||||
},
|
||||
// 自动报警
|
||||
@ -346,8 +320,9 @@
|
||||
confirmBtnColor: "rgba(255, 255, 255, 0.87)",
|
||||
showCancel: false,
|
||||
},
|
||||
confirm() {
|
||||
console.log('自动报警解除报警的弹框');
|
||||
onConfirm() {
|
||||
console.log('自动报警确认');
|
||||
// 这里可以添加自动报警的逻辑
|
||||
}
|
||||
}
|
||||
|
||||
@ -462,19 +437,12 @@
|
||||
this.currentPopup = {
|
||||
show: true,
|
||||
config: POPUP_CONFIGS[type].config,
|
||||
callback: POPUP_CONFIGS[type].confirm
|
||||
callback: POPUP_CONFIGS[type].onConfirm
|
||||
}
|
||||
},
|
||||
handleConfirm() {
|
||||
if (this.currentPopup.callback) {
|
||||
const nextPopupType = this.currentPopup.callback(); // 执行回调并获取下一个弹框类型
|
||||
this.currentPopup.show = false; // 关闭当前弹框
|
||||
if (nextPopupType) {
|
||||
this.showPopup(nextPopupType); // 打开下一个弹框
|
||||
}
|
||||
} else {
|
||||
this.currentPopup.show = false; // 默认关闭
|
||||
}
|
||||
this.currentPopup.show = false;
|
||||
console.log('这是点击了确认');
|
||||
},
|
||||
// 统一处理取消
|
||||
handleCancel() {
|
||||
@ -920,8 +888,7 @@
|
||||
.mode-v1.active-mode .battery-v2 {
|
||||
color: #BBE600 !important;
|
||||
}
|
||||
|
||||
.mode-v1.active-mode .mode-v3 {
|
||||
.mode-v1.active-mode .mode-v3{
|
||||
color: #BBE600 !important;
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
<view>
|
||||
<view class="device-page">
|
||||
<view class="sendFlex">
|
||||
<view class="Sendmessage" @click="call">呼叫</view>
|
||||
<view class="Sendmessage" @click="location">呼叫</view>
|
||||
<view class="Sendmessage" @click="handleSend">发送信息</view>
|
||||
</view>
|
||||
<scroll-view class="device-list" scroll-y @scrolltolower="onScrollToLower" :lower-threshold="100"
|
||||
@ -79,20 +79,6 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
// 呼叫功能
|
||||
call(){
|
||||
uni.navigateTo({
|
||||
url: '/pages/210/call/index',
|
||||
events: {
|
||||
ack: function(data) {}
|
||||
},
|
||||
success: (res) => {
|
||||
res.eventChannel.emit('deviceCall', {
|
||||
data:this.deviceType
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.getData()
|
||||
|
@ -25,18 +25,21 @@
|
||||
onLoad: function(option) {
|
||||
const eventChannel = this.getOpenerEventChannel();
|
||||
var these = this;
|
||||
eventChannel.on('checkImg', function(data) {
|
||||
eventChannel.on('checkImg', (data)=> {
|
||||
console.log("我收到你的消息了,消息内容是:" + JSON.stringify(data));
|
||||
these.src = data.data;
|
||||
this.src = data.data;
|
||||
console.log("我收到你的消息了,消息内容是:",data);
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
handleCrop(e) {
|
||||
|
||||
var these = this;
|
||||
|
||||
this.Statu = true;
|
||||
console.log("裁剪完成");
|
||||
console.log(e.tempFilePath);
|
||||
|
||||
//
|
||||
const ctx = uni.createCanvasContext('splashCanvas', this);
|
||||
ctx.drawImage(
|
||||
e.tempFilePath,
|
||||
@ -53,11 +56,12 @@
|
||||
height: 80,
|
||||
success: (res) => {
|
||||
// 处理像素数据并发送
|
||||
const eventChannel = these.getOpenerEventChannel();
|
||||
console.log("res.data.length="+res.data.length);
|
||||
// this.processAndSendImageData(res.data).then(
|
||||
// resolve).catch(reject);
|
||||
const eventChannel = these.getOpenerEventChannel();
|
||||
|
||||
|
||||
eventChannel.emit('ImgCutOver',res.data);
|
||||
eventChannel.emit('ImgCutOver_Path',e.tempFilePath);
|
||||
uni.navigateBack();
|
||||
},
|
||||
fail: (err) => {
|
||||
|
@ -236,7 +236,7 @@
|
||||
<style scoped>
|
||||
.container {
|
||||
min-height: 100vh;
|
||||
background-color: #1A1D24;
|
||||
background-color: rgb(18, 18, 18);
|
||||
box-sizing: border-box;
|
||||
overflow-x: hidden;
|
||||
|
||||
@ -280,7 +280,7 @@
|
||||
}
|
||||
|
||||
.device-content {
|
||||
background-color: rgba(30, 33, 40, 0.8);
|
||||
background-color: rgb(26, 26, 26);
|
||||
border-radius: 16rpx;
|
||||
position: relative;
|
||||
/* display: flex; */
|
||||
|
@ -1,34 +1,23 @@
|
||||
<template>
|
||||
<view class="share">
|
||||
<!-- 下拉刷新区域 -->
|
||||
<mescroll-uni ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :up="upOption" :down="downOption">
|
||||
<view class="device-title">已分享用户</view>
|
||||
<view class="" v-if="deviceList.length>0">
|
||||
<view class="device-info" v-for="(item, index) in deviceList" :key="index">
|
||||
<view class="device-header" @click.stop="handleFile(item)">
|
||||
<view class="deviceIMG">
|
||||
<image src="@/static/images/common/user.png" mode="aspectFit" class="IMG"></image>
|
||||
</view>
|
||||
<view class="device-name">
|
||||
<view>用户名:{{item.deviceName}}</view>
|
||||
<view class="ID">
|
||||
<view class="ID">{{item.phonenumber}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="device-delete">
|
||||
<text class="delete" @click.stop="handleDelete(item)">移除</text>
|
||||
<view class="device-title">已分享用户</view>
|
||||
<view class="device-info" v-for="(item, index) in deviceList" :key="index">
|
||||
<view class="device-header" @click.stop="handleFile(item)">
|
||||
<view class="deviceIMG">
|
||||
<image src="@/static/images/common/user.png" mode="aspectFit" class="IMG"></image>
|
||||
</view>
|
||||
<view class="device-name">
|
||||
<view>用户名:{{item.deviceName}}</view>
|
||||
<view class="ID">
|
||||
<view class="ID">{{item.phonenumber}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="noDATA">
|
||||
<view> <uni-icons type="image-filled" size="120" color="rgba(255, 255, 255, 0.9)"></uni-icons>
|
||||
<view class="device-delete">
|
||||
<text class="delete" @click.stop="handleDelete(item)">移除</text>
|
||||
</view>
|
||||
暂无数据
|
||||
</view>
|
||||
</mescroll-uni>
|
||||
|
||||
</view>
|
||||
<!-- 删除弹框 -->
|
||||
<view class="agreement-mask" v-if="deleteShow" @click="closePopup('delete')">
|
||||
<view class="agreement-popup" @click.stop>
|
||||
@ -53,62 +42,16 @@
|
||||
deviceShareList,
|
||||
deviceShareDelete
|
||||
} from '@/api/6170/share.js'
|
||||
import MescrollUni from 'mescroll-uni/mescroll-uni.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
MescrollUni
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
deviceList: [],
|
||||
deleteShow: false,
|
||||
delelteItemInfo: '',
|
||||
itemInfo: '',
|
||||
mescroll: null, // mescroll实例对象
|
||||
downOption: {
|
||||
auto: false // 不自动加载
|
||||
},
|
||||
upOption: {
|
||||
auto: false, // 不自动加载
|
||||
noMoreSize: 5, // 如果列表已无数据,可设置列表的总数量要大于等于5条才显示无更多数据
|
||||
empty: {
|
||||
tip: '暂无相关数据'
|
||||
}
|
||||
},
|
||||
page: 1, // 当前页码
|
||||
size: 10, // 每页条数
|
||||
total: 0 // 总数据量
|
||||
itemInfo: ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// mescroll组件初始化的回调,可获取到mescroll对象
|
||||
mescrollInit(mescroll) {
|
||||
this.mescroll = mescroll;
|
||||
},
|
||||
// 下拉刷新的回调
|
||||
downCallback() {
|
||||
// 重置分页参数
|
||||
this.page = 1;
|
||||
this.getData(this.itemInfo.id).then(res => {
|
||||
// 数据请求成功后,隐藏下拉刷新的状态
|
||||
this.mescroll.endSuccess();
|
||||
}).catch(() => {
|
||||
// 请求失败,隐藏下拉刷新的状态
|
||||
this.mescroll.endErr();
|
||||
})
|
||||
},
|
||||
// 上拉加载的回调
|
||||
upCallback() {
|
||||
this.getData(this.itemInfo.id).then(res => {
|
||||
// 根据是否有数据来决定是否显示无更多数据的提示
|
||||
const hasNext = this.deviceList.length < this.total;
|
||||
this.mescroll.endSuccess(this.deviceList.length, hasNext);
|
||||
}).catch(() => {
|
||||
// 请求失败,隐藏上拉加载的状态
|
||||
this.mescroll.endErr();
|
||||
})
|
||||
},
|
||||
// 点击弹框外的区域关闭
|
||||
closePopup(type) {
|
||||
if (type === 'delete') {
|
||||
@ -130,43 +73,25 @@
|
||||
icon: 'none'
|
||||
})
|
||||
this.deleteShow = false
|
||||
// 删除后刷新列表
|
||||
this.page = 1;
|
||||
this.getData(this.itemInfo.id).then(() => {
|
||||
this.mescroll.resetUpScroll();
|
||||
})
|
||||
this.getData()
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
//
|
||||
},
|
||||
getData(val) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let data = {
|
||||
deviceId: val,
|
||||
pageNum: this.page,
|
||||
pageSize: this.size,
|
||||
let data = {
|
||||
deviceId: val
|
||||
}
|
||||
deviceShareList(data).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.deviceList = res.rows
|
||||
}
|
||||
deviceShareList(data).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.total = res.total;
|
||||
if (this.page === 1) {
|
||||
// 如果是第一页,直接替换数据
|
||||
this.deviceList = res.rows;
|
||||
} else {
|
||||
// 如果不是第一页,追加数据
|
||||
this.deviceList = this.deviceList.concat(res.rows);
|
||||
}
|
||||
resolve(res);
|
||||
} else {
|
||||
reject(res);
|
||||
}
|
||||
}).catch(err => {
|
||||
reject(err);
|
||||
})
|
||||
})
|
||||
},
|
||||
// 跳转分享详情
|
||||
@ -182,6 +107,7 @@
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
onLoad() {
|
||||
const eventChannel = this.getOpenerEventChannel();
|
||||
@ -189,14 +115,7 @@
|
||||
eventChannel.on('shareManagement', (data) => {
|
||||
console.log(data, 'data1t111');
|
||||
this.itemInfo = data.data;
|
||||
// 初始化加载数据
|
||||
this.page = 1;
|
||||
this.getData(this.itemInfo.id).then(() => {
|
||||
// 数据加载完成后,如果需要可以手动触发下拉刷新结束
|
||||
if (this.mescroll) {
|
||||
this.mescroll.endSuccess();
|
||||
}
|
||||
})
|
||||
this.getData(this.itemInfo.id)
|
||||
})
|
||||
}
|
||||
}
|
||||
@ -211,7 +130,7 @@
|
||||
|
||||
.device-title {
|
||||
color: rgba(255, 255, 255, 0.87);
|
||||
padding: 30rpx;
|
||||
padding: 30rpx 0;
|
||||
}
|
||||
|
||||
.device-info {
|
||||
@ -243,7 +162,7 @@
|
||||
|
||||
.deviceIMG {
|
||||
/* width: 100rpx; */
|
||||
/* height: 100rpx; */
|
||||
/* height: 100rpx; */
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@ -254,12 +173,6 @@
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.noDATA {
|
||||
text-align: center;
|
||||
color: rgba(255, 255, 255, 0.87);
|
||||
transform: translate(-0%, 100%);
|
||||
}
|
||||
|
||||
.delete {
|
||||
border-radius: 32px;
|
||||
background: rgba(255, 200, 78, 0.06);
|
||||
|
1841
pages/650/HBY650.vue
Normal file
1841
pages/670/HBY670.vue
Normal file
1947
pages/BlueTooth/ModeSetting/HBY6155.vue
Normal file
1925
pages/BlueTooth/ModeSetting/HBY6155V1.vue
Normal file
1892
pages/BlueTooth/ModeSetting/HBY650.vue
Normal file
1899
pages/BlueTooth/ModeSetting/HBY650_1.vue
Normal file
2837
pages/BlueTooth/ModeSetting/HBY670.vue
Normal file
1499
pages/BlueTooth/ModeSetting/ModeSetting.vue
Normal file
472
pages/BlueTooth/ModeSetting/VideoSend.vue
Normal file
@ -0,0 +1,472 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<canvas canvas-id="flashCanvas"
|
||||
style="width: 160px; height: 80px; z-index: 9999;position: fixed; top:-9999px;left:-9999px;"></canvas>
|
||||
|
||||
<f-video ref="compARef" :src="videoPath" :direction="-90" :autoplay="true" @shotVideoClick="shotVideoClick"
|
||||
:videoWidth="videoWidth" :videoHeight="videoHeight"></f-video>
|
||||
|
||||
|
||||
<view>
|
||||
<text>发送间隔</text>
|
||||
<input type="text" v-model="inteval" />
|
||||
</view>
|
||||
<view>
|
||||
<button @click="checkVideo">选择视频</button>
|
||||
<!-- <button @click="CutImg">发送</button> -->
|
||||
<button @click="uploadVideo">发送</button>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="sending-progress" v-if="isSending">
|
||||
<view class="progress-bar">
|
||||
<view class="progress-fill" :style="{ width: progress + '%' }"></view>
|
||||
</view>
|
||||
<text>正在发送: {{ progress }}% ({{ currentPacket }}/{{ totalPackets }})</text>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Common from '@/utils/Common';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
videoPath: '',
|
||||
inteval: 0,
|
||||
progress: 0,
|
||||
currentPacket: 0,
|
||||
totalPackets: 100,
|
||||
|
||||
connectedDeviceId: '',
|
||||
serviceId: '0xFFE1',
|
||||
writeCharacteristicId: '0xFFE1',
|
||||
notifyCharacteristicId: '0xFFE2',
|
||||
isSending: "",
|
||||
textProgress: "",
|
||||
|
||||
imgs: [],
|
||||
videoWidth: 320,
|
||||
videoHeight: 160,
|
||||
videoDuration: 2,
|
||||
|
||||
hexArray: []
|
||||
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
const eventChannel = this.getOpenerEventChannel();
|
||||
|
||||
eventChannel.on('receiveDevice', (data) => {
|
||||
this.connectedDeviceId = data.connectedDeviceId;
|
||||
this.serviceId = data.serviceId;
|
||||
this.writeCharacteristicId = data.writeCharacteristicId;
|
||||
this.notifyCharacteristicId = data.notifyCharacteristicId;
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
checkVideo: function() {
|
||||
uni.chooseVideo({
|
||||
sourceType: ['album', 'camera'],
|
||||
compressed: false,
|
||||
maxDuration: 2,
|
||||
camera: 'back',
|
||||
success: (res) => {
|
||||
this.videoPath = res.tempFilePath;
|
||||
|
||||
this.imgs = [];
|
||||
this.hexArray = [];
|
||||
this.$refs.compARef.base64 = [];
|
||||
this.videoWidth = res.width;
|
||||
this.videoHeight = res.height;
|
||||
this.videoDuration = res.duration;
|
||||
console.log("视频宽:" + res.width + ",视频高:" + res.height + ",视频时长:" + res.duration);
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
uploadVideo: function() {
|
||||
|
||||
if (this.hexArray.length > 0) {
|
||||
console.log("开始处理,无需上传");
|
||||
this.shotVideoClick(this.hexArray, 'rgb565');
|
||||
return;
|
||||
|
||||
}
|
||||
if(!this.videoPath){
|
||||
uni.showToast({
|
||||
title: "请选择视频",
|
||||
icon: 'fail'
|
||||
})
|
||||
return;
|
||||
}
|
||||
|
||||
console.log("正在上传视频");
|
||||
uni.showLoading({
|
||||
title: "上传中"
|
||||
});
|
||||
|
||||
let p2=new Promise((resolve,reject)=>{
|
||||
let start = new Date();
|
||||
console.log("Common.baseURL="+Common.baseURL);
|
||||
uni.uploadFile({
|
||||
url:Common.baseURL+'video/upload',
|
||||
filePath: this.videoPath,
|
||||
name: 'file',
|
||||
header: {
|
||||
"Method": "POST",
|
||||
"Content-Type": "multipart/form-data"
|
||||
},
|
||||
timeout: 600000,
|
||||
fail: (ex) => {
|
||||
//console.log("上传视频失败" + JSON.stringify(ex));
|
||||
uni.showToast({
|
||||
title: "视频文件上传失败了,请检查网络连接",
|
||||
icon: 'fail'
|
||||
})
|
||||
uni.hideLoading();
|
||||
reject(ex);
|
||||
},
|
||||
success: (res) => {
|
||||
let end = new Date();
|
||||
var diff = (end.getTime() - start.getTime()) / 1000;
|
||||
let s = diff % 60;
|
||||
let m = (diff - s) / 60;
|
||||
console.log("上传完成,耗时:" + m + "分" + s + "秒");
|
||||
uni.hideLoading();
|
||||
resolve(res);
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
let p1=this.HoldYouHand();
|
||||
|
||||
Promise.all([p2,p1]).then((arr)=>{
|
||||
|
||||
if(arr[1]===true){
|
||||
let res=arr[0];
|
||||
res = JSON.parse(res.data);
|
||||
|
||||
if (res.data) {
|
||||
this.hexArray = res.data;
|
||||
uni.showLoading({
|
||||
title: "正在发送"
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
this.shotVideoClick(res.data, 'rgb565');
|
||||
}, 0)
|
||||
|
||||
} else {
|
||||
console.log("res")
|
||||
uni.showModal({
|
||||
content: "服务器未返回RGB565数据",
|
||||
title: '错误'
|
||||
})
|
||||
}
|
||||
}else{
|
||||
uni.showModal({
|
||||
content:"与设备握手失败了",
|
||||
title:"错误"
|
||||
})
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
shotVideoClick: function(array, type) {
|
||||
//console.log("处理视频完成", array);
|
||||
//console.log("type=" + type)
|
||||
//console.log("array=", array);
|
||||
this.imgs = array;
|
||||
|
||||
|
||||
|
||||
var sendImagePackets = (imageData) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
this.isSending = true;
|
||||
this.progress = 0;
|
||||
this.currentPacket = 0;
|
||||
|
||||
// 总数据包数
|
||||
const totalPackets = 1536;
|
||||
this.totalPackets = totalPackets;
|
||||
let currentPacket = 1;
|
||||
|
||||
// 发送单个数据包
|
||||
const sendNextPacket = () => {
|
||||
////console.log("currentPacket="+currentPacket+",imageData.length="+imageData.length);
|
||||
if (currentPacket > totalPackets) {
|
||||
this.isSending = false;
|
||||
resolve();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// 计算当前包的数据
|
||||
let packetSize = 250;
|
||||
if (type == 'rgb565') {
|
||||
packetSize = 500;
|
||||
}
|
||||
|
||||
// 创建数据包
|
||||
const startIndex = (currentPacket - 1) * packetSize;
|
||||
const endIndex = Math.min(startIndex + packetSize, imageData.length);
|
||||
if (startIndex > endIndex) {
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
////console.log("111111");
|
||||
const packetData = imageData.slice(startIndex, endIndex);
|
||||
|
||||
// 构建数据包
|
||||
////console.log("packetData.length"+packetData.length);
|
||||
const bufferSize = 506; // 头部5字节 + 数据部分
|
||||
const buffer = new ArrayBuffer(bufferSize);
|
||||
const dataView = new DataView(buffer);
|
||||
|
||||
let sortNo = currentPacket.toString(16).padStart(4, '0');
|
||||
|
||||
// 填充头部
|
||||
dataView.setUint8(0, 0x55); // 帧头
|
||||
dataView.setUint8(1, 0x04); // 帧类型:开机画面
|
||||
dataView.setUint8(2, '0x' + sortNo.substring(0, 2)); // 包序号
|
||||
dataView.setUint8(3, '0x' + sortNo.substring(2, 4)); // 包序号
|
||||
|
||||
|
||||
dataView.setUint8(4, 0x01);
|
||||
dataView.setUint8(5, 0xF4);
|
||||
|
||||
|
||||
if (type == 'rgb565') {
|
||||
for (let i = 0; i < packetData.length; i++) {
|
||||
dataView.setUint8(6 + i, '0x' + packetData[i]);
|
||||
}
|
||||
} else {
|
||||
for (let i = 0; i < packetData.length; i++) {
|
||||
dataView.setUint16(6 + i * 2, packetData[i], false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
let inteval = parseInt(this.inteval ? this.inteval : 0);
|
||||
this.sendData(buffer).then(() => {
|
||||
// 更新进度
|
||||
this.currentPacket = currentPacket;
|
||||
this.progress = Math.round((currentPacket / totalPackets) *
|
||||
100);
|
||||
//console.log(`发送数据包完成 ${currentPacket}/${totalPackets}`);
|
||||
|
||||
// 发送下一个包(添加延迟避免蓝牙缓冲区溢出)
|
||||
currentPacket++;
|
||||
|
||||
|
||||
setTimeout(sendNextPacket, inteval);
|
||||
}).catch(err => {
|
||||
|
||||
// console.log(err.errMsg + ",发送失败了,正在补偿:" + currentPacket);
|
||||
setTimeout(sendNextPacket, inteval);
|
||||
// uni.showToast({
|
||||
// title:"发送失败"+JSON.stringify(err)
|
||||
// })
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
sendNextPacket();
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if (type == 'rgb565') {
|
||||
let start = new Date();
|
||||
console.log("开始发送");
|
||||
sendImagePackets(array).then(() => {
|
||||
console.log("发送完成");
|
||||
let end = new Date();
|
||||
var diff = (end.getTime() - start.getTime()) / 1000;
|
||||
let s = diff % 60;
|
||||
let m = (diff-s) / 60;
|
||||
console.log("发送完成,耗时:" + m + "分" + s + "秒");
|
||||
uni.showToast({
|
||||
title: "发送完成,耗时:" + m + "分" + s + "秒",
|
||||
icon: 'success'
|
||||
})
|
||||
}).catch((ex1) => {
|
||||
//console.log("出现了异常", ex1)
|
||||
}).finally(() => {
|
||||
uni.hideLoading();
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
HoldYouHand() {
|
||||
|
||||
var promise=new Promise((resolve,reject)=>{
|
||||
try{
|
||||
let start=new Date();
|
||||
var str = "video transmit start"; //握手的协议字符串
|
||||
console.log("开始握手:"+str)
|
||||
|
||||
// 1. 创建 ArrayBuffer 和 DataView
|
||||
const buffer = new ArrayBuffer(str.length);
|
||||
const dataView = new DataView(buffer);
|
||||
|
||||
// 2. 将字符串转换为 ASCII 码并写入 DataView
|
||||
for (let i = 0; i < str.length; i++) {
|
||||
dataView.setUint8(i, str.charCodeAt(i));
|
||||
}
|
||||
//console.log("111111");
|
||||
this.sendData(buffer).then(() => {
|
||||
// 开始发送第一个包
|
||||
setTimeout(()=>{
|
||||
|
||||
let end = new Date();
|
||||
var diff = (end.getTime() - start.getTime()) / 1000;
|
||||
let s = diff % 60;
|
||||
let m = (diff - s) / 60;
|
||||
|
||||
console.log("握手成功并完成2200ms等待,耗时"+m+"分"+s+"秒");
|
||||
|
||||
resolve(true);
|
||||
}, 2200);
|
||||
|
||||
}).catch(err => {
|
||||
//console.log("握手没有成功");
|
||||
reject(err);
|
||||
});
|
||||
}catch(ex){
|
||||
reject(ex);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
return promise;
|
||||
|
||||
},
|
||||
sendData(buffer) {
|
||||
////console.log("deviceId=" + this.connectedDeviceId);
|
||||
////console.log("serviceId=" + this.serviceId);
|
||||
|
||||
return new Promise(async (resolve, reject) => {
|
||||
|
||||
// //console.log("开始发送数据,buffer");
|
||||
|
||||
|
||||
var promise = new Promise((succ, err) => {
|
||||
uni.writeBLECharacteristicValue({
|
||||
deviceId: this.connectedDeviceId,
|
||||
serviceId: this.serviceId,
|
||||
characteristicId: this.writeCharacteristicId,
|
||||
value: buffer,
|
||||
writeType: plus.os.name == 'iOS' ? 'write' : 'writeNoResponse',
|
||||
success: () => {
|
||||
// //console.log("发送数据成功");
|
||||
succ();
|
||||
},
|
||||
fail: (ex) => {
|
||||
//console.log("发送数据失败", ex);
|
||||
err(ex);
|
||||
},
|
||||
complete: function() {
|
||||
// //console.log("123456");
|
||||
}
|
||||
});
|
||||
});
|
||||
if (plus.os.name == 'iOS') {
|
||||
|
||||
function timeout(ms) {
|
||||
return new Promise((_, err) => {
|
||||
setTimeout(() => {
|
||||
err({
|
||||
code: -1,
|
||||
errMsg: '超时了'
|
||||
})
|
||||
}, ms);
|
||||
});
|
||||
}
|
||||
|
||||
let inteval = parseInt(this.inteval ? this.inteval : 0);
|
||||
|
||||
Promise.race([promise, timeout(inteval)]).then(resolve).catch((ex) => {
|
||||
//console.log("ex=", ex);
|
||||
if (ex.code == -1) {
|
||||
resolve();
|
||||
} else {
|
||||
reject();
|
||||
}
|
||||
|
||||
}).finally(() => {
|
||||
//console.log("完成了")
|
||||
});
|
||||
} else {
|
||||
promise.then(resolve).catch(reject);
|
||||
}
|
||||
});
|
||||
},
|
||||
CutImg: function() {
|
||||
if (this.imgs.length == 30) {
|
||||
this.shotVideoClick(this.imgs, 'img');
|
||||
return;
|
||||
}
|
||||
//console.log("开始处理视频")
|
||||
uni.showLoading({
|
||||
title: '开始处理'
|
||||
});
|
||||
this.$refs.compARef.shotVideoClick(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.sending-progress {
|
||||
margin-top: 30rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.progress-bar {
|
||||
height: 12rpx;
|
||||
background-color: #e0e0e0;
|
||||
border-radius: 6rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.progress-fill {
|
||||
height: 100%;
|
||||
background-color: #409eff;
|
||||
transition: width 0.3s;
|
||||
}
|
||||
|
||||
input {
|
||||
border: 2rpx solid #000000;
|
||||
}
|
||||
|
||||
button {
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
font-size: 28rpx;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.content {
|
||||
width: 100vw;
|
||||
height: 300px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
517
pages/BlueTooth/ModeSetting/VideoSend_1.vue
Normal file
@ -0,0 +1,517 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<canvas canvas-id="flashCanvas"
|
||||
style="width: 160px; height: 80px; z-index: 9999;position: fixed; top:-9999px;left:-9999px;"></canvas>
|
||||
|
||||
<f-video ref="compARef" :src="videoPath" :direction="-90" :autoplay="true" @shotVideoClick="shotVideoClick"
|
||||
:videoWidth="videoWidth" :videoHeight="videoHeight"></f-video>
|
||||
|
||||
<view>
|
||||
<text>并发包数量</text>
|
||||
<input type="text" v-model="packgeCnt" />
|
||||
</view>
|
||||
<view>
|
||||
<text>发送间隔</text>
|
||||
<input type="text" v-model="inteval" />
|
||||
</view>
|
||||
<view>
|
||||
<button @click="checkVideo">选择视频</button>
|
||||
<!-- <button @click="CutImg">发送</button> -->
|
||||
<button @click="uploadVideo">发送</button>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="sending-progress" v-if="isSending">
|
||||
<view class="progress-bar">
|
||||
<view class="progress-fill" :style="{ width: progress + '%' }"></view>
|
||||
</view>
|
||||
<text>正在发送: {{ progress }}% ({{ currentPacket }}/{{ totalPackets }})</text>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
videoPath: '',
|
||||
packgeCnt: 20,
|
||||
inteval: 0,
|
||||
progress: 0,
|
||||
currentPacket: 0,
|
||||
totalPackets: 100,
|
||||
|
||||
connectedDeviceId: '',
|
||||
serviceId: '0xFFE1',
|
||||
writeCharacteristicId: '0xFFE1',
|
||||
notifyCharacteristicId: '0xFFE2',
|
||||
isSending: "",
|
||||
textProgress: "",
|
||||
|
||||
imgs: [],
|
||||
videoWidth: 320,
|
||||
videoHeight: 160,
|
||||
videoDuration: 2,
|
||||
|
||||
hexArray: []
|
||||
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
const eventChannel = this.getOpenerEventChannel();
|
||||
|
||||
eventChannel.on('receiveDevice', (data) => {
|
||||
this.connectedDeviceId = data.connectedDeviceId;
|
||||
this.serviceId = data.serviceId;
|
||||
this.writeCharacteristicId = data.writeCharacteristicId;
|
||||
this.notifyCharacteristicId = data.notifyCharacteristicId;
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
checkVideo: function() {
|
||||
uni.chooseVideo({
|
||||
sourceType: ['album', 'camera'],
|
||||
compressed: false,
|
||||
maxDuration: 2,
|
||||
camera: 'back',
|
||||
success: (res) => {
|
||||
this.videoPath = res.tempFilePath;
|
||||
|
||||
this.imgs = [];
|
||||
this.hexArray = [];
|
||||
this.$refs.compARef.base64 = [];
|
||||
this.videoWidth = res.width;
|
||||
this.videoHeight = res.height;
|
||||
this.videoDuration = res.duration;
|
||||
console.log("视频宽:" + res.width + ",视频高:" + res.height + ",视频时长:" + res.duration);
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
uploadVideo: function() {
|
||||
|
||||
if (this.hexArray.length > 0) {
|
||||
console.log("开始处理,无需上传");
|
||||
this.shotVideoClick(this.hexArray, 'rgb565');
|
||||
return;
|
||||
|
||||
}
|
||||
if(!this.videoPath){
|
||||
uni.showToast({
|
||||
title: "请选择视频",
|
||||
icon: 'fail'
|
||||
})
|
||||
return;
|
||||
}
|
||||
|
||||
console.log("正在上传视频");
|
||||
uni.showLoading({
|
||||
title: "上传中"
|
||||
});
|
||||
|
||||
let p2=new Promise((resolve,reject)=>{
|
||||
console.log("Common.baseURL="+Common.baseURL);
|
||||
let start = new Date();
|
||||
uni.uploadFile({
|
||||
url: Common.baseURL+'video/upload',
|
||||
// url: 'http://192.168.110.169:5000/video/upload',
|
||||
filePath: this.videoPath,
|
||||
name: 'file',
|
||||
header: {
|
||||
"Method": "POST",
|
||||
"Content-Type": "multipart/form-data"
|
||||
},
|
||||
timeout: 600000,
|
||||
fail: (ex) => {
|
||||
//console.log("上传视频失败" + JSON.stringify(ex));
|
||||
uni.showToast({
|
||||
title: "视频文件上传失败了,请检查网络连接",
|
||||
icon: 'fail'
|
||||
})
|
||||
uni.hideLoading();
|
||||
reject(ex);
|
||||
},
|
||||
success: (res) => {
|
||||
let end = new Date();
|
||||
var diff = (end.getTime() - start.getTime()) / 1000;
|
||||
let s = diff % 60;
|
||||
let m = (diff - s) / 60;
|
||||
console.log("上传完成,耗时:" + m + "分" + s + "秒");
|
||||
uni.hideLoading();
|
||||
resolve(res);
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
let p1=this.HoldYouHand();
|
||||
|
||||
Promise.all([p2,p1]).then((arr)=>{
|
||||
if(arr[1]===true){
|
||||
let res=arr[0];
|
||||
res = JSON.parse(res.data);
|
||||
|
||||
if (res.data) {
|
||||
this.hexArray = res.data;
|
||||
uni.showLoading({
|
||||
title: "正在发送"
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
this.shotVideoClick(res.data, 'rgb565');
|
||||
}, 0)
|
||||
|
||||
} else {
|
||||
console.log("res")
|
||||
uni.showModal({
|
||||
content: "服务器未返回RGB565数据",
|
||||
title: '错误'
|
||||
})
|
||||
}
|
||||
}else{
|
||||
uni.showModal({
|
||||
content:"与设备握手失败了",
|
||||
title:"错误"
|
||||
})
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
},
|
||||
pause(e) {
|
||||
////console.log('pause--------------------------', e);
|
||||
},
|
||||
shotVideoClick: function(array, type) {
|
||||
//console.log("处理视频完成", array);
|
||||
//console.log("type=" + type)
|
||||
//console.log("array=", array);
|
||||
this.imgs = array;
|
||||
|
||||
|
||||
|
||||
var sendImagePackets = (imageData) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
this.isSending = true;
|
||||
this.progress = 0;
|
||||
this.currentPacket = 0;
|
||||
|
||||
// 总数据包数
|
||||
const totalPackets = 1536;
|
||||
this.totalPackets = totalPackets;
|
||||
let currentPacket = 1;
|
||||
let promises = [];
|
||||
// 发送单个数据包
|
||||
const sendNextPacket = () => {
|
||||
////console.log("currentPacket="+currentPacket+",imageData.length="+imageData.length);
|
||||
if (currentPacket > totalPackets) {
|
||||
this.isSending = false;
|
||||
resolve();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// 计算当前包的数据
|
||||
let packetSize = 250;
|
||||
if (type == 'rgb565') {
|
||||
packetSize = 500;
|
||||
}
|
||||
|
||||
// 创建数据包
|
||||
const startIndex = (currentPacket - 1) * packetSize;
|
||||
const endIndex = Math.min(startIndex + packetSize, imageData.length);
|
||||
if (startIndex > endIndex) {
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
////console.log("111111");
|
||||
const packetData = imageData.slice(startIndex, endIndex);
|
||||
|
||||
// 构建数据包
|
||||
////console.log("packetData.length"+packetData.length);
|
||||
const bufferSize = 506; // 头部5字节 + 数据部分
|
||||
const buffer = new ArrayBuffer(bufferSize);
|
||||
const dataView = new DataView(buffer);
|
||||
|
||||
let sortNo = currentPacket.toString(16).padStart(4, '0');
|
||||
|
||||
// 填充头部
|
||||
dataView.setUint8(0, 0x55); // 帧头
|
||||
dataView.setUint8(1, 0x04); // 帧类型:开机画面
|
||||
dataView.setUint8(2, '0x' + sortNo.substring(0, 2)); // 包序号
|
||||
dataView.setUint8(3, '0x' + sortNo.substring(2, 4)); // 包序号
|
||||
|
||||
|
||||
dataView.setUint8(4, 0x01);
|
||||
dataView.setUint8(5, 0xF4);
|
||||
|
||||
|
||||
if (type == 'rgb565') {
|
||||
for (let i = 0; i < packetData.length; i++) {
|
||||
dataView.setUint8(6 + i, '0x' + packetData[i]);
|
||||
}
|
||||
} else {
|
||||
for (let i = 0; i < packetData.length; i++) {
|
||||
dataView.setUint16(6 + i * 2, packetData[i], false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
let inteval = parseInt(this.inteval ? this.inteval : 0);
|
||||
let promise = this.sendData(buffer);
|
||||
promises.push(promise);
|
||||
let packgeCnt = parseInt(this.packgeCnt || 20);
|
||||
if (currentPacket % packgeCnt == 0 || (currentPacket >= totalPackets &&
|
||||
promises.length > 0)) {
|
||||
Promise.all(promises).then(() => {
|
||||
if (currentPacket >= totalPackets) {
|
||||
this.isSending = false;
|
||||
resolve();
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
this.currentPacket = currentPacket;
|
||||
this.progress = Math.round((currentPacket / totalPackets) *
|
||||
100);
|
||||
currentPacket++;
|
||||
setTimeout(sendNextPacket, inteval);
|
||||
})
|
||||
} else {
|
||||
currentPacket++;
|
||||
sendNextPacket();
|
||||
}
|
||||
// .then(() => {
|
||||
// // 更新进度
|
||||
// this.currentPacket = currentPacket;
|
||||
// this.progress = Math.round((currentPacket / totalPackets) *
|
||||
// 100);
|
||||
|
||||
// currentPacket++;
|
||||
|
||||
|
||||
// setTimeout(sendNextPacket, inteval);
|
||||
// }).catch(err => {
|
||||
|
||||
// console.log(err.errMsg+",发送失败了,正在补偿:" + currentPacket);
|
||||
// setTimeout(sendNextPacket, inteval);
|
||||
|
||||
// });
|
||||
};
|
||||
|
||||
//
|
||||
|
||||
|
||||
sendNextPacket();
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if (type == 'rgb565') {
|
||||
let start = new Date();
|
||||
console.log("开始发送");
|
||||
sendImagePackets(array).then(() => {
|
||||
|
||||
let end = new Date();
|
||||
|
||||
var diff = (end.getTime() - start.getTime()) / 1000;
|
||||
let s = diff % 60;
|
||||
let m = (diff - s) / 60;
|
||||
console.log("发送完成,耗时:" + m + "分" + s + "秒");
|
||||
uni.showToast({
|
||||
title: "发送完成,耗时:" + m + "分" + s + "秒",
|
||||
icon: 'success',
|
||||
|
||||
})
|
||||
}).catch((ex1) => {
|
||||
//console.log("出现了异常", ex1)
|
||||
}).finally(() => {
|
||||
uni.hideLoading();
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
HoldYouHand() {
|
||||
|
||||
var promise=new Promise((resolve,reject)=>{
|
||||
try{
|
||||
let start=new Date();
|
||||
var str = "video transmit start"; //握手的协议字符串
|
||||
console.log("开始握手:"+str)
|
||||
|
||||
// 1. 创建 ArrayBuffer 和 DataView
|
||||
const buffer = new ArrayBuffer(str.length);
|
||||
const dataView = new DataView(buffer);
|
||||
|
||||
// 2. 将字符串转换为 ASCII 码并写入 DataView
|
||||
for (let i = 0; i < str.length; i++) {
|
||||
dataView.setUint8(i, str.charCodeAt(i));
|
||||
}
|
||||
//console.log("111111");
|
||||
this.sendData(buffer).then(() => {
|
||||
// 开始发送第一个包
|
||||
setTimeout(()=>{
|
||||
|
||||
let end = new Date();
|
||||
var diff = (end.getTime() - start.getTime()) / 1000;
|
||||
let s = diff % 60;
|
||||
let m = (diff - s) / 60;
|
||||
|
||||
console.log("握手成功并完成2200ms等待,耗时"+m+"分"+s+"秒");
|
||||
|
||||
resolve(true);
|
||||
}, 2200);
|
||||
|
||||
}).catch(err => {
|
||||
//console.log("握手没有成功");
|
||||
reject(err);
|
||||
});
|
||||
}catch(ex){
|
||||
reject(ex);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
return promise;
|
||||
|
||||
},
|
||||
sendData(buffer) {
|
||||
let sendBuffer = () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
var promise = new Promise((succ, err) => {
|
||||
uni.writeBLECharacteristicValue({
|
||||
deviceId: this.connectedDeviceId,
|
||||
serviceId: this.serviceId,
|
||||
characteristicId: this.writeCharacteristicId,
|
||||
value: buffer,
|
||||
writeType: plus.os.name == 'iOS' ? 'write' : 'writeNoResponse',
|
||||
success: () => {
|
||||
// console.log("发送数据成功");
|
||||
succ();
|
||||
},
|
||||
fail: (ex) => {
|
||||
if (ex.code == '10007') {
|
||||
// console.log("失败重试");
|
||||
setTimeout(() => {
|
||||
sendBuffer().then(succ).catch(err);
|
||||
}, this.inteval || 0)
|
||||
// succ()
|
||||
|
||||
} else
|
||||
|
||||
{
|
||||
// console.log("发送数据失败",ex);
|
||||
err(ex);
|
||||
}
|
||||
},
|
||||
complete: function() {
|
||||
//console.log("123456");
|
||||
}
|
||||
});
|
||||
});
|
||||
if (plus.os.name == 'iOS') {
|
||||
|
||||
function timeout(ms) {
|
||||
return new Promise((_, err) => {
|
||||
setTimeout(() => {
|
||||
err({
|
||||
code: -1,
|
||||
errMsg: '超时了'
|
||||
})
|
||||
}, ms);
|
||||
});
|
||||
}
|
||||
|
||||
Promise.race([promise, timeout(this.inteval ? this.inteval : 0)]).then(() => {
|
||||
// console.log("成功了");
|
||||
resolve();
|
||||
})
|
||||
.catch((ex) => {
|
||||
|
||||
if (ex.code == -1) {
|
||||
// console.log("超时了")
|
||||
resolve();
|
||||
} else {
|
||||
reject(ex);
|
||||
// console.log("异常了", ex);
|
||||
//sendBuffer().then(resolve).catch(reject);
|
||||
}
|
||||
|
||||
});
|
||||
} else {
|
||||
|
||||
promise.then(() => {
|
||||
//console.log("then........")
|
||||
resolve();
|
||||
}).catch(() => {
|
||||
//console.log("catch.........")
|
||||
reject()
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
return sendBuffer();
|
||||
},
|
||||
CutImg: function() {
|
||||
if (this.imgs.length == 30) {
|
||||
this.shotVideoClick(this.imgs, 'img');
|
||||
return;
|
||||
}
|
||||
//console.log("开始处理视频")
|
||||
uni.showLoading({
|
||||
title: '开始处理'
|
||||
});
|
||||
this.$refs.compARef.shotVideoClick(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.sending-progress {
|
||||
margin-top: 30rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.progress-bar {
|
||||
height: 12rpx;
|
||||
background-color: #e0e0e0;
|
||||
border-radius: 6rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.progress-fill {
|
||||
height: 100%;
|
||||
background-color: #409eff;
|
||||
transition: width 0.3s;
|
||||
}
|
||||
|
||||
input {
|
||||
border: 2rpx solid #000000;
|
||||
}
|
||||
|
||||
button {
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
font-size: 28rpx;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.content {
|
||||
width: 100vw;
|
||||
height: 300px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
537
pages/BlueTooth/ModeSetting/VideoSend_670.vue
Normal file
@ -0,0 +1,537 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<canvas canvas-id="flashCanvas"
|
||||
style="width: 160px; height: 80px; z-index: 9999;position: fixed; top:-9999px;left:-9999px;"></canvas>
|
||||
|
||||
<view>
|
||||
<view>
|
||||
选择的视频:{{videoPath}}</view>
|
||||
</view>
|
||||
<view>
|
||||
重发包序号:{{reSendNumber}}
|
||||
</view>
|
||||
<view>
|
||||
<text>发送间隔</text>
|
||||
<input type="text" v-model="inteval" />
|
||||
</view>
|
||||
<view>
|
||||
<button @click="checkVideo">选择视频</button>
|
||||
|
||||
<button @click="uploadVideo">发送</button>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="sending-progress" v-if="isSending">
|
||||
<view class="progress-bar">
|
||||
<view class="progress-fill" :style="{ width: progress + '%' }"></view>
|
||||
</view>
|
||||
<text>正在发送: {{ progress }}% ({{ currentPacket }}/{{ totalPackets }})</text>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Common from '../../../utils/Common';
|
||||
var mqttClient=null;
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
videoPath: '',
|
||||
inteval: 0,
|
||||
progress: 0,
|
||||
currentPacket: 0,
|
||||
totalPackets: 100,
|
||||
|
||||
connectedDeviceId: '',
|
||||
serviceId: '0xFFE1',
|
||||
writeCharacteristicId: '0xFFE1',
|
||||
notifyCharacteristicId: '0xFFE2',
|
||||
isSending: "",
|
||||
textProgress: "",
|
||||
netMode:"ble",
|
||||
IMEI:"",
|
||||
|
||||
|
||||
imgs: [],
|
||||
videoWidth: 320,
|
||||
videoHeight: 160,
|
||||
videoDuration: 2,
|
||||
|
||||
hexArray: [],
|
||||
reSendNumber:""
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
const eventChannel = this.getOpenerEventChannel();
|
||||
|
||||
eventChannel.on('receiveDevice', (data) => {
|
||||
this.connectedDeviceId = data.connectedDeviceId;
|
||||
this.serviceId = data.serviceId;
|
||||
this.writeCharacteristicId = data.writeCharacteristicId;
|
||||
this.notifyCharacteristicId = data.notifyCharacteristicId;
|
||||
this.netMode=data.netMode;
|
||||
mqttClient=data.mqttClient;
|
||||
this.IMEI=data.IMEI;
|
||||
});
|
||||
|
||||
eventChannel.on('ReSendVideo',(data)=>{
|
||||
//重新发送某一包
|
||||
this.reSendNumber=data.videoNo;
|
||||
setTimeout(()=>{
|
||||
this.shotVideoClick(this.hexArray,'rgb565',data.videoNo);
|
||||
},0);
|
||||
|
||||
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
checkVideo: function() {
|
||||
uni.chooseVideo({
|
||||
sourceType: ['album', 'camera'],
|
||||
compressed: false,
|
||||
maxDuration: 2,
|
||||
camera: 'back',
|
||||
success: (res) => {
|
||||
this.videoPath = res.tempFilePath;
|
||||
|
||||
this.imgs = [];
|
||||
this.hexArray = [];
|
||||
|
||||
this.videoWidth = res.width;
|
||||
this.videoHeight = res.height;
|
||||
this.videoDuration = res.duration;
|
||||
console.log("视频宽:" + res.width + ",视频高:" + res.height + ",视频时长:" + res.duration);
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
uploadVideo: function() {
|
||||
|
||||
if (this.hexArray.length > 0) {
|
||||
console.log("开始处理,无需上传");
|
||||
this.shotVideoClick(this.hexArray, 'rgb565');
|
||||
return;
|
||||
|
||||
}
|
||||
if(!this.videoPath){
|
||||
uni.showToast({
|
||||
title: "请选择视频",
|
||||
icon: 'fail'
|
||||
})
|
||||
return;
|
||||
}
|
||||
|
||||
console.log("正在上传视频");
|
||||
uni.showLoading({
|
||||
title: "上传中"
|
||||
});
|
||||
|
||||
let p2=new Promise((resolve,reject)=>{
|
||||
let start = new Date();
|
||||
console.log("Common.baseURL="+Common.baseURL);
|
||||
uni.uploadFile({
|
||||
url:Common.baseURL+'video/upload',
|
||||
filePath: this.videoPath,
|
||||
name: 'file',
|
||||
header: {
|
||||
"Method": "POST",
|
||||
"Content-Type": "multipart/form-data"
|
||||
},
|
||||
timeout: 600000,
|
||||
fail: (ex) => {
|
||||
//console.log("上传视频失败" + JSON.stringify(ex));
|
||||
uni.showToast({
|
||||
title: "视频文件上传失败了,请检查网络连接",
|
||||
icon: 'fail'
|
||||
})
|
||||
uni.hideLoading();
|
||||
reject(ex);
|
||||
},
|
||||
success: (res) => {
|
||||
let end = new Date();
|
||||
var diff = (end.getTime() - start.getTime()) / 1000;
|
||||
let s = diff % 60;
|
||||
let m = (diff - s) / 60;
|
||||
console.log("上传完成,耗时:" + m + "分" + s + "秒");
|
||||
uni.hideLoading();
|
||||
resolve(res);
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
let p1=this.HoldYouHand();
|
||||
|
||||
Promise.all([p2,p1]).then((arr)=>{
|
||||
|
||||
if(arr[1]===true){
|
||||
let res=arr[0];
|
||||
res = JSON.parse(res.data);
|
||||
|
||||
if (res.data) {
|
||||
this.hexArray = res.data;
|
||||
uni.showLoading({
|
||||
title: "正在发送"
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
this.shotVideoClick(res.data, 'rgb565');
|
||||
}, 0)
|
||||
|
||||
} else {
|
||||
console.log("res")
|
||||
uni.showModal({
|
||||
content: "服务器未返回RGB565数据",
|
||||
title: '错误'
|
||||
})
|
||||
}
|
||||
}else{
|
||||
uni.showModal({
|
||||
content:"与设备握手失败了",
|
||||
title:"错误"
|
||||
})
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
shotVideoClick: function(array, type,ReSendNo) {
|
||||
//console.log("处理视频完成", array);
|
||||
//console.log("type=" + type)
|
||||
//console.log("array=", array);
|
||||
this.imgs = array;
|
||||
|
||||
|
||||
|
||||
var sendImagePackets = (imageData) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
this.isSending = true;
|
||||
this.progress = 0;
|
||||
this.currentPacket = 0;
|
||||
|
||||
// 总数据包数
|
||||
var totalPackets = 1536;
|
||||
this.totalPackets = totalPackets;
|
||||
let currentPacket = 1;
|
||||
if(ReSendNo){
|
||||
this.progress = ReSendNo-1;
|
||||
this.currentPacket = ReSendNo-1;
|
||||
currentPacket=ReSendNo;
|
||||
totalPackets=ReSendNo;
|
||||
this.totalPackets=ReSendNo;
|
||||
}
|
||||
// 发送单个数据包
|
||||
const sendNextPacket = () => {
|
||||
////console.log("currentPacket="+currentPacket+",imageData.length="+imageData.length);
|
||||
if (currentPacket > totalPackets) {
|
||||
this.isSending = false;
|
||||
if(!ReSendNo){
|
||||
this.bleSendComplete();
|
||||
}else{
|
||||
// this.reSendNumber="";
|
||||
}
|
||||
|
||||
resolve();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// 计算当前包的数据
|
||||
let packetSize = 250;
|
||||
if (type == 'rgb565') {
|
||||
packetSize = 500;
|
||||
}
|
||||
|
||||
// 创建数据包
|
||||
const startIndex = (currentPacket - 1) * packetSize;
|
||||
const endIndex = Math.min(startIndex + packetSize, imageData.length);
|
||||
if (startIndex > endIndex) {
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
////console.log("111111");
|
||||
const packetData = imageData.slice(startIndex, endIndex);
|
||||
|
||||
// 构建数据包
|
||||
////console.log("packetData.length"+packetData.length);
|
||||
const bufferSize = 506; // 头部5字节 + 数据部分
|
||||
const buffer = new ArrayBuffer(bufferSize);
|
||||
const dataView = new DataView(buffer);
|
||||
|
||||
let sortNo = currentPacket.toString(16).padStart(4, '0');
|
||||
|
||||
// 填充头部
|
||||
dataView.setUint8(0, 0x55); // 帧头
|
||||
dataView.setUint8(1, 0x04); // 帧类型:开机画面
|
||||
dataView.setUint8(2, '0x' + sortNo.substring(0, 2)); // 包序号
|
||||
dataView.setUint8(3, '0x' + sortNo.substring(2, 4)); // 包序号
|
||||
|
||||
|
||||
dataView.setUint8(4, 0x01);
|
||||
dataView.setUint8(5, 0xF4);
|
||||
|
||||
|
||||
if (type == 'rgb565') {
|
||||
for (let i = 0; i < packetData.length; i++) {
|
||||
dataView.setUint8(6 + i, '0x' + packetData[i]);
|
||||
}
|
||||
} else {
|
||||
for (let i = 0; i < packetData.length; i++) {
|
||||
dataView.setUint16(6 + i * 2, packetData[i], false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
let inteval = parseInt(this.inteval ? this.inteval : 0);
|
||||
this.sendData(buffer).then(() => {
|
||||
// 更新进度
|
||||
this.currentPacket = currentPacket;
|
||||
this.progress = Math.round((currentPacket / totalPackets) *
|
||||
100);
|
||||
console.log(`发送数据包完成 ${currentPacket}/${totalPackets}`);
|
||||
|
||||
// 发送下一个包(添加延迟避免蓝牙缓冲区溢出)
|
||||
currentPacket++;
|
||||
|
||||
|
||||
setTimeout(sendNextPacket, inteval);
|
||||
}).catch(err => {
|
||||
|
||||
console.log(err.errMsg + ",发送失败了,正在补偿:" + currentPacket);
|
||||
setTimeout(sendNextPacket, inteval);
|
||||
// uni.showToast({
|
||||
// title:"发送失败"+JSON.stringify(err)
|
||||
// })
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
sendNextPacket();
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if (type == 'rgb565') {
|
||||
let start = new Date();
|
||||
console.log("开始发送");
|
||||
sendImagePackets(array).then(() => {
|
||||
console.log("发送完成");
|
||||
let end = new Date();
|
||||
var diff = (end.getTime() - start.getTime()) / 1000;
|
||||
let s = diff % 60;
|
||||
let m = (diff-s) / 60;
|
||||
console.log("发送完成,耗时:" + m + "分" + s + "秒");
|
||||
uni.showModal({
|
||||
content: "发送完成,耗时:" + m + "分" + s + "秒",
|
||||
title: 'success'
|
||||
});
|
||||
|
||||
}).catch((ex1) => {
|
||||
console.log("出现了异常", ex1)
|
||||
}).finally(() => {
|
||||
uni.hideLoading();
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
HoldYouHand() {
|
||||
|
||||
var promise=new Promise((resolve,reject)=>{
|
||||
try{
|
||||
let start=new Date();
|
||||
var str = "video transmit start"; //握手的协议字符串
|
||||
console.log("开始握手:"+str)
|
||||
|
||||
// 1. 创建 ArrayBuffer 和 DataView
|
||||
const buffer = new ArrayBuffer(str.length);
|
||||
const dataView = new DataView(buffer);
|
||||
|
||||
// 2. 将字符串转换为 ASCII 码并写入 DataView
|
||||
for (let i = 0; i < str.length; i++) {
|
||||
dataView.setUint8(i, str.charCodeAt(i));
|
||||
}
|
||||
//console.log("111111");
|
||||
this.sendData(buffer).then(() => {
|
||||
// 开始发送第一个包
|
||||
setTimeout(()=>{
|
||||
|
||||
let end = new Date();
|
||||
var diff = (end.getTime() - start.getTime()) / 1000;
|
||||
let s = diff % 60;
|
||||
let m = (diff - s) / 60;
|
||||
|
||||
console.log("握手成功并完成2200ms等待,耗时"+m+"分"+s+"秒");
|
||||
|
||||
resolve(true);
|
||||
}, 2200);
|
||||
|
||||
}).catch(err => {
|
||||
//console.log("握手没有成功");
|
||||
reject(err);
|
||||
});
|
||||
}catch(ex){
|
||||
reject(ex);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
return promise;
|
||||
|
||||
},
|
||||
bleSendComplete() {
|
||||
var str = "transmit complete"; //握手的协议字符串
|
||||
let buffer = new ArrayBuffer(str.length);
|
||||
let dataView = new DataView(buffer);
|
||||
for (let i = 0; i < str.length; i++) {
|
||||
dataView.setUint8(i, str.charCodeAt(i));
|
||||
}
|
||||
setTimeout(()=>{
|
||||
this.sendData(buffer).then(() => {
|
||||
console.log("完成指令发送成功");
|
||||
}).catch(err => {
|
||||
console.log("完成指令发送失败");
|
||||
});
|
||||
},500)
|
||||
|
||||
},
|
||||
sendData(buffer) {
|
||||
if(this.netMode=='ble'){
|
||||
return this.sendBle(buffer);
|
||||
|
||||
}
|
||||
|
||||
return this.sendMQ(buffer);
|
||||
},
|
||||
sendBle(buffer){
|
||||
return new Promise(async (resolve, reject) => {
|
||||
|
||||
// //console.log("开始发送数据,buffer");
|
||||
|
||||
|
||||
var promise = new Promise((succ, err) => {
|
||||
uni.writeBLECharacteristicValue({
|
||||
deviceId: this.connectedDeviceId,
|
||||
serviceId: this.serviceId,
|
||||
characteristicId: this.writeCharacteristicId,
|
||||
value: buffer,
|
||||
writeType: plus.os.name == 'iOS' ? 'write' : 'writeNoResponse',
|
||||
success: () => {
|
||||
// //console.log("发送数据成功");
|
||||
succ();
|
||||
},
|
||||
fail: (ex) => {
|
||||
//console.log("发送数据失败", ex);
|
||||
err(ex);
|
||||
},
|
||||
complete: function() {
|
||||
// //console.log("123456");
|
||||
}
|
||||
});
|
||||
});
|
||||
if (plus.os.name == 'iOS') {
|
||||
|
||||
function timeout(ms) {
|
||||
return new Promise((_, err) => {
|
||||
setTimeout(() => {
|
||||
err({
|
||||
code: -1,
|
||||
errMsg: '超时了'
|
||||
})
|
||||
}, ms);
|
||||
});
|
||||
}
|
||||
|
||||
let inteval = parseInt(this.inteval ? this.inteval : 0);
|
||||
|
||||
Promise.race([promise, timeout(inteval)]).then(resolve).catch((ex) => {
|
||||
//console.log("ex=", ex);
|
||||
if (ex.code == -1) {
|
||||
resolve();
|
||||
} else {
|
||||
reject();
|
||||
}
|
||||
|
||||
}).finally(() => {
|
||||
//console.log("完成了")
|
||||
});
|
||||
} else {
|
||||
promise.then(resolve).catch(reject);
|
||||
}
|
||||
});
|
||||
},
|
||||
sendMQ(message) {
|
||||
|
||||
const topic = `B/${this.IMEI}`;
|
||||
return new Promise((resolve, reject) => {
|
||||
if(!mqttClient){
|
||||
reject("MQTT未连接");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
let flag=mqttClient.publish(topic, message, {
|
||||
qos: 1
|
||||
});
|
||||
if(flag){
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
reject("MQTT未连接,无法发布消息");
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.sending-progress {
|
||||
margin-top: 30rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.progress-bar {
|
||||
height: 12rpx;
|
||||
background-color: #e0e0e0;
|
||||
border-radius: 6rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.progress-fill {
|
||||
height: 100%;
|
||||
background-color: #409eff;
|
||||
transition: width 0.3s;
|
||||
}
|
||||
|
||||
input {
|
||||
border: 2rpx solid #000000;
|
||||
}
|
||||
|
||||
button {
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
font-size: 28rpx;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.content {
|
||||
width: 100vw;
|
||||
height: 300px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
115
pages/BlueTooth/ModeSetting/index.vue
Normal file
@ -0,0 +1,115 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="grid">
|
||||
<view class="cell" @click="goToDetail(item.name)" v-for="item,index in options">{{item.url}}</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
options: [{
|
||||
name: '/pages/BlueTooth/ModeSetting/ModeSetting',
|
||||
url: '7307'
|
||||
},
|
||||
{
|
||||
name: '/pages/BlueTooth/ModeSetting/HBY650',
|
||||
url: 'HBY650'
|
||||
},
|
||||
{
|
||||
name: '/pages/BlueTooth/ModeSetting/HBY650_1',
|
||||
url: 'HBY650_V1'
|
||||
},
|
||||
|
||||
{
|
||||
name: '/pages/BlueTooth/ModeSetting/HBY6155',
|
||||
url: '6155'
|
||||
},
|
||||
{
|
||||
name: '/pages/BlueTooth/ModeSetting/HBY6155V1',
|
||||
url: '6155_V1'
|
||||
},
|
||||
{
|
||||
name: "/pages/BlueTooth/ModeSetting/HBY670",
|
||||
url: 'HBY670'
|
||||
},
|
||||
|
||||
{
|
||||
name: '/pages/MapTest/MapTest',
|
||||
url: '地图测试'
|
||||
},
|
||||
{
|
||||
name: '',
|
||||
url: '更多'
|
||||
}
|
||||
|
||||
]
|
||||
|
||||
}
|
||||
},
|
||||
onShow: () => {
|
||||
|
||||
},
|
||||
methods: {
|
||||
goToDetail: function(url) {
|
||||
console.log("url=" + url)
|
||||
let qd = () => {
|
||||
uni.showToast({
|
||||
title: '敬请期待',
|
||||
duration: 2000,
|
||||
icon: "none"
|
||||
});
|
||||
|
||||
};
|
||||
if (url) {
|
||||
uni.navigateTo({
|
||||
url: url,
|
||||
success: () => {
|
||||
|
||||
},
|
||||
fail: () => {
|
||||
qd();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
qd();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.container {
|
||||
padding: 15px;
|
||||
background-color: #f5f5f5;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.grid {
|
||||
display: flex;
|
||||
align-content: space-around;
|
||||
align-items: stretch;
|
||||
justify-items: center;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.cell {
|
||||
padding: 0rpx 20rpx;
|
||||
border: 2rpx solid rgba(0, 0, 0, 0.3);
|
||||
border-radius: 15rpx;
|
||||
font-size: 28rpx;
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
margin-left: 30rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
</style>
|
273
pages/BlueTooth/ModeSetting/update.vue
Normal file
@ -0,0 +1,273 @@
|
||||
<template>
|
||||
<view class="update-container">
|
||||
<!-- 进度条 -->
|
||||
<view v-if="showProgress" class="progress-container">
|
||||
<view class="progress-title">正在更新 {{ progress }}%</view>
|
||||
<view class="progress-bar">
|
||||
<view class="progress" :style="{ width: progress + '%' }"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 更新提示弹窗 -->
|
||||
<view v-if="showUpdateDialog" class="dialog-mask">
|
||||
<view class="dialog">
|
||||
<view class="dialog-title">发现新版本 v{{ newVersion }}</view>
|
||||
<view class="dialog-content">{{ updateInfo.desc || '有新的功能和优化,建议立即更新' }}</view>
|
||||
<view class="dialog-buttons">
|
||||
<button v-if="!updateInfo.force" class="cancel-btn" @click="showUpdateDialog = false">稍后更新</button>
|
||||
<button class="confirm-btn" @click="startUpdate">立即更新</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
// 当前版本
|
||||
currentVersion: '',
|
||||
// 最新版本
|
||||
newVersion: '',
|
||||
// 更新信息
|
||||
updateInfo: {},
|
||||
// 是否显示更新弹窗
|
||||
showUpdateDialog: false,
|
||||
// 是否显示进度条
|
||||
showProgress: false,
|
||||
// 更新进度
|
||||
progress: 0
|
||||
};
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
// 初始化时检查版本
|
||||
this.checkVersion();
|
||||
},
|
||||
|
||||
methods: {
|
||||
/**
|
||||
* 检查当前版本
|
||||
*/
|
||||
async checkVersion() {
|
||||
try {
|
||||
// 获取当前应用版本
|
||||
const versionInfo = plus.runtime.version;
|
||||
this.currentVersion = versionInfo;
|
||||
console.log('当前版本:', this.currentVersion);
|
||||
|
||||
// 调用后端接口检查最新版本
|
||||
// 这里替换为你的后端接口地址
|
||||
const res = await this.$http.get('/api/checkVersion', {
|
||||
platform: uni.getSystemInfoSync().platform,
|
||||
version: this.currentVersion
|
||||
});
|
||||
|
||||
if (res.code === 0 && res.data.hasUpdate) {
|
||||
this.newVersion = res.data.version;
|
||||
this.updateInfo = res.data;
|
||||
// 显示更新提示
|
||||
this.showUpdateDialog = true;
|
||||
} else {
|
||||
console.log('当前已是最新版本');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('版本检查失败:', error);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 开始更新
|
||||
*/
|
||||
startUpdate() {
|
||||
if (!this.updateInfo.downloadUrl) {
|
||||
uni.showToast({
|
||||
title: '更新地址不存在',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
this.showUpdateDialog = false;
|
||||
this.showProgress = true;
|
||||
this.downloadWgt(this.updateInfo.downloadUrl);
|
||||
},
|
||||
|
||||
/**
|
||||
* 下载wgt包
|
||||
*/
|
||||
downloadWgt(url) {
|
||||
const downloadTask = uni.downloadFile({
|
||||
url: url,
|
||||
success: (downloadResult) => {
|
||||
if (downloadResult.statusCode === 200) {
|
||||
// 下载成功,安装wgt包
|
||||
this.installWgt(downloadResult.tempFilePath);
|
||||
} else {
|
||||
this.showProgress = false;
|
||||
uni.showToast({
|
||||
title: '下载失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
this.showProgress = false;
|
||||
console.error('下载失败:', err);
|
||||
uni.showToast({
|
||||
title: '下载失败,请稍后重试',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// 监听下载进度
|
||||
downloadTask.onProgressUpdate((res) => {
|
||||
this.progress = res.progress;
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 安装wgt包
|
||||
*/
|
||||
installWgt(path) {
|
||||
plus.runtime.install(
|
||||
path,
|
||||
{
|
||||
force: false // 是否强制安装
|
||||
},
|
||||
() => {
|
||||
console.log('安装成功');
|
||||
this.showProgress = false;
|
||||
|
||||
// 安装成功后提示重启
|
||||
uni.showModal({
|
||||
title: '更新完成',
|
||||
content: '应用已更新,是否立即重启?',
|
||||
showCancel: !this.updateInfo.force,
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
// 重启应用
|
||||
plus.runtime.restart();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
(err) => {
|
||||
console.error('安装失败:', err);
|
||||
this.showProgress = false;
|
||||
uni.showToast({
|
||||
title: '更新失败: ' + err.message,
|
||||
icon: 'none',
|
||||
duration: 3000
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.update-container {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
pointer-events: none;
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
/* 进度条样式 */
|
||||
.progress-container {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
padding: 10rpx 20rpx;
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
.progress-title {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
margin-bottom: 10rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.progress-bar {
|
||||
height: 8rpx;
|
||||
background-color: #eee;
|
||||
border-radius: 4rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.progress {
|
||||
height: 100%;
|
||||
background-color: #007aff;
|
||||
transition: width 0.3s ease;
|
||||
}
|
||||
|
||||
/* 弹窗样式 */
|
||||
.dialog-mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
.dialog {
|
||||
width: 600rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.dialog-title {
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
padding: 30rpx;
|
||||
text-align: center;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
.dialog-content {
|
||||
font-size: 32rpx;
|
||||
color: #666;
|
||||
padding: 40rpx 30rpx;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.dialog-buttons {
|
||||
display: flex;
|
||||
border-top: 1px solid #eee;
|
||||
}
|
||||
|
||||
.cancel-btn, .confirm-btn {
|
||||
flex: 1;
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
font-size: 32rpx;
|
||||
border: none;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.cancel-btn {
|
||||
color: #666;
|
||||
border-right: 1px solid #eee;
|
||||
}
|
||||
|
||||
.confirm-btn {
|
||||
color: #007aff;
|
||||
}
|
||||
</style>
|
@ -1,22 +1,296 @@
|
||||
<template>
|
||||
<view>
|
||||
|
||||
<view class="content">
|
||||
<view class="deviceDetail">
|
||||
<view class="imgContent">
|
||||
<image src="/static/images/BLEAdd/addBleDevice.png" class="titleIco" mode="aspectFit">
|
||||
</image>
|
||||
</view>
|
||||
<view class="deviceName">
|
||||
蓝牙名:{{device.name}}
|
||||
</view>
|
||||
<view class="deviceName">
|
||||
设备名:{{device.deviceName}}
|
||||
</view>
|
||||
<view class="deviceId">
|
||||
ID:{{device.deviceId}}
|
||||
</view>
|
||||
<view class="bound" v-bind:class="boundStatu">
|
||||
{{Statu.boundRemark}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="btnLink" @click="Link()">
|
||||
连接
|
||||
</view>
|
||||
|
||||
<global-loading ref="loading" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import request from '@/utils/request.js';
|
||||
import bleTool from '@/utils/BleHelper.js';
|
||||
import {
|
||||
showLoading,
|
||||
hideLoading,
|
||||
updateLoading
|
||||
} from '@/utils/loading.js';
|
||||
|
||||
const pagePath="pages/common/addBLE/LinkBle";
|
||||
|
||||
var these = null;
|
||||
var eventChannel = null;
|
||||
var ble = null;
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
Statu: {
|
||||
bound: null
|
||||
},
|
||||
device: {
|
||||
"deviceId": "",
|
||||
"name": "",
|
||||
"deviceName": "",
|
||||
"RSSI": -37,
|
||||
"localName": "",
|
||||
"advertisServiceUUIDs": [
|
||||
|
||||
],
|
||||
"linkStatu": false,
|
||||
"macAddress": ""
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
computed: {
|
||||
boundStatu: function() {
|
||||
if (this.Statu.bound === null) {
|
||||
return "displayNone"
|
||||
}
|
||||
if (this.Statu.bound) {
|
||||
return "green"
|
||||
} else {
|
||||
return "red";
|
||||
}
|
||||
}
|
||||
},
|
||||
onBackPress() {
|
||||
console.log("返回时断开蓝牙连接,取消订阅");
|
||||
ble.disconnectDevice(these.device.deviceId);
|
||||
ble.removeReceiveCallback(pagePath);
|
||||
},
|
||||
onUnload() {
|
||||
ble.removeReceiveCallback(pagePath);
|
||||
},
|
||||
onLoad(option) {
|
||||
these = this;
|
||||
ble = bleTool.getBleTool();
|
||||
ble.addReceiveCallback((receive,f,path) => {
|
||||
console.log("收到设备消息,", receive);
|
||||
if (these.device.deviceId == receive.deviceId) {
|
||||
console.log("11111");
|
||||
|
||||
if (receive.bytes[0] == 0xFC || receive.str.indexOf('mac address:') == 0) {
|
||||
if (f && f.macAddress) {
|
||||
these.device.macAddress = f.macAddress;
|
||||
console.log("222222");
|
||||
these.initDevice();
|
||||
}
|
||||
}
|
||||
}
|
||||
},pagePath);
|
||||
eventChannel = this.getOpenerEventChannel();
|
||||
eventChannel.on('LinkItem', function(data) {
|
||||
let f = ble.data.LinkedList.find((v) => {
|
||||
return v.deviceId = data.deviceId;
|
||||
});
|
||||
if (f) {
|
||||
these.device = Object.assign({}, these.device, f);
|
||||
console.log("获取到设备", f);
|
||||
|
||||
} else {
|
||||
console.log("未获取到设备");
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
|
||||
initDevice: function() {
|
||||
showLoading(these, {
|
||||
text: '正在获取设备信息'
|
||||
});
|
||||
request({
|
||||
url: '/app/device/getDeviceInfoByDeviceMac',
|
||||
method: 'GET',
|
||||
data: {
|
||||
deviceMac: these.device.macAddress
|
||||
}
|
||||
}).then(res => {
|
||||
console.log("获取设备信息", res);
|
||||
if (res && res.code == 200) {
|
||||
let data = res.data;
|
||||
if (data) {
|
||||
let keys = Object.keys(data);
|
||||
ble.data.LinkedList.find((v) => {
|
||||
if(v.deviceId = these.device.deviceId){
|
||||
for (var i = 0; i < keys.length; i++) {
|
||||
let key = keys[i];
|
||||
v[key] = data[key];
|
||||
console.log("key="+key);
|
||||
console.log("value="+data[key]);
|
||||
|
||||
|
||||
these.$set(these.device, key, data[key]);
|
||||
|
||||
}
|
||||
|
||||
ble.setBleData();
|
||||
}
|
||||
});
|
||||
|
||||
console.log("device=",these.device);
|
||||
console.log("LinkedList=",ble.data.LinkedList);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}).catch((ex) => {
|
||||
console.log("获取设备出现异常:", ex);
|
||||
}).finally(() => {
|
||||
hideLoading(these);
|
||||
});
|
||||
},
|
||||
Link() {
|
||||
// 调用绑定设备接口
|
||||
|
||||
let f = ble.data.LinkedList.find((v) => {
|
||||
return v.deviceId = these.device.deviceId;
|
||||
});
|
||||
if (!f) {
|
||||
these.Statu.bound = false;
|
||||
these.Statu.boundRemark = "蓝牙连接不成功";
|
||||
return;
|
||||
}
|
||||
if (!f.macAddress) {
|
||||
these.Statu.bound = false;
|
||||
these.Statu.boundRemark = "设备上报Mac地址异常";
|
||||
return;
|
||||
}
|
||||
these.Statu.bound = null;
|
||||
these.Statu.boundRemark = "";
|
||||
showLoading(these, {
|
||||
|
||||
text: "连接中..."
|
||||
})
|
||||
let promise = request({
|
||||
url: '/app/device/bind',
|
||||
method: 'POST',
|
||||
data: {
|
||||
deviceImei: '',
|
||||
deviceMac: these.device.macAddress,
|
||||
communicationMode: '1', //0是4g,1是蓝牙
|
||||
}
|
||||
});
|
||||
promise.then((res) => {
|
||||
console.log("1111" + JSON.stringify(res));
|
||||
if (res.code == 200) {
|
||||
these.Statu.bound = true;
|
||||
these.Statu.boundRemark = "设备绑定成功!";
|
||||
|
||||
|
||||
uni.$emit("refreshDeviceList");
|
||||
setTimeout(() => {
|
||||
uni.switchTab({
|
||||
url: "/pages/common/index/index"
|
||||
});
|
||||
}, 500);
|
||||
} else {
|
||||
these.Statu.bound = false;
|
||||
these.Statu.boundRemark = res.msg;
|
||||
}
|
||||
}).catch((ex) => {
|
||||
these.Statu.bound = false;
|
||||
these.Statu.boundRemark = '出现了未知的异常,操作失败';
|
||||
}).finally(() => {
|
||||
hideLoading(this);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.content {
|
||||
background-color: #1d1d1d;
|
||||
color: #ffffffde;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
min-height: 100vh;
|
||||
height: auto;
|
||||
font-family: "PingFang SC";
|
||||
}
|
||||
|
||||
</style>
|
||||
.deviceDetail {
|
||||
margin: 200rpx auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-wrap: nowrap;
|
||||
align-content: center;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.imgContent,
|
||||
.titleIco {
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
}
|
||||
|
||||
.deviceId {
|
||||
color: rgba(255, 255, 255, 0.87);
|
||||
font-size: 32rpx;
|
||||
|
||||
line-height: 44rpx;
|
||||
letter-spacing: 0.14rpx;
|
||||
margin-top: 5rpx;
|
||||
}
|
||||
|
||||
.btnLink {
|
||||
position: fixed;
|
||||
bottom: 30rpx;
|
||||
left: 30rpx;
|
||||
right: 30rpx;
|
||||
width: calc(100% - 60rpx);
|
||||
border-radius: 91px;
|
||||
height: 90rpx;
|
||||
background: rgba(187, 230, 0, 1);
|
||||
color: rgba(35, 35, 35, 1);
|
||||
|
||||
|
||||
font-size: 32rpx;
|
||||
line-height: 90rpx;
|
||||
letter-spacing: 12rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.bound,
|
||||
.deviceName {
|
||||
font-size: 32rpx;
|
||||
font-weight: 400;
|
||||
line-height: 44rpx;
|
||||
letter-spacing: 0.14rpx;
|
||||
margin-top: 5rpx;
|
||||
}
|
||||
|
||||
.displayNone {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.green {
|
||||
color: rgba(187, 230, 0, 1);
|
||||
}
|
||||
|
||||
.red {
|
||||
color: rgba(245, 80, 80, 1);
|
||||
}
|
||||
</style>
|
@ -81,13 +81,22 @@
|
||||
</view>
|
||||
</view>
|
||||
</BottomSlideMenuPlus>
|
||||
|
||||
<global-loading ref="loading" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ble from '../../../api/6155/BlueHelper.js';
|
||||
import request from '../../../utils/request.js';
|
||||
|
||||
import bleTool from '@/utils/BleHelper.js';
|
||||
import request from '@/utils/request.js';
|
||||
import {
|
||||
showLoading,
|
||||
hideLoading,
|
||||
updateLoading
|
||||
} from '@/utils/loading.js'
|
||||
const pagePath="pages/common/addBLE/addEquip";
|
||||
var ble = null;
|
||||
var these = null;
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@ -127,72 +136,71 @@
|
||||
},
|
||||
onHide: function() {
|
||||
ble.StopSearch();
|
||||
ble.removeReceiveCallback(pagePath);
|
||||
},
|
||||
onBackPress: (e) => {
|
||||
ble.StopSearch();
|
||||
ble.disconnectDevice();
|
||||
ble.removeDeviceFound(pagePath);
|
||||
ble.removeReceiveCallback(pagePath);
|
||||
},
|
||||
onUnload(){
|
||||
ble.StopSearch();
|
||||
ble.removeDeviceFound(pagePath);
|
||||
ble.removeReceiveCallback(pagePath);
|
||||
},
|
||||
onLoad() {
|
||||
these = this;
|
||||
ble = bleTool.getBleTool();
|
||||
ble.addDeviceFound((arr) => {
|
||||
|
||||
arr = arr.devices;
|
||||
for (var i = 0; i < arr.length; i++) {
|
||||
|
||||
onShow: function() {
|
||||
// return;
|
||||
var these = this;
|
||||
uni.getStorage({
|
||||
key: "linkedDevices",
|
||||
success: (res) => {
|
||||
this.PairEquip = JSON.parse(res.data);
|
||||
},
|
||||
fail: (ex) => {
|
||||
this.PairEquip = [];
|
||||
}
|
||||
});
|
||||
|
||||
if (process.env.UNI_PLATFORM == 'mp-weixin' ||
|
||||
process.env.UNI_PLATFORM == 'mp-alipay' ||
|
||||
process.env.UNI_PLATFORM == 'app-plus' ||
|
||||
process.env.UNI_PLATFORM == 'app'
|
||||
|
||||
) {
|
||||
//打开蓝牙开始搜索设备
|
||||
ble.OpenBlue(true, () => {
|
||||
ble.StartSearch(function(arr) {
|
||||
|
||||
arr = arr.devices;
|
||||
for (var i = 0; i < arr.length; i++) {
|
||||
|
||||
arr[i].linkStatu = false;
|
||||
let f = these.EquipMents.find(function(v) {
|
||||
return v.deviceId == arr[i].deviceId;
|
||||
});
|
||||
|
||||
if (!f) {
|
||||
these.EquipMents.push(arr[i]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
console.log("设备列表:" + JSON.stringify(these.EquipMents));
|
||||
});
|
||||
},
|
||||
() => {
|
||||
these.showOpenSetting();
|
||||
arr[i].linkStatu = false;
|
||||
if(!arr[i].name){
|
||||
continue;
|
||||
}
|
||||
let f = these.EquipMents.find(function(v) {
|
||||
return v.deviceId == arr[i].deviceId;
|
||||
});
|
||||
|
||||
if (!f) {
|
||||
|
||||
these.EquipMents.push(arr[i]);
|
||||
} else {
|
||||
|
||||
}
|
||||
)
|
||||
}
|
||||
},pagePath);
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
console.log('当前环境:' + process.env.UNI_PLATFORM + '不支持蓝牙');
|
||||
}
|
||||
},
|
||||
|
||||
onShow: function() {
|
||||
|
||||
|
||||
this.EquipMents=[];
|
||||
this.PairEquip=[];
|
||||
ble.StartSearch().catch((ex) => {
|
||||
if (ex.code == 10001) {
|
||||
these.showOpenSetting();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
ble.addReceiveCallback((receivData) => {
|
||||
console.log("收到数据了:", receivData);//数据格式:{bytes:[109,97],str:"",hexs:"FA 01"}
|
||||
console.log("LinkedList=",ble.data.LinkedList);
|
||||
let data=uni.getStorageSync(ble.StorageKey);
|
||||
console.log("data=",data);
|
||||
},pagePath);
|
||||
|
||||
|
||||
},
|
||||
methods: {
|
||||
isItemLink: function(item, index) {
|
||||
let src = '/static/images/BLEAdd/noLink.png';
|
||||
if (this.PairEquip && this.PairEquip instanceof Array) {
|
||||
|
||||
if (this.PairEquip && this.PairEquip.length) {
|
||||
if (this.PairEquip.length > 0) {
|
||||
let f = this.PairEquip.find(function(v) {
|
||||
return v.deviceId == item.deviceId;
|
||||
@ -206,114 +214,56 @@
|
||||
}
|
||||
return src;
|
||||
},
|
||||
alert: function(title, content, callback) {
|
||||
if (!title) {
|
||||
title = '提示'
|
||||
}
|
||||
if (!content) {
|
||||
content = title;
|
||||
}
|
||||
|
||||
uni.showModal({
|
||||
title: title,
|
||||
content: content,
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
|
||||
if (callback) {
|
||||
callback(res);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
showOpenSetting: function() {
|
||||
this.Status.BottomMenu.show = true;
|
||||
},
|
||||
gotoSetting: function() {
|
||||
this.Status.BottomMenu.show = false;
|
||||
ble.showBluetoothGuide(false);
|
||||
ble.showBlueSetting(false);
|
||||
},
|
||||
Link: function(item, index) {
|
||||
var these = this;
|
||||
if (process.env.UNI_PLATFORM == 'mp-weixin' ||
|
||||
process.env.UNI_PLATFORM == 'mp-alipay' ||
|
||||
process.env.UNI_PLATFORM == 'app-plus' ||
|
||||
process.env.UNI_PLATFORM == 'app'
|
||||
) {
|
||||
|
||||
uni.showLoading({
|
||||
title: "正在连接",
|
||||
mask: true
|
||||
});
|
||||
setTimeout(() => {
|
||||
|
||||
|
||||
ble.LinkBlue(item.deviceId, function() {
|
||||
let c = these.PairEquip.find(function(v) {
|
||||
return v.deviceId == item.deviceId;
|
||||
});
|
||||
if (!c) {
|
||||
these.PairEquip.push(item);
|
||||
uni.setStorage({
|
||||
key: 'linkedDevices',
|
||||
data: JSON.stringify(these.PairEquip),
|
||||
success: () => {}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 调用绑定设备接口
|
||||
let promise = request({
|
||||
url: '/app/device/bind',
|
||||
method: 'POST',
|
||||
data: {
|
||||
deviceImei: '',
|
||||
deviceMac: item.deviceId,
|
||||
communicationMode: '1', //0是4g,1是蓝牙
|
||||
}
|
||||
});
|
||||
promise.then((res) => {
|
||||
console.log("1111" + JSON.stringify(res));
|
||||
if (res.code == 0) {
|
||||
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: res.data,
|
||||
icon: 'success'
|
||||
});
|
||||
|
||||
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
});
|
||||
}
|
||||
}).catch((ex) => {
|
||||
|
||||
uni.showToast({
|
||||
title: '出现了未知的异常,操作失败',
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}, (ex) => {
|
||||
uni.hideLoading();
|
||||
|
||||
showLoading(this,{
|
||||
text: "正在连接"
|
||||
});
|
||||
setTimeout(() => {
|
||||
let serviceid=null;
|
||||
if(item.advertisServiceUUIDs.length>0){
|
||||
serviceid=item.advertisServiceUUIDs[0];
|
||||
}
|
||||
ble.LinkBlue(item.deviceId,serviceid).then((res) => {
|
||||
let c = these.PairEquip.find(function(v) {
|
||||
return v.deviceId == item.deviceId;
|
||||
});
|
||||
}, 0);
|
||||
if (!c) {
|
||||
|
||||
these.PairEquip.push(item);
|
||||
}
|
||||
ble.removeReceiveCallback(pagePath);
|
||||
uni.navigateTo({
|
||||
url:"/pages/common/addBLE/LinkBle",
|
||||
events:{
|
||||
|
||||
},
|
||||
success(res) {
|
||||
|
||||
res.eventChannel.emit('LinkItem', item);
|
||||
}
|
||||
});
|
||||
|
||||
}).catch((ex) => {
|
||||
console.log("ex=",ex)
|
||||
uni.showModal({
|
||||
content:"连接失败:"+ex.msg
|
||||
});
|
||||
}).finally(()=>{
|
||||
hideLoading(this);
|
||||
});
|
||||
}, 0);
|
||||
|
||||
|
||||
} else {
|
||||
these.alert("提示", "当前平台不支持蓝牙");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -451,7 +401,7 @@
|
||||
|
||||
.mainContent .lblTitle {
|
||||
color: #ffffffde;
|
||||
font-family: PingFang SC;
|
||||
font-family: "PingFang SC";
|
||||
font-size: 28rpx;
|
||||
font-weight: 700;
|
||||
text-align: left;
|
||||
@ -516,7 +466,7 @@
|
||||
|
||||
.list .item .name {
|
||||
color: #ffffffde;
|
||||
font-family: PingFang SC;
|
||||
font-family: "PingFang SC";
|
||||
font-size: 26rpx;
|
||||
font-weight: 400;
|
||||
line-height: 50rpx;
|
||||
@ -525,7 +475,7 @@
|
||||
|
||||
.list .item .id {
|
||||
color: #ffffff99;
|
||||
font-family: PingFang SC;
|
||||
font-family: "PingFang SC";
|
||||
font-size: 24rpx;
|
||||
font-weight: 400;
|
||||
line-height: 30rpx;
|
||||
@ -547,7 +497,7 @@
|
||||
|
||||
.openBlue .txt {
|
||||
color: rgba(255, 255, 255, 0.87);
|
||||
font-family: PingFang SC;
|
||||
font-family: "PingFang SC";
|
||||
font-size: 28rpx;
|
||||
font-weight: 400;
|
||||
letter-spacing: 0.14rpx;
|
||||
@ -572,7 +522,7 @@
|
||||
width: 25%;
|
||||
height: 60rpx;
|
||||
text-align: center;
|
||||
font-family: PingFang SC;
|
||||
font-family: "PingFang SC";
|
||||
font-size: 28rpx;
|
||||
letter-spacing: 12rpx;
|
||||
display: flex !important;
|
||||
@ -584,10 +534,12 @@
|
||||
justify-content: center;
|
||||
|
||||
}
|
||||
|
||||
.openBlue .cancel {
|
||||
border: 1px solid rgba(255, 255, 255, 1);
|
||||
color: rgba(255, 255, 255, 1);
|
||||
}
|
||||
|
||||
.openBlue .ok {
|
||||
background-color: #BBE600;
|
||||
color: #232323;
|
||||
|
@ -19,7 +19,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="sendFlex"
|
||||
v-if="activeTab && activeTab.id !== ''&& activeTabInfo.communicationMode==0">
|
||||
v-if="activeTab && activeTab.id !== ''&& activeTabInfo.communicationMode==0 && activeTabInfo.typeName=='BJQ6170'">
|
||||
<view class="callpolice" @click="callpolice">报警</view>
|
||||
<view class="Sendmessage" @click="location">位置</view>
|
||||
<view class="Sendmessage" @click="handleSend">发送信息</view>
|
||||
@ -433,7 +433,7 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
// 报警
|
||||
// 报警
|
||||
callpolice() {
|
||||
const currentTab = this.tabs[this.activeTab];
|
||||
const deviceType = currentTab.id || '';
|
||||
|
@ -60,7 +60,7 @@
|
||||
data() {
|
||||
return {
|
||||
showView: false,
|
||||
phone: '13800138002', //手机号码
|
||||
phone: '17671332251', //手机号码
|
||||
code: "123456", //验证码
|
||||
agreed: false,
|
||||
isCounting: false,
|
||||
@ -145,6 +145,29 @@
|
||||
return false
|
||||
}
|
||||
try {
|
||||
|
||||
|
||||
console.log('44444');
|
||||
if(uni.getStorageSync("token") && uni.getStorageSync("clientID")){//免登陆
|
||||
|
||||
let time=uni.getStorageSync("tokenTime");
|
||||
if(!time){
|
||||
time=0;
|
||||
}
|
||||
let currTime=new Date().getTime();
|
||||
if(currTime<time){
|
||||
uni.switchTab({
|
||||
url: '/pages/common/index/index'
|
||||
});
|
||||
return;
|
||||
}else{
|
||||
//token过期了
|
||||
uni.removeStorageSync("token")
|
||||
uni.removeStorageSync("clientID")
|
||||
uni.removeStorageSync("tokenTime")
|
||||
}
|
||||
|
||||
}
|
||||
uni.showLoading({
|
||||
title: '登录中...'
|
||||
})
|
||||
@ -155,30 +178,37 @@
|
||||
tenantId: '894078' //租户ID
|
||||
})
|
||||
if (res.code == 200) {
|
||||
uni.hideLoading()
|
||||
uni.setStorageSync('token', res.data.access_token) // 缓存token
|
||||
uni.setStorageSync('clientID', res.data.client_id) // 缓存token
|
||||
console.log(res, 'ressss');
|
||||
uni.hideLoading();
|
||||
uni.setStorageSync('token', res.data.access_token); // 缓存token
|
||||
uni.setStorageSync('clientID', res.data.client_id); // 缓存token
|
||||
uni.setStorageSync('tokenTime',new Date().getTime()+86400000);//过期时间
|
||||
uni.showToast({
|
||||
title: '登录成功',
|
||||
icon: 'success'
|
||||
})
|
||||
uni.switchTab({
|
||||
url: '/pages/common/index/index'
|
||||
})
|
||||
});
|
||||
|
||||
// uni.navigateTo({
|
||||
// url:"/pages/BlueTooth/ModeSetting/index"
|
||||
// });
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg || '服务器异常,请稍后重试',
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
console.log('捕获错误:', error);
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: error.msg || '登录失败',
|
||||
title: error.msg,
|
||||
icon: 'none'
|
||||
});
|
||||
uni.hideLoading()
|
||||
}
|
||||
|
||||
},
|
||||
// 跳转到协议页面
|
||||
goToPage(type) {
|
||||
|
@ -5,13 +5,17 @@
|
||||
<image src="/static/images/common/svg.png" class="svg"></image>
|
||||
<view class="scanT">ID: {{ deviceId }}</view>
|
||||
</view>
|
||||
|
||||
<!-- 连接中状态 -->
|
||||
<view class="connecting-container" v-else>
|
||||
<view class="device-info">
|
||||
<view class="">
|
||||
<image src="/static/images/common/svg.png" class="svg"></image>
|
||||
</view>
|
||||
|
||||
<!-- <view>
|
||||
<image src="/static/images/bip.6.png" class="bip"></image>
|
||||
</view> -->
|
||||
|
||||
<text class="device-name">设备名:{{deviceId}}</text>
|
||||
<text class="device-model1">ID:{{deviceId}}</text>
|
||||
</view>
|
||||
@ -67,7 +71,6 @@
|
||||
})
|
||||
console.log(this.deviceId, 'deerer ere');
|
||||
if (res.code == 200) {
|
||||
|
||||
this.isConnectNo = false
|
||||
this.isSuccess = true
|
||||
uni.hideLoading()
|
||||
|
@ -6,7 +6,7 @@
|
||||
<image src="/static/images/common/logo.png" class="logo"></image>
|
||||
</view>
|
||||
<view class="user-right">
|
||||
<view class="user-title">富源晟科技</view>
|
||||
<view class="user-title">武汉研创</view>
|
||||
<view class="ID">ID:123456</view>
|
||||
</view>
|
||||
</view>
|
||||
|
BIN
static/fonts/PingFangSC.ttf
Normal file
BIN
static/images/6155/DeviceDetail/Hby650.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
static/images/6155/DeviceDetail/close.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
static/images/6155/DeviceDetail/uploadErr.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
static/images/6155/DeviceDetail/warnning.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
static/images/BLEAdd/addBleDevice.png
Normal file
After Width: | Height: | Size: 867 B |
BIN
static/images/add.png
Normal file
After Width: | Height: | Size: 125 B |
BIN
static/images/bip.6.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
static/images/bluetooth.png
Normal file
After Width: | Height: | Size: 265 B |
BIN
static/images/bs.png
Normal file
After Width: | Height: | Size: 463 B |
BIN
static/images/cires.png
Normal file
After Width: | Height: | Size: 171 B |
BIN
static/images/cp.png
Normal file
After Width: | Height: | Size: 489 B |
BIN
static/images/delel.png
Normal file
After Width: | Height: | Size: 486 B |
BIN
static/images/delete-icon.png
Normal file
After Width: | Height: | Size: 605 B |
BIN
static/images/delete.png
Normal file
After Width: | Height: | Size: 766 B |
BIN
static/images/dell.png
Normal file
After Width: | Height: | Size: 324 B |
BIN
static/images/dl.png
Normal file
After Width: | Height: | Size: 512 B |
BIN
static/images/fg.png
Normal file
After Width: | Height: | Size: 264 B |
BIN
static/images/gprs.png
Normal file
After Width: | Height: | Size: 250 B |
BIN
static/images/jg.png
Normal file
After Width: | Height: | Size: 331 B |
BIN
static/images/login.png
Normal file
After Width: | Height: | Size: 60 KiB |
BIN
static/images/logo.png
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
static/images/more.png
Normal file
After Width: | Height: | Size: 167 B |
BIN
static/images/nz.png
Normal file
After Width: | Height: | Size: 901 B |
BIN
static/images/path1.png
Normal file
After Width: | Height: | Size: 246 B |
BIN
static/images/path2.png
Normal file
After Width: | Height: | Size: 587 B |
BIN
static/images/path7.png
Normal file
After Width: | Height: | Size: 357 B |
BIN
static/images/scan.png
Normal file
After Width: | Height: | Size: 563 B |
BIN
static/images/scane.png
Normal file
After Width: | Height: | Size: 228 B |
BIN
static/images/sendSucc.png
Normal file
After Width: | Height: | Size: 500 B |
BIN
static/images/set.png
Normal file
After Width: | Height: | Size: 799 B |
BIN
static/images/sett.png
Normal file
After Width: | Height: | Size: 927 B |
BIN
static/images/settt.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
static/images/shape.png
Normal file
After Width: | Height: | Size: 278 B |
BIN
static/images/share.png
Normal file
After Width: | Height: | Size: 226 B |
BIN
static/images/sm.png
Normal file
After Width: | Height: | Size: 457 B |
BIN
static/images/sp.png
Normal file
After Width: | Height: | Size: 320 B |
BIN
static/images/success.png
Normal file
After Width: | Height: | Size: 510 B |
BIN
static/images/svg.png
Normal file
After Width: | Height: | Size: 475 B |
BIN
static/images/type.png
Normal file
After Width: | Height: | Size: 209 B |
BIN
static/images/upload.png
Normal file
After Width: | Height: | Size: 740 B |
BIN
static/images/upload_ax.png
Normal file
After Width: | Height: | Size: 446 B |
BIN
static/images/user.png
Normal file
After Width: | Height: | Size: 654 B |
BIN
static/images/video.png
Normal file
After Width: | Height: | Size: 691 B |
BIN
static/images/wm.png
Normal file
After Width: | Height: | Size: 509 B |
BIN
static/images/xy.png
Normal file
After Width: | Height: | Size: 385 B |
BIN
static/images/ys.png
Normal file
After Width: | Height: | Size: 489 B |
BIN
static/zj.png
Normal file
After Width: | Height: | Size: 296 KiB |