Compare commits
4 Commits
main
...
c626f3766e
| Author | SHA1 | Date | |
|---|---|---|---|
| c626f3766e | |||
| fcea5b1dba | |||
| f3d502b00e | |||
| 5399ecf359 |
@ -4,7 +4,8 @@ export function login(data) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/app/auth/login',
|
url: '/app/auth/login',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: data
|
data: data,
|
||||||
|
isAuthen:false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 注册发送验证码
|
// 注册发送验证码
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
const config = {
|
const config = {
|
||||||
// 开发环境
|
// 开发环境
|
||||||
development: {
|
development: {
|
||||||
BASE_URL: 'http://192.168.110.57:8000',//http://139.224.253.23:8000
|
BASE_URL: 'http://192.168.110.172:8000',//http://139.224.253.23:8000
|
||||||
API_PREFIX: '',
|
API_PREFIX: '',
|
||||||
// MQTT 配置
|
// MQTT 配置
|
||||||
MQTT_HOST: 'www.cnxhyc.com',
|
MQTT_HOST: 'www.cnxhyc.com',
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
"name" : "星汉物联",
|
"name" : "星汉物联",
|
||||||
"appid" : "__UNI__A21EF43",
|
"appid" : "__UNI__A21EF43",
|
||||||
"description" : "设备管控",
|
"description" : "设备管控",
|
||||||
"versionName" : "1.0.12",
|
"versionName" : "1.0.14",
|
||||||
"versionCode" : "100",
|
"versionCode" : "100",
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
|
|||||||
@ -95,7 +95,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<view class="warn" style="padding-bottom: 20rpx;">
|
<view style="padding-bottom: 20rpx;">
|
||||||
|
|
||||||
|
|
||||||
<view class="proinfo lamp">
|
<view class="proinfo lamp">
|
||||||
|
|||||||
@ -223,25 +223,30 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<view class="proinfo lamp">
|
|
||||||
<text class="title">产品信息</text>
|
|
||||||
<view class="itemcontent">
|
|
||||||
<view class="item" @click="proParam()">
|
</view>
|
||||||
<image class="img" src="/static/images/6155/DeviceDetail/param.png" mode="aspectFit"></image>
|
|
||||||
<text class="txt">产品参数</text>
|
<view class="proinfo lamp">
|
||||||
</view>
|
<text class="title">产品信息</text>
|
||||||
<view class="item" @click="handRemark()">
|
<view class="itemcontent">
|
||||||
<image class="img" src="/static/images/6155/DeviceDetail/remark.png" mode="aspectFit"></image>
|
<view class="item" @click="proParam()">
|
||||||
<text class="txt">操作说明</text>
|
<image class="img" src="/static/images/6155/DeviceDetail/param.png" mode="aspectFit"></image>
|
||||||
</view>
|
<text class="txt">产品参数</text>
|
||||||
<view class="item" @click="handVideo()">
|
</view>
|
||||||
<image class="img" src="/static/images/6155/DeviceDetail/video.png" mode="aspectFit"></image>
|
<view class="item" @click="handRemark()">
|
||||||
<text class="txt">操作视频</text>
|
<image class="img" src="/static/images/6155/DeviceDetail/remark.png" mode="aspectFit"></image>
|
||||||
</view>
|
<text class="txt">操作说明</text>
|
||||||
|
</view>
|
||||||
|
<view class="item" @click="handVideo()">
|
||||||
|
<image class="img" src="/static/images/6155/DeviceDetail/video.png" mode="aspectFit"></image>
|
||||||
|
<text class="txt">操作视频</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
<!-- 弹窗通知 -->
|
|
||||||
|
<!-- 弹窗通知 -->
|
||||||
<MessagePopup :visible="Status.Pop.showPop" :type="Status.Pop.popType" :bgColor="Status.Pop.bgColor"
|
<MessagePopup :visible="Status.Pop.showPop" :type="Status.Pop.popType" :bgColor="Status.Pop.bgColor"
|
||||||
:borderColor="Status.Pop.borderColor" :textColor="Status.Pop.textColor"
|
:borderColor="Status.Pop.borderColor" :textColor="Status.Pop.textColor"
|
||||||
:buttonBgColor="Status.Pop.buttonBgColor" :buttonTextColor="Status.Pop.buttonTextColor"
|
:buttonBgColor="Status.Pop.buttonBgColor" :buttonTextColor="Status.Pop.buttonTextColor"
|
||||||
@ -249,7 +254,7 @@
|
|||||||
@buttonClick="HidePop" :visiblePrompt="Status.Pop.visiblePrompt" :promptTitle="Status.Pop.promptTitle"
|
@buttonClick="HidePop" :visiblePrompt="Status.Pop.visiblePrompt" :promptTitle="Status.Pop.promptTitle"
|
||||||
v-model="Status.Pop.modelValue" @closePop="closePop" :buttonCancelText="Status.Pop.buttonCancelText"
|
v-model="Status.Pop.modelValue" @closePop="closePop" :buttonCancelText="Status.Pop.buttonCancelText"
|
||||||
:showCancel="Status.Pop.showCancel" @cancelPop="closePop" />
|
:showCancel="Status.Pop.showCancel" @cancelPop="closePop" />
|
||||||
|
|
||||||
<!-- 下方菜单 -->
|
<!-- 下方菜单 -->
|
||||||
<!-- <BottomSlideMenuPlus :config="Status.BottomMenu" @close="closeMenu" @itemClick="handleItemClick"
|
<!-- <BottomSlideMenuPlus :config="Status.BottomMenu" @close="closeMenu" @itemClick="handleItemClick"
|
||||||
@btnClick="btnClick">
|
@btnClick="btnClick">
|
||||||
@ -261,9 +266,8 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</BottomSlideMenuPlus> -->
|
</BottomSlideMenuPlus> -->
|
||||||
|
|
||||||
<global-loading ref="loading" />
|
<global-loading ref="loading" />
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@ -147,7 +147,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<view class="warn" style="padding-bottom: 20rpx;">
|
<view style="padding-bottom: 20rpx;">
|
||||||
|
|
||||||
|
|
||||||
<view class="proinfo lamp">
|
<view class="proinfo lamp">
|
||||||
|
|||||||
@ -183,7 +183,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="warn" style="padding-bottom: 20rpx;">
|
<view style="padding-bottom: 20rpx;">
|
||||||
|
|
||||||
|
|
||||||
<view class="proinfo lamp">
|
<view class="proinfo lamp">
|
||||||
|
|||||||
@ -184,22 +184,22 @@
|
|||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
eventChannel = this.getOpenerEventChannel();
|
eventChannel = this.getOpenerEventChannel();
|
||||||
|
|
||||||
eventChannel.on('detailData', function(rec) {
|
eventChannel.on('detailData', function(rec) {
|
||||||
console.log("接收到父页面的参数:", rec);
|
console.log("接收到父页面的参数:", rec);
|
||||||
these.device = rec.data;
|
these.device = rec.data;
|
||||||
if (rec.data.bluetoothName) {
|
if (rec.data.bluetoothName) {
|
||||||
these.search = rec.data.bluetoothName;
|
these.search = rec.data.bluetoothName;
|
||||||
}else if(rec.data.deviceName){
|
} else if (rec.data.deviceName) {
|
||||||
these.search = rec.data.deviceName;
|
these.search = rec.data.deviceName;
|
||||||
}
|
}
|
||||||
|
|
||||||
startValidDevice();
|
startValidDevice();
|
||||||
|
|
||||||
});
|
});
|
||||||
let search = option.search;
|
let search = option.search;
|
||||||
these = this;
|
these = this;
|
||||||
|
|
||||||
const systemInfo = uni.getSystemInfoSync();
|
const systemInfo = uni.getSystemInfoSync();
|
||||||
|
|
||||||
ble = bleTool.getBleTool(); // Ensure ble is initialized
|
ble = bleTool.getBleTool(); // Ensure ble is initialized
|
||||||
@ -464,7 +464,7 @@
|
|||||||
|
|
||||||
StartSubsrib();
|
StartSubsrib();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -533,21 +533,15 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
showLoading(these,{text:'正在刷新'})
|
||||||
|
let time = null;
|
||||||
|
let startSearch = () => {
|
||||||
ble.StopSearch().finally(() => {
|
|
||||||
|
if(time){
|
||||||
let disconnectPromises = [];
|
clearTimeout(time);
|
||||||
if (ble.data && ble.data.LinkedList) {
|
|
||||||
ble.data.LinkedList.forEach(device => {
|
|
||||||
console.log(`Requesting disconnect for ${device.deviceId}`);
|
|
||||||
disconnectPromises.push(ble.disconnectDevice(device.deviceId));
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Promise.allSettled(disconnectPromises).finally(() => {
|
time = setTimeout(() => {
|
||||||
|
|
||||||
these.EquipMents = [];
|
these.EquipMents = [];
|
||||||
these.PairEquip = [];
|
these.PairEquip = [];
|
||||||
|
|
||||||
@ -563,8 +557,31 @@
|
|||||||
content: '开始搜索失败:' + err.msg
|
content: '开始搜索失败:' + err.msg
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}).finally(()=>{
|
||||||
|
hideLoading(these);
|
||||||
});
|
});
|
||||||
});
|
}, 500);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
ble.StopSearch().finally(() => {
|
||||||
|
|
||||||
|
let disconnectPromises = [];
|
||||||
|
if (ble.data && ble.data.LinkedList) {
|
||||||
|
ble.data.LinkedList.forEach(device => {
|
||||||
|
if (device.Linked) {
|
||||||
|
disconnectPromises.push(ble.disconnectDevice(device.deviceId));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (disconnectPromises.length > 0) {
|
||||||
|
Promise.allSettled(disconnectPromises).finally(() => {
|
||||||
|
startSearch();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
startSearch();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@ -678,12 +695,11 @@
|
|||||||
console.log("客户端验证失败");
|
console.log("客户端验证失败");
|
||||||
deviceInvalid();
|
deviceInvalid();
|
||||||
return;
|
return;
|
||||||
}
|
} else if (f.macAddress == these.device.deviceMac) {
|
||||||
else if (f.macAddress == these.device.deviceMac){
|
|
||||||
console.log("客户端验证成功");
|
console.log("客户端验证成功");
|
||||||
deviceOK();
|
deviceOK();
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|||||||
@ -775,7 +775,7 @@ class BleHelper {
|
|||||||
str: str,
|
str: str,
|
||||||
hexs: hexs
|
hexs: hexs
|
||||||
};
|
};
|
||||||
// console.log("监听到特征值:" + JSON.stringify(recData));
|
console.log("监听到特征值:" + JSON.stringify(recData));
|
||||||
if (this.cfg.receivDataCallback) {
|
if (this.cfg.receivDataCallback) {
|
||||||
|
|
||||||
if (this.cfg.receivDataCallback.length > 0) {
|
if (this.cfg.receivDataCallback.length > 0) {
|
||||||
|
|||||||
@ -48,8 +48,11 @@ const request = (options) => {
|
|||||||
reject(err);
|
reject(err);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
//是否添加身份验证,undefined时默认需要
|
||||||
if (!options.url.includes('/login')) {
|
if(options.isAuthen===undefined){
|
||||||
|
options.isAuthen=true;
|
||||||
|
}
|
||||||
|
if (options.isAuthen) {
|
||||||
const token = uni.getStorageSync('token');
|
const token = uni.getStorageSync('token');
|
||||||
const clientid = uni.getStorageSync('clientID');
|
const clientid = uni.getStorageSync('clientID');
|
||||||
if (token) {
|
if (token) {
|
||||||
|
|||||||
Reference in New Issue
Block a user