|
|
@@ -40,21 +40,20 @@
|
|
|
{{currentHitStrength}}
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view v-else style="position: relative; width: 100%;" :style="{'opacity': hitStrengthOpacity}">
|
|
|
+ <!-- <view v-else style="position: relative; width: 100%;" :style="{'opacity': hitStrengthOpacity}">
|
|
|
<view style="position: absolute;
|
|
|
left: 0;
|
|
|
top: 0;
|
|
|
bottom: 0;
|
|
|
right: 0;" class="flex justify-center">
|
|
|
<view class="flex justify-center align-center " style="background-color: rgba(0,0,0,0.4); width: 300rpx; height: 90rpx;border-radius: 60rpx;">
|
|
|
- <!-- <image src="/static/modal/boxing-hit/b.png" style="width: 50rpx; height: 50rpx;" mode="aspectFit"></image> -->
|
|
|
<view class="hit-current-count-power">力量</view>
|
|
|
<view class="hit-current-count">
|
|
|
{{currentHitStrength}}
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
+ </view> -->
|
|
|
|
|
|
|
|
|
<view v-if="mode == 'pkMode'" style="height: 110rpx;"></view>
|
|
|
@@ -83,7 +82,8 @@
|
|
|
</view> -->
|
|
|
<!-- <view v-if="mode == 'pkMode'" style="height: 20rpx;"></view> -->
|
|
|
<view v-if="mode == 'pkMode'" style="height: 170rpx;"></view>
|
|
|
- <view v-else style="height: 110rpx;"></view>
|
|
|
+ <!-- <view v-else style="height: 110rpx;"></view> -->
|
|
|
+ <view v-else style="height: 80rpx;"></view>
|
|
|
|
|
|
<view v-if="mode == 'pkMode'" class="hit-vertical-container" :style="{'top': mode == 'pkMode'?'-120rpx':'-300rpx'}">
|
|
|
<view class="hit-vertical-bar">
|
|
|
@@ -103,12 +103,12 @@
|
|
|
<view class="hit-vertical-bar">
|
|
|
<view class="hit-vertical-child" v-for="(item, index) in 25" :key="index">
|
|
|
<view :class="showCount>=index+1? 'hit-vertical-active':'hit-vertical-inactive'"></view>
|
|
|
- <view :class="index%5 == 0?'':'hit-text-hidden'" class="hit-vertical-text">{{index+1}}</view>
|
|
|
+ <view :class="index%5 == 0?'':'hit-text-hidden'" class="hit-vertical-text">{{(index+1)*2}}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="hit-vertical-bar">
|
|
|
<view class="hit-vertical-child" v-for="(item, index) in 25" :key="index">
|
|
|
- <view :class="index%5 == 0?'':'hit-text-hidden'" class="hit-vertical-text">{{index+26}}</view>
|
|
|
+ <view :class="index%5 == 0?'':'hit-text-hidden'" class="hit-vertical-text">{{(index+26)*2}}</view>
|
|
|
<view :class="showCount>=index+26? 'hit-vertical-active':'hit-vertical-inactive'"></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -118,7 +118,7 @@
|
|
|
<!-- <button style="margin-top: 100rpx;" @tap="onTestHit('left')">击中</button> -->
|
|
|
|
|
|
<!-- 显示数据 -->
|
|
|
- <view class="flex justify-around " style="margin: 0rpx 15rpx;">
|
|
|
+ <view v-if="mode == 'pkMode'" class="flex justify-around " style="margin: 0rpx 15rpx;">
|
|
|
<view class="boxing-item-bg">
|
|
|
<image src="/static/modal/boxing-hit/f.png" class="boxing-hit-png " mode="aspectFit"></image>
|
|
|
<view class="text-white text-13px" style="margin: 10rpx 0;">最大力量</view>
|
|
|
@@ -148,7 +148,33 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
+ <view v-else class="flex margin-bottom-sm justify-center align-center">
|
|
|
+ <view class="flex align-center">
|
|
|
+ <view class="flex justify-start flex-direction align-center">
|
|
|
+ <image src="/static/mileageIcon-w.png" class="data-png-26 margin-sm" mode="aspectFit"></image>
|
|
|
+ <text style="text-align: start; line-height: 24px; font-weight: 400;color: #FFFFFF;">里程</text>
|
|
|
+ </view>
|
|
|
+ <view class="flex justify-start flex-direction">
|
|
|
+ <view style="height: 26px;" class="margin-top-sm margin-bottom-sm">
|
|
|
+ <view class="cu-progress" style="height: 6rpx; width: 140rpx; border-radius: 45rpx;"></view>
|
|
|
+ </view>
|
|
|
+ <text style="text-align: start; line-height: 24px; font-weight: 400;color: #FFFFFF;">{{runMileage}}km</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view style="width: 40rpx;"></view>
|
|
|
+ <view class="flex align-center">
|
|
|
+ <view class="flex justify-start flex-direction align-center">
|
|
|
+ <image src="/static/icon-run-normal.png" class="data-png-26 margin-sm" mode="aspectFit"></image>
|
|
|
+ <text style="text-align: start; line-height: 24px; font-weight: 400; color: #FFFFFF;">速度</text>
|
|
|
+ </view>
|
|
|
+ <view class="flex justify-start flex-direction">
|
|
|
+ <view style="height: 26px;" class="margin-top-sm margin-bottom-sm">
|
|
|
+ <view class="cu-progress" style="height: 6rpx; width: 140rpx; border-radius: 45rpx;"></view>
|
|
|
+ </view>
|
|
|
+ <text style="text-align: start; line-height: 24px; font-weight: 400;color: #FFFFFF;">{{runSpeed}}m/s</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
|
|
|
</view>
|
|
|
</template>
|
|
|
@@ -404,7 +430,7 @@
|
|
|
allShowHitCount: 0,
|
|
|
|
|
|
currentHitStrength: 0,
|
|
|
-
|
|
|
+
|
|
|
// testHitInterval: null,
|
|
|
aiHitInterval: null,
|
|
|
//击打时候动画对象
|
|
|
@@ -424,6 +450,13 @@
|
|
|
BLENum: 0,
|
|
|
BLEACX: 0,
|
|
|
BLEACYL: 0,
|
|
|
+
|
|
|
+ /** 跑步参数*/
|
|
|
+ runMileage:0,
|
|
|
+ runSpeed:0,
|
|
|
+ runTempCount:0,
|
|
|
+ runAllTempCount:0,
|
|
|
+ runAllCount:0,
|
|
|
|
|
|
}
|
|
|
},
|
|
|
@@ -472,9 +505,13 @@
|
|
|
} else {
|
|
|
this.averageSpeed = this.tempHitCount;
|
|
|
this.tempHitCount = 0;
|
|
|
+
|
|
|
+ //跑步速度 70cm步长 速度:步长*步数/5秒
|
|
|
+ this.runSpeed = this.runTempCount * 70 / 100;
|
|
|
+ this.runTempCount = 0;
|
|
|
}
|
|
|
|
|
|
- }, 10000)
|
|
|
+ }, 5000)
|
|
|
|
|
|
},
|
|
|
beforeDestroy() {
|
|
|
@@ -529,7 +566,9 @@
|
|
|
if (this.mode == "pkMode") {
|
|
|
this._pkHitOnly(maxPower, maxPower * 10);
|
|
|
} else {
|
|
|
- this._HitOnly(maxPower, maxPower * 10);
|
|
|
+ for(let i=0;i<100;i++){
|
|
|
+ this._HitOnly(maxPower, maxPower * 10);
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
//平时击打的力量槽动画播放
|
|
|
@@ -898,6 +937,7 @@
|
|
|
}
|
|
|
},
|
|
|
//自由模式下的打击
|
|
|
+ //首页现在尝试用于跑步
|
|
|
_HitOnly(acc, power) {
|
|
|
|
|
|
//动画的高度
|
|
|
@@ -911,35 +951,44 @@
|
|
|
|
|
|
this.onPlayPowerAnimation();
|
|
|
|
|
|
- this.allTempHitCount++;
|
|
|
+ // this.allTempHitCount++;
|
|
|
+ this.runAllTempCount++;
|
|
|
this.allShowHitCount++;
|
|
|
this.tempHitCount++;
|
|
|
+
|
|
|
+ this.runTempCount ++;
|
|
|
+
|
|
|
+ this.runAllCount = this.allShowHitCount;
|
|
|
+ //里面转换千米
|
|
|
+ //175公分的bai成人一般两步间距du为70厘米,zhi170公分为65厘米,180公分为75厘米。
|
|
|
+ this.runMileage = this.runAllCount*70 / 100000;
|
|
|
|
|
|
this.currentHitStrength = power;
|
|
|
if (this.maxStrength < power) {
|
|
|
this.maxStrength = power;
|
|
|
}
|
|
|
this.allStrength += power;
|
|
|
-
|
|
|
+
|
|
|
this.averageStrength = (this.allStrength / this.allShowHitCount).toFixed(1);
|
|
|
|
|
|
- //击打次数一个卡路里,就是基础卡路里
|
|
|
- this.calorie = puchConfig.getBoxingCalorie(this.allTempHitCount);
|
|
|
+ //跑步的卡路里,allTempHiCount
|
|
|
+ this.calorie = puchConfig.getRunCalorie(this.runAllTempCount);
|
|
|
//击打的加速度添加的卡路里,是额外计算的卡路里
|
|
|
- this.otherCalorie += puchConfig.getAccCalorie(acc);
|
|
|
- // console.log( puchConfig.getAccCalorie(acc),this.calorie);
|
|
|
- let _all = this.calorie.add(this.otherCalorie);
|
|
|
+ // this.otherCalorie += puchConfig.getAccCalorie(acc);
|
|
|
+ let _all = this.calorie;// this.calorie.add(this.otherCalorie);
|
|
|
|
|
|
- //10 大卡,为一个周期 分50份
|
|
|
- this.powerCount = parseInt(_all * 5);
|
|
|
+ //100 大卡,为一个周期 分50份
|
|
|
+ //现在显示1格子是2大卡,所以 _all要 除去一半
|
|
|
+ this.powerCount = parseInt(_all / 2);
|
|
|
|
|
|
if (this.powerCount >= 50) {
|
|
|
console.log("同步卡路里");
|
|
|
console.log("this.calorie:", this.calorie, this.otherCalorie, _all);
|
|
|
this.$emit('updateCalorie', _all);
|
|
|
- this.allTempHitCount = 0;
|
|
|
+ // this.allTempHitCount = 0;
|
|
|
+ this.runAllTempCount = 0;
|
|
|
this.powerCount = 0;
|
|
|
- this.otherCalorie = 0;
|
|
|
+ // this.otherCalorie = 0;
|
|
|
}
|
|
|
|
|
|
if (!this.wave_d_play) {
|
|
|
@@ -1070,7 +1119,7 @@
|
|
|
let _name = 'pk模式';
|
|
|
if (this.mode == 'pkMode') {
|
|
|
this.mode = 'calorieMode';
|
|
|
- _name = '健身模式';
|
|
|
+ _name = '长跑模式'; //健身模式
|
|
|
} else if (this.mode == 'calorieMode') {
|
|
|
this.mode = 'pkMode';
|
|
|
_name = 'pk模式';
|
|
|
@@ -1084,7 +1133,7 @@
|
|
|
},
|
|
|
//设置一个切换模式
|
|
|
onSetMode(modeValue) {
|
|
|
- console.log("modeValue =====",modeValue);
|
|
|
+ console.log("modeValue =====", modeValue);
|
|
|
//todo 切换模式时候,停止当前运行状态
|
|
|
if (this.bControlRun) {
|
|
|
uni.showToast({
|
|
|
@@ -1102,7 +1151,7 @@
|
|
|
let _name = 'pk模式';
|
|
|
if (modeValue == 'calorieMode') {
|
|
|
this.mode = 'calorieMode';
|
|
|
- _name = '健身模式';
|
|
|
+ _name = '长跑模式';
|
|
|
} else if (modeValue == 'pkMode') {
|
|
|
this.mode = 'pkMode';
|
|
|
_name = 'pk模式';
|
|
|
@@ -1353,4 +1402,9 @@
|
|
|
.big {
|
|
|
transform: scale(1.2);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ /* .progress-bar-container{
|
|
|
+
|
|
|
+ } */
|
|
|
</style>
|