Przeglądaj źródła

1.修改首页动画状态
2.修复部分bug

slambb 3 lat temu
rodzic
commit
e878e017dc

+ 548 - 124
components/modal/action-jump/action-jump.vue

@@ -12,7 +12,7 @@
 						</view>
 						<view :class="(index%5 == 0||index == 1)?'':'grid-progress-text-hidden'"
 							class="grid-progress-vertical-text" style="position: absolute;right: 0;top: -4px;">
-							{{Math.floor(taskSignCount / 40 * index)}}
+							{{Math.floor(taskSignCount / 26 * index)}}
 						</view>
 					</view>
 				</view>
@@ -21,20 +21,44 @@
 						v-if="index!==0">
 						<view :class="(index%5 == 0||index == 1)?'':'grid-progress-text-hidden'"
 							class="grid-progress-vertical-text" style="position: absolute;left: 0;top: -4px;">
-							{{Math.floor(taskSignCount / 40 * index)+taskSignCount/2}}
+							{{Math.floor(taskSignCount / 26 * index)+taskSignCount/2}}
 						</view>
 						<!-- 设置空位 -->
 						<view></view>
 						<view
-							:class="showCurCount>=index+20? 'grid-progress-vertical-active':'grid-progress-vertical-inactive'">
+							:class="showCurCount>=index+13? 'grid-progress-vertical-active':'grid-progress-vertical-inactive'">
 						</view>
 					</view>
 				</view>
 			</view>
 		</view>
 		<view class="position-relative">
-			<image class="position-absolute-left-top" style="width: 86.12px;height:55.96px; left: 146rpx;top:-100rpx;"
-				src="../../../static/modal/action-jump/progress-tip-add.png"></image>
+			<!-- <image class="position-absolute-left-top" style="width: 86.12px;height:55.96px; left: 146rpx;top:-100rpx;"
+				src="../../../static/modal/action-jump/progress-tip-add.png"></image> -->
+			<view class="position-absolute-left-top flex justify-center align-center " style="width: 86.12px;height:55.96px; 
+			left: 146rpx;top:-90rpx; ">
+				<view style="transform: scale(0.5);">
+					<view class="sprite-yellow-arrow " :class="bRuning?'animation-play-state-play':''"></view>
+				</view>
+			</view>
+			<view class="position-absolute-right-bottom flex justify-center align-center "
+				style="width: 317rpx; height:138px; right: 46rpx; bottom: 15rpx;">
+				<view class="flex  flex-direction justify-between" style="transform: scale(0.5);  height: 276px; ">
+					<block v-if="bJumpPlay">
+						<view class="sprite-rightToLeftArrow" :class="bJumpPlay?'sprite-rightToLeftArrow-play':''">
+						</view>
+						<view class="sprite-rightToLeftArrow" :class="bJumpPlay?'sprite-rightToLeftArrow-play':''">
+						</view>
+					</block>
+					<block v-else>
+						<image style="width: 317px; height: 42px;"
+							src="../../../static/modal/action-jump/progress-tip.png"></image>
+						<image style="width: 317px; height: 42px;"
+							src="../../../static/modal/action-jump/progress-tip.png"></image>
+					</block>
+
+				</view>
+			</view>
 			<canvas canvas-id="actionJumpCanvas" :style="{ width: canvasW + 'px', height: canvasH + 'px' }"></canvas>
 			<canvas class="position-absolute-center" canvas-id="effectCanvas"
 				:style="{ width: canvasW + 'px', height: '164px' }"></canvas>
@@ -48,7 +72,7 @@
 							src="../../../static/modal/action-jump/jumpSpeed.png"></image>
 						<view style="margin-left: 6rpx;">平均速度</view>
 					</view>
-					<view style="margin-top: 12rpx;">{{jumpSpeed}}</view>
+					<view style="margin-top: 12rpx;">{{averageSpeed}}</view>
 				</view>
 			</view>
 			<view id="ActionJumpPlay" class="flex" style="position: relative;" @click="onControllerPlay">
@@ -72,12 +96,12 @@
 							src="../../../static/modal/action-jump/jumpCalorie.png"></image>
 						<view style="margin-left: 6rpx;">卡路里</view>
 					</view>
-					<view style="margin-top: 12rpx;">{{jumpCalorie}}</view>
+					<view style="margin-top: 12rpx;">{{Math.floor(jumpCalorie)}}</view>
 				</view>
 			</view>
 		</view>
 
-		<view class="flex align-center justify-center" style="width: 750rpx;">
+		<view class="flex align-center justify-center" style="width: 750rpx;margin-top: 16rpx;">
 			<view class="flex justify-center align-center" style="height: 120rpx; width: 444rpx; ">
 				<view class="text-12px text-white text-center">
 					{{taskDescribe}}
@@ -122,6 +146,8 @@
 	} from "@/util/util-js/enum.js"
 
 	import Firework from "@/util/util-js/effect/firework.js"
+	import Animation from "@/util/util-js/Animation.js"
+	import puchConfig from "@/util/util-js/puchConfig.js"
 
 	import {
 		mapState,
@@ -154,18 +180,23 @@
 				canvasH: 0, // 画布高
 				// SystemInfo: {}, // 设备信息
 
-				directionJump: null,
+				directionJumpRight: null,
+				directionJumpLeft: null,
 				midJump: null,
-				rotateJump: null,
-				directionJumpWhite: null,
+				rotateJumpRight: null,
+				rotateJumpLeft: null,
+				directionJumpWhiteRight: null,
+				directionJumpWhiteLeft: null,
 				midJumpWhite: null,
-				rotateJumpWhite: null,
+				rotateJumpWhiteRight: null,
+				rotateJumpWhiteLeft: null,
 				//参考图片
 				cankao: null,
 
 				jumpTipImage: null,
 				JumpTipOrange: null,
-				jumpNormalImage: null,
+				jumpNormalLine: null,
+				jumpNormalRect: null,
 				jumpNormalWidth: 70,
 				jumpNormalHeight: 164,
 
@@ -182,7 +213,7 @@
 					jumpName: 'LEFT',
 					jumpCode: 1,
 					icon: 'directionJump',
-					scaleX: -1,
+					scaleX: 1,
 					bTrigger: false,
 					bShow: true,
 				}, {
@@ -196,7 +227,7 @@
 					jumpName: 'LEFT_ROTATE',
 					jumpCode: 3,
 					icon: 'rotateJump',
-					scaleX: -1,
+					scaleX: 1,
 					bTrigger: false,
 					bShow: true,
 				}, {
@@ -208,10 +239,14 @@
 					bShow: true,
 				}],
 				spawnArray: [],
+				deleteSpawn: null, //已删除的对象
+				deleteImage: null,
 				/**
 				 * 生成的背景位置
 				 */
 				spawnPos: [],
+				spawnAnimation: null,
+				spawnProcess: 1,
 
 				//下一个生成是相反的方向
 				bNextSpawnRightDirection: false,
@@ -251,12 +286,14 @@
 				eliminationCount: 0,
 
 				bJumpPlay: false,
-				jumpCalorie: 1000,
-				jumpSpeed: 1000,
+				jumpCalorie: 0,
+
+				averageSpeedInterval: null,
+				averageSpeed: 0,
+				tempHitCount: 0,
 
 				//硬件设备处理
 				BLEAccIndex: 0,
-				bJump: false,
 				xA: 0,
 				yA: 0,
 				zA: 0,
@@ -322,7 +359,11 @@
 				/**
 				 * 烟花特效
 				 */
-				bDrawBoomEffect: false
+				bDrawBoomEffect: false,
+				//绘制箭头效果
+				bRuning: false,
+				bRuningInfinite: false,
+				yellowRuningTimeout: null,
 			}
 		},
 		watch: {
@@ -345,7 +386,7 @@
 
 			},
 			currentMode(val) {
-				console.log('==========> action jump currentMode:', val);
+				// console.log('==========> action jump currentMode:', val);
 			}
 		},
 		created() {
@@ -370,6 +411,15 @@
 			}
 
 			// console.log('==========>levelButtonPrompt:', _self.bTipLevel);
+			if (this.averageSpeedInterval) {
+				clearInterval(this.averageSpeedInterval);
+				this.averageSpeedInterval = null;
+			}
+			//计算平均速度
+			this.averageSpeedInterval = setInterval(() => {
+				this.averageSpeed = this.tempHitCount;
+				this.tempHitCount = 0;
+			}, 3000)
 		},
 		methods: {
 			...mapMutations(['onWriteBLEConnectionValue', 'onConvertDeviceData']),
@@ -382,10 +432,7 @@
 				console.log("*****************onListenActionJump*****************************");
 				_self.actionJumpObj = new ActionJump();
 				_self.actionJumpObj.addEventListener('resultant', (e) => {
-					if (e.type == 'jump') {
-						// this.jumpCount++;
-						this.bJump = true;
-					} else if (e.type == 'stateDataOfJump') {
+					if (e.type == 'stateDataOfJump') {
 						//发送给game,在game里面处理判断
 						this.listenStateDataOfJump(e);
 					} else if (e.type == 'stop') {
@@ -396,14 +443,14 @@
 							this.canOnDraw = false;
 							// //这里更新特效
 							// this.onDrawEffect(this.canSpawnTemp);
-							this.onDraw("tipHit");
+							this.onDraw("tipHit", true);
 						}
 						if (this.canGoNext) {
 							this.canGoNext = false;
 							// //这里更新特效
 							// this.onDrawEffect(this.canSpawnTemp);
 							//绘制新触发状态
-							this.onDraw("normal");
+							this.onDraw("normal", false);
 							setTimeout(() => {
 								this.startJumpGame();
 							}, 500)
@@ -417,9 +464,15 @@
 			onLoadImage() {
 				let _self = this;
 				uni.getImageInfo({
-					src: "../../../static/modal/action-jump/directionJump.png",
+					src: "../../../static/modal/action-jump/directionJump-left.png",
 					success: function(image) {
-						_self.directionJump = image;
+						_self.directionJumpLeft = image;
+					}
+				});
+				uni.getImageInfo({
+					src: "../../../static/modal/action-jump/directionJump-right.png",
+					success: function(image) {
+						_self.directionJumpRight = image;
 					}
 				});
 				uni.getImageInfo({
@@ -429,16 +482,27 @@
 					}
 				});
 				uni.getImageInfo({
-					src: "../../../static/modal/action-jump/rotateJump.png",
+					src: "../../../static/modal/action-jump/rotateJump-right.png",
 					success: function(image) {
-						_self.rotateJump = image;
+						_self.rotateJumpRight = image;
+					}
+				});
+				uni.getImageInfo({
+					src: "../../../static/modal/action-jump/rotateJump-left.png",
+					success: function(image) {
+						_self.rotateJumpLeft = image;
+					}
+				});
+				uni.getImageInfo({
+					src: "../../../static/modal/action-jump/directionJumpWhite-right.png",
+					success: function(image) {
+						_self.directionJumpWhiteRight = image;
 					}
 				});
-
 				uni.getImageInfo({
-					src: "../../../static/modal/action-jump/directionJumpWhite.png",
+					src: "../../../static/modal/action-jump/directionJumpWhite-left.png",
 					success: function(image) {
-						_self.directionJumpWhite = image;
+						_self.directionJumpWhiteLeft = image;
 					}
 				});
 				uni.getImageInfo({
@@ -448,13 +512,18 @@
 					}
 				});
 				uni.getImageInfo({
-					src: "../../../static/modal/action-jump/rotateJumpWhite.png",
+					src: "../../../static/modal/action-jump/rotateJumpWhite-right.png",
 					success: function(image) {
-						_self.rotateJumpWhite = image;
+						_self.rotateJumpWhiteRight = image;
 					}
 				});
 
-
+				uni.getImageInfo({
+					src: "../../../static/modal/action-jump/rotateJumpWhite-left.png",
+					success: function(image) {
+						_self.rotateJumpWhiteLeft = image;
+					}
+				});
 				uni.getImageInfo({
 					src: "../../../static/modal/action-jump/jumpTip.png",
 					success: function(image) {
@@ -474,15 +543,21 @@
 					}
 				})
 
-
 				uni.getImageInfo({
-					src: "../../../static/modal/action-jump/jumpNormal.png",
+					src: "../../../static/modal/action-jump/jumpNormal-line.png",
 					success: function(image) {
-						_self.jumpNormalImage = image;
+						_self.jumpNormalLine = image;
+					}
+				});
+				uni.getImageInfo({
+					src: "../../../static/modal/action-jump/jumpNormal-rect.png",
+					success: function(image) {
+						_self.jumpNormalRect = image;
 						_self.onDrawBg(true);
 					}
 				});
 
+
 				uni.getImageInfo({
 					src: "../../../static/modal/action-jump/cankao.png",
 					success: function(image) {
@@ -522,23 +597,25 @@
 				//开始游戏
 				this.index = 0;
 				// this.levelType = 5;
+				let spawnCount = 7;
 				let _ranType = Math.floor(Math.random() * 2);
+				//生成二个占位
+				this.addTemplatePoolFromType(false, this.template[0].spawnList[0][0]);
+				this.addTemplatePoolFromType(false, this.template[0].spawnList[0][0]);
 				if (this.levelType == 0) {
 					//随便生成一组跳的数据
 					let _spawnList = this.template[0].spawnList;
-					for (let i = 0; i < 31; i++) {
+					for (let i = 0; i < 30; i++) {
 						//再对象池里面生成一组对象
-						this.addTemplatePoolFromType(0 !== i, _spawnList[0][0]);
+						this.addTemplatePoolFromType(true, _spawnList[0][0]);
 					}
-					//先生成4
-					for (let i = 0; i < 5; i++) {
+					//先生成spawnCount
+					for (let i = 0; i < spawnCount; i++) {
 						this.spawnArray.push(this.templatePool[this.index]);
 						this.index++;
 					}
 
 				} else if (this.levelType == 1) {
-					//生成一个占位
-					this.addTemplatePoolFromType(false, this.template[0].spawnList[0][0]);
 					//生成一组 左跳右跳
 					let _spawnList = this.template[1].spawnList;
 					for (let i = 0; i < 30; i++) {
@@ -548,15 +625,13 @@
 							this.addTemplatePoolFromType(true, _spawnList[ran][j]);
 						}
 					}
-					//先生成5
-					for (let i = 0; i < 5; i++) {
+					//先生成spawnCount
+					for (let i = 0; i < spawnCount; i++) {
 						this.spawnArray.push(this.templatePool[this.index]);
 						this.index++;
 					}
 
 				} else if (this.levelType == 2) {
-					//生成一个占位
-					this.addTemplatePoolFromType(false, this.template[0].spawnList[0][0]);
 					//生成一组 左跳右跳原地
 					let _spawnList = this.template[2].spawnList;
 					for (let i = 0; i < 30; i++) {
@@ -566,16 +641,14 @@
 							this.addTemplatePoolFromType(true, _spawnList[ran][j]);
 						}
 					}
-					//先生成5
-					for (let i = 0; i < 5; i++) {
+					//先生成spawnCount
+					for (let i = 0; i < spawnCount; i++) {
 						this.spawnArray.push(this.templatePool[this.index]);
 						this.index++;
 					}
 
 
 				} else if (this.levelType == 3) {
-					//生成一个占位
-					this.addTemplatePoolFromType(false, this.template[0].spawnList[0][0]);
 					//生成一组 左旋跳右旋跳
 					let _spawnList = this.template[1].spawnList;
 					for (let i = 0; i < 30; i++) {
@@ -585,14 +658,12 @@
 							this.addTemplatePoolFromType(true, _spawnList[ran][j]);
 						}
 					}
-					//先生成5
-					for (let i = 0; i < 30; i++) {
+					//先生成spawnCount
+					for (let i = 0; i < spawnCount; i++) {
 						this.spawnArray.push(this.templatePool[this.index]);
 						this.index++;
 					}
 				} else if (this.levelType == 4) {
-					//生成一个占位
-					this.addTemplatePoolFromType(false, this.template[0].spawnList[0][0]);
 					//生成一组 左旋跳右旋跳
 					let _spawnList = this.template[2].spawnList;
 					for (let i = 0; i < 30; i++) {
@@ -602,16 +673,13 @@
 							this.addTemplatePoolFromType(true, _spawnList[ran][j]);
 						}
 					}
-					//先生成5
-					for (let i = 0; i < 5; i++) {
+					//先生成spawnCount
+					for (let i = 0; i < spawnCount; i++) {
 						this.spawnArray.push(this.templatePool[this.index]);
 						this.index++;
 					}
 
 				} else if (this.levelType == 5) {
-					//生成一个占位
-					this.addTemplatePoolFromType(false, this.template[0].spawnList[0][0]);
-					
 					for (let i = 0; i < 20; i++) {
 						//随便生成三组数据
 						let _newArray = [];
@@ -628,19 +696,28 @@
 							this.addTemplatePoolFromType(true, _newArray[j]);
 						}
 					}
-					//先生成5
-					for (let i = 0; i < 5; i++) {
+					//先生成spawnCount
+					for (let i = 0; i < spawnCount; i++) {
 						this.spawnArray.push(this.templatePool[this.index]);
 						this.index++;
 					}
 				}
-				this.onDraw("tipHit");
+				this.onDraw("tipHit", false);
 			},
+			/**
+			 * 生成对应预制对象
+			 * @param {Object} bShow
+			 * @param {Object} _jumpType
+			 */
 			addTemplatePoolFromType(bShow, _jumpType) {
+
 				for (let i = 0; i < this.jumpTypeArray.length; i++) {
 					if (this.jumpTypeArray[i].jumpCode == _jumpType) {
 						let _jumpPrefab = Object.assign({}, this.jumpTypeArray[i], {
-							bShow: bShow
+							bShow: bShow,
+							bInit: true,
+							position: 0,
+							animation: null, //动画
 						});
 						this.templatePool.push(_jumpPrefab);
 						break;
@@ -656,21 +733,30 @@
 				}
 
 				let _currentBgStartX = this.canvasW / 2;
-				let count = 5;
+				let count = 7;
 				let _currentPos = -12,
 					_addPos = 0;
 
-				this.actionJumpCanvas.drawImage(this.jumpProgressTip.path, _currentBgStartX, 5, 171, 24.66);
-				this.actionJumpCanvas.drawImage(this.jumpProgressTip.path, _currentBgStartX, 116, 171, 24.66);
+				// this.actionJumpCanvas.drawImage(this.jumpProgressTip.path, _currentBgStartX, 5, 171, 24.66);
+				// this.actionJumpCanvas.drawImage(this.jumpProgressTip.path, _currentBgStartX, 116, 171, 24.66);
 				for (let i = 0; i < count; i++) {
 					if (0 !== i) {
 						_currentPos += this.jumpNormalWidth;
+					} else {
+						_currentPos -= this.jumpNormalWidth;
 					}
 
-					if (1 === i) {
-						this.actionJumpCanvas.drawImage(this.jumpTipImage.path, _currentPos, 0, 120, this.canvasH);
-						this.actionJumpCanvas.drawImage(this.JumpTipOrange.path, _currentPos + 3, 7, 113, this.canvasH -
-							14);
+					if (2 === i) {
+						//结尾时候快消除完绘制一次大图背景。不然会为空白
+						if (this.spawnArray.length < 3)
+							this.actionJumpCanvas.drawImage(this.jumpTipImage.path, _currentPos, 0, 120, this.canvasH);
+
+						if (bDraw) {
+							this.actionJumpCanvas.drawImage(this.JumpTipOrange.path, _currentPos + 3, 7, 113, this
+								.canvasH -
+								14);
+						}
+
 						// this.actionJumpCanvas.drawImage(this.midJump.path, _currentPos + 30, 46, 60, 60);
 						//添加对应生成点
 						this.spawnPos.push({
@@ -678,8 +764,12 @@
 						})
 						_currentPos += 50;
 					} else {
-						this.actionJumpCanvas.drawImage(this.jumpNormalImage.path, _currentPos, 0, this.jumpNormalWidth,
+						this.actionJumpCanvas.drawImage(this.jumpNormalLine.path, _currentPos, 0, this.jumpNormalWidth,
 							this.canvasH);
+						if (bDraw) {
+							this.actionJumpCanvas.drawImage(this.jumpNormalRect.path, _currentPos, 0, this.jumpNormalWidth,
+								this.canvasH);
+						}
 
 						// this.actionJumpCanvas.drawImage(this.midJump.path, _currentPos + 16, 55, 40, 40);
 						//添加对应生成点
@@ -693,51 +783,117 @@
 					this.actionJumpCanvas.draw();
 				}
 			},
-			onDraw(type) {
+			onDraw(type, bAnimation) {
+				let _self = this;
+				if (bAnimation && _self.spawnAnimation == null) {
+					_self.spawnProcess = 0;
+					_self.spawnAnimation = new Animation({
+						timing: 'linear',
+						duration: 200,
+						onProcess: function onProcess(process) {
+							_self.spawnProcess = process;
+							_self.onDraw('normal', true);
+							// console.log("process=" + process);
+						},
+						onAnimationFinish: function onAnimationFinish() {
+							// console.log("finish animation");
+							_self.spawnAnimation = null;
+						}
+					})
+				}
 				this.actionJumpCanvas.clearRect(0, 0, this.canvasW, this.canvasH);
 				//单纯绘制背景
 				this.onDrawBg(false);
 				//计算一个节点数组
+				// let _oldRectMoveDis = 1;
 				for (let i = 0; i < this.spawnArray.length; i++) {
 					//默认 mid 图标
 					let _temp = this.spawnArray[i].bTrigger ? this.midJump : this.midJumpWhite;
 					if (this.spawnArray[i].icon == 'directionJump') {
-						_temp = this.spawnArray[i].bTrigger ? this.directionJump : this.directionJumpWhite;
+						if (this.spawnArray[i].jumpName == "RIGHT") {
+							_temp = this.spawnArray[i].bTrigger ? this.directionJumpRight : this.directionJumpWhiteRight;
+						} else {
+							_temp = this.spawnArray[i].bTrigger ? this.directionJumpLeft : this.directionJumpWhiteLeft;
+						}
 					} else if (this.spawnArray[i].icon == 'rotateJump') {
-						_temp = this.spawnArray[i].bTrigger ? this.rotateJump : this.rotateJumpWhite;
+						if (this.spawnArray[i].jumpName == "RIGHT_ROTATE") {
+							_temp = this.spawnArray[i].bTrigger ? this.rotateJumpRight : this.rotateJumpWhiteRight;
+						} else {
+							_temp = this.spawnArray[i].bTrigger ? this.rotateJumpLeft : this.rotateJumpWhiteLeft;
+						}
 					}
-					//如果是相反绘制,需要加多一个自身位置偏移
-					let _pos = this.spawnArray[i].scaleX < 0 ? i + 1 : 0;
 					this.actionJumpCanvas.save();
-					let _opacity = this.spawnArray[i].bTrigger ? 0.7 : 1;
-					console.log(this.spawnArray[i].bTrigger + '==' + _opacity);
-					this.actionJumpCanvas.globalAlpha = this.spawnArray[i].bShow ? _opacity : 0;
-					this.actionJumpCanvas.scale(this.spawnArray[i].scaleX, 1);
+					// let _opacity = this.spawnArray[i].bTrigger ? 0.7 : 1;
+					// this.actionJumpCanvas.globalAlpha = this.spawnArray[i].bShow ? _opacity : 0;
+					// this.actionJumpCanvas.scale(this.spawnArray[i].scaleX, 1);
 
 					let _currentPos = this.spawnPos[i].center;
 					let _currentCenterPos = 0;
 
-					if (i == 1) {
-						if (this.spawnArray[i].scaleX < 0) {
-							_currentPos = (_currentPos * 2 - 30) * this.spawnArray[i].scaleX;
-							//这里记录一个生成点,后面用于生成特效
-							this.effectSpawnPosX = _currentPos - 30;
+					if (2 === i) {
+						//这里分两部分走,从小图走到大图
+						let _spawnBiggerToLeft = this.spawnArray[i];
+						//这里记录一个生成点,后面用于生成特效
+						this.effectSpawnPosX = _currentPos;
+						//大图
+						let tempPosition = _currentPos;
+						if (!bAnimation || _spawnBiggerToLeft.bInit) {
+							_spawnBiggerToLeft.position = _currentPos;
+							_spawnBiggerToLeft.bInit = false;
+						} else {
+							tempPosition = _spawnBiggerToLeft.position - Math.abs(_currentPos - _spawnBiggerToLeft
+								.position) * _self.spawnProcess;
+
+						}
+						if (1 === this.spawnProcess) {
+							_spawnBiggerToLeft.position = tempPosition;
 						} else {
-							//这里记录一个生成点,后面用于生成特效
-							this.effectSpawnPosX = _currentPos;
+							//绘制一次前面方块背景前移
+							this.actionJumpCanvas.drawImage(this.jumpNormalRect.path, tempPosition - 16, 0, this
+								.jumpNormalWidth,
+								this.canvasH);
+							this.actionJumpCanvas.clearRect(this.spawnPos[i].center - 30, 0, 120, this.canvasH);
 						}
+						let _width = 40 + 20 * _self.spawnProcess;
+						this.actionJumpCanvas.drawImage(_temp.path, tempPosition, 55 - 9 * _self.spawnProcess, _width,
+							_width);
 
+						//绘制多一次背景
+						this.actionJumpCanvas.drawImage(this.jumpTipImage.path, this.spawnPos[i].center - 30, 0, 120, this
+							.canvasH);
 
-						//大图
-						this.actionJumpCanvas.drawImage(_temp.path, _currentPos, 46, 60, 60);
-						// console.log('big:' + _currentPos);
+						this.actionJumpCanvas.drawImage(this.JumpTipOrange.path, this.spawnPos[i].center - 27, 7, 113, this
+							.canvasH -
+							14);
 					} else {
 						//小图
-						if (this.spawnArray[i].scaleX < 0) {
-							_currentPos = (_currentPos + 40) * this.spawnArray[i].scaleX
-							console.log('min:' + _currentPos);
+						let _otherObj = this.spawnArray[i];
+						let tempPosition = _currentPos;
+						if (!bAnimation || _otherObj.bInit) {
+							_otherObj.position = _currentPos;
+							_otherObj.bInit = false;
+							// console.log(i + " add== " + _otherObj.position + " == " + tempPosition);
+						} else {
+							tempPosition = _otherObj.position - Math.abs(_currentPos - _otherObj.position) * _self
+								.spawnProcess;
+							// if (i === 1) {
+							// 	console.log(tempPosition + "==" + _otherObj.position + "==" + Math.abs(_currentPos -
+							// 		_otherObj.position));
+							// }
+						}
+						if (1 === this.spawnProcess) {
+							_otherObj.position = tempPosition;
+						}
+						// if (1 === i) {
+						// 	_oldRectMoveDis = Math.abs(_currentPos - _otherObj.position);
+						// }
+
+						this.actionJumpCanvas.drawImage(this.jumpNormalRect.path, tempPosition - 16, 0, this
+							.jumpNormalWidth,
+							this.canvasH);
+						if (this.spawnArray[i].bShow) {
+							this.actionJumpCanvas.drawImage(_temp.path, tempPosition, 55, 40, 40);
 						}
-						this.actionJumpCanvas.drawImage(_temp.path, _currentPos, 55, 40, 40);
 
 					}
 					this.actionJumpCanvas.restore();
@@ -746,16 +902,32 @@
 				this.actionJumpCanvas.draw();
 			},
 			onDrawEffect(_temp) {
+				if (!this.bRuning) {
+					this.bRuning = true;
+					// console.log(this.bRuning);
+					if (this.yellowRuningTimeout) {
+						clearTimeout(this.yellowRuningTimeout)
+						this.yellowRuningTimeout = null;
+					}
+					this.yellowRuningTimeout = setTimeout(() => {
+						this.bRuning = false;
+						// console.log(this.bRuning);
+					}, 1000)
+				}
+
+
 				//根据当前消除的生成一个
 				// console.log("生成的_temp:" + JSON.stringify(_temp));
 				let spawnTemp = this.midJump;
+				let offest = 5;
 				if (_temp.icon == 'directionJump') {
-					spawnTemp = this.directionJump;
+					spawnTemp = _temp.jumpName == "RIGHT" ? this.directionJumpRight : this.directionJumpLeft;
 				} else if (_temp.icon == 'rotateJump') {
-					spawnTemp = this.rotateJump;
+					spawnTemp = _temp.jumpName == "RIGHT_ROTATE" ? this.rotateJumpRight : this.rotateJumpLeft;
+					offest = _temp.jumpName == "RIGHT_ROTATE" ? 8 : 6;
 				}
 				let tempFirework = new Firework(this.fireworkImage,
-					spawnTemp, _temp.scaleX, this.effectSpawnPosX, 0, this.canvasW, 164);
+					spawnTemp, _temp.scaleX, this.effectSpawnPosX, 0, this.canvasW, 164, offest);
 				this.fireworks.push(tempFirework);
 				this.bDrawBoomEffect = true;
 				this.onInitFirework();
@@ -768,7 +940,6 @@
 				this.xA = 0;
 				this.yA = 0;
 				this.zA = 0;
-				this.bJump = false;
 
 				this.actionJumpObj.resetAll();
 			},
@@ -817,14 +988,15 @@
 			//模拟测试调用
 			eliminateJumpPrefab(_jumpType) {
 				//只触发第二个
-				if (this.spawnArray.length < 2) {
+				if (this.spawnArray.length < 3) {
 					return;
 				}
-				let _temp = this.spawnArray[1];
+				let _temp = this.spawnArray[2];
 				//如果当前的跳类型和预制目标一样
 				if (_jumpType == _temp.jumpCode) {
 					_temp.bTrigger = true;
-					this.spawnArray.splice(0, 1);
+					this.deleteSpawn = this.spawnArray.splice(0, 1);
+
 					if (this.index < this.templatePool.length) {
 						this.spawnArray.push(this.templatePool[this.index]);
 						this.index++;
@@ -833,16 +1005,16 @@
 					let _endTemp = Object.assign({}, _temp);
 					this.onDrawEffect(_endTemp);
 					//绘制新触发状态
-					this.onDraw('tipHit');
+					this.onDraw('tipHit', true);
 					//成功
 					this.setEliminationCount(1);
 					//替换数组
 					// console.log(this.index + " == " + this.spawnArray.length);
-					if (this.spawnArray.length < 2 && this.index > 2) {
+					if (this.spawnArray.length < 3 && this.index > 3) {
 						clearInterval(this.countdownInterval);
 						this.countdownInterval = null;
 						//绘制新触发状态
-						this.onDraw("normal");
+						this.onDraw("normal", false);
 						setTimeout(() => {
 							this.startJumpGame();
 						}, 2000)
@@ -870,6 +1042,7 @@
 			},
 			//设置ui信息
 			setEliminationCount(value) {
+				this.tempHitCount++;
 				this.taskSignCurCount++;
 				this.roundingCount += this.addShowCountUnit;
 				this.eliminationCount += value;
@@ -879,6 +1052,7 @@
 					eliminationCount: this.eliminationCount,
 					faultCount: this.faultCount
 				});
+				this.jumpCalorie += puchConfig.getJumpCalorie(this.eliminationCount + this.faultCount);
 
 				//如果是pk模式。不走下面判断
 				if (this.currentMode == 'pkMode') return;
@@ -957,12 +1131,15 @@
 				});
 			},
 			setFaultCount(value) {
+				this.tempHitCount++;
 				this.faultCount += value;
 				// this.faultLabel.string = '失误:' + this.faultCount;
 				this.$emit('actionJumpDataUpdate', {
 					eliminationCount: this.eliminationCount,
 					faultCount: this.faultCount
 				});
+				this.jumpCalorie += puchConfig.getJumpCalorie(this.eliminationCount + this.faultCount);
+
 			},
 
 			//控制播放
@@ -1008,7 +1185,7 @@
 			},
 
 			getCurrentJumpType() {
-				let _temp = this.spawnArray[1];
+				let _temp = this.spawnArray[2];
 				return _temp.jumpCode;
 			},
 
@@ -1016,7 +1193,7 @@
 			listenStateDataOfJump(data) {
 				if (this.isGameOver || !this.bJumpPlay) return;
 
-				if (this.spawnArray.length < 2) return;
+				if (this.spawnArray.length < 3) return;
 				let _jumpType = this.getCurrentJumpType();
 				//初始全部默认状态
 				let _tempState = [{
@@ -1144,16 +1321,19 @@
 				// }
 			},
 			eliminateJumpPrefabFormTemp(_tempState) {
-				//只触发第
-				if (this.spawnArray.length < 2) {
+				//只触发第
+				if (this.spawnArray.length < 3) {
 					return;
 				}
-				let _temp = this.spawnArray[1];	
+				let _temp = this.spawnArray[2];
 				let bSuccess = false;
 				for (let i = 0; i < _tempState.length; i++) {
 					let _state = _tempState[i];
 					if (_state.bTrigger)
-						console.log(JSON.stringify(_state) + JSON.stringify(this.onLogData));
+					{
+						console.log('识别跳的类型:' +_state.describe + ',当前预制类型:'+_temp.jumpName + 
+						"\n直跳判断值:"+this.onLogData.currentMaxValue+",旋转跳值:"+this.onLogData.oGyroValue);
+					}
 					//如果当前的跳类型和预制目标一样
 					if (_state.jumpCode == _temp.jumpCode && _state.bTrigger) {
 						//成功
@@ -1169,7 +1349,8 @@
 						//这里更新特效
 						this.onDrawEffect(this.canSpawnTemp);
 					}, 150);
-					this.spawnArray.splice(0, 1);
+					this.deleteSpawn = this.spawnArray.splice(0, 1);
+
 					if (this.index < this.templatePool.length) {
 						this.spawnArray.push(this.templatePool[this.index]);
 						this.index++;
@@ -1178,16 +1359,16 @@
 					this.setEliminationCount(1);
 					//替换数组
 					// console.log(this.index + " == " + this.spawnArray.length);
-					if (this.spawnArray.length < 2 && this.index > 2) {
+					if (this.spawnArray.length < 3 && this.index > 3) {
 						clearInterval(this.countdownInterval);
 						this.countdownInterval = null;
 						//绘制新触发状态
 						this.canGoNext = true;
-					}else {
+					} else {
 						//绘制新触发状态
 						this.canOnDraw = true;
 					}
-					
+
 				} else {
 					//失误
 					this.setFaultCount(1);
@@ -1259,13 +1440,6 @@
 					bYAxis: true,
 				};
 				this.actionJumpObj.updateJump(_temp);
-
-
-				// if (this.BLEAccIndex > 150) {
-				// 	this.onClearData();
-				// 	this.bJump = false;
-				// 	return;
-				// }
 				this.BLEAccIndex++;
 			},
 			onClearData() {
@@ -1332,4 +1506,254 @@
 	.grid-progress-vertical-inactive {
 		width: 28rpx;
 	}
+
+	.sprite-yellow-arrow {
+		display: inline-block;
+		overflow: hidden;
+		background-repeat: no-repeat;
+		width: 194px;
+		height: 232px;
+		background-image: url('@/static/modal/action-jump/yellow-arrow.png');
+
+		// border: 1rpx solid #00CE47;
+	}
+
+	.animation-play-state-play {
+		animation: yellowArrowRun 1s steps(1, end); // infinite
+		animation-play-state: running;
+	}
+
+	.animation-play-state-paused {
+		animation-play-state: paused;
+	}
+
+	/**
+	 * 箭头动画
+	 */
+	@keyframes yellowArrowRun {
+		0% {
+			background-position: -0px -0px;
+		}
+
+		5% {
+			background-position: -0px -0px;
+		}
+
+		10% {
+			background-position: -194px -0px;
+		}
+
+		15% {
+			background-position: -388px -0px;
+		}
+
+		20% {
+			background-position: -582px -0px;
+		}
+
+		25% {
+			background-position: -776px -0px;
+		}
+
+		30% {
+			background-position: -0px -232px;
+		}
+
+		35% {
+			background-position: -194px -232px;
+		}
+
+		40% {
+			background-position: -388px -232px;
+		}
+
+		45% {
+			background-position: -582px -232px;
+		}
+
+		50% {
+			background-position: -776px -232px;
+		}
+
+		55% {
+			background-position: -0px -464px;
+		}
+
+		60% {
+			background-position: -194px -464px;
+		}
+
+		65% {
+			background-position: -388px -464px;
+		}
+
+		70% {
+			background-position: -582px -464px;
+		}
+
+		75% {
+			background-position: -776px -464px;
+		}
+
+		80% {
+			background-position: -0px -696px;
+		}
+
+		85% {
+			background-position: -194px -696px;
+		}
+
+		90% {
+			background-position: -388px -696px;
+		}
+
+		95% {
+			background-position: -582px -696px;
+		}
+
+		100% {
+			background-position: -776px -696px;
+		}
+	}
+
+	.sprite-rightToLeftArrow {
+		display: inline-block;
+		overflow: hidden;
+		background-repeat: no-repeat;
+		width: 317px;
+		height: 42px;
+		background-image: url('@/static/modal/action-jump/rightToLeftArrow.png');
+
+		// border: 1rpx solid #00CE47;
+	}
+
+	.sprite-rightToLeftArrow-play {
+		animation: rightToLeftArrowRun 1s steps(1, end) infinite;
+	}
+
+	@keyframes rightToLeftArrowRun {
+		0% {
+			background-position: -0px -0px;
+		}
+
+		3.33% {
+			background-position: -0px -0px;
+		}
+
+		6.66% {
+			background-position: -317px -0px;
+		}
+
+		9.99% {
+			background-position: -0px -42px;
+		}
+
+		13.33% {
+			background-position: -317px -42px;
+		}
+
+		16.66% {
+			background-position: -0px -84px;
+		}
+
+		19.99% {
+			background-position: -317px -84px;
+		}
+
+		23.33% {
+			background-position: -0px -126px;
+		}
+
+		26.66% {
+			background-position: -317px -126px;
+		}
+
+		29.99% {
+			background-position: -0px -168px;
+		}
+
+		33.33% {
+			background-position: -317px -168px;
+		}
+
+		36.66% {
+			background-position: -0px -210px;
+		}
+
+		39.99% {
+			background-position: -317px -210px;
+		}
+
+		43.33% {
+			background-position: -0px -252px;
+		}
+
+		46.66% {
+			background-position: -317px -252px;
+		}
+
+		49.99% {
+			background-position: -0px -294px;
+		}
+
+		53.33% {
+			background-position: -317px -294px;
+		}
+
+		56.66% {
+			background-position: -0px -336px;
+		}
+
+		59.99% {
+			background-position: -317px -336px;
+		}
+
+		63.33% {
+			background-position: -0px -378px;
+		}
+
+		66.66% {
+			background-position: -317px -378px;
+		}
+
+		69.99% {
+			background-position: -0px -420px;
+		}
+
+		73.33% {
+			background-position: -317px -420px;
+		}
+
+		76.66% {
+			background-position: -0px -462px;
+		}
+
+		79.99% {
+			background-position: -317px -462px;
+		}
+
+		83.33% {
+			background-position: -0px -504px;
+		}
+
+		86.66% {
+			background-position: -317px -504px;
+		}
+
+		89.99% {
+			background-position: -0px -546px;
+		}
+
+		93.33% {
+			background-position: -317px -546px;
+		}
+
+		96.66% {
+			background-position: -0px -588px;
+		}
+
+		100% {
+			background-position: -317px -588px;
+		}
+	}
 </style>

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
     "name" : "哔蹦",
     "appid" : "__UNI__2635DF5",
     "description" : "",
-    "versionName" : "2.4.21",
-    "versionCode" : 21100901,
+    "versionName" : "2.4.23",
+    "versionCode" : 21101301,
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {

+ 188 - 69
pages/game-page/game-play-sub/subGame/subGame.nvue

@@ -2,8 +2,8 @@
 	<view class="web-view">
 		<!-- :src="url" src = 'http://192.168.0.112:7456/build/index.html' :src="LocationGameUrl" -->
 		<!-- @receivedtitle="onReceivedTitle"   @pagefinish="onPageFinish"-->
-		<web-view class="web-view-child" :src="url" ref="webview" @pagestart="onPageStart" @onPostMessage="handlePostMessage"
-		 @error="onError"></web-view>
+		<web-view class="web-view-child" :src="url" ref="webview" @pagestart="onPageStart"
+			@onPostMessage="handlePostMessage" @error="onError"></web-view>
 		<view class="web-back" @click="navBack">
 			<image style="width: 40rpx;height: 40rpx;" src="/static/gameCloseW.png"></image>
 		</view>
@@ -23,6 +23,7 @@
 	import puchConfig from "@/util/util-js/puchConfig.js"
 
 	import EquipmentAction from "@/util/util-js/EquipmentAction.js"
+	import ActionJump from "@/util/util-js/action/jump-0.1.js"
 
 
 	var currentWebview;
@@ -36,7 +37,8 @@
 
 	export default {
 		computed: mapState([
-			'avatarUrl', 'gender', 'userName', 'city', 'BLEConnectDevice', 'instructionState', 'currentInstruction',
+			'avatarUrl', 'gender', 'userName', 'city', 'BLEConnectDevice', 'instructionState',
+			'currentInstruction',
 			'cIndex', 'globalAcc', 'globalOri', 'LocationGameUrl',
 			'ConnectBindingDevice',
 			'currentModeIndex'
@@ -77,7 +79,7 @@
 
 				//拳击数据判断对象
 				EquipmentActionObj: null,
-
+			
 				BLENum: 0,
 				BLEACX: 0,
 				BLEACYL: 0,
@@ -85,7 +87,14 @@
 				//是否是游戏里面开启的监听,如果是的话,退出游戏界面时候需要关闭相应的监听,如加速计和陀螺仪
 				bGameOpenListen: false,
 				//手机陀螺仪和加速计android模块
-				bMyAttitudeListen:false,
+				bMyAttitudeListen: false,
+				
+				/**
+				 * 跳绳相应数据
+				 */
+				//跳绳数据判断对象
+				actionJumpObj: null,
+				BLEAccIndex:0
 			}
 		},
 		onLoad() {
@@ -132,12 +141,12 @@
 				uni.$off('updateBLEDeviceData', _self.BLECallback);
 				//json
 				uni.$off('updateBLEDeviceJson', _self.BLEJsonCallback);
-				
+
 				//去掉监听
-				if(_self.bMyAttitudeListen){
+				if (_self.bMyAttitudeListen) {
 					_self.gStopSimulateBLEUpdate();
 				}
-				
+
 				// console.log(_self.BLEConnectDevice);
 				//如果连接了蓝牙设备是手柄
 				if (_self.BLEConnectDevice && _self.BLEConnectDevice.deviceType == "BLEHandle") {
@@ -149,9 +158,9 @@
 					_self.onWriteBLEConnectionValue({
 						value: "6"
 					});
-				
+
 					uni.$off('updateBLEDeviceData', _self.gWatchBLEUpdate);
-				}//关闭跳绳模式指令
+				} //关闭跳绳模式指令
 				else if (_self.BLEConnectDevice && _self.BLEConnectDevice.deviceType == "BLERope") {
 					console.warn("还没设置关闭跳绳模式")
 					_self.B_CloseRopeSkipping();
@@ -162,8 +171,8 @@
 					globalOri: _self.globalOri,
 					bGameOpenListen: _self.bGameOpenListen
 				});
-				
-				
+
+
 			});
 			//*****注释蓝牙操作******
 			// 监听事件    
@@ -175,7 +184,7 @@
 			plus.key.addEventListener('backbutton', () => {
 				this.navBack();
 			}, false);
-			
+
 			//设置store状态
 			_self.$store.state.bGamePlaying = true;
 		},
@@ -195,8 +204,9 @@
 		},
 		methods: {
 			...mapMutations(['addlocalCalorie', 'syncRequestEvent', 'onWriteBLEConnectionValue',
-				'gCreateFilterObj', 'gUpdateFilter' ,'B_OpenRopeSkipping','B_CloseRopeSkipping',
-				'gStopSimulateBLEUpdate','gStartSimulateBLEUpdate','gUpdateSandbagAlgorithm','gCreateSandbagAlgorithm'
+				'gCreateFilterObj', 'gUpdateFilter', 'B_OpenRopeSkipping', 'B_CloseRopeSkipping',
+				'gStopSimulateBLEUpdate', 'gStartSimulateBLEUpdate', 'gUpdateSandbagAlgorithm',
+				'gCreateSandbagAlgorithm','onConvertDeviceData'
 			]),
 			navBack() {
 
@@ -420,7 +430,8 @@
 
 							let _temp = {
 								//假如排行id 为空,排行榜就是游戏自己的id
-								gameId: this.decodeItem.gameRankingId == null ? this.decodeItem.gameId : this.decodeItem.gameRankingId,
+								gameId: this.decodeItem.gameRankingId == null ? this.decodeItem
+									.gameId : this.decodeItem.gameRankingId,
 								score: gameData.gameScore,
 								cityCode: this.city.cityCode,
 								bMaxLimit: true
@@ -490,7 +501,8 @@
 						fruitIndexArray = fruit.getFruitIndex(gameData.calorie);
 					}
 
-					this.urlToBase64("https://bbeng-bucket.oss-cn-beijing.aliyuncs.com/cocos/fruitMachine.png", (toBase64Url) => {
+					this.urlToBase64("https://bbeng-bucket.oss-cn-beijing.aliyuncs.com/cocos/fruitMachine.png", (
+						toBase64Url) => {
 						this.sendMessage("onFruitInfo", {
 							// 水果雪碧图
 							fruitBase64Url: toBase64Url,
@@ -603,16 +615,16 @@
 					}
 				} else if (temp.funName == "bindHitBoxingPost") {
 					console.log("bindHitBoxingPost");
-					
-					if(this.ConnectBindingDevice){
+
+					if (this.ConnectBindingDevice) {
 						uni.$on('updateBLEDeviceData', this.gWatchBLEUpdate);
 						//hotman 沙袋情景
 						this.gCreateSandbagAlgorithm();
 						this.gStartSimulateBLEUpdate();
 						return;
 					}
-					
-					if(!this.BLEConnectDevice)return;
+
+					if (!this.BLEConnectDevice) return;
 					//用设备来区分,开启什么加速计;
 					if (this.BLEConnectDevice.deviceType == "BLEHandle") {
 						//处理蓝牙设备情况下
@@ -620,17 +632,18 @@
 						this.onWriteBLEConnectionValue({
 							value: "3"
 						});
-						setTimeout(()=>{
+						setTimeout(() => {
 							//设置加速计b:20ms a:10ms
 							this.onWriteBLEConnectionValue({
 								value: config.refreshRate
 							});
-							
-						},2000)
-						
+
+						}, 2000)
+
 						uni.$on('updateBLEDeviceData', this.gWatchBLEUpdate);
 
-						if (this.BLEConnectDevice.usageMode == "phone" || this.BLEConnectDevice.usageMode == "general") {
+						if (this.BLEConnectDevice.usageMode == "phone" || this.BLEConnectDevice.usageMode ==
+							"general") {
 							//手机情景或者自由模式
 							this._createEquipmentBasedOnBoxingPostHit();
 						} else if (this.BLEConnectDevice.usageMode == "hotman") {
@@ -649,7 +662,8 @@
 									this.bGameOpenListen = true;
 									this.$store.state.globalAcc = accId;
 									uni.$on('watchAcceleration', this.gWatchHitBoxingAcc);
-									if (this.BLEConnectDevice.usageMode == "phone" || this.BLEConnectDevice.usageMode == "general") {
+									if (this.BLEConnectDevice.usageMode == "phone" || this.BLEConnectDevice
+										.usageMode == "general") {
 										//手机情景或者自由模式
 										this._createEquipmentBasedOnBoxingPostHit();
 									} else if (this.BLEConnectDevice.usageMode == "hotman") {
@@ -660,30 +674,32 @@
 								}
 							});
 						}
-					} else if(this.BLEConnectDevice.deviceType == "BLERope"){
+					} else if (this.BLEConnectDevice.deviceType == "BLERope") {
 						//todo 开启跳绳模式
 						this.B_OpenRopeSkipping();
+						this._createActionJumpOnBoxingPostHit();
 						//监听蓝牙回调
 						uni.$on('updateBLEDeviceData', this.gWatchBLEUpdate);
 					}
 
 
 				} else if (temp.funName == "unbindHitBoxingPost") {
-					
-					if(this.ConnectBindingDevice){
+
+					if (this.ConnectBindingDevice) {
 						uni.$off('updateBLEDeviceData', this.gWatchBLEUpdate);
 						this.gStopSimulateBLEUpdate();
 						return;
 					}
-					
-					if (this.BLEConnectDevice&&this.BLEConnectDevice.deviceType == "BLEHandle") {
+
+					if (this.BLEConnectDevice && this.BLEConnectDevice.deviceType == "BLEHandle") {
 						//开启设备回调 3/4关闭
 						this.onWriteBLEConnectionValue({
 							value: "4"
 						});
 						uni.$off('updateBLEDeviceData', this.gWatchBLEUpdate);
-					}else if (this.BLEConnectDevice && this.BLEConnectDevice.deviceType == "BLERope") {
-					 	console.warn("unbindHitBoxingPost 还没设置关闭跳绳模式")
+					} else if (this.BLEConnectDevice && this.BLEConnectDevice.deviceType == "BLERope") {
+						console.warn("unbindHitBoxingPost 还没设置关闭跳绳模式")
+						this.onClearData();
 						this.B_CloseRopeSkipping();
 						uni.$off('updateBLEDeviceData', this.gWatchBLEUpdate);
 					} else {
@@ -705,8 +721,8 @@
 					});
 				} else if (temp.funName == "writeBLEConnectionValue") {
 					if (!gameData.value || gameData.value == "") return;
-					
-					if(!this.BLEConnectDevice)return;
+
+					if (!this.BLEConnectDevice) return;
 					//蓝牙写入数据
 					this.onWriteBLEConnectionValue(gameData);
 				} else if (temp.funName == "log") {
@@ -721,13 +737,12 @@
 					uni.$off('updateBLEDeviceJson', this.BLEJsonCallback);
 				}
 				//获取手机原始陀螺仪和加速计数据
-				else if(temp.funName == "onStartAccAndGyro"){
+				else if (temp.funName == "onStartAccAndGyro") {
 					this.bMyAttitudeListen = true;
 					this.gStartSimulateBLEUpdate();
 					//监听蓝牙回调
 					uni.$on('updateBLEDeviceData', this.gWatchBLEUpdate);
-				}
-				else if(temp.funName == "onStopAccAndGyro"){
+				} else if (temp.funName == "onStopAccAndGyro") {
 					this.bMyAttitudeListen = false;
 					this.gStopSimulateBLEUpdate();
 					//监听蓝牙回调
@@ -738,11 +753,11 @@
 				// 监听页面加载成功
 				this.PageStart = true;
 				console.log("onPageStart==", e);
-				setTimeout(()=>{
+				setTimeout(() => {
 					//加载成功后,显示
 					uni.getCurrentSubNVue().show('fade-in', 250, () => {});
-				},100)
-				
+				}, 100)
+
 
 			},
 			onPageFinish: function(e) {
@@ -805,14 +820,14 @@
 				}
 			},
 			gWatchBLEUpdate: function(data) {
-				
+
 				//如果是模块外面触发,需要离线打包
-				if(this.bMyAttitudeListen){
+				if (this.bMyAttitudeListen) {
 					this.sendMessage("updateAccAndGyro", data);
 					return;
 				}
-				
-				if(this.ConnectBindingDevice){
+
+				if (this.ConnectBindingDevice) {
 					//hotman 沙袋情景 todo
 					this.gUpdateSandbagAlgorithm({
 						data: data,
@@ -820,10 +835,10 @@
 							// console.log(res);
 							if (res.type == 'hit') {
 								// console.log('gUpdateFilter callback:',res)
-					
+
 								let temp = {
 									direction: res.direction,
-									angle:res.angle,
+									angle: res.angle,
 									name: res.name,
 									ename: res.ename,
 									value: res.hit,
@@ -836,7 +851,7 @@
 					});
 					return;
 				}
-				
+
 				if (this.BLEConnectDevice.usageMode == "phone" || this.BLEConnectDevice.usageMode == "general") {
 					//手机情景或者自由模式
 					let {
@@ -863,7 +878,7 @@
 
 								let temp = {
 									direction: res.direction,
-									angle:res.angle,
+									angle: res.angle,
 									name: res.name,
 									ename: res.ename,
 									value: res.hit,
@@ -874,19 +889,28 @@
 							}
 						}
 					});
-				} else if(this.BLEConnectDevice.usageMode == "ropeSkipping"){
+				} else if (this.BLEConnectDevice.usageMode == "ropeSkipping") {
 					//跳绳模式场景,简单更新触发
 					//看看是否反馈一个角度,180 ,360
-					let temp = {
-						direction: "all",
-						angle: 0,
-						name: "击中",// this.BLEConnectDevice.name,
-						ename: "hit",//this.BLEConnectDevice.ename,
-						value: 10,
-						mass: 10, //质量
-						hitPower: 10 //计算的力
-					}
-					this.sendMessage("onBoxingPostHit", temp);
+					// let temp = {
+					// 	direction: "all",
+					// 	angle: 0,
+					// 	name: "击中", // this.BLEConnectDevice.name,
+					// 	ename: "hit", //this.BLEConnectDevice.ename,
+					// 	value: 10,
+					// 	mass: 10, //质量
+					// 	hitPower: 10 //计算的力
+					// }
+					// this.sendMessage("onBoxingPostHit", temp);
+					this.onConvertDeviceData({
+						data: data,
+						callback: (outData) => {
+							data.acc = outData.convertAcc;
+							data.gyro = outData.convertGyro;
+							//跳绳蓝牙反馈
+							this.onBLERopeUpdate(data);
+						}
+					});
 				}
 			},
 
@@ -905,23 +929,28 @@
 							for (let i = 0; i < this.xAccArray.length; i++) {
 								if (this.xAccArray[i] < 0 && this.xAccArray[i] < this.xAccArray[this.xMin]) {
 									this.xMin = i;
-								} else if (this.xAccArray[i] > 0 && this.xAccArray[i] > this.xAccArray[this.xMax]) {
+								} else if (this.xAccArray[i] > 0 && this.xAccArray[i] > this.xAccArray[this
+										.xMax]) {
 									this.xMax = i;
 								}
 							}
 							console.log(this.xAccArray, "==", this.xMin, "==", this.xMax);
 							if (this.xAccArray[this.xMin] < 0 && this.xAccArray[this.xMax] > 0) {
 								if (this.xMin > this.xMax)
-									this.onHit("xRCount", "左勾拳", "leftPunch", this.xAccArray[this.xMin], Math.ceil(Math.abs(this.xAccArray[this.xMin]) *
+									this.onHit("xRCount", "左勾拳", "leftPunch", this.xAccArray[this.xMin], Math.ceil(
+										Math.abs(this.xAccArray[this.xMin]) *
 										puchConfig.BOXING_MASS));
 								else if (this.xMin < this.xMax)
-									this.onHit("xLCount", "右勾拳", "rightPunch", this.xAccArray[this.xMax], Math.ceil(Math.abs(this.xAccArray[this
-										.xMax]) * puchConfig.BOXING_MASS));
+									this.onHit("xLCount", "右勾拳", "rightPunch", this.xAccArray[this.xMax], Math
+										.ceil(Math.abs(this.xAccArray[this
+											.xMax]) * puchConfig.BOXING_MASS));
 							} else if (this.xAccArray[this.xMin] < 0) {
-								this.onHit("xLCount", "右勾拳", "rightPunch", this.xAccArray[this.xMin], Math.ceil(Math.abs(this.xAccArray[this.xMin]) *
+								this.onHit("xLCount", "右勾拳", "rightPunch", this.xAccArray[this.xMin], Math.ceil(
+									Math.abs(this.xAccArray[this.xMin]) *
 									puchConfig.BOXING_MASS));
 							} else if (this.xAccArray[this.xMax] > 0) {
-								this.onHit("xRCount", "左勾拳", "leftPunch", this.xAccArray[this.xMax], Math.ceil(Math.abs(this.xAccArray[this.xMax]) *
+								this.onHit("xRCount", "左勾拳", "leftPunch", this.xAccArray[this.xMax], Math.ceil(Math
+									.abs(this.xAccArray[this.xMax]) *
 									puchConfig.BOXING_MASS));
 							}
 							setTimeout(() => {
@@ -978,7 +1007,97 @@
 					}
 					this.sendMessage("onBoxingPostHit", temp);
 				})
-			}
+			},
+
+			//创建一个 跳识别对象
+			_createActionJumpOnBoxingPostHit() {
+				this.actionJumpObj = new ActionJump();
+				this.actionJumpObj.addEventListener('resultant', (e) => {
+					let temp = {
+						direction: "all",
+						angle: 0,
+						name: "击中", // this.BLEConnectDevice.name,
+						ename: "hit", //this.BLEConnectDevice.ename,
+						value: 10,
+						mass: 10, //质量
+						hitPower: 10 //计算的力
+					}
+					if (e.type == 'stateDataOfJump') {
+						console.log("game stateDataOfJump");
+						this.sendMessage("onBoxingPostHit", temp);
+					} else if (e.type == 'stop') {
+						console.log("game stop");
+						this.onClearData();
+						// this.sendMessage("onBoxingPostHit", temp);
+					}
+				})
+			},
+			/**
+			 * @param {Object} gameData
+			 * 识别跳部分数据处理
+			 */
+			onBLERopeUpdate(gameData) {
+				//********陀螺仪角速度********
+				let {
+					gx,
+					gy,
+					gz
+				} = gameData.gyro;
+				let {
+					min,
+					s,
+					ms
+				} = gameData;
+				//-gameData.acc.ax * 10;
+				let _ax = gameData.acc.ax * 10;
+				let _ay = gameData.acc.ay * 10;
+				let _az = gameData.acc.az * 10;
+				//低通滤波分离重力
+				let alpha = 0.8;
+				this.xA = alpha * this.xA + (1 - alpha) * _ax;
+				this.yA = alpha * this.yA + (1 - alpha) * _ay;
+				this.zA = alpha * this.zA + (1 - alpha) * _az;
+			
+				//高通滤波获取线性速度
+				let linear_acceleration_x = _ax - this.xA;
+				let linear_acceleration_y = _az - this.zA;
+				let linear_acceleration_z = _ay - this.yA;
+			
+				let _temp = {
+					linearAcc: {
+						lAccX: linear_acceleration_x,
+						lAccY: linear_acceleration_y,
+						lAccZ: linear_acceleration_z
+					}, //gameData.acc,
+					oriAcc: {
+						oAccX: _ax,
+						oAccY: _ay,
+						oAccZ: _az
+					},
+					gravityAcc: {
+						gravityX: this.xA,
+						gravityY: this.yA,
+						gravityZ: this.zA
+					},
+					bLimitRebound: false,
+					resultant: Math.sqrt(_ax * _ax +
+						_ay * _ay + _az * _az),
+					runIndex: this.BLEAccIndex,
+					//陀螺仪
+					oriGyro: {
+						oGyroX: gx,
+						oGyroY: gy,
+						oGyroZ: gz
+					},
+					//输入当前轴
+					bYAxis: true,
+				};
+				this.actionJumpObj.updateJump(_temp);
+				this.BLEAccIndex++;
+			},
+			onClearData() {
+				this.BLEAccIndex = 0;
+			},
 		}
 	}
 </script>
@@ -1039,7 +1158,7 @@
 		opacity: 0.5;
 
 		/* #ifndef APP-PLUS-NVUE */
-		z-Index: 10;
+		z-Index: 100;
 		display: flex;
 		/* #endif */
 

+ 23 - 29
pages/personal-page/devices-hardware/devices-hardware.vue

@@ -235,7 +235,7 @@
 		onShow() {
 			this.bShow = true;
 			this.bLimitClose = false;
-			console.log(this.cIndex, this.BLEDeviceShowList, this.BLEConnectDevice, this.devicesList);
+			// console.log(this.cIndex, this.BLEDeviceShowList, this.BLEConnectDevice, this.devicesList);
 			//this.bConnection &&
 			if (this.bVerifiedConnection && this.BLEConnectDevice) {
 				for (let i = 0; i < this.devicesList.length; i++) {
@@ -318,7 +318,7 @@
 				}
 				let _self = this;
 				let mac = res.value;
-				console.log('mac =====', mac);
+				// console.log('mac =====', mac);
 				//用返回的mac 判断,如果非法,则断开连接
 				//就判断一下是否
 				//测试
@@ -347,7 +347,7 @@
 					mac: mac,
 				}).then(
 					res => {
-						console.log('BLEFINDHASBIND:', res);
+						console.log('BLEFINDHASBIND:'+mac+" = "+JSON.stringify(res));
 						if (res.code == 0) {
 							//code = 0 是新的地址,没绑定过
 							//绑定设备使用者
@@ -406,13 +406,10 @@
 					}
 				);
 			},
+			/**
+			 * 连接设备成功
+			 */
 			ConnectionSuccess() {
-				// console.log(this.cIndex, this.BLEDeviceShowList, this.BLEConnectDevice);
-				// uni.showToast({
-				// 	icon: "none",
-				// 	title: "连接设备成功!",
-				// 	duration: 2000
-				// })
 				for (let i = 0; i < this.devicesList.length; i++) {
 					let eq = this.devicesList[i];
 					if (
@@ -427,11 +424,8 @@
 						 * 已验证的连接设置true
 						 */
 						this.$store.state.bVerifiedConnection = true;
-
-						// setTimeout(() => {
-						// 	this.onCheckBondDevice();
-						// }, 5000)
-
+						
+						uni.hideToast();
 					}
 				}
 			},
@@ -617,7 +611,7 @@
 				uni.startBluetoothDevicesDiscovery({
 					allowDuplicatesKey: true,
 					success: res => {
-						console.log("startBluetoothDevicesDiscovery:", res);
+						// console.log("startBluetoothDevicesDiscovery:", res);
 
 						_self.bSwitch = false;
 						_self.onBluetoothDeviceFound();
@@ -648,7 +642,7 @@
 			stopBluetoothDevicesDiscovery() {
 				uni.stopBluetoothDevicesDiscovery({
 					success: e => {
-						console.log('停止搜索蓝牙设备:' + e.errMsg);
+						// console.log('停止搜索蓝牙设备:' + e.errMsg);
 					},
 					fail: e => {
 						console.log('停止搜索蓝牙设备失败,错误码:' + e.errCode);
@@ -689,7 +683,7 @@
 								id: _self.currentItem.id
 							}, device);
 
-							console.log(device, "****", obj, _self.saveObj, _self.currentItem)
+							// console.log(device, "****", obj, _self.saveObj, _self.currentItem)
 							// 先直连,然后判断版本
 							_self._onConnectDevice(obj);
 							_self.stopBluetoothDevicesDiscovery();
@@ -735,10 +729,10 @@
 							// 初始化服务后,获取版本,判断
 							// 停止蓝牙加速计
 							this.writeMacTimeout = setTimeout(() => {
-								//停止蓝牙加速计
-								this.onWriteBLEConnectionValue({
-									value: "4"
-								});
+								//todo 停止蓝牙加速计
+								// this.onWriteBLEConnectionValue({
+								// 	value: "4"
+								// });
 								// 发送获取mac
 								this.onWriteBLEConnectionValue({
 									value: "M"
@@ -751,7 +745,7 @@
 									uni.hideToast();
 									uni.showModal({
 										title: '提示',
-										content: '检测设备失败。\r\n1.检查手机蓝牙是否已连接上设备。\r\n2.再次尝试连接或者 重启手柄(Reset键位也可)后再尝试连接'
+										content: '检测设备失败。\r\n1.再次尝试连接。\r\n2.或者重启手柄(Reset键位也可)后再尝试连接'
 									})
 									this.onOnlyCloseBLEConnection({
 										getSuccess: () => {
@@ -772,7 +766,7 @@
 				this.onCreateBLESuccess({
 					item: item,
 					getSuccess: () => {
-						console.log("****创建一个连接*******");
+						// console.log("****创建一个连接*******");
 						this.getServicesTimeout = setTimeout(() => {
 							this.onGetBLEDeviceServices({
 								item: item,
@@ -789,10 +783,10 @@
 									// 初始化服务后,获取版本,判断
 									// 停止蓝牙加速计
 									this.writeMacTimeout = setTimeout(() => {
-										//停止蓝牙加速计
-										this.onWriteBLEConnectionValue({
-											value: "4"
-										});
+										//todo 停止蓝牙加速计
+										// this.onWriteBLEConnectionValue({
+										// 	value: "4"
+										// });
 										// 发送获取mac
 										this.onWriteBLEConnectionValue({
 											value: "M"
@@ -805,7 +799,7 @@
 											uni.hideToast();
 											uni.showModal({
 												title: '提示',
-												content: '检测设备失败。\r\n1.检查手机蓝牙是否已连接上设备。\r\n2.再次尝试连接或者 重启手柄(Reset键位也可)后再尝试连接'
+												content: '检测设备失败。\r\n1.再次尝试连接。\r\n2.或者重启手柄(Reset键位也可)后再尝试连接'
 											})
 											this.onOnlyCloseBLEConnection({
 												getSuccess: () => {
@@ -854,7 +848,7 @@
 					}
 					this.currentItem = null;
 					this.currentItem = item;
-					console.log("this.currentItem ==2:", this.currentItem, this.bOpenBluetooth, this.BLEConnectDevice);
+					// console.log("this.currentItem ==2:", this.currentItem, this.bOpenBluetooth, this.BLEConnectDevice);
 					this.startBluetoothDeviceDiscovery();
 				}
 			},

+ 79 - 64
pages/personal-page/personal/personal.vue

@@ -2,8 +2,8 @@
 
 <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">
+		<uni-nav-bar id="nav-bar" status-bar="true" backgroundColor="RGBA(30, 30, 85, 1)" @clickLeft="showClickEvent()"
+			color="#FFFFFF" fixed="true" :border="false">
 			<view slot="left">
 				<view class=" flex align-center margin-left">
 					<image class="png-more" src="/static/more.png"></image>
@@ -13,13 +13,15 @@
 				<view class="flex justify-center align-center" style="margin-left: 160rpx; ">
 					<view class="flex align-center "
 						style="margin-right: 40rpx; padding: 0 18px; height: 56rpx; background-color: rgba(255, 153, 0, 1); border-radius: 13.5px;">
-						<image class="png-more-black" style="margin-right: 16rpx;" src="/static/common/sideBar/gold_black@2x.png">
+						<image class="png-more-black" style="margin-right: 16rpx;"
+							src="/static/common/sideBar/gold_black@2x.png">
 						</image>
 						<view class="text-14px" style="line-height: 28rpx;">{{cGold}}</view>
 					</view>
 					<view class="flex  align-center"
 						style="padding: 0 18px; height: 56rpx; background-color: rgba(255, 153, 0, 1); border-radius: 13.5px;">
-						<image class="png-more-black" style="margin-right: 16rpx; " src="/static/common/sideBar/diamond_black@2x.png">
+						<image class="png-more-black" style="margin-right: 16rpx; "
+							src="/static/common/sideBar/diamond_black@2x.png">
 						</image>
 						<view class="text-14px" style="line-height: 28rpx;">{{cDiamond}}</view>
 					</view>
@@ -72,52 +74,57 @@
 
 							<!-- pk模式下的跳绳 -->
 							<block v-if="1 === currentModeIndex">
-								<view v-if="currentMode == 'pkMode'" class="flex justify-center "
-									style="height: 180rpx; margin-top: 20rpx;">
-									<view class="flex flex-direction justify-center align-center">
-										<view class="cu-avatar-group" style="position: relative;">
-											<view class="cu-avatar round xl" :class="bAiHitShake?' screen-jitter':''"
-												:style="[{ backgroundImage:'url('+avatarUrl+')' }]"></view>
-										</view>
-										<view style="margin-top: 20rpx; width: 165rpx; "
-											class="text-cut text-white text-center">
-											{{userName}}
+								<view v-if="currentMode == 'pkMode'" class="position-relative"
+									style="height: 128rpx; background-color: RGBA(30, 30, 85, 1);  z-index: 10;">
+									<view style="height: 14rpx;"></view>
+									<view class="position-absolute-center-top flex justify-center" style="height: 148rpx;">
+										<view class="flex flex-direction justify-center align-center">
+											<view class="cu-avatar-group" style="position: relative;">
+												<view class="cu-avatar round xl"
+													:class="bAiHitShake?' screen-jitter':''"
+													:style="[{ backgroundImage:'url('+avatarUrl+')' }]" style="width: 102.4rpx ;height: 102.4rpx;"></view>
+											</view>
+											<view style="margin-top: 8rpx; width: 165rpx; "
+												class="text-cut text-white text-center">
+												{{userName}}
+											</view>
 										</view>
-									</view>
 
-									<view class="flex justify-center align-center " style=" width: 300rpx;">
-										<LEDFont style="" :showValue='AJData.myScore' :size="30" color='#FFFFFF'>
-										</LEDFont>
-										<view class="text-white text-bold">:</view>
-										<LEDFont style="" :showValue='AJData.otherScore' :size="30" color='#FFFFFF'>
-										</LEDFont>
-									</view>
-									<view v-if="finallySelectFriendInfo"
-										class="flex flex-direction justify-center align-center"
-										@click="onNavToSelectFriend()">
-										<view class="cu-avatar-group" style="position: relative;">
-											<view class="cu-avatar round xl" :class="bHitShake?' screen-jitter':''"
-												:style="[{ backgroundImage:'url('+finallySelectFriendInfo.avatarUrl+')' }]">
-											</view>
+										<view class="flex justify-center align-center " style=" width: 300rpx;">
+											<LEDFont style="" :showValue='AJData.myScore' :size="30" color='#FFFFFF'>
+											</LEDFont>
+											<view class="text-white text-bold">:</view>
+											<LEDFont style="" :showValue='AJData.otherScore' :size="30" color='#FFFFFF'>
+											</LEDFont>
 										</view>
-										<view style="margin-top: 20rpx; width: 165rpx;"
-											class="text-cut text-white text-center">
-											{{finallySelectFriendInfo.username}}
+										<view v-if="finallySelectFriendInfo"
+											class="flex flex-direction justify-center align-center"
+											@click="onNavToSelectFriend()">
+											<view class="cu-avatar-group" style="position: relative;">
+												<view class="cu-avatar round xl" :class="bHitShake?' screen-jitter':''"
+													:style="[{ backgroundImage:'url('+finallySelectFriendInfo.avatarUrl+')' }]" style="width: 102.4rpx ;height: 102.4rpx;">
+												</view>
+											</view>
+											<view style="margin-top: 8rpx; width: 165rpx;"
+												class="text-cut text-white text-center">
+												{{finallySelectFriendInfo.username}}
+											</view>
 										</view>
-									</view>
-									<view v-else class="flex flex-direction justify-center align-center"
-										@click="onNavToSelectFriend()">
-										<image style="width: 100rpx ;height: 100rpx;"
-											src="/static/friend/friend-add.png">
-										</image>
-										<view style="margin-top: 20rpx; width: 165rpx;"
-											class="text-cut text-white text-center">
-											选择好友
+										<view v-else class="flex flex-direction justify-center align-center"
+											@click="onNavToSelectFriend()">
+											<image style="width: 102.4rpx ;height: 102.4rpx;"
+												src="/static/friend/friend-add.png">
+											</image>
+											<view style="margin-top: 8rpx; width: 165rpx;"
+												class="text-cut text-white text-center">
+												选择好友
+											</view>
 										</view>
 									</view>
+
 								</view>
 								<!-- 80rpx -->
-								<view v-else style="height:20rpx;"> </view>
+								<view v-else style="height:14rpx; background-color: RGBA(30, 30, 85, 1);"> </view>
 							</block>
 
 							<!-- 圆形进度条 -->
@@ -125,7 +132,8 @@
 								v-if="(currentMode == 'pkMode' && 1 === currentModeIndex)||currentMode== 'calorieMode'"
 								class="qiun-charts-arcbar">
 								<!-- 进度条 -->
-								<canvas v-show="false" canvas-id="canvasArcbar" id="canvasArcbar" class="charts-arcbar "></canvas>
+								<canvas v-show="false" canvas-id="canvasArcbar" id="canvasArcbar"
+									class="charts-arcbar "></canvas>
 								<!-- 图标 -->
 								<!-- <view class="personal-fruit-container">
 									<image style="width: 36rpx;height: 56rpx; margin-top: -120px;"
@@ -133,21 +141,20 @@
 								</view> -->
 
 								<!-- 图标 -->
-							<!-- 	<view class="personal-fruit-container">
+								<!-- 	<view class="personal-fruit-container">
 									<view class="text-13px text-white" style="margin-top: -50px;">
 										失误:{{AJData.faultCount}}</view>
 								</view> -->
 
 								<!-- 跳动次数 -->
-								<view class="position-absolute-center-bottom flex" style="align-items: flex-end; height: 276rpx;">
-									<LEDFont style="margin-left: 117rpx;" :showValue='AJData.allCount' :height="120" :size="120"
-										color='#FF9900'>
+								<view class="position-absolute-center-bottom flex justify-center"
+									style="align-items: flex-end; height: 276rpx; bottom: 40rpx;">
+									<LEDFont style="" :showValue='AJData.allCount-AJData.faultCount' :height="120"
+										:size="120" color='#FF9900'>
 									</LEDFont>
-									<LEDFont  showValue="/" :height="65" :size="65"
-										color='#FFFFFF'>
+									<LEDFont showValue="/" :height="65" :size="65" color='#FFFFFF'>
 									</LEDFont>
-									<LEDFont  :showValue='199' :height="65" :size="65"
-										color='#FFFFFF'>
+									<LEDFont :showValue='AJData.targetCount' :height="65" :size="65" color='#FFFFFF'>
 									</LEDFont>
 								</view>
 								<!-- 计时器 -->
@@ -199,9 +206,9 @@
 			<!-- <view class="example">
 				<button @click="onTipLevel">显示 ontipLevel</button>
 			</view> -->
-			<!-- <view class="example" style="margin-top: 10rpx;">
+			<view class="example" style="margin-top: 10rpx;">
 				<button @click="onNavToDirection">跳转校准页面</button>
-			</view> -->
+			</view>
 			<!-- <view class="example">
 				<button @click="onGetBluetoothConnectView({
 												hiddenType: 'firstInstallation'
@@ -210,6 +217,12 @@
 			<!-- <view class="example">
 				<button @click="onUserSignIn()">签到</button>
 			</view> -->
+			<!-- <view class="example">
+				<button @click="showGuide('plan', {
+												hiddenType: 'firstInstallation'
+											})">计划</button>
+			</view> -->
+			
 			<view style="height: 100rpx;"></view>
 		</scroll-view>
 
@@ -220,7 +233,8 @@
 				data-target="slideUpModal"></image> -->
 			<image style="width: 248rpx;height: 104rpx;" class="position-absolute-center"
 				src="../../../static/modal/level-tip/level-tip-bg-orange.png"></image>
-			<view class="text-blue bg-white radius " style="z-index: 10; margin-top: 20rpx; width: 72rpx; height: 12rpx;"></view>
+			<view class="text-blue bg-white radius "
+				style="z-index: 10; margin-top: 20rpx; width: 72rpx; height: 12rpx;"></view>
 			<!-- <image style="width: 30px;height: 23px; " src="../../../static/modal/level-tip/level-tip-logo@2x.png">
 			</image> -->
 			<!-- <view style="width: 100%;height: 16rpx; background-color: #FFFFFF; color: #FFFFFF;"></view> -->
@@ -354,8 +368,7 @@
 		<view class="cu-modal bottom-modal" :class="modalName=='slideUpModal'?'show':''" @tap="hideModal">
 			<view class="cu-dialog bg-white" style="border-radius: 15px 15px 0 0 ;" @tap.stop="">
 				<view class="flex justify-center align-center position-relative"
-				 style="width: 750rpx; height: 64rpx; background-color: RGBA(255, 153, 0, 1);"
-					@tap="hideModal">
+					style="width: 750rpx; height: 64rpx; background-color: RGBA(255, 153, 0, 1);" @tap="hideModal">
 					<view class="text-blue bg-white radius" style="width: 114rpx; height: 12rpx;"></view>
 					<!-- <view class="position-absolute-right-top">
 						<image style="width: 64rpx;height: 64rpx;" src="../../../static/common/modal/task-close@2x.png">
@@ -483,8 +496,8 @@
 			updateData(newValue, oldValue, ownerInstance, instance) {
 				// newValue: 新数据
 				// oldValue: 老数据
-				var log = console.log.bind(console);
-				log(newValue)
+				// var log = console.log.bind(console);
+				// log(newValue)
 			}
 		}
 	}
@@ -733,6 +746,7 @@
 				AJData: {
 					allCount: 0,
 					faultCount: 0,
+					targetCount: 0,
 					perCountDown: 0,
 					gameCountDown: 0,
 					//pk部分参数
@@ -950,7 +964,7 @@
 		onReady() {
 			// 计算屏幕剩余高度  填补剩余高度
 			// 计算组件的高度
-			_self.scrollviewHight = this.systemInfo.windowHeight - this.navHeight - this.tabbarHeight - 16 - this
+			_self.scrollviewHight = this.systemInfo.windowHeight - this.navHeight - this.tabbarHeight - 10 - this
 				.systemInfo
 				.statusBarHeight;
 
@@ -1629,7 +1643,7 @@
 				/**
 				 * 蓝牙部分操作,转全局变量操作
 				 * */
-				console.log("openDeviceList bOpenBluetooth", this.bOpenBluetooth);
+				// console.log("openDeviceList bOpenBluetooth", this.bOpenBluetooth);
 				// #ifdef APP-PLUS
 				if (!this.bOpenBluetooth) {
 
@@ -2776,9 +2790,10 @@
 					faultCount: 0,
 					perCountDown: 0,
 					gameCountDown: 0,
-					gameLimitTime: _item.limitTime
+					gameLimitTime: _item.limitTime,
+					targetCount:_item.signCount,
 				})
-				console.log('onSetActionJumpData', JSON.stringify(this.AJData), JSON.stringify(_item));
+				// console.log('onSetActionJumpData'+JSON.stringify(this.AJData)+JSON.stringify(_item));
 			},
 			onActionJumpGameOver(data) {
 				let {
@@ -3332,7 +3347,7 @@
 	.bg-person {
 		/* background-color: #9797ff; */
 		background-color: #00003D;
-		
+
 		/* #ifdef H5 */
 		/* background-size:750rpx 1622rpx;
 		background-image: url(../../../static/modal/action-jump/temp-tip.png); */
@@ -3374,7 +3389,7 @@
 		position: relative;
 		width: 750rpx;
 		/* border: 1rpx solid #fff; */
-		/* background-color: RGBA(30, 30, 85, 1); */
+		background-color: RGBA(30, 30, 85, 1);
 	}
 
 	.charts-arcbar {

+ 4 - 4
pages/platform-page/guide/guide-level-scroll.vue

@@ -76,12 +76,12 @@
 					{
 						title: '解锁左右跳',
 						firstText: '此为左跳图标,通过向左跳的方式消除标志块',
-						firstImage: '../../../static/modal/action-jump/directionJumpWhite.png',
+						firstImage: '../../../static/modal/action-jump/directionJumpWhite-left.png',
 						firstDirection: -1,
 						firstWidth: 68,
 						firstHeight: 68,
 						secondText: '此为右跳图标,通过向右跳的方式消除标志块',
-						secondImage: '../../../static/modal/action-jump/directionJumpWhite.png',
+						secondImage: '../../../static/modal/action-jump/directionJumpWhite-right.png',
 						secondDirection: 1,
 						secondWidth: 68,
 						secondHeight: 68,
@@ -90,12 +90,12 @@
 					{
 						title: '解锁左右旋跳',
 						firstText: '此为左旋跳图标,通过向左旋跳的方式消除标志块',
-						firstImage: '../../../static/modal/action-jump/directionJumpWhite.png',
+						firstImage: '../../../static/modal/action-jump/directionJumpWhite-left.png',
 						firstDirection: -1,
 						firstWidth: 68,
 						firstHeight: 68,
 						secondText: '此为右旋跳图标,通过向右旋跳的方式消除标志块',
-						secondImage: '../../../static/modal/action-jump/directionJumpWhite.png',
+						secondImage: '../../../static/modal/action-jump/directionJumpWhite-right.png',
 						secondDirection: 1,
 						secondWidth: 68,
 						secondHeight: 68,

+ 24 - 16
platform/app-plus/subNVue/guide.nvue

@@ -25,7 +25,7 @@
 						</view>
 					</view>
 				</view>
-				<view style="width: 750rpx;height: 82rpx;" class="flex flex-direction-row">
+				<!-- <view style="width: 750rpx;height: 82rpx;" class="flex flex-direction-row">
 					<view class="flex-sub mask-bg-07"></view>
 					<view class="position-relative justify-center align-center"
 						style="width: 147px;height: 82rpx; background-color: rgba(0,0,0,0.7);">
@@ -34,8 +34,16 @@
 						<image style="width: 30px;height: 23px; "
 							src="../../../static/modal/level-tip/level-tip-logo@2x.png"></image>
 					</view>
-
-
+					<view class="flex-sub mask-bg-07"></view>
+				</view> -->
+				<view style="width: 750rpx;height: 82rpx;" class="flex flex-direction-row">
+					<view class="flex-sub mask-bg-07"></view>
+					<view class="position-relative align-center"
+						style="width: 248rpx;height: 104rpx; background-color: rgba(0,0,0,0.7);">
+						<image  class="position-absolute-center" style="width: 248rpx;height: 104rpx; top: 18rpx;"
+								src="../../../static/modal/level-tip/level-tip-bg-orange.png"></image>
+						<view style="margin-top: 38rpx; width: 72rpx; height: 12rpx; background-color: #FFFFFF; border-radius: 18px;"></view>
+					</view>
 					<view class="flex-sub mask-bg-07"></view>
 				</view>
 			</view>
@@ -64,22 +72,22 @@
 			<!-- top: 55px; 相当于 上间隔 -->
 			<view class="mask-bg-07" :style="{height:guideHeight+'px'}"></view>
 			<!-- 中心位置 225 -->
-			<view style="width: 750rpx;height: 284px;">
-				<view style="height: 200px;" class="mask-bg-07">
-					<view class="position-absolute-center" style="top: 0;left:100rpx;">
+			<view style="width: 750rpx;height: 284px;" >
+				<view style="height: 220px;" class="mask-bg-07">
+					<view class="position-absolute-center-bottom">
 						<image style="width: 488rpx;height: 366rpx;"
 							src="../../../static/common/subNVue/guide/guide-plan@3x.png">
 						</image>
 					</view>
 					<view class="position-absolute-center">
 						<text class="text-white text-14px text-lines2"
-							style="top: -30rpx;left:90rpx; width: 300rpx;">请先定制属于您的专属计划</text>
+							style="top: 20rpx;left:40rpx; width: 300rpx;">请先定制属于您的专属计划</text>
 					</view>
 				</view>
-				<view style="width: 750rpx;height: 120px;" class="flex flex-direction-row">
+				<view style="width: 750rpx;height: 100px;" class="flex flex-direction-row">
 					<!-- 32+ 60/2 -->
 					<view style="width: 62px;" class="mask-bg-07"></view>
-					<image style="width: 90px;height: 150px; opacity: 0.7;"
+					<image style="width: 90px;height: 100px; opacity: 0.7;"
 						src="../../../static/common/subNVue/guide/guide-rect-mask.png"></image>
 					<view class="mask-bg-07 flex-sub"></view>
 				</view>
@@ -122,13 +130,13 @@
 			<!-- 中心位置 225 -->
 			<view style="width: 750rpx;height: 764rpx;">
 				<view style="height: 596rpx;" class="mask-bg-07">
-					<view class="position-absolute-center" style="top: 0;left:31rpx;">
+					<view class="position-absolute-center-bottom" style="left:31rpx;">
 						<image style="width: 442rpx;height: 372rpx;"
 							src="../../../static/common/subNVue/guide/guide-bluetooth@3x.png">
 						</image>
 					</view>
 					<view class="position-absolute-center">
-						<text class="text-white text-14px" style="left: 20px;top: -5px;">请先连接蓝牙设备.</text>
+						<text class="text-white text-14px" style="left: 20px;top: 50px;">请先连接蓝牙设备</text>
 						<!-- <text class="text-left  text-white text-14px"
 							style="width: 542rpx;">1、长按开关键3秒,绿灯连续闪烁为可连接状态.</text>
 						<text class="text-left  text-white text-14px" style="width: 542rpx;">2、选择设备类型进行连接.</text>
@@ -250,12 +258,12 @@
 				directionJumpInfo: {
 					title: '解锁左右跳',
 					firstText: '此为左跳图标,通过向左跳的方式消除标志块',
-					firstImage: '../../../static/modal/action-jump/directionJumpWhite.png',
+					firstImage: '../../../static/modal/action-jump/directionJumpWhite-left.png',
 					firstDirection: -1,
 					firstWidth: 68,
 					firstHeight: 68,
 					secondText: '此为右跳图标,通过向右跳的方式消除标志块',
-					secondImage: '../../../static/modal/action-jump/directionJumpWhite.png',
+					secondImage: '../../../static/modal/action-jump/directionJumpWhite-right.png',
 					secondDirection: 1,
 					secondWidth: 68,
 					secondHeight: 68,
@@ -265,12 +273,12 @@
 				rotationJumpInfo: {
 					title: '解锁左右旋跳',
 					firstText: '此为左旋跳图标,通过向左旋跳的方式消除标志块',
-					firstImage: '../../../static/modal/action-jump/directionJumpWhite.png',
+					firstImage: '../../../static/modal/action-jump/directionJumpWhite-left.png',
 					firstDirection: -1,
 					firstWidth: 68,
 					firstHeight: 68,
 					secondText: '此为右旋跳图标,通过向右旋跳的方式消除标志块',
-					secondImage: '../../../static/modal/action-jump/directionJumpWhite.png',
+					secondImage: '../../../static/modal/action-jump/directionJumpWhite-right.png',
 					secondDirection: 1,
 					secondWidth: 68,
 					secondHeight: 68,
@@ -303,7 +311,7 @@
 					// vm.guideLeft = 55;
 				} else if (vm.currentType == "level-button-tip") {
 					//首页提示选择关卡
-					vm.guideHeight = vm.systemInfo.screenHeight - 284 - 32 + 3;
+					vm.guideHeight = vm.systemInfo.screenHeight - 284 - 32 + 3 + 6;
 					const value = uni.getStorageSync('levelButtonPrompt');
 					if (value) {
 						vm.isSelected = value.isSelected;

+ 2 - 1
platform/app-plus/subNVue/reward-popup.nvue

@@ -346,7 +346,8 @@
 				} else if (vm.currentType == 'signIn') {
 					vm.lists = data.lists;
 					//判断是否签到完
-					vm.isSignIn = data.isSignIn || vm.lists[vm.lists.length-1].flag == 1;
+					vm.isSignIn = data.isSignIn || vm.lists[vm.lists.length-1].isSelect;
+					// console.log(data.isSignIn +" = "+ JSON.stringify(vm.lists[vm.lists.length-1]));
 					
 				} else if (vm.currentType == "levelReward") {
 					let _item = data.item;

BIN
static/guide/blutooth/guide-ble-tip.png


BIN
static/modal/action-jump/directionJump-left.png


+ 0 - 0
static/modal/action-jump/directionJump.png → static/modal/action-jump/directionJump-right.png


BIN
static/modal/action-jump/directionJumpWhite-left.png


+ 0 - 0
static/modal/action-jump/directionJumpWhite.png → static/modal/action-jump/directionJumpWhite-right.png


BIN
static/modal/action-jump/jumpNormal-line.png


BIN
static/modal/action-jump/jumpNormal-rect.png


BIN
static/modal/action-jump/rightToLeftArrow.png


BIN
static/modal/action-jump/rotateJump-left.png


+ 0 - 0
static/modal/action-jump/rotateJump.png → static/modal/action-jump/rotateJump-right.png


BIN
static/modal/action-jump/rotateJumpWhite-left.png


+ 0 - 0
static/modal/action-jump/rotateJumpWhite.png → static/modal/action-jump/rotateJumpWhite-right.png


BIN
static/modal/action-jump/yellow-arrow.png


BIN
static/modal/level-tip/level-tip-bg-orange-guide.png


+ 77 - 0
util/util-js/Animation.js

@@ -0,0 +1,77 @@
+var Timing = {
+	easeIn: function easeIn(pos) {
+		return Math.pow(pos, 3);
+	},
+	easeOut: function easeOut(pos) {
+		return Math.pow(pos - 1, 3) + 1;
+	},
+	easeInOut: function easeInOut(pos) {
+		if ((pos /= 0.5) < 1) {
+			return 0.5 * Math.pow(pos, 3);
+		} else {
+			return 0.5 * (Math.pow(pos - 2, 3) + 2);
+		}
+	},
+	linear: function linear(pos) {
+		return pos;
+	}
+};
+
+function Animation(opts) {
+	this.isStop = false;
+	opts.duration = typeof opts.duration === 'undefined' ? 1000 : opts.duration;
+	opts.timing = opts.timing || 'linear';
+	var delay = 17;
+
+	function createAnimationFrame() {
+		if (typeof setTimeout !== 'undefined') {
+			return function(step, delay) {
+				setTimeout(function() {
+					var timeStamp = +new Date();
+					step(timeStamp);
+				}, delay);
+			};
+		} else if (typeof requestAnimationFrame !== 'undefined') {
+			return requestAnimationFrame;
+		} else {
+			return function(step) {
+				step(null);
+			};
+		}
+	};
+	var animationFrame = createAnimationFrame();
+	var startTimeStamp = null;
+	var _step = function step(timestamp) {
+		if (timestamp === null || this.isStop === true) {
+			opts.onProcess && opts.onProcess(1);
+			opts.onAnimationFinish && opts.onAnimationFinish();
+			return;
+		}
+		if (startTimeStamp === null) {
+			startTimeStamp = timestamp;
+		}
+		if (timestamp - startTimeStamp < opts.duration) {
+			var process = (timestamp - startTimeStamp) / opts.duration;
+			var timingFunction = Timing[opts.timing];
+			process = timingFunction(process);
+
+			opts.onProcess && opts.onProcess(process);
+			animationFrame(_step, delay);
+		} else {
+			opts.onProcess && opts.onProcess(1);
+			opts.onAnimationFinish && opts.onAnimationFinish();
+		}
+	};
+	_step = _step.bind(this);
+	animationFrame(_step, delay);
+}
+
+// stop animation immediately
+// and tigger onAnimationFinish
+Animation.prototype.stop = function() {
+	this.isStop = true;
+};
+
+if (typeof module === "object" && typeof module.exports === "object") {
+	module.exports = Animation;
+}

+ 53 - 55
util/util-js/action/jump-0.1.js

@@ -172,7 +172,7 @@ ActionJump.prototype.detectorNewStep = function (resultant, linearX, linearY, li
 
 			this.jumpOpts.startCount = 0;
 
-			console.log("开始:", JSON.stringify(this.frame), '当前:', resultant);
+			// console.log("开始:", JSON.stringify(this.frame), '当前:', resultant);
 
 		}
 		if (this.jumpOpts.bUpState) {
@@ -180,21 +180,21 @@ ActionJump.prototype.detectorNewStep = function (resultant, linearX, linearY, li
 			if (_judgmentValue > 2) {
 				if (_judgmentValue > this.peakOfWaveMaxValue)
 					this.peakOfWaveMaxValue += _judgmentValue;
-				this.peakOfWaveArrayValue.push(_judgmentValue);
+				// this.peakOfWaveArrayValue.push(_judgmentValue);
 
 			}
 			else if (_judgmentValue < -2) {
 				if (_judgmentValue < this.valleyOfWaveMinValue)
 					this.valleyOfWaveMinValue += _judgmentValue;
-				this.valleyOfWaveArrayValue.push(_judgmentValue);
+				// this.valleyOfWaveArrayValue.push(_judgmentValue);
 
 			}
-			if (linearZ > 2)
-				this.peakOfWaveArrayValueLinear.push(linearZ);
-			else if (linearZ < -2)
-				this.valleyOfWaveArrayValueLinear.push(linearZ);
+			// if (linearZ > 2)
+			// 	this.peakOfWaveArrayValueLinear.push(linearZ);
+			// else if (linearZ < -2)
+			// 	this.valleyOfWaveArrayValueLinear.push(linearZ);
 
-			if (Math.abs(_oGyroY) > 10)
+			if (Math.abs(_oGyroY) > 5)
 				this.oriGyroYArray.push(_oGyroY);
 			//出现极值后
 			// Math.abs(linearZ) < 7 &&
@@ -212,30 +212,30 @@ ActionJump.prototype.detectorNewStep = function (resultant, linearX, linearY, li
 					// 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 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 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 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];
-					}
+					// 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("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) ||
@@ -251,23 +251,23 @@ ActionJump.prototype.detectorNewStep = function (resultant, linearX, linearY, li
 					}
 					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: "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",
@@ -283,15 +283,13 @@ ActionJump.prototype.detectorNewStep = function (resultant, linearX, linearY, li
 
 			}
 		}
-
-
 		if ((this.frameOffset += 1) >= this.frameCapacity) {
 			this.frameOffset -= this.frameCapacity;
 		}
 	} else if (this.jumpOpts.bUpdateTimeOfPeakCount) {
 		this.jumpOpts.timeOfPeakCount++;
 		//todo 如果直跳,可以调节更小的 limitTimeOfPeakCount
-		let limitTimeOfPeakCount = 40;
+		let limitTimeOfPeakCount = 30;
 		if (this.jumpOpts.timeOfPeakCount >= limitTimeOfPeakCount) {
 			this.jumpOpts.timeOfPeakCount = 0;
 			this.jumpOpts.bStopJump = false;
@@ -303,15 +301,15 @@ ActionJump.prototype.detectorNewStep = function (resultant, linearX, linearY, li
 			this.jumpOpts.bUpdateTimeOfPeakCount = false;
 		}
 	}
-	this.event.trigger('resultant', {
-		type: "bUpdateDraw",
-		linearX: linearX,
-		linearZ: linearZ,
-		linearY: linearY,
-		oriX: oriX,
-		oriY: oriY,
-		oriZ: oriZ
-	});
+	// this.event.trigger('resultant', {
+	// 	type: "bUpdateDraw",
+	// 	linearX: linearX,
+	// 	linearZ: linearZ,
+	// 	linearY: linearY,
+	// 	oriX: oriX,
+	// 	oriY: oriY,
+	// 	oriZ: oriZ
+	// });
 }
 
 

+ 20 - 90
util/util-js/effect/firework.js

@@ -40,7 +40,7 @@ function calculateDistance(p1x, p1y, p2x, p2y) {
 
 
 // create firework
-var Firework = function Firework(image, typeImage, direction, tx, ty, cw, ch) {
+var Firework = function Firework(image, typeImage, direction, tx, ty, cw, ch,offest) {
 	this.event = new Event();
 	//图片信息
 	this.image = image;
@@ -74,6 +74,8 @@ var Firework = function Firework(image, typeImage, direction, tx, ty, cw, ch) {
 
 	this.cw = cw;
 	this.ch = ch;
+	
+	this.offest = offest;
 
 	this.index = 0;
 	// let _this = this;
@@ -89,21 +91,21 @@ var Firework = function Firework(image, typeImage, direction, tx, ty, cw, ch) {
 	// 	}
 	// });
 	this.hiddenMidImage = false;
-	
-	
+
+
 	const innerAudioContext = uni.createInnerAudioContext();
 	innerAudioContext.autoplay = true;
 	innerAudioContext.src = '/static/elect/hit.mp3';
 	innerAudioContext.onPlay(() => {
-	  // console.log('开始播放');
+		// console.log('开始播放');
 	});
 	innerAudioContext.onError((res) => {
-	  console.log(res.errMsg);
-	  console.log(res.errCode);
+		console.log(res.errMsg);
+		console.log(res.errCode);
 	});
-	setTimeout(()=>{
+	setTimeout(() => {
 		innerAudioContext.destroy();
-	},800)
+	}, 800)
 }
 
 Firework.prototype.addEventListener = function(type, listener) {
@@ -117,24 +119,26 @@ Firework.prototype.draw = function(ctx, callback) {
 	let temp = this.position["EF_baozha_" + i];
 	// console.log("draw:"+this.direction);
 	let tempX = this.tx * this.direction;
-	let tempValue =  this.direction < 0 ? 65 : -25
+	let tempValue = this.direction < 0 ? 65 : -25
 	ctx.drawImage(this.image.path,
 		temp[0] //截取原始图片的 x坐标
 		, temp[1] //截取原始图片的 y坐标
 		, 312 //截取原始图片的 宽度
 		, 312 // 截取的高度
-		, tempX - 164 * 0.5 - tempValue //图片在canvas画布上的x坐标
-		, 0 //图片在canvas画布上的y坐标
-		, 164 //绘制图片的宽度
-		, 164 //绘制图片的高度
+		, tempX - 264 * 0.5 - tempValue + this.offest //图片在canvas画布上的x坐标
+		, -50 //图片在canvas画布上的y坐标
+		, 264 //绘制图片的宽度
+		, 264 //绘制图片的高度
 	);
-	if(!this.hiddenMidImage){
-		let _r = this.index / 19;
+	if (!this.hiddenMidImage) {
+		//19
+		let _r = this.index / 32 + 1;
 		ctx.save();
 		//如果是相反绘制,需要加多一个自身位置偏移
 		let _pos = this.direction < 0 ? this.typeImage.width : 0;
 		//左边位置
-		let left = (this.typeImage.width + tempX - 164 * 0.5) - (this.typeImage.width / 2 - _pos) * _r + 20 - tempValue;
+		let left = (this.typeImage.width + tempX - 164 * 0.5) - (this.typeImage.width / 2 - _pos) * _r + 20 -
+			tempValue +  this.offest;
 		// 中心点 this.cw / 2 - this.typeImage.width / 2 * _r
 		ctx.translate(left, this.ch / 2 - this.typeImage.height / 2 * _r);
 		ctx.scale(_r * this.direction, _r);
@@ -147,80 +151,6 @@ Firework.prototype.draw = function(ctx, callback) {
 	this.index++;
 
 }
-var Timing = {
-	easeIn: function easeIn(pos) {
-		return Math.pow(pos, 3);
-	},
-	easeOut: function easeOut(pos) {
-		return Math.pow(pos - 1, 3) + 1;
-	},
-	easeInOut: function easeInOut(pos) {
-		if ((pos /= 0.5) < 1) {
-			return 0.5 * Math.pow(pos, 3);
-		} else {
-			return 0.5 * (Math.pow(pos - 2, 3) + 2);
-		}
-	},
-	linear: function linear(pos) {
-		return pos;
-	}
-};
-
-function Animation(opts) {
-	this.isStop = false;
-	opts.duration = typeof opts.duration === 'undefined' ? 1000 : opts.duration;
-	opts.timing = opts.timing || 'linear';
-	var delay = 17;
-
-	function createAnimationFrame() {
-		if (typeof setTimeout !== 'undefined') {
-			return function(step, delay) {
-				setTimeout(function() {
-					var timeStamp = +new Date();
-					step(timeStamp);
-				}, delay);
-			};
-		} else if (typeof requestAnimationFrame !== 'undefined') {
-			return requestAnimationFrame;
-		} else {
-			return function(step) {
-				step(null);
-			};
-		}
-	};
-	var animationFrame = createAnimationFrame();
-	var startTimeStamp = null;
-	var _step = function step(timestamp) {
-		if (timestamp === null || this.isStop === true) {
-			opts.onProcess && opts.onProcess(1);
-			opts.onAnimationFinish && opts.onAnimationFinish();
-			return;
-		}
-		if (startTimeStamp === null) {
-			startTimeStamp = timestamp;
-		}
-		if (timestamp - startTimeStamp < opts.duration) {
-			var process = (timestamp - startTimeStamp) / opts.duration;
-			var timingFunction = Timing[opts.timing];
-			process = timingFunction(process);
-
-			opts.onProcess && opts.onProcess(process);
-			animationFrame(_step, delay);
-		} else {
-			opts.onProcess && opts.onProcess(1);
-			opts.onAnimationFinish && opts.onAnimationFinish();
-		}
-	};
-	_step = _step.bind(this);
-	animationFrame(_step, delay);
-}
-
-// stop animation immediately
-// and tigger onAnimationFinish
-Animation.prototype.stop = function() {
-	this.isStop = true;
-};
-
 
 if (typeof module === "object" && typeof module.exports === "object") {
 	module.exports = Firework;

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

@@ -34,12 +34,19 @@ const getRunCalorie = function(runCount){
 }
 
 
+// 一分钟 60下,30分钟 消耗卡路里大概 270大卡
+const getJumpCalorie  = function(jumpCount){
+	return jumpCount * 0.1125; //单位大卡
+}
+
+
 export default {
 	BOXING_MASS,
 	ANGLE_RATIO,
 	SENDITIVITY,
 	getBoxingCalorie,
 	getAccCalorie,
-	getRunCalorie
+	getRunCalorie,
 	// calculation
+	getJumpCalorie
 }

+ 22 - 13
util/util-js/store.js

@@ -564,7 +564,7 @@ const store = new Vuex.Store({
 		setFinallUseDevice(state, device) {
 			uni.setStorageSync('finallyUseDevice', device);
 			state.finallyUseDevice = device;
-			console.log("保存finallyUseDevice:", state.finallyUseDevice);
+			// console.log("保存finallyUseDevice:", state.finallyUseDevice);
 			// uni.setStorage({
 			// 	key: 'finallyUseDevice',
 			// 	data: device,
@@ -971,7 +971,7 @@ const store = new Vuex.Store({
 			uni.getStorage({
 				key: 'BLEDeviceList',
 				success: (res) => {
-					console.log("*****getBLEDeviceList=", res);
+					// console.log("*****getBLEDeviceList=", res);
 					let _list = res.data;
 					state.BLEDeviceList = res.data;
 					//更新BLEDeviceShowList 数组
@@ -1579,12 +1579,12 @@ const store = new Vuex.Store({
 					})
 				},
 				complete: (complete) => {
-					console.log("complete bListenAdapterStateChange:", state.bListenAdapterStateChange);
+					// console.log("complete bListenAdapterStateChange:", state.bListenAdapterStateChange);
 					if (state.bListenAdapterStateChange) return;
 
 					state.bListenAdapterStateChange = true;
 					uni.onBluetoothAdapterStateChange((res) => {
-						console.log('adapterState changed, now is', res)
+						// console.log('adapterState changed, now is', res)
 						// 手机蓝牙状态
 						state.bOpenBluetooth = res.available;
 						if (state.bOpenBluetooth && !state.bOpenSuccess) {
@@ -2389,7 +2389,7 @@ const store = new Vuex.Store({
 			this.commit('initBLEData');
 			state.deviceId = item.deviceId;
 			let timeout = 10000;
-			console.log("B_CreateBLEConnection deviceId ==", state.deviceId)
+			// console.log("B_CreateBLEConnection deviceId ==", state.deviceId)
 			uni.createBLEConnection({
 				// 这里的 deviceId 需要已经通过 createBLEConnection 与对应设备建立链接
 				deviceId: state.deviceId,
@@ -2538,7 +2538,7 @@ const store = new Vuex.Store({
 			let {
 				callback
 			} = context;
-			console.log("onBLECharacteristicValueChange success");
+			// console.log("onBLECharacteristicValueChange success");
 			if (callback) {
 				callback({
 					notifyCharacteristicId: state.notifyCharacteristicId,
@@ -2877,10 +2877,10 @@ const store = new Vuex.Store({
 				_sendData = BLE.str2ab(value);
 			}
 
-			console.log("currentInstruction:", state.currentInstruction, value, state.bListenerUpdate, state
-				.bListenerMac,
-				state.bListenerHexUpdate);
-			console.log("state.deviceId:", state.deviceId, state.serviceId, state.writeCharacteristicId);
+			// console.log("currentInstruction:", state.currentInstruction, value, state.bListenerUpdate, state
+			// 	.bListenerMac,
+			// 	state.bListenerHexUpdate);
+			// console.log("state.deviceId:", state.deviceId, state.serviceId, state.writeCharacteristicId);
 			uni.writeBLECharacteristicValue({
 				deviceId: state.deviceId,
 				serviceId: state.serviceId,
@@ -3425,14 +3425,18 @@ const store = new Vuex.Store({
 			const subNVue = uni.getSubNVueById('personal-guide')
 			subNVue.show('fade-in', 250)
 		},
-
+		/**
+		 * 获取签到列表
+		 * @param {Object} state
+		 * @param {Object} callback
+		 */
 		getSignInList(state, callback) {
 			reqUtil
 				.requestData(config.URL.GETSIGNINLIST, {})
 				.then(
 					res => {
 						if (res.code == 0) {
-							console.log('GETSIGNINLIST:' + JSON.stringify(res.data));
+							// console.log('GETSIGNINLIST:' + JSON.stringify(res.data));
 							state.signInList = res.data.signInList;
 							state.isSignIn = res.data.isSignIn;
 							if (callback)
@@ -3444,6 +3448,11 @@ const store = new Vuex.Store({
 					}
 				);
 		},
+		/**
+		 * 签到
+		 * @param {Object} state
+		 * @param {Object} callback
+		 */
 		onUserSignIn(state, callback) {
 			reqUtil
 				.requestData(config.URL.USERSIGNIN, {})
@@ -3521,7 +3530,7 @@ const store = new Vuex.Store({
 				}
 				lists[i].isSelect = list[i].flag == 1 ? true : false;
 			}
-
+			// console.log("list:"+JSON.stringify(list));
 			// 向 popup 传递消息
 			uni.$emit('reward-popup', {
 				title: '每日签到',