瀏覽代碼

2.3.2 21022601版本
1.修改首页连接普通模式时候,现在跑步模式

slambb 5 年之前
父節點
當前提交
cba8b8625e

+ 1 - 1
common/config.js

@@ -1,7 +1,7 @@
 //设置游戏列表的更新时间,超过这个时间,不显示出来
 //"2020-07-14"
 //************* ios 注意此时间设置,目前设置2021-01-24,暂时用于处理游戏显示 *************
-const endTime = "2021-02-24"
+const endTime = "2021-02-26"
 
 
 //线上地址,腾讯云服务器

+ 2 - 1
components/code-elf-guide/code-elf-guide.vue

@@ -111,7 +111,8 @@
 							
 							<view style="position: relative;" >
 								<image style="position: relative; width: 400rpx;height: 170rpx;" src="/static/guide/boxingHitMid.png"></image>
-								<view style="position: absolute;top: 70rpx; left: 45rpx;right:35rpx; color: #000;">打击拳击柱越快或力量越大力量条会越快增长哦!</view>
+								<!-- 打击拳击柱越快或力量越大力量条会越快增长哦! -->
+								<view style="position: absolute;top: 70rpx; left: 45rpx;right:35rpx; color: #000;">跑的越快速度条会增长越快哦!</view>
 							</view>
 						</view>
 						<view class="guide-vertical-bar">

+ 79 - 25
components/modal/boxing-hit/boxing-hit.vue

@@ -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>

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
     "name" : "哔蹦",
     "appid" : "__UNI__2635DF5",
     "description" : "",
-    "versionName" : "2.3.0",
-    "versionCode" : 21022503,
+    "versionName" : "2.3.2",
+    "versionCode" : 21022601,
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {

+ 6 - 1
util/util-js/puchConfig.js

@@ -28,6 +28,10 @@ const getAccCalorie = function(acc) {
 	
 	return acc/5*0.015625;
 }
+//一步72厘米,已 6 公里消耗 470 大卡计算,一步出来 约是 55 卡路里
+const getRunCalorie = function(runCount){
+	return runCount * 0.055; //单位大卡
+}
 
 
 export default {
@@ -35,6 +39,7 @@ export default {
 	ANGLE_RATIO,
 	SENDITIVITY,
 	getBoxingCalorie,
-	getAccCalorie
+	getAccCalorie,
+	getRunCalorie
 	// calculation
 }