|
|
@@ -100,7 +100,7 @@
|
|
|
<!-- <view id="boxingHitID" style="position: absolute;top: 180rpx; pointer-events: none;" ></view> -->
|
|
|
<view id="boxingHitID" v-if="currentModeIndex == 0" class="charts-pring-bottom">
|
|
|
<boxing-hit ref="boxingPostRef" :bUpdate="!bHide && cIndex!=-1 && BLEConnectDevice!=null &&
|
|
|
- (BLEConnectDevice.deviceType == 'mySelf'||BLEConnectDevice.deviceType == 'BLEHandle')"
|
|
|
+ (BLEConnectDevice.deviceType == 'mySelf'||BLEConnectDevice.deviceType == 'BLEHandle' || BLEConnectDevice.deviceType == 'BLERope' )"
|
|
|
:showTime="localSportTime" :bRebound="BLEConnectDevice&&BLEConnectDevice.limitType == 'rebound'"
|
|
|
@updateCalorie="boxingUpdateCalorie" @boxingPostCheck="onPersonalCheck" @shake="onScreenShake"
|
|
|
@updateSportTime="onUpdateSportTime" @boxingGuideFinish="onBoxingGuideFinish" @boxingPostControlPlay="onBoxingPostControlPlay"
|
|
|
@@ -289,7 +289,7 @@
|
|
|
<!-- <button class="margin" @click="openGyro">开启手机加速计和方向传感器</button> -->
|
|
|
<!-- <button class="margin" @click="stopGyro">关闭手机加速计和方向传感器</button> -->
|
|
|
<!-- <button class="margin" @click="getBLEDeviceServices">getBLEDeviceServices</button> -->
|
|
|
-
|
|
|
+
|
|
|
<!-- <keyboard-listener @keydown="onKeyDown"></keyboard-listener> -->
|
|
|
<!-- 视频推荐 -->
|
|
|
<view class="card-view" v-if="cIndex != -1 && versionCodeState&&versionCodeState.showVideo && videoList.length !== 0">
|
|
|
@@ -390,7 +390,8 @@
|
|
|
</view>
|
|
|
|
|
|
<!-- 引导蒙层 bGuidePages guideCurrent-->
|
|
|
- <code-elf-guide ref="codeElfGuide" v-if="bGuidePages" @hide="guideHide" @change="onGuideChange" :current="guideCurrent" :currentMode="currentMode"></code-elf-guide>
|
|
|
+ <code-elf-guide ref="codeElfGuide" v-if="bGuidePages" @hide="guideHide" @change="onGuideChange" :current="guideCurrent"
|
|
|
+ :currentMode="currentMode"></code-elf-guide>
|
|
|
|
|
|
<!-- <view v-if="bStartBoxingPost" class="CountDownMask">
|
|
|
{{BoxingPostCountDownText}}
|
|
|
@@ -740,7 +741,7 @@
|
|
|
avatar: '/static/defaultAvatar.png'
|
|
|
},
|
|
|
currentMode: 'calorieMode', //pkMode calorieMode
|
|
|
-
|
|
|
+
|
|
|
bHitShake: false,
|
|
|
|
|
|
bAiHitShake: false,
|
|
|
@@ -878,15 +879,15 @@
|
|
|
if (this.bVerifiedConnection && this.BLEConnectDevice) {
|
|
|
this.updateBLECIndex();
|
|
|
|
|
|
- setTimeout(() => {
|
|
|
- /**
|
|
|
- * 如果是首页连接,则检测
|
|
|
- */
|
|
|
- if (this.bGetBondTesting) {
|
|
|
- this.onGetBondDevice();
|
|
|
- this.bGetBondTesting = false;
|
|
|
- }
|
|
|
- }, 5000)
|
|
|
+ // setTimeout(() => {
|
|
|
+ // /**
|
|
|
+ // * 如果是首页连接,则检测
|
|
|
+ // */
|
|
|
+ // if (this.bGetBondTesting) {
|
|
|
+ // this.onGetBondDevice();
|
|
|
+ // this.bGetBondTesting = false;
|
|
|
+ // }
|
|
|
+ // }, 5000)
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -954,7 +955,7 @@
|
|
|
'syncLocalDataToServer', 'syncRequestEvent', 'setLocalSportTime',
|
|
|
'initAdapter', 'onCreateBLEConnection', 'onUnloadCreateBLEConnectionTimeout', 'onCloseBLEConnection',
|
|
|
'gOnAddClientInfo', 'onWriteBLEConnectionValue',
|
|
|
- 'gCreateFilterObj', 'gUpdateFilter', 'B_GetBondedDevices', 'B_OpenBLESetting'
|
|
|
+ 'gCreateFilterObj', 'gUpdateFilter', 'B_GetBondedDevices', 'B_OpenBLESetting','B_OpenRopeSkipping','B_CloseRopeSkipping'
|
|
|
]),
|
|
|
onKeyDown(e) {
|
|
|
console.log(e);
|
|
|
@@ -1343,31 +1344,41 @@
|
|
|
let eq = this.BLEDeviceShowList[i];
|
|
|
if ((eq.ename.indexOf("mobilePhoneBandage") > -1 && this.BLEConnectDevice.id == 0) ||
|
|
|
(eq.ename.indexOf("hotman") > -1 && this.BLEConnectDevice.id == 1) ||
|
|
|
- (eq.ename.indexOf("BLEHandle") > -1 && this.BLEConnectDevice.id == 2)) {
|
|
|
+ (eq.ename.indexOf("BLEHandle") > -1 && this.BLEConnectDevice.id == 2) ||
|
|
|
+ (eq.ename.indexOf("rope") > -1 && this.BLEConnectDevice.id == 3)) {
|
|
|
|
|
|
eq.bRatio = true;
|
|
|
this.$store.state.cIndex = i;
|
|
|
|
|
|
}
|
|
|
-
|
|
|
- if(eq.ename.indexOf("hotman") > -1 && this.BLEConnectDevice.id == 1){
|
|
|
- if(this.$refs.boxingPostRef){
|
|
|
+
|
|
|
+ if (eq.ename.indexOf("hotman") > -1 && this.BLEConnectDevice.id == 1) {
|
|
|
+ if (this.$refs.boxingPostRef) {
|
|
|
this.$refs.boxingPostRef.onSetMode('pkMode');
|
|
|
- }else{
|
|
|
- setTimeout(()=>{
|
|
|
+ } else {
|
|
|
+ setTimeout(() => {
|
|
|
this.$refs.boxingPostRef.onSetMode('pkMode');
|
|
|
- },500)
|
|
|
+ }, 500)
|
|
|
}
|
|
|
-
|
|
|
- }else if(eq.ename.indexOf("BLEHandle") > -1 && this.BLEConnectDevice.id == 2){
|
|
|
- if(this.$refs.boxingPostRef){
|
|
|
+
|
|
|
+ } else if (eq.ename.indexOf("BLEHandle") > -1 && this.BLEConnectDevice.id == 2) {
|
|
|
+ if (this.$refs.boxingPostRef) {
|
|
|
this.$refs.boxingPostRef.onSetMode('calorieMode');
|
|
|
- }else{
|
|
|
- setTimeout(()=>{
|
|
|
+ } else {
|
|
|
+ setTimeout(() => {
|
|
|
this.$refs.boxingPostRef.onSetMode('calorieMode');
|
|
|
- },500)
|
|
|
+ }, 500)
|
|
|
+ }
|
|
|
+ } else if (eq.ename.indexOf("rope") > -1 && this.BLEConnectDevice.id == 3) {
|
|
|
+ //todo 暂时设置兼容跑步模式
|
|
|
+ if (this.$refs.boxingPostRef) {
|
|
|
+ this.$refs.boxingPostRef.onSetMode('ropeMode');
|
|
|
+ } else {
|
|
|
+ setTimeout(() => {
|
|
|
+ this.$refs.boxingPostRef.onSetMode('ropeMode');
|
|
|
+ }, 500)
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
|
|
|
@@ -1432,6 +1443,13 @@
|
|
|
} else if (this.BLEConnectDevice.usageMode == "general") {
|
|
|
//这个是普通打击模式
|
|
|
this.$refs.boxingPostRef.onBLEHandleUpdate(data);
|
|
|
+ } else if (this.BLEConnectDevice.usageMode == "ropeSkipping") {
|
|
|
+ //跳绳蓝牙反馈
|
|
|
+ let _data = {
|
|
|
+ jump: 1
|
|
|
+ }
|
|
|
+ this.$refs.boxingPostRef.onBLERopeUpdate(_data);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -1490,7 +1508,7 @@
|
|
|
uni.showToast({
|
|
|
title: '当前已连接设备',
|
|
|
icon: 'none',
|
|
|
- mask:true
|
|
|
+ mask: true
|
|
|
})
|
|
|
return;
|
|
|
}
|
|
|
@@ -1508,20 +1526,22 @@
|
|
|
this.bGetBondTesting = true;
|
|
|
} else {
|
|
|
//没有弹出框时候,直接检测
|
|
|
- setTimeout(() => {
|
|
|
- this.onGetBondDevice();
|
|
|
- }, 5000)
|
|
|
+ // setTimeout(() => {
|
|
|
+ // this.onGetBondDevice();
|
|
|
+ // }, 5000)
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//刷新状态
|
|
|
- if(this.cIndex != -1){
|
|
|
+ if (this.cIndex != -1) {
|
|
|
let eq = this.BLEDeviceShowList[this.cIndex];
|
|
|
// console.log(eq,this.BLEConnectDevice);
|
|
|
- if(eq.ename.indexOf("hotman") > -1 && this.BLEConnectDevice.id == 1){
|
|
|
+ if (eq.ename.indexOf("hotman") > -1 && this.BLEConnectDevice.id == 1) {
|
|
|
this.$refs.boxingPostRef.onSetMode('pkMode');
|
|
|
- }else if(eq.ename.indexOf("BLEHandle") > -1 && this.BLEConnectDevice.id == 2){
|
|
|
+ } else if (eq.ename.indexOf("BLEHandle") > -1 && this.BLEConnectDevice.id == 2) {
|
|
|
this.$refs.boxingPostRef.onSetMode('calorieMode');
|
|
|
- }
|
|
|
+ } else if (eq.ename.indexOf("rope") > -1 && this.BLEConnectDevice.id == 3) {
|
|
|
+ this.$refs.boxingPostRef.onSetMode('ropeMode');
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
@@ -1533,9 +1553,9 @@
|
|
|
/**
|
|
|
* 假如手机没有匹配,断开连接
|
|
|
*/
|
|
|
- console.log("****",this.BLEConnectDevice);
|
|
|
- if(!this.BLEConnectDevice)return;
|
|
|
-
|
|
|
+ console.log("****", this.BLEConnectDevice);
|
|
|
+ if (!this.BLEConnectDevice) return;
|
|
|
+
|
|
|
this.B_GetBondedDevices({
|
|
|
deviceId: this.BLEConnectDevice.deviceId,
|
|
|
success: (bondedDevice) => {
|
|
|
@@ -1623,12 +1643,12 @@
|
|
|
onCloseDevice(item, e) {
|
|
|
//如果不是连接状态,则删除
|
|
|
if (e.currentTarget.dataset.index != this.cIndex) {
|
|
|
- if(this.cIndex !=-1){
|
|
|
+ if (this.cIndex != -1) {
|
|
|
uni.showToast({
|
|
|
- icon:'none',
|
|
|
- title:"请先断开已连接设备",
|
|
|
- duration:2000,
|
|
|
- mask:true
|
|
|
+ icon: 'none',
|
|
|
+ title: "请先断开已连接设备",
|
|
|
+ duration: 2000,
|
|
|
+ mask: true
|
|
|
})
|
|
|
return;
|
|
|
}
|
|
|
@@ -1796,24 +1816,28 @@
|
|
|
this.toView = "boxingHitID";
|
|
|
this.$store.state.bNewGuide = false;
|
|
|
} else {
|
|
|
-
|
|
|
- //初始化filter快速打击对象
|
|
|
- if (this.BLEConnectDevice.usageMode == "hotman") {
|
|
|
- this.gCreateFilterObj();
|
|
|
- }
|
|
|
- //打开加速计
|
|
|
- this.onWriteBLEConnectionValue({
|
|
|
- value: "3"
|
|
|
- });
|
|
|
-
|
|
|
- setTimeout(() => {
|
|
|
- //设置加速计b:20ms a:10ms
|
|
|
+ //todo 跳绳模式 发送开启指令
|
|
|
+ if (this.BLEConnectDevice.usageMode == "ropeSkipping") {
|
|
|
+ //打开跳绳模式
|
|
|
+ this.B_OpenRopeSkipping();
|
|
|
+ } else {
|
|
|
+ //初始化filter快速打击对象
|
|
|
+ if (this.BLEConnectDevice.usageMode == "hotman") {
|
|
|
+ this.gCreateFilterObj();
|
|
|
+ }
|
|
|
+ //打开加速计
|
|
|
this.onWriteBLEConnectionValue({
|
|
|
- value: config.refreshRate
|
|
|
+ value: "3"
|
|
|
});
|
|
|
|
|
|
- }, 1000)
|
|
|
+ setTimeout(() => {
|
|
|
+ //设置加速计b:20ms a:10ms
|
|
|
+ this.onWriteBLEConnectionValue({
|
|
|
+ value: config.refreshRate
|
|
|
+ });
|
|
|
|
|
|
+ }, 1000)
|
|
|
+ }
|
|
|
|
|
|
//监听蓝牙回调
|
|
|
uni.$on('updateBLEDeviceData', this.callbackUpdateBLEData);
|
|
|
@@ -1851,7 +1875,7 @@
|
|
|
}
|
|
|
|
|
|
|
|
|
- if (this.currentMode == 'calorieMode') {
|
|
|
+ if (this.currentMode == 'calorieMode' || this.currentMode == 'ropeMode') {
|
|
|
this.personalAudioContext.stop();
|
|
|
this.personalAudioContext.play();
|
|
|
|
|
|
@@ -2143,7 +2167,7 @@
|
|
|
this.currentMode = data.mode;
|
|
|
this.title = data.name;
|
|
|
|
|
|
- if (this.currentMode == 'calorieMode') {
|
|
|
+ if (this.currentMode == 'calorieMode' || this.currentMode == 'ropeMode') {
|
|
|
setTimeout(() => {
|
|
|
this.updateNoLimit();
|
|
|
}, 0)
|
|
|
@@ -2199,10 +2223,15 @@
|
|
|
//弹出目标提示后,进行下一步
|
|
|
onBoxingPause(bFinish) {
|
|
|
if (bFinish) {
|
|
|
- //停止蓝牙加速计
|
|
|
- this.onWriteBLEConnectionValue({
|
|
|
- value: "4"
|
|
|
- });
|
|
|
+ if(this.BLEConnectDevice.usageMode == "ropeSkipping"){
|
|
|
+ this.B_CloseRopeSkipping();
|
|
|
+ }else{
|
|
|
+ //停止蓝牙加速计
|
|
|
+ this.onWriteBLEConnectionValue({
|
|
|
+ value: "4"
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
uni.$off('updateBLEDeviceData', this.callbackUpdateBLEData);
|
|
|
|
|
|
@@ -2245,7 +2274,7 @@
|
|
|
//跳转计划页面
|
|
|
this.openPlan();
|
|
|
} else if (e.current == 1 && !e.onlyHide) {
|
|
|
- console.log('guideHide:',e.current);
|
|
|
+ console.log('guideHide:', e.current);
|
|
|
//跳转搜索设备页面
|
|
|
// this.openDeviceList();
|
|
|
} else if (e.current == 3 && !e.onlyHide) {
|
|
|
@@ -2271,24 +2300,28 @@
|
|
|
}, 200);
|
|
|
} else if (e.current == 5 && !e.onlyHide) {
|
|
|
console.log("==:", e);
|
|
|
- //初始化filter快速打击对象
|
|
|
- if (this.BLEConnectDevice.usageMode == "hotman") {
|
|
|
- this.gCreateFilterObj();
|
|
|
- }
|
|
|
- //打开加速计
|
|
|
- this.onWriteBLEConnectionValue({
|
|
|
- value: "3"
|
|
|
- });
|
|
|
-
|
|
|
- setTimeout(() => {
|
|
|
- //设置加速计b:20ms a:10ms
|
|
|
+ //todo 跳绳模式 新手引导
|
|
|
+ if (this.BLEConnectDevice.usageMode == "ropeSkipping") {
|
|
|
+ this.B_OpenRopeSkipping();
|
|
|
+ } else {
|
|
|
+ //初始化filter快速打击对象
|
|
|
+ if (this.BLEConnectDevice.usageMode == "hotman") {
|
|
|
+ this.gCreateFilterObj();
|
|
|
+ }
|
|
|
+ //打开加速计
|
|
|
this.onWriteBLEConnectionValue({
|
|
|
- value: config.refreshRate
|
|
|
+ value: "3"
|
|
|
});
|
|
|
-
|
|
|
- }, 1000)
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+ setTimeout(() => {
|
|
|
+ //设置加速计b:20ms a:10ms
|
|
|
+ this.onWriteBLEConnectionValue({
|
|
|
+ value: config.refreshRate
|
|
|
+ });
|
|
|
+
|
|
|
+ }, 1000)
|
|
|
+ }
|
|
|
+
|
|
|
//监听蓝牙回调
|
|
|
uni.$on('updateBLEDeviceData', this.callbackUpdateBLEData);
|
|
|
this.onBoxingGuideFinish();
|
|
|
@@ -2482,10 +2515,10 @@
|
|
|
url: '../../info-page/app-info/app-info'
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
- getBLEDeviceServices(){
|
|
|
+
|
|
|
+ getBLEDeviceServices() {
|
|
|
console.log("getBLEDeviceServices");
|
|
|
-
|
|
|
+
|
|
|
// uni.getBLEDeviceServices({
|
|
|
// deviceId: "C5:5C:19:04:00:30",
|
|
|
// success: res => {
|
|
|
@@ -2493,7 +2526,7 @@
|
|
|
// },
|
|
|
// fail: failRes => {
|
|
|
// console.log('device services:', failRes)
|
|
|
-
|
|
|
+
|
|
|
// }
|
|
|
// });
|
|
|
}
|