|
@@ -1,6 +1,6 @@
|
|
|
<!-- 新版本跳首页文件修改版本 -->
|
|
|
|
|
|
-<template>
|
|
|
+<template>
|
|
|
<view class="bg-person " :class="bEFHitShake?' screen-jitter ':''">
|
|
|
<uni-nav-bar id="nav-bar" status-bar="true" backgroundColor="RGBA(30, 30, 85, 1)" @clickLeft="showClickEvent()"
|
|
|
color="#FFFFFF" fixed="true" :border="false">
|
|
@@ -997,7 +997,7 @@
|
|
|
//限制开始点击播放
|
|
|
setTimeout(() => {
|
|
|
_self.bShowComplete = true;
|
|
|
- console.log("=============>", _self.bShowComplete);
|
|
|
+ // console.log("=============>", _self.bShowComplete);
|
|
|
}, 500)
|
|
|
// 计算屏幕剩余高度 填补剩余高度
|
|
|
// 计算组件的高度
|
|
@@ -1442,34 +1442,11 @@
|
|
|
callbackUpdateBLEData(data) {
|
|
|
//如果在监听状态时候隐藏页面,返回
|
|
|
if (_self.bHide) return;
|
|
|
- // console.log("callbackDeviceState==", data);
|
|
|
-
|
|
|
- // if (this.ConnectBindingDevice) {
|
|
|
- // this.gUpdateSandbagAlgorithm({
|
|
|
- // data: data,
|
|
|
- // callback: (res) => {
|
|
|
- // if (res.type == 'hit') {
|
|
|
- // this.$refs.boxingPostRef.onBLEHotmanUpdate(res);
|
|
|
- // }
|
|
|
- // }
|
|
|
- // });
|
|
|
- // return;
|
|
|
- // }
|
|
|
-
|
|
|
//连接了手柄模式
|
|
|
//没有开启指令不刷新
|
|
|
if (!this.instructionState.bOpen) return;
|
|
|
|
|
|
if (this.BLEConnectDevice.usageMode == "hotman") {
|
|
|
- // this.gUpdateFilter({
|
|
|
- // data: data,
|
|
|
- // callback: (res) => {
|
|
|
- // if (res.type == 'hit') {
|
|
|
- // // this.$refs.boxingPostRef.onBLEHotmanUpdate(res);
|
|
|
- // this.$refs.actionHitRef.onBLEHitUpdate(res);
|
|
|
- // }
|
|
|
- // }
|
|
|
- // });
|
|
|
this.gUpdateSandbagAlgorithm({
|
|
|
data: data,
|
|
|
callback: (res) => {
|
|
@@ -1482,24 +1459,7 @@
|
|
|
//这个是普通打击模式
|
|
|
this.$refs.boxingPostRef.onBLEHandleUpdate(data);
|
|
|
} else if (this.BLEConnectDevice.usageMode == "ropeSkipping") {
|
|
|
-
|
|
|
this.$refs.actionJumpRef.onBLERopeUpdate(data);
|
|
|
- // this.onConvertDeviceData({
|
|
|
- // data: data,
|
|
|
- // callback: (outData) => {
|
|
|
- // // this.outBLEData = {
|
|
|
- // // acc: outData.convertAcc,
|
|
|
- // // gyro: outData.convertGyro
|
|
|
- // // }
|
|
|
- // // console.log(JSON.stringify(outData),JSON.stringify(data));
|
|
|
- // data.acc = outData.convertAcc;
|
|
|
- // data.gyro = outData.convertGyro;
|
|
|
- // //跳绳蓝牙反馈
|
|
|
- // this.$refs.actionJumpRef.onBLERopeUpdate(data);
|
|
|
-
|
|
|
- // }
|
|
|
- // });
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1714,61 +1674,17 @@
|
|
|
|
|
|
return;
|
|
|
//#endif
|
|
|
- //分类型判断
|
|
|
- // if (0 === this.currentModeIndex) {
|
|
|
- // //拳击运动类型
|
|
|
- // // 1.检测是否有对应设备,没有ConnectBindingDevice,再进行下一步
|
|
|
- // if (this.ConnectBindingDevice == null) {
|
|
|
- // uni.showToast({
|
|
|
- // title: '开启连接数据',
|
|
|
- // icon: 'none'
|
|
|
- // })
|
|
|
- // this.toView = "openAccGyroView";
|
|
|
- // return;
|
|
|
-
|
|
|
- // }
|
|
|
- // // TODO,目前去掉蓝牙设备
|
|
|
- // // //2.检测是否有设备
|
|
|
- // // if (this.BLEDeviceShowList.length == 0) {
|
|
|
- // // this.$store.state.bGuidePages = true;
|
|
|
- // // this.guideCurrent = 3;
|
|
|
- // // uni.showToast({
|
|
|
- // // title: '请添加蓝牙设备',
|
|
|
- // // icon: 'none'
|
|
|
- // // })
|
|
|
- // // this.toView = "addDeviceView";
|
|
|
- // // return;
|
|
|
- // // }
|
|
|
- // // //2.检测是否连接设备 || this.BLEConnectDevice.ename !== 'BT04'
|
|
|
- // // if (this.cIndex == -1) {
|
|
|
- // // //没有连接设备,提示去连接设备
|
|
|
- // // uni.showToast({
|
|
|
- // // title: '请连接蓝牙设备',
|
|
|
- // // icon: 'none'
|
|
|
- // // })
|
|
|
- // // this.toView = "addDeviceView";
|
|
|
- // // return;
|
|
|
- // // }
|
|
|
-
|
|
|
- // } else
|
|
|
//跳和拳击进入
|
|
|
if (1 === this.currentModeIndex || 0 === this.currentModeIndex) {
|
|
|
-
|
|
|
//2.检测是否连接设备 || this.BLEConnectDevice.ename !== 'BT04'
|
|
|
if (this.cIndex == -1) {
|
|
|
- //没有连接设备,提示去连接设备
|
|
|
- // uni.showToast({
|
|
|
- // title: '请连接蓝牙设备',
|
|
|
- // icon: 'none'
|
|
|
- // })
|
|
|
+
|
|
|
this.onGetBluetoothConnectView({
|
|
|
hiddenType: 'none'
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
//3.检测一下计划日期
|
|
|
console.log("remainingDays == >", this.planData, this.remainingDays);
|
|
|
if (date.formatDate(new Date()) > this.planData.endTime || this.remainingDays == 0) {
|
|
@@ -1777,10 +1693,6 @@
|
|
|
setTimeout(() => {
|
|
|
this.$store.state.bPlanExpired = false;
|
|
|
}, 3000)
|
|
|
- // uni.showToast({
|
|
|
- // title: "计划到期,请制定计划。",
|
|
|
- // icon: 'none'
|
|
|
- // })
|
|
|
uni.showModal({
|
|
|
title: '提醒',
|
|
|
content: '计划到期,请制定新计划。',
|
|
@@ -1797,52 +1709,6 @@
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- // if (0 === this.currentModeIndex) {
|
|
|
-
|
|
|
- // //如果新手,调用新手教程
|
|
|
- // console.log("this.bNewGuide:", this.bNewGuide);
|
|
|
- // if (this.bNewGuide) {
|
|
|
- // // 拳击的新手提示
|
|
|
- // this.$store.state.bGuidePages = true;
|
|
|
- // this.guideCurrent = 5;
|
|
|
- // this.toView = "boxingHitID";
|
|
|
- // this.$store.state.bNewGuide = false;
|
|
|
- // } else {
|
|
|
- // if (this.ConnectBindingDevice) {
|
|
|
- // //假如有连接bingding设备
|
|
|
- // this.gCreateSandbagAlgorithm();
|
|
|
- // this.gStartSimulateBLEUpdate();
|
|
|
- // } else {
|
|
|
- // //todo 跳绳模式 发送开启指令
|
|
|
- // if (this.BLEConnectDevice.usageMode == "ropeSkipping") {
|
|
|
- // //打开跳绳模式
|
|
|
- // this.B_OpenRopeSkipping();
|
|
|
- // } else {
|
|
|
- // //初始化filter快速打击对象
|
|
|
- // if (this.BLEConnectDevice.usageMode == "hotman") {
|
|
|
- // this.gCreateFilterObj();
|
|
|
- // }
|
|
|
- // //打开加速计
|
|
|
- // this.onWriteBLEConnectionValue({
|
|
|
- // value: "3"
|
|
|
- // });
|
|
|
-
|
|
|
- // // setTimeout(() => {
|
|
|
- // // //设置加速计b:20ms a:10ms
|
|
|
- // // this.onWriteBLEConnectionValue({
|
|
|
- // // value: config.refreshRate
|
|
|
- // // });
|
|
|
-
|
|
|
- // // }, 1000)
|
|
|
- // }
|
|
|
-
|
|
|
- // }
|
|
|
- // //监听蓝牙回调
|
|
|
- // uni.$on('updateBLEDeviceData', this.callbackUpdateBLEData);
|
|
|
- // this.onBoxingGuideFinish();
|
|
|
- // }
|
|
|
-
|
|
|
- // } else
|
|
|
if (1 == this.currentModeIndex || 0 === this.currentModeIndex) {
|
|
|
if (data) {
|
|
|
let {
|
|
@@ -1925,7 +1791,7 @@
|
|
|
//检测是否符合要求,没有的话进行新手提示
|
|
|
onPersonalCheck(data) {
|
|
|
if (!this.bShowComplete) {
|
|
|
- // console.log('不要点击这么快!!');
|
|
|
+ console.log('不要点击这么快!!');
|
|
|
return;
|
|
|
} else {
|
|
|
console.error('点击!!');
|
|
@@ -1934,7 +1800,6 @@
|
|
|
// #ifdef APP-PLUS
|
|
|
if (1 === this.currentModeIndex || 0 === this.currentModeIndex) {
|
|
|
if (this.currentJumpTask == null) {
|
|
|
- // console.log("**************11");
|
|
|
this.onTipLevel({
|
|
|
hiddenType: 'normal'
|
|
|
});
|
|
@@ -1945,13 +1810,7 @@
|
|
|
});
|
|
|
this.setGuideUnlockState(guideUnlockState);
|
|
|
}
|
|
|
- // else {
|
|
|
- // uni.showToast({
|
|
|
- // title: '先选一个挑战关卡',
|
|
|
- // icon: 'none',
|
|
|
- // duration: 2000,
|
|
|
- // })
|
|
|
- // }
|
|
|
+ this.bShowComplete = true;
|
|
|
return;
|
|
|
}
|
|
|
if (this.currentMode == 'pkMode' && this.finallySelectFriendInfo == null) {
|
|
@@ -1961,6 +1820,7 @@
|
|
|
icon: 'none',
|
|
|
duration: 2000,
|
|
|
})
|
|
|
+ this.bShowComplete = true;
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -2227,15 +2087,7 @@
|
|
|
this.gStopSimulateBLEUpdate();
|
|
|
uni.$off('updateBLEDeviceData', this.callbackUpdateBLEData);
|
|
|
} else {
|
|
|
- // if (this.BLEConnectDevice.usageMode == "ropeSkipping") {
|
|
|
- // this.B_CloseRopeSkipping();
|
|
|
- // } else {
|
|
|
- // }
|
|
|
if (0 === this.currentModeIndex) {
|
|
|
- // this.$refs.boxingPostRef.onBoxingPostStop();
|
|
|
- // //停止时候,重置ai信息
|
|
|
- // this.aiObj.name = this.aiOldObj.name;
|
|
|
- // this.aiObj.avatar = this.aiOldObj.avatar;
|
|
|
if (this.currentMode == "calorieMode") {
|
|
|
this.$refs.actionHitRef.onGameOver("none");
|
|
|
} else {
|
|
@@ -2296,12 +2148,6 @@
|
|
|
//跳转搜索设备页面
|
|
|
// this.openDeviceList();
|
|
|
} else if (e.current == 3 && !e.onlyHide) {
|
|
|
- //新手引导跳转扫码页面,直接走绑定 再check
|
|
|
- // this.openQRCode((res) => {
|
|
|
- // setTimeout(() => {
|
|
|
- // this.onPersonalCheck();
|
|
|
- // }, 200);
|
|
|
- // });
|
|
|
// 跳转连接蓝牙页面
|
|
|
this.openDeviceList();
|
|
|
} else if (e.current == 5 && !e.onlyHide) {
|
|
@@ -2666,24 +2512,7 @@
|
|
|
let {
|
|
|
isOffEvent = false
|
|
|
} = data;
|
|
|
- if (isOffEvent) {
|
|
|
- //停止蓝牙加速计
|
|
|
- this.onWriteBLEConnectionValue({
|
|
|
- value: "4"
|
|
|
- });
|
|
|
- uni.$off('updateBLEDeviceData', this.callbackUpdateBLEData);
|
|
|
- console.log('onActionJumpGameOver 任务结束');
|
|
|
-
|
|
|
- this.bGamePlaying = false;
|
|
|
-
|
|
|
- //同步到数据库
|
|
|
- if (0 === this.currentModeIndex) {
|
|
|
- //拳击柱
|
|
|
- this.uploadUserData_hitCount();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
//游戏结束,重置时间
|
|
|
this.arcbarCountDownTimeReset();
|
|
|
//todo 可能区分 levelJump 关卡类型
|
|
@@ -2698,11 +2527,32 @@
|
|
|
success: (res) => {
|
|
|
if (res.confirm) {
|
|
|
//重新开始计算
|
|
|
- this.onActionJumpPlay();
|
|
|
+ if (0 === this.currentModeIndex) {
|
|
|
+ //调用开始
|
|
|
+ this.onActionHitPlay();
|
|
|
+ } else if (1 === this.currentModeIndex) {
|
|
|
+ //调用开始
|
|
|
+ this.onActionJumpPlay();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
} else {
|
|
|
+ if (isOffEvent) {
|
|
|
+ //停止蓝牙加速计
|
|
|
+ this.onWriteBLEConnectionValue({
|
|
|
+ value: "4"
|
|
|
+ });
|
|
|
+ uni.$off('updateBLEDeviceData', this.callbackUpdateBLEData);
|
|
|
+ console.log('pkMode onActionJumpGameOver 任务结束');
|
|
|
+ this.bGamePlaying = false;
|
|
|
+ //同步到数据库
|
|
|
+ if (0 === this.currentModeIndex) {
|
|
|
+ //拳击柱
|
|
|
+ this.uploadUserData_hitCount();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
this.AJData.isFinish = true;
|
|
|
//奖励赢的人 PKLEVELREWARD
|
|
|
let _item = this.currentJumpTask.item;
|
|
@@ -2712,13 +2562,7 @@
|
|
|
let isMyWin = true;
|
|
|
//如果是右边好友,即判断结束。计算胜负关系
|
|
|
if (this.AJData.myScore > this.AJData.otherScore) {
|
|
|
- //规定时间内,跳得最多
|
|
|
- // uni.showToast({
|
|
|
- // title: '我赢!!',
|
|
|
- // duration: 2000
|
|
|
- // })
|
|
|
isMyWin = true;
|
|
|
-
|
|
|
//显示一个提示框
|
|
|
this.showPopup('pkFinish', {
|
|
|
name: this.username,
|
|
@@ -2728,14 +2572,14 @@
|
|
|
hit: this.AJData.allCount - this.AJData.faultCount,
|
|
|
miss: this.AJData.faultCount
|
|
|
});
|
|
|
- console.log({
|
|
|
- name: this.username,
|
|
|
- url: this.avatarUrl,
|
|
|
- score: this.AJData.myScore,
|
|
|
- consumeTime: Math.abs(this.AJData.myUsageTime),
|
|
|
- hit: this.AJData.allCount - this.AJData.faultCount,
|
|
|
- miss: this.AJData.faultCount
|
|
|
- });
|
|
|
+ // console.log({
|
|
|
+ // name: this.username,
|
|
|
+ // url: this.avatarUrl,
|
|
|
+ // score: this.AJData.myScore,
|
|
|
+ // consumeTime: Math.abs(this.AJData.myUsageTime),
|
|
|
+ // hit: this.AJData.allCount - this.AJData.faultCount,
|
|
|
+ // miss: this.AJData.faultCount
|
|
|
+ // });
|
|
|
} else {
|
|
|
// uni.showToast({
|
|
|
// title: '好友赢或者平局',
|
|
@@ -2788,6 +2632,20 @@
|
|
|
);
|
|
|
}
|
|
|
} else {
|
|
|
+ if (isOffEvent) {
|
|
|
+ //停止蓝牙加速计
|
|
|
+ this.onWriteBLEConnectionValue({
|
|
|
+ value: "4"
|
|
|
+ });
|
|
|
+ uni.$off('updateBLEDeviceData', this.callbackUpdateBLEData);
|
|
|
+ console.log('onActionJumpGameOver 任务结束');
|
|
|
+ this.bGamePlaying = false;
|
|
|
+ //同步到数据库
|
|
|
+ if (0 === this.currentModeIndex) {
|
|
|
+ //拳击柱
|
|
|
+ this.uploadUserData_hitCount();
|
|
|
+ }
|
|
|
+ }
|
|
|
this.AJData.isFinish = true;
|
|
|
if (data.myWin) {
|
|
|
//通过关卡,处理逻辑
|