|
@@ -38,17 +38,19 @@
|
|
|
<!-- 计划显示 区域 topScrollHight :style="{ height: + '100%' }"-->
|
|
|
<scroll-view scroll-y="true" style="height: 100%; width: 100%;">
|
|
|
<view class="plan-view">
|
|
|
- <view class="text-white text-center" style="background-color: RGBA(30, 30, 85, 1); z-index: 10;">今日击打次数:{{sandbagHitCount}}</view>
|
|
|
-
|
|
|
+ <view class="text-white text-center"
|
|
|
+ style="background-color: RGBA(30, 30, 85, 1); z-index: 10;">今日击打次数:{{sandbagHitCount}}
|
|
|
+ </view>
|
|
|
+
|
|
|
<!-- #ifdef H5 -->
|
|
|
<button @click="onAddSandbagHitCount()">add</button>
|
|
|
<button @click="onReset()">onReset</button>
|
|
|
<button @click="getUserData_hitCount()">getUserData_hitCount</button>
|
|
|
<button @click="uploadUserData_hitCount()">uploadUserData_hitCount</button>
|
|
|
-
|
|
|
+ <button @click="onSendMsg()">onSendMsg</button>
|
|
|
<!-- #endif -->
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
<!-- pk模式下的跳绳 v-if="1 === currentModeIndex"-->
|
|
|
<view v-if="currentMode == 'pkMode'" class="position-relative"
|
|
|
style="height: 128rpx; background-color: RGBA(30, 30, 85, 1); z-index: 10;">
|
|
@@ -189,7 +191,7 @@
|
|
|
hiddenType: 'firstInstallation'
|
|
|
})">计划</button>
|
|
|
</view> -->
|
|
|
-
|
|
|
+
|
|
|
<view style="height: 50rpx;"></view>
|
|
|
</scroll-view>
|
|
|
|
|
@@ -874,7 +876,7 @@
|
|
|
uni.$on("onLog", this.onLog);
|
|
|
//人物列表变化处理监听
|
|
|
uni.$on("onSwitchTaskList", this.onSwitchTaskList);
|
|
|
-
|
|
|
+
|
|
|
//获取对应的用户数据,并且设置记录的打击数据
|
|
|
this.getUserData_hitCount();
|
|
|
},
|
|
@@ -966,6 +968,8 @@
|
|
|
}
|
|
|
|
|
|
// #endif
|
|
|
+
|
|
|
+ this.onConnectSocket();
|
|
|
},
|
|
|
onUnload() {
|
|
|
console.log("personal ********* onUnload *********");
|
|
@@ -989,6 +993,7 @@
|
|
|
|
|
|
uni.$off("onShowFirstInstallation", this.onShowFirstInstallation);
|
|
|
|
|
|
+ this.onCloseSocket();
|
|
|
},
|
|
|
onHide() {
|
|
|
_self.bHide = true;
|
|
@@ -1020,8 +1025,9 @@
|
|
|
'setGuideUnlockState',
|
|
|
'resetActionJumpTask',
|
|
|
'getUserData_hitCount',
|
|
|
- 'uploadUserData_hitCount','getUserData_hitCount',
|
|
|
+ 'uploadUserData_hitCount', 'getUserData_hitCount',
|
|
|
'addSandbagHitCount',
|
|
|
+ ,'onConnectSocket','onCloseSocket','onSendSocketMessage'
|
|
|
]),
|
|
|
BasicsSteps() {
|
|
|
this.basics = this.basics == this.basicsList.length - 1 ? 0 : this.basics + 1
|
|
@@ -1416,22 +1422,23 @@
|
|
|
//这个是普通打击模式
|
|
|
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);
|
|
|
|
|
|
- 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);
|
|
|
-
|
|
|
- }
|
|
|
- });
|
|
|
+ // }
|
|
|
+ // });
|
|
|
|
|
|
}
|
|
|
|
|
@@ -2524,7 +2531,7 @@
|
|
|
if (0 === this.currentModeIndex) {
|
|
|
//拳击柱
|
|
|
this.onAddSandbagHitCount();
|
|
|
- }
|
|
|
+ }
|
|
|
// else if (1 === this.currentModeIndex) {
|
|
|
// //跳
|
|
|
// }
|
|
@@ -2608,12 +2615,12 @@
|
|
|
console.log('onActionJumpGameOver 任务结束');
|
|
|
|
|
|
this.bGamePlaying = false;
|
|
|
-
|
|
|
+
|
|
|
//同步到数据库
|
|
|
if (0 === this.currentModeIndex) {
|
|
|
//拳击柱
|
|
|
this.uploadUserData_hitCount();
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
@@ -3184,13 +3191,215 @@
|
|
|
});
|
|
|
this.setGuideUnlockState(guideUnlockState);
|
|
|
},
|
|
|
-
|
|
|
-
|
|
|
- onAddSandbagHitCount(){
|
|
|
- this.addSandbagHitCount({count:1});
|
|
|
+
|
|
|
+
|
|
|
+ onAddSandbagHitCount() {
|
|
|
+ this.addSandbagHitCount({
|
|
|
+ count: 1
|
|
|
+ });
|
|
|
},
|
|
|
- onReset(){
|
|
|
+ onReset() {
|
|
|
this.$store.state.sandbagHitCount = 0;
|
|
|
+ },
|
|
|
+
|
|
|
+ onSendMsg(){
|
|
|
+ let msg = [{
|
|
|
+ "maxValue": 19.267578125,
|
|
|
+ "gyroValue": -1172.607421875,
|
|
|
+ "resultant": 23.36043492594914,
|
|
|
+ "index": 98,
|
|
|
+ "acc": {
|
|
|
+ "oAccX": 10.2587890625,
|
|
|
+ "oAccY": -8.3203125,
|
|
|
+ "oAccZ": -19.267578125
|
|
|
+ },
|
|
|
+ "gyro": {
|
|
|
+ "oGyroX": -13.0615234375,
|
|
|
+ "oGyroY": -1172.607421875,
|
|
|
+ "oGyroZ": -42.66357421875
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ "maxValue": 19.267578125,
|
|
|
+ "gyroValue": -1172.607421875,
|
|
|
+ "resultant": 23.36043492594914,
|
|
|
+ "index": 99,
|
|
|
+ "acc": {
|
|
|
+ "oAccX": 10.2587890625,
|
|
|
+ "oAccY": -8.3203125,
|
|
|
+ "oAccZ": -19.267578125
|
|
|
+ },
|
|
|
+ "gyro": {
|
|
|
+ "oGyroX": -13.0615234375,
|
|
|
+ "oGyroY": -1172.607421875,
|
|
|
+ "oGyroZ": -42.66357421875
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ "maxValue": 6.58203125,
|
|
|
+ "gyroValue": -1144.59228515625,
|
|
|
+ "resultant": 8.733990874058362,
|
|
|
+ "index": 100,
|
|
|
+ "acc": {
|
|
|
+ "oAccX": 3.740234375,
|
|
|
+ "oAccY": -4.35546875,
|
|
|
+ "oAccZ": -6.58203125
|
|
|
+ },
|
|
|
+ "gyro": {
|
|
|
+ "oGyroX": -26.91650390625,
|
|
|
+ "oGyroY": -1144.59228515625,
|
|
|
+ "oGyroZ": -45.10498046875
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ "maxValue": 6.58203125,
|
|
|
+ "gyroValue": -1144.59228515625,
|
|
|
+ "resultant": 8.733990874058362,
|
|
|
+ "index": 101,
|
|
|
+ "acc": {
|
|
|
+ "oAccX": 3.740234375,
|
|
|
+ "oAccY": -4.35546875,
|
|
|
+ "oAccZ": -6.58203125
|
|
|
+ },
|
|
|
+ "gyro": {
|
|
|
+ "oGyroX": -26.91650390625,
|
|
|
+ "oGyroY": -1144.59228515625,
|
|
|
+ "oGyroZ": -45.10498046875
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ "maxValue": -1.1376953125,
|
|
|
+ "gyroValue": -1038.87939453125,
|
|
|
+ "resultant": 3.372542722981424,
|
|
|
+ "index": 102,
|
|
|
+ "acc": {
|
|
|
+ "oAccX": -1.5966796875,
|
|
|
+ "oAccY": -2.744140625,
|
|
|
+ "oAccZ": 1.1376953125
|
|
|
+ },
|
|
|
+ "gyro": {
|
|
|
+ "oGyroX": -46.93603515625,
|
|
|
+ "oGyroY": -1038.87939453125,
|
|
|
+ "oGyroZ": -66.162109375
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ "maxValue": -1.30859375,
|
|
|
+ "gyroValue": -951.2939453125,
|
|
|
+ "resultant": 10.222525689439594,
|
|
|
+ "index": 103,
|
|
|
+ "acc": {
|
|
|
+ "oAccX": 1.23046875,
|
|
|
+ "oAccY": -10.0634765625,
|
|
|
+ "oAccZ": 1.30859375
|
|
|
+ },
|
|
|
+ "gyro": {
|
|
|
+ "oGyroX": -54.0771484375,
|
|
|
+ "oGyroY": -951.2939453125,
|
|
|
+ "oGyroZ": -85.205078125
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ "maxValue": -1.30859375,
|
|
|
+ "gyroValue": -951.2939453125,
|
|
|
+ "resultant": 10.222525689439594,
|
|
|
+ "index": 104,
|
|
|
+ "acc": {
|
|
|
+ "oAccX": 1.23046875,
|
|
|
+ "oAccY": -10.0634765625,
|
|
|
+ "oAccZ": 1.30859375
|
|
|
+ },
|
|
|
+ "gyro": {
|
|
|
+ "oGyroX": -54.0771484375,
|
|
|
+ "oGyroY": -951.2939453125,
|
|
|
+ "oGyroZ": -85.205078125
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ "maxValue": 0,
|
|
|
+ "gyroValue": -890.2587890625,
|
|
|
+ "resultant": 16.96604926042062,
|
|
|
+ "index": 105,
|
|
|
+ "acc": {
|
|
|
+ "oAccX": 4.4384765625,
|
|
|
+ "oAccY": -16.3623046875,
|
|
|
+ "oAccZ": 0.6494140625
|
|
|
+ },
|
|
|
+ "gyro": {
|
|
|
+ "oGyroX": -47.36328125,
|
|
|
+ "oGyroY": -890.2587890625,
|
|
|
+ "oGyroZ": -100.15869140625
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ "maxValue": 0,
|
|
|
+ "gyroValue": -890.2587890625,
|
|
|
+ "resultant": 16.96604926042062,
|
|
|
+ "index": 106,
|
|
|
+ "acc": {
|
|
|
+ "oAccX": 4.4384765625,
|
|
|
+ "oAccY": -16.3623046875,
|
|
|
+ "oAccZ": 0.6494140625
|
|
|
+ },
|
|
|
+ "gyro": {
|
|
|
+ "oGyroX": -47.36328125,
|
|
|
+ "oGyroY": -890.2587890625,
|
|
|
+ "oGyroZ": -100.15869140625
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ "maxValue": 1.6455078125,
|
|
|
+ "gyroValue": -826.47705078125,
|
|
|
+ "resultant": 19.088619035995112,
|
|
|
+ "index": 107,
|
|
|
+ "acc": {
|
|
|
+ "oAccX": 6.8798828125,
|
|
|
+ "oAccY": -17.7294921875,
|
|
|
+ "oAccZ": -1.6455078125
|
|
|
+ },
|
|
|
+ "gyro": {
|
|
|
+ "oGyroX": -32.04345703125,
|
|
|
+ "oGyroY": -826.47705078125,
|
|
|
+ "oGyroZ": -116.2109375
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ "maxValue": 0,
|
|
|
+ "gyroValue": -754.7607421875,
|
|
|
+ "resultant": 12.858333021663745,
|
|
|
+ "index": 108,
|
|
|
+ "acc": {
|
|
|
+ "oAccX": 4.4580078125,
|
|
|
+ "oAccY": -12.060546875,
|
|
|
+ "oAccZ": -0.078125
|
|
|
+ },
|
|
|
+ "gyro": {
|
|
|
+ "oGyroX": -20.751953125,
|
|
|
+ "oGyroY": -754.7607421875,
|
|
|
+ "oGyroZ": -133.544921875
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ "maxValue": 0,
|
|
|
+ "gyroValue": -754.7607421875,
|
|
|
+ "resultant": 12.858333021663745,
|
|
|
+ "index": 109,
|
|
|
+ "acc": {
|
|
|
+ "oAccX": 4.4580078125,
|
|
|
+ "oAccY": -12.060546875,
|
|
|
+ "oAccZ": -0.078125
|
|
|
+ },
|
|
|
+ "gyro": {
|
|
|
+ "oGyroX": -20.751953125,
|
|
|
+ "oGyroY": -754.7607421875,
|
|
|
+ "oGyroZ": -133.544921875
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ "maxValue": 4.0087890625,
|
|
|
+ "gyroValue": -700.1953125,
|
|
|
+ "resultant": 4.438586679567735,
|
|
|
+ "index": 110,
|
|
|
+ "acc": {
|
|
|
+ "oAccX": 1.5869140625,
|
|
|
+ "oAccY": -1.0546875,
|
|
|
+ "oAccZ": -4.0087890625
|
|
|
+ },
|
|
|
+ "gyro": {
|
|
|
+ "oGyroX": -10.43701171875,
|
|
|
+ "oGyroY": -700.1953125,
|
|
|
+ "oGyroZ": -149.35302734375
|
|
|
+ }
|
|
|
+ }];
|
|
|
+ this.onSendSocketMessage(msg);
|
|
|
}
|
|
|
}
|
|
|
};
|