1
0
forked from dyf/APP

6155完成部分协议对接

This commit is contained in:
liub
2025-08-15 16:39:00 +08:00
parent 6ef2bb08b9
commit e95b2466e1
10 changed files with 871 additions and 708 deletions

View File

@ -19,13 +19,18 @@
连接
</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'
var these = null;
var eventChannel = null;
var ble=null;
@ -110,9 +115,9 @@
}
these.Statu.bound = null;
these.Statu.boundRemark = "";
uni.showLoading({
mask: true,
title: "连接中..."
showLoading(these,{
text: "连接中..."
})
let promise = request({
url: '/app/device/bind',
@ -142,7 +147,7 @@
these.Statu.bound = false;
these.Statu.boundRemark = '出现了未知的异常,操作失败';
}).finally(() => {
uni.hideLoading();
hideLoading(this);
});
}
}

View File

@ -81,12 +81,20 @@
</view>
</view>
</BottomSlideMenuPlus>
<global-loading ref="loading" />
</view>
</template>
<script>
import bleTool from '@/utils/BleHelper.js';
import request from '@/utils/request.js';
import {
showLoading,
hideLoading,
updateLoading
} from '@/utils/loading.js'
var ble = null;
var these = null;
export default {
@ -131,7 +139,8 @@
},
onBackPress: (e) => {
ble.StopSearch();
ble.removeDeviceFound();
ble.removeReceiveCallback();
},
onLoad() {
these = this;
@ -142,12 +151,15 @@
for (var i = 0; i < arr.length; i++) {
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 {
@ -229,9 +241,8 @@
},
Link: function(item, index) {
uni.showLoading({
title: "正在连接",
mask: true
showLoading(this,{
text: "正在连接"
});
setTimeout(() => {
let serviceid=null;
@ -262,7 +273,7 @@
content:"连接失败:"+ex.msg
});
}).finally(()=>{
uni.hideLoading();
hideLoading(this);
});
}, 0);