瀏覽代碼

1.在首页添加一个测试vConsole,修改判断跳的版本。
2.修复注册计划跳不过问题。改为switchTab。
3.添加一个校准的默认值。默认最新设备。

slambb 4 年之前
父節點
當前提交
a207f0a761

+ 19 - 12
components/modal/action-jump/action-jump.vue

@@ -101,7 +101,7 @@
 </template>
 
 <script>
-	import ActionJump from "@/util/util-js/action/jump.js"
+	import ActionJump from "@/util/util-js/action/jump-0.1.js"
 	import {
 		CONDITIONPASSED
 	} from "@/util/util-js/enum.js"
@@ -262,7 +262,9 @@
 				/**
 				 * 是否去到下一个关卡
 				 */
-				canGoNext: false
+				canGoNext: false,
+				
+				onLogData:'',
 			}
 		},
 		watch: {
@@ -296,10 +298,12 @@
 			this.canvasW = this.SystemInfo.windowWidth; // 画布宽度
 			this.canvasH = 114;
 			this.onLoadImage();
+			
+			setTimeout(()=>{
+				this.onListenActionJump();
+			},2000)
 
-			this.onListenActionJump();
-
-			console.log('==========>1 action jump currentMode:', this.currentMode);
+			// console.log('==========>1 action jump currentMode:', this.currentMode);
 		},
 		methods: {
 			...mapMutations(['onWriteBLEConnectionValue', 'onConvertDeviceData']),
@@ -819,7 +823,8 @@
 				});
 				this.$emit('gameOver', {
 					myWin: myWin,
-					type: 'calorieMode'
+					type: 'calorieMode',
+					isOffEvent:true
 				});
 			},
 			//pk模式下结束游戏关卡
@@ -831,7 +836,8 @@
 				this.bJumpPlay = false;
 
 				this.$emit('gameOver', {
-					type: 'pkMode'
+					type: 'pkMode',
+					isOffEvent:true
 				});
 			},
 			setFaultCount(value) {
@@ -935,9 +941,11 @@
 					peakOfWaveMaxValue,
 					valleyOfWaveMinValue
 				} = data
-				console.log('stateDataOfJump:', JSON.stringify(data));
-				let _rotateLimit = 10;
-				let _jumpLimit = 10;
+				// console.log('stateDataOfJump:');
+				// console.log(JSON.stringify(data));
+				this.onLogData = data;
+				let _rotateLimit = 4;
+				let _jumpLimit = 8;
 				
 				switch (_jumpType) {
 					case 0:
@@ -1022,11 +1030,10 @@
 				//如果消除完,需要重新生成
 				let _temp = this.spawnArray[this.index];
 				let bSuccess = false;
-				// console.log(JSON.stringify(_tempState));
 				for (let i = 0; i < _tempState.length; i++) {
 					let _state = _tempState[i];
 					if (_state.bTrigger)
-						console.log(JSON.stringify(_state));
+						console.log(JSON.stringify(_state)+JSON.stringify(this.onLogData));
 					//如果当前的跳类型和预制目标一样
 					if (_state.jumpCode == _temp.jumpCode && _state.bTrigger) {
 						//成功

+ 17 - 1
main.js

@@ -1,6 +1,22 @@
 import Vue from 'vue'
 import App from './App'
 
+var getStackTrace = function() {
+	var obj = {};
+	Error.captureStackTrace(obj, getStackTrace);
+	return obj.stack;
+};
+
+console.oldLog = console.log;
+console.log = function(str) {
+	uni.$emit("onLog", str);
+	//这里可以操作给服务器
+	console.oldLog(str);
+}
+
+
+
+
 import store from './util/util-js/store.js'
 import testWebSocket from './util/util-js/webSocket.js'
 
@@ -16,6 +32,6 @@ App.mpType = 'app'
 
 const app = new Vue({
 	store,
-    ...App
+	...App
 })
 app.$mount()

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
     "name" : "哔蹦",
     "appid" : "__UNI__2635DF5",
     "description" : "",
-    "versionName" : "2.3.14",
-    "versionCode" : 21042302,
+    "versionName" : "2.4.10",
+    "versionCode" : 21091002,
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {

+ 2 - 2
pages/my-page/firstPlan/firstPlan.vue

@@ -299,7 +299,7 @@
 								// console.log("updateArcbarData==setTimeout");
 								that.addlocalCalorie(0);
 								
-								uni.redirectTo({
+								uni.switchTab({
 									url: "../../personal-page/personal/personal"
 								})
 							}, 500);
@@ -331,7 +331,7 @@
 			},
 			
 			onSkip(){
-				uni.redirectTo({
+				uni.switchTab({
 					url: "../../personal-page/personal/personal"
 				})
 			}

+ 8 - 8
pages/personal-page/directionOfDetection/directionOfDetection.vue

@@ -246,24 +246,24 @@
 						name,
 						value
 					} = this.onMatchAccData();
-					this.convertAcc[1].match = name;
-					this.convertAcc[1].direction = value > 0 ? 1 : -1;
+					this.$store.state.convertAcc[1].match = name;
+					this.$store.state.convertAcc[1].direction = value > 0 ? 1 : -1;
 				} else if (1 === index) {
 					//校准z轴方向
 					let {
 						name,
 						value
 					} = this.onMatchAccData();
-					this.convertAcc[2].match = name;
-					this.convertAcc[2].direction = value > 0 ? 1 : -1;
+					this.$store.state.convertAcc[2].match = name;
+					this.$store.state.convertAcc[2].direction = value > 0 ? 1 : -1;
 				} else if (2 === index) {
 					//校准x轴方向
 					let {
 						name,
 						value
 					} = this.onMatchAccData();
-					this.convertAcc[0].match = name;
-					this.convertAcc[0].direction = value > 0 ? 1 : -1;
+					this.$store.state.convertAcc[0].match = name;
+					this.$store.state.convertAcc[0].direction = value > 0 ? 1 : -1;
 				}
 				this.updateTaskScroll();
 			},
@@ -361,9 +361,9 @@
 						currentMaxGyro = currentGyroZValue;
 					}
 					//定y为旋转轴,即 convertGyro 下标 1
-					this.convertGyro[1].match = _data.name;
+					this.$store.state.convertGyro[1].match = _data.name;
 					//以左旋转为校准轴,如果当前左旋值大于0.即设置direction -1;
-					this.convertGyro[1].direction = _data.value > 0 ? -1 : 1;
+					this.$store.state.convertGyro[1].direction = _data.value > 0 ? -1 : 1;
 					
 					console.log('convertGyro=',JSON.stringify(_data))
 					uni.showToast({

+ 53 - 23
pages/personal-page/personal/personal.vue

@@ -2,8 +2,7 @@
 	<view class="bg-person " :class="bEFHitShake?' screen-jitter ':''">
 		<!-- :title="title" @clickRight="onNavAppInfo() title="PK模式"" -->
 		<!-- 自定义导航栏 backgroundColor="rgba(164, 136, 220, 1)"  @clickRight="onSyncData" @clickRight="onTestShare"-->
-		<uni-nav-bar id="nav-bar" status-bar="true" backgroundColor="rgba(153, 150, 252, 255)"
-			<!-- #ifdef APP-PLUS -->
+		<uni-nav-bar id="nav-bar" status-bar="true" backgroundColor="rgba(153, 150, 252, 255)" <!-- #ifdef APP-PLUS -->
 			@clickLeft="showDrawer()"
 			<!-- #endif -->
 			<!-- #ifdef H5 || MP-WEIXIN -->
@@ -268,7 +267,7 @@
 				<button @click="onGetBluetoothConnectView()">显示 bluetoothConnect</button>
 			</view>
  -->
- 
+
 			<view class="example" style="margin-top: 10rpx;">
 				<button @click="onNavToDirection">跳转校准页面</button>
 			</view>
@@ -506,11 +505,34 @@
 
 			</view>
 		</view>
-
-
+		
+		<!-- 这里vConsole 是为了解决再页面内显示vconsole -->
+		<view id="vconsole" :prop="vLog" :change:prop="vconsole.updateData"></view>
 	</view>
 </template>
 
+<!-- 这里vConsole 是为了解决再页面内显示vconsole -->
+<script module="vconsole" lang="renderjs">
+	import VConsole from '../../../util/util-js/vconsole.min.js'
+	new VConsole();
+	export default {
+		mounted() {
+			// ...
+		},
+		data: {
+			return () {}
+		},
+		methods: {
+			updateData(newValue, oldValue, ownerInstance, instance) {
+				// newValue: 新数据
+				// oldValue: 老数据
+				var log = console.log.bind(console);
+				log(newValue)
+			}
+		}
+	}
+</script>
+
 <script>
 	// import uniNavBar from '@/components/uni-nav-bar/uni-nav-bar.vue';
 	import uCharts from '@/components/u-charts/u-charts.js';
@@ -771,6 +793,7 @@
 				 * 任务参数
 				 */
 				modalHeight: 300,
+				vLog: ''
 
 			};
 		},
@@ -891,6 +914,10 @@
 
 			//用户签到列表
 			this.getSignInList();
+
+
+			uni.$on("onLog", this.onLog);
+
 		},
 		onShow() {
 			_self.bHide = false;
@@ -947,7 +974,6 @@
 			// 		})
 			// 	}
 			// }
-
 		},
 		onReady() {
 			// 计算屏幕剩余高度  填补剩余高度
@@ -977,6 +1003,8 @@
 		},
 		onUnload() {
 			console.log("personal ********* onUnload *********");
+			uni.$off("onLog", this.onLog);
+
 			// #ifndef APP-PLUS||H5
 			//监听
 			console.log('移除监听');
@@ -1023,6 +1051,9 @@
 			BasicsSteps() {
 				this.basics = this.basics == this.basicsList.length - 1 ? 0 : this.basics + 1
 			},
+			onLog(value) {
+				this.vLog = value;
+			},
 			onKeyDown(e) {
 				console.log(e);
 			},
@@ -1871,11 +1902,8 @@
 							}
 
 						}
-
 						//监听蓝牙回调
 						uni.$on('updateBLEDeviceData', this.callbackUpdateBLEData);
-
-
 						this.onBoxingGuideFinish();
 					}
 
@@ -1889,7 +1917,6 @@
 					}
 					//监听蓝牙回调
 					uni.$on('updateBLEDeviceData', this.callbackUpdateBLEData);
-
 					//调用开始
 					this.onActionJumpPlay();
 				}
@@ -2143,18 +2170,17 @@
 				if (bFinish) {
 					if (this.ConnectBindingDevice) {
 						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;
-
 						} else if (1 === this.currentModeIndex) {
 							//todo actionJump
 							if (this.currentMode == "calorieMode") {
@@ -2163,13 +2189,7 @@
 								this.$refs.actionJumpRef.onPKModeGameOver("none");
 							}
 						}
-						//停止蓝牙加速计
-						this.onWriteBLEConnectionValue({
-							value: "4"
-						});
-
 					}
-					uni.$off('updateBLEDeviceData', this.callbackUpdateBLEData);
 					if (1 === this.currentModeIndex) {
 						if (this.currentMode == "calorieMode") {
 							this.syncRequestEvent({
@@ -2198,12 +2218,7 @@
 							this.arcbarCountDownPlay(false);
 						}
 					}
-					// if (this.BLEConnectDevice.usageMode == "ropeSkipping") {
-
-					// } else {
-					// }
 				}
-
 			},
 
 			/**
@@ -2414,6 +2429,8 @@
 				this.$refs.hitEffectRef.onStop();
 
 				this.onActionPause(true);
+				//拳击柱部分
+				uni.$off('updateBLEDeviceData', this.callbackUpdateBLEData);
 
 				let _title = res.myWin ? "胜利" : "失败";
 				let _context = res.myWin ? "你已经赢得PK胜利!" : "你在PK中被打败了!";
@@ -2667,6 +2684,19 @@
 				console.log('onSetActionJumpData', JSON.stringify(this.AJData), JSON.stringify(_item));
 			},
 			onActionJumpGameOver(data) {
+				let {
+					isOffEvent = false
+				} = data;
+				if (isOffEvent) {
+					//停止蓝牙加速计
+					this.onWriteBLEConnectionValue({
+						value: "4"
+					});
+					uni.$off('updateBLEDeviceData', this.callbackUpdateBLEData);
+					console.log('onActionJumpGameOver 任务结束');
+				}
+
+
 				//游戏结束,重置时间
 				this.arcbarCountDownTimeReset();
 				//todo 可能区分 levelJump 关卡类型

+ 2 - 1
pages/personal-page/plan/plan.vue

@@ -315,7 +315,8 @@
 								// console.log("updateArcbarData==setTimeout");
 								that.addlocalCalorie(0);
 								// uni.$emit('updateArcbarData', 'plan');
-								uni.navigateBack();
+								//todo 首页不需要back
+								// uni.navigateBack();
 							}, 500);
 						}
 					},

+ 375 - 0
util/util-js/action/jump-0.1.js

@@ -0,0 +1,375 @@
+/**
+ * 跳判断相关脚本代码
+ */
+
+function Event() {
+	this.events = {};
+}
+Event.prototype.addEventListener = function (type, listener) {
+	this.events[type] = this.events[type] || [];
+	this.events[type].push(listener);
+};
+Event.prototype.trigger = function () {
+	for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
+		args[_key] = arguments[_key];
+	}
+
+	var type = args[0];
+	var params = args.slice(1);
+	if (!!this.events[type]) {
+		// console.log("type:",type);
+		this.events[type].forEach(function (listener) {
+			try {
+				listener.apply(null, params);
+			} catch (e) {
+				console.error(e);
+			}
+		});
+	}
+};
+var jumpOpts = {
+	//是否上升的标志位
+	isDirectionUp: false,
+	//持续上升次数
+	continueUpCount: 0,
+	//上一点的持续上升的次数,为了记录波峰的上升次数
+	continueUpFormerCount: 0,
+
+	continueDownCount: 0,
+	continueDownFormerCount: 0,
+
+	//上一点的状态,上升还是下降
+	lastStatus: false,
+	//波峰值
+	peakOfWave: 0,
+	//波谷值
+	valleyOfWave: 0,
+	//检测到极快的波动的次数
+	timeOfPeakCount: 0,
+	//开始添加
+	bUpdateTimeOfPeakCount: false,
+	//开始更新的次数
+	startCount: 0,
+	//停止跳
+	bStopJump: false,
+	//上次传感器的值
+	gravityOld: 0,
+
+	bUpState: false,
+}
+var ActionJump = function ActionJump() {
+
+	this.jumpOpts = jumpOpts;
+	//其他波峰波谷参数相关数组记录
+	this.peakOfWaveArray = [];
+	this.peakOfWaveMaxValue = 0;
+	this.valleyOfWaveArray = [];
+	this.valleyOfWaveMinValue = 0;
+
+	this.peakOfWaveArrayValue = [];
+	this.valleyOfWaveArrayValue = [];
+
+	this.peakOfWaveArrayValueLinear = [];
+	this.valleyOfWaveArrayValueLinear = [];
+
+
+	this.highestCount = 0;
+	//陀螺仪
+	this.oriGyroYArray = [];
+
+	this.isJumpTop = false;
+
+	this.event = new Event();
+
+
+	this.frameCapacity = 6;
+	this.frame = [];
+	this.frameLength = 5;
+	this.frameOffset = 0;
+
+	this.frameHitCapacity = 11;
+	this.frameHit = [];//打击后的n帧
+
+	for (var i = 0; i < this.frameCapacity; ++i) {
+		var o = new Object();
+		// o.acc = [0, 0, 0];
+		// o.gyr = [0, 0, 0];
+		o.resultant = 0;
+		this.frame.push(o);
+	}
+
+
+}
+ActionJump.prototype.addEventListener = function (type, listener) {
+	this.event.addEventListener(type, listener);
+};
+
+
+ActionJump.prototype.updateJump = function () {
+	let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+	//使用三个轴的数据,计算重力轴的加速度。最后减去重力的加速度值
+	//********加速计********
+	let {
+		lAccX,
+		lAccY,
+		lAccZ
+	} = data.linearAcc;
+	let {
+		oAccX,
+		oAccY,
+		oAccZ
+	} = data.oriAcc;
+	let {
+		oGyroX,
+		oGyroY,
+		oGyroZ
+	} = data.oriGyro;
+	let {
+		bYAxis
+	} = data;
+	let _tempAxisData = bYAxis ? oGyroY : oGyroX;
+	this.detectorNewStep(data.resultant, lAccX, lAccY, lAccZ, oAccX, oAccY, oAccZ, data.runIndex, _tempAxisData);
+};
+
+
+
+/*
+ * 检测步子,并开始计步
+ * 1.传入数据
+ * 2.如果检测到了波峰,并且符合时间差以及阈值的条件,则判定为1步
+ * 3.符合时间差条件,波峰波谷差值大于initialValue,则将该差值纳入阈值的计算中
+ * */
+ActionJump.prototype.detectorNewStep = function (resultant, linearX, linearY, linearZ, oriX, oriY, oriZ, _runIndex,
+	_oGyroY) {
+	let _judgmentValue = oriZ;
+	// if (this.jumpOpts.gravityOld == 0) {
+	// 	this.jumpOpts.gravityOld = _judgmentValue;
+	// } else {
+	if (!this.jumpOpts.bStopJump) {
+		// let {
+		// 	bState,
+		// 	bType,
+		// 	value
+		// } = this.detectorPeakOfWaveAndValleyOfWave(_judgmentValue, this.jumpOpts.gravityOld);
+		// let lastFrame = this.frame[(this.frameOffset + this.frameLength - 1) % this.frameCapacity];
+		// let last2Frame = this.frame[(this.frameOffset + this.frameLength - 2) % this.frameCapacity];
+		// let last3Frame = this.frame[(this.frameOffset + this.frameLength - 3) % this.frameCapacity];
+		// let last4Frame = this.frame[(this.frameOffset + this.frameLength - 4) % this.frameCapacity];
+		// let last5Frame = this.frame[(this.frameOffset + this.frameLength - 5) % this.frameCapacity];
+		let newFrame = this.frame[(this.frameOffset + this.frameLength) % this.frameCapacity];
+		newFrame.resultant = resultant;
+
+		if (resultant > 20 && !this.jumpOpts.bUpState) {
+			this.jumpOpts.bUpState = true;
+			this.isJumpTop = false;
+			this.highestCount = 0;
+			//陀螺仪部分
+			this.oriGyroYArray = [];
+			this.peakOfWaveArrayValue = [];
+			this.valleyOfWaveArrayValue = [];
+			this.peakOfWaveArrayValueLinear = [];
+			this.valleyOfWaveArrayValueLinear = [];
+
+			this.jumpOpts.startCount = 0;
+
+			console.log("开始:", JSON.stringify(this.frame), '当前:', resultant);
+
+		}
+		if (this.jumpOpts.bUpState) {
+
+			if (_judgmentValue > 2) {
+				if (_judgmentValue > this.peakOfWaveMaxValue)
+					this.peakOfWaveMaxValue += _judgmentValue;
+				this.peakOfWaveArrayValue.push(_judgmentValue);
+
+			}
+			else if (_judgmentValue < -2) {
+				if (_judgmentValue < this.valleyOfWaveMinValue)
+					this.valleyOfWaveMinValue += _judgmentValue;
+				this.valleyOfWaveArrayValue.push(_judgmentValue);
+
+			}
+			if (linearZ > 2)
+				this.peakOfWaveArrayValueLinear.push(linearZ);
+			else if (linearZ < -2)
+				this.valleyOfWaveArrayValueLinear.push(linearZ);
+
+			if (Math.abs(_oGyroY) > 10)
+				this.oriGyroYArray.push(_oGyroY);
+			//出现极值后
+			// Math.abs(linearZ) < 7 &&
+			if (Math.abs(resultant) < 9.8) {
+				console.log('出现极值后:', linearZ, resultant);
+				// this.isJumpTop = true;
+				this.highestCount++;
+				if (this.highestCount >= 1) {
+					//达到最高点,
+					this.jumpOpts.bStopJump = true;
+					this.jumpOpts.bUpdateTimeOfPeakCount = true;
+					// this.isJumpTop = false;
+
+					let _currentMaxValue = 0;
+					// console.log("highestCount peakOfWaveArray", JSON.stringify(this.peakOfWaveArray));
+					// console.log("highestCount valleyOfWaveArray", JSON.stringify(this.valleyOfWaveArray));
+
+					let allPeakOfWave = 0;
+					for (let i = 0; i < this.peakOfWaveArrayValue.length; i++) {
+						allPeakOfWave += this.peakOfWaveArrayValue[i];
+					}
+
+					let allValleyOfWave = 0;
+					for (let i = 0; i < this.valleyOfWaveArrayValue.length; i++) {
+						allValleyOfWave += this.valleyOfWaveArrayValue[i];
+					}
+
+					let allPeakOfWaveLinear = 0;
+					for (let i = 0; i < this.peakOfWaveArrayValueLinear.length; i++) {
+						allPeakOfWaveLinear += this.peakOfWaveArrayValueLinear[i];
+					}
+
+					let allValleyOfWaveLinear = 0;
+					for (let i = 0; i < this.valleyOfWaveArrayValueLinear.length; i++) {
+						allValleyOfWaveLinear += this.valleyOfWaveArrayValueLinear[i];
+					}
+
+					// console.log("highestCount peakOfWaveArrayValue", JSON.stringify(this.peakOfWaveArrayValue));
+					// console.log("highestCount valleyOfWaveArrayValue", JSON.stringify(this.valleyOfWaveArrayValue));
+					console.log("ori总值 peak:", allPeakOfWave, " valley:", allValleyOfWave);
+					console.log("linear总值 peak:", allPeakOfWaveLinear, " valley:", allValleyOfWaveLinear);
+					// console.log("达到最高点时候数值 Max:", this.peakOfWaveMaxValue, " min:", this.valleyOfWaveMinValue);
+					//(Math.abs(this.peakOfWaveMaxValue) > 5 && Math.abs(this.valleyOfWaveMinValue) - Math
+					//  .abs(this.peakOfWaveMaxValue) < 10) ||
+					if (Math.abs(this.peakOfWaveMaxValue) > Math.abs(this.valleyOfWaveMinValue)) {
+						_currentMaxValue = this.peakOfWaveMaxValue;
+					} else {
+						_currentMaxValue = this.valleyOfWaveMinValue;
+					}
+
+					let allOGyroValue = 0;
+					for (let i = 0; i < this.oriGyroYArray.length; i++) {
+						allOGyroValue += this.oriGyroYArray[i];
+					}
+					allOGyroValue /= this.oriGyroYArray.length;
+
+					this.event.trigger('resultant', {
+						type: "jump",
+						acc: _currentMaxValue,
+						value: resultant
+					});
+
+					this.event.trigger('resultant', {
+						type: "curAngle",
+						value: _currentMaxValue,
+						resultant: resultant
+					});
+
+					this.event.trigger('resultant', {
+						type: "rotate",
+						value: allOGyroValue,
+						resultant: resultant
+					});
+					//后面通用使用这个类型传输数据
+					this.event.trigger('resultant', {
+						type: "stateDataOfJump",
+						currentMaxValue: _currentMaxValue,
+						peakOfWaveMaxValue: this.peakOfWaveMaxValue,
+						valleyOfWaveMinValue: this.valleyOfWaveMinValue,
+						oGyroValue: allOGyroValue,
+						resultant: resultant,
+						name: "highestCountEnd"
+					});
+					this.jumpOpts.bUpState = false;
+				}
+
+			}
+		}
+
+
+		if ((this.frameOffset += 1) >= this.frameCapacity) {
+			this.frameOffset -= this.frameCapacity;
+		}
+	} else if (this.jumpOpts.bUpdateTimeOfPeakCount) {
+		this.jumpOpts.timeOfPeakCount++;
+		//todo 如果直跳,可以调节更小的 limitTimeOfPeakCount
+		let limitTimeOfPeakCount = 40;
+		if (this.jumpOpts.timeOfPeakCount >= limitTimeOfPeakCount) {
+			this.jumpOpts.timeOfPeakCount = 0;
+			this.jumpOpts.bStopJump = false;
+			this.event.trigger('resultant', {
+				type: "stop"
+			});
+			console.log("timeOfPeakCount >= " + limitTimeOfPeakCount);
+			this.resetAll();
+			this.jumpOpts.bUpdateTimeOfPeakCount = false;
+		}
+	}
+	this.event.trigger('resultant', {
+		type: "bUpdateDraw",
+		linearX: linearX,
+		linearZ: linearZ,
+		linearY: linearY,
+		oriX: oriX,
+		oriY: oriY,
+		oriZ: oriZ
+	});
+}
+
+
+ActionJump.prototype.detectorPeakOfWaveAndValleyOfWave = function (newValue, oldValue) {
+	this.jumpOpts.lastStatus = this.jumpOpts.isDirectionUp;
+	if (newValue >= oldValue) {
+		this.jumpOpts.continueDownFormerCount = this.jumpOpts.continueDownCount;
+		this.jumpOpts.continueDownCount = 0;
+		this.jumpOpts.isDirectionUp = true;
+		this.jumpOpts.continueUpCount++;
+	} else {
+		this.jumpOpts.continueUpFormerCount = this.jumpOpts.continueUpCount;
+		this.jumpOpts.continueUpCount = 0;
+		this.jumpOpts.isDirectionUp = false;
+		this.jumpOpts.continueDownCount++;
+	}
+	if (!this.jumpOpts.isDirectionUp && this.jumpOpts.lastStatus && this.jumpOpts.continueUpFormerCount >= 2 && Math
+		.abs(oldValue) > 4) {
+		this.jumpOpts.peakOfWave = oldValue;
+		return {
+			value: oldValue,
+			bType: 'peakOfWave',
+			bState: true
+		};
+	} else if (!this.jumpOpts.lastStatus && this.jumpOpts.isDirectionUp && this.jumpOpts.continueDownFormerCount >=
+		2 && Math.abs(oldValue) > 4) {
+		this.jumpOpts.valleyOfWave = oldValue;
+		return {
+			value: oldValue,
+			bType: 'valleyOfWave',
+			bState: true
+		};
+	} else {
+		return {
+			value: oldValue,
+			bType: 'None',
+			bState: false
+		};
+	}
+}
+//重置对应的参数
+ActionJump.prototype.resetAll = function () {
+	// console.log('******************* resetAll ******************');
+	this.peakOfWaveArray = [];
+	this.peakOfWaveMaxValue = 0;
+	this.valleyOfWaveArray = [];
+	this.valleyOfWaveMinValue = 0;
+	this.highestCount = 0;
+
+
+	this.jumpOpts.continueDownFormerCount = 0;
+	this.jumpOpts.continueDownCount = 0;
+	this.jumpOpts.continueUpFormerCount = 0;
+	this.jumpOpts.continueUpCount = 0;
+
+	// this.jumpOpts.gravityOld = 0;
+}
+
+if (typeof module === "object" && typeof module.exports === "object") {
+	module.exports = ActionJump;
+}

+ 3 - 3
util/util-js/action/jump.js

@@ -225,9 +225,9 @@ ActionJump.prototype.detectorNewStep = function(resultant, linearX, linearY, lin
 						// this.isJumpTop = false;
 
 						let _currentMaxValue = 0;
-						console.log("highestCount peakOfWaveArray", JSON.stringify(this.peakOfWaveArray));
-						console.log("highestCount valleyOfWaveArray", JSON.stringify(this.valleyOfWaveArray));
-						console.log("达到最高点时候数值 Max:", this.peakOfWaveMaxValue, " min:", this.valleyOfWaveMinValue);
+						// console.log("highestCount peakOfWaveArray", JSON.stringify(this.peakOfWaveArray));
+						// console.log("highestCount valleyOfWaveArray", JSON.stringify(this.valleyOfWaveArray));
+						// console.log("达到最高点时候数值 Max:", this.peakOfWaveMaxValue, " min:", this.valleyOfWaveMinValue);
 						//(Math.abs(this.peakOfWaveMaxValue) > 5 && Math.abs(this.valleyOfWaveMinValue) - Math
 						//  .abs(this.peakOfWaveMaxValue) < 10) ||
 						if (Math.abs(this.peakOfWaveMaxValue) > Math.abs(this.valleyOfWaveMinValue)) {

+ 5 - 4
util/util-js/store.js

@@ -16,6 +16,7 @@ Vue.use(Vuex)
 
 const store = new Vuex.Store({
 	state: {
+		// vLog:'',
 		//引导层
 		bGuidePages: false,
 
@@ -364,11 +365,11 @@ const store = new Vuex.Store({
 		}, {
 			type: 'y',
 			match: 'ay',
-			direction: 1,
+			direction: -1,
 		}, {
 			type: 'z',
 			match: 'az',
-			direction: 1,
+			direction: -1,
 		}],
 		convertGyro: [{
 			type: 'x',
@@ -445,11 +446,11 @@ const store = new Vuex.Store({
 			}, {
 				type: 'y',
 				match: 'ay',
-				direction: 1,
+				direction: -1,
 			}, {
 				type: 'z',
 				match: 'az',
-				direction: 1,
+				direction: -1,
 			}];
 			state.convertGyro = [{
 				type: 'x',

文件差異過大導致無法顯示
+ 9 - 0
util/util-js/vconsole.min.js


部分文件因文件數量過多而無法顯示