Explorar el Código

1.修改添加拳击模块

slambb hace 3 años
padre
commit
ff1776d844

+ 4 - 3
common/config.js

@@ -7,11 +7,11 @@ const refreshRate = "a";
 //*******当前活动环境,需要和根据地址设置!!环境 dev,prd
 const active = "dev";
 //线上地址,腾讯云服务器
-const host="https://www.9527fun.cn/api_prd"
+// const host="https://www.9527fun.cn/api_prd"
 //测试地址,阿里云服务器
-// const host = "https://www.9527fun.cn/api_dev"
+const host = "https://www.9527fun.cn/api_dev"
 //本地测试地址
-// const host = "http://192.168.0.106:9090/api_dev"
+// const host = "http://192.168.0.109:9090/api_dev"
 // const host = "http://192.168.0.112:9090/api_dev"
 // const host = "http://47.104.216.192:9090/api_dev"
 // const host = "http://121.4.103.151:9090/api_prd"
@@ -194,6 +194,7 @@ const URL = {
 	GETLEVELJUMPLIST: `${host}/level/getLevelJumpList`, //只获取levelJump列表,后续其他扩展新加
 	PASSTHELEVEL: `${host}/level/passTheLevel`, //通用处理过关操作
 	UNLOCKLEVEL: `${host}/level/unlockLevel`, //通用处理解锁关卡操作
+	GETLEVELLIST: `${host}/level/getLevelList`, //获取level列表,返回一个全类型
 
 	PKLEVELREWARD: `${host}/level/pkLevelReward`, //pk奖励
 

+ 1586 - 0
components/modal/action-hit/action-hit.vue

@@ -0,0 +1,1586 @@
+11
+<!-- 新版本拳击区域部分文件 -->
+<template>
+	<view style="width: 750rpx;">
+		<view class="flex justify-center" style="margin-top: 68rpx;">
+			<!-- 目前格子数量不代表数字,显示完成度而已 -460rpx;-->
+			<view class="grid-progress-vertical-container" style="top:-376rpx;">
+				<view class="grid-progress-vertical-bar">
+					<view class="grid-progress-vertical-child" v-for="(item, index) in maxShowCount +1" :key="index"
+						v-if="index!==0">
+						<view
+							:class="showCurCount>=index? 'grid-progress-vertical-active':'grid-progress-vertical-inactive'">
+						</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 / 26 * index)}}
+						</view>
+					</view>
+				</view>
+				<view class="grid-progress-vertical-bar">
+					<view class="grid-progress-vertical-child" v-for="(item, index) in maxShowCount +1" :key="index"
+						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 / 26 * index)+taskSignCount/2}}
+						</view>
+						<!-- 设置空位 -->
+						<view></view>
+						<view
+							:class="showCurCount>=index+13? 'grid-progress-vertical-active':'grid-progress-vertical-inactive'">
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
+		<!-- class="position-relative" -->
+		<view style="position: relative;">
+			<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="actionHitCanvas" :style="{ width: canvasW + 'px', height: canvasH + 'px' }"></canvas>
+		</view>
+		<view style="position: absolute;
+				top: 30px;
+				bottom: 0;
+				left: 0;
+				right: 0;
+				justify-content: center;
+				align-items: center;">
+			<!-- class="position-absolute-center" -->
+			<canvas canvas-id="effectHitCanvas" :style="{ width: canvasW + 'px', height: '164px' }"></canvas>
+		</view>
+		<view class="flex align-center justify-center" style="font-size: 14px; width:750rpx;">
+			<view style="position: relative;">
+				<image style="width: 135px;height: 75px;" src="../../../static/modal/action-jump/Fill.png"></image>
+				<view class="mid-absolute flex flex-direction align-center justify-center text-white">
+					<view class="flex align-center">
+						<image style="width: 22rpx;height: 28rpx;"
+							src="../../../static/modal/action-jump/jumpSpeed.png"></image>
+						<view style="margin-left: 6rpx;">平均速度</view>
+					</view>
+					<view style="margin-top: 12rpx;">{{averageSpeed}}</view>
+				</view>
+			</view>
+			<view id="ActionJumpPlay" class="flex" style="position: relative;" @click="onControllerPlay">
+				<image style="width: 110px;height: 110px;"
+					src="../../../static/modal/action-jump/mid-button-orange@2x.png">
+				</image>
+
+				<image v-if="!bJumpPlay" class="mid-absolute" style="left:12rpx; width: 56rpx;height: 70rpx;"
+					src="../../../static/play.png">
+				</image>
+				<image v-else class="mid-absolute" style="width: 100rpx;height: 100rpx;"
+					src="../../../static/e-pause.png">
+				</image>
+			</view>
+			<view style="position: relative;">
+				<image style="width: 135px;height: 75px; transform: scaleX(-1);"
+					src="../../../static/modal/action-jump/Fill.png"></image>
+				<view class="mid-absolute flex flex-direction align-center justify-center text-white">
+					<view class="flex align-center">
+						<image style="width: 22rpx;height: 28rpx;"
+							src="../../../static/modal/action-jump/jumpCalorie.png"></image>
+						<view style="margin-left: 6rpx;">卡路里</view>
+					</view>
+					<view style="margin-top: 12rpx;">{{Math.floor(jumpCalorie)}}</view>
+				</view>
+			</view>
+		</view>
+
+		<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}}
+				</view>
+			</view>
+		</view>
+
+		<!-- #ifdef H5 -->
+		<view style="display: flex;justify-content: space-between;" class="margin-top margin-bottom">
+			<button @click="onJumpType(0)">middle</button>
+			<button @click="onJumpType(1)">left</button>
+			<button @click="onJumpType(2)">right</button>
+		</view>
+		<!-- #endif -->
+	</view>
+
+</template>
+
+<script>
+	import {
+		CONDITIONPASSED
+	} 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,
+		mapMutations
+	} from 'vuex';
+
+	export default {
+		computed: mapState(['systemInfo', 'bOldDeviceType']),
+		components: {
+
+		},
+		props: {
+			showTime: {
+				type: Number,
+				default: 0
+			},
+			levelData: {
+				type: Object,
+				default: null
+			},
+			currentMode: {
+				type: String,
+				default: ''
+			}
+		},
+		data() {
+			return {
+				isY: true,
+				canvasW: 0, // 画布宽
+				canvasH: 0, // 画布高
+				// SystemInfo: {}, // 设备信息
+
+				directionJumpRight: null,
+				directionJumpLeft: null,
+				midJump: null,
+				rotateJumpRight: null,
+				rotateJumpLeft: null,
+				directionJumpWhiteRight: null,
+				directionJumpWhiteLeft: null,
+				midJumpWhite: null,
+				rotateJumpWhiteRight: null,
+				rotateJumpWhiteLeft: null,
+				//参考图片
+				cankao: null,
+
+				jumpTipImage: null,
+				JumpTipOrange: null,
+				jumpNormalLine: null,
+				jumpNormalRect: null,
+				jumpNormalWidth: 70,
+				jumpNormalHeight: 164,
+
+				jumpProgressTip: null,
+
+				jumpTypeArray: [{
+					jumpName: 'NORMAL',
+					jumpCode: 0,
+					icon: 'midJump',
+					scaleX: 1,
+					bTrigger: false,
+					bShow: true,
+				}, {
+					jumpName: 'LEFT',
+					jumpCode: 1,
+					icon: 'directionJump',
+					scaleX: 1,
+					bTrigger: false,
+					bShow: true,
+				}, {
+					jumpName: 'RIGHT',
+					jumpCode: 2,
+					icon: 'directionJump',
+					scaleX: 1,
+					bTrigger: false,
+					bShow: true,
+				}],
+				spawnArray: [],
+				deleteSpawn: null, //已删除的对象
+				deleteImage: null,
+				/**
+				 * 生成的背景位置
+				 */
+				spawnPos: [],
+				spawnAnimation: null,
+				spawnProcess: 1,
+
+				//下一个生成是相反的方向
+				bNextSpawnRightDirection: false,
+				bNextSpawnRightRotateDirection: false,
+
+				//生成预制的模板,用count 来判断生成哪一种
+				template: [{ //原地
+					count: 1,
+					spawnList: [
+						[0]
+					]
+				}, {
+					count: 2,
+					spawnList: [
+						[2, 1],
+						[1, 2],
+						[3, 4],
+						[4, 3]
+					]
+				}, {
+					count: 3,
+					spawnList: [
+						[2, 0, 1],
+						[1, 0, 2],
+						[3, 0, 4],
+						[4, 0, 3]
+					]
+				}, ],
+				//模板对象池,管理生成对象
+				templatePool: [],
+
+				levelType: 0,
+				countdown: 60,
+				countdownInterval: null,
+
+				faultCount: 0,
+				eliminationCount: 0,
+
+				bJumpPlay: false,
+				jumpCalorie: 0,
+
+				averageSpeedInterval: null,
+				averageSpeed: 0,
+				tempHitCount: 0,
+
+				//硬件设备处理
+				BLEAccIndex: 0,
+				xA: 0,
+				yA: 0,
+				zA: 0,
+
+				/**
+				 * 交互数据处理
+				 */
+				//当前选择的关卡信息
+				selfLevelData: null,
+				// 双人模式下 数据
+				//标记块数量
+				taskSignCount: 0, //总数
+				taskSignCurCount: 0, //当前计数
+				//{"type":1,"explain":"规定时间内跳完所有标志块","limitType":1}
+				taskConditionPassed: null,
+				taskDescribe: '',
+				//满格的数值是 25
+				maxShowCount: 13,
+				addShowCountUnit: 0,
+				showCurCount: 0,
+				roundingCount: 0,
+				//游戏结束
+				isGameOver: false,
+
+
+				//pk模式下操作
+				leftShowCurCount: 0,
+				rightShowCurCount: 0,
+				isleftPlayer: true,
+
+				/**
+				 * 是否允许绘制
+				 */
+				canOnDraw: false,
+				/**
+				 * 是否去到下一个关卡
+				 */
+				canGoNext: false,
+				/**
+				 * 生成的特效
+				 */
+				canSpawnTemp: null,
+
+				onLogData: '',
+
+				/**
+				 * 是否显示关卡提示
+				 */
+				bTipLevel: false,
+
+				/**
+				 * 烟花相关
+				 */
+				// firework collection
+				fireworks: [],
+				fireworkImage: null,
+				loop: null,
+				count: 100,
+				effectHitCanvas: null,
+				effectCurrentSpawn: null,
+				effectSpawnPosX: 0,
+				/**
+				 * 烟花特效
+				 */
+				bDrawBoomEffect: false,
+				//绘制箭头效果
+				bRuning: false,
+				bRuningInfinite: false,
+				yellowRuningTimeout: null,
+			}
+		},
+		watch: {
+			levelData(val) {
+				//更新数据
+				// console.log("levelData ============>"+JSON.stringify(val));
+				if (val) {
+					this.taskSignCount = val.signCount;
+					this.taskConditionPassed = val.conditionPassed;
+					this.taskDescribe = val.describe;
+					this.addShowCountUnit = (this.maxShowCount * 2) / this.taskSignCount;
+					// console.log("this.addShowCountUnit:", this.addShowCountUnit, this.maxShowCount * 2, this
+					// 	.taskSignCount);
+					this.showCount = 0;
+					//用signType 做等级类型
+					this.levelType = val.signType;
+
+					// console.log(JSON.stringify(this.taskConditionPassed));
+				}
+
+			},
+			currentMode(val) {
+				// console.log('==========> action jump currentMode:', val);
+			}
+		},
+		created() {
+			let _self = this;
+			this.actionHitCanvas = uni.createCanvasContext("actionHitCanvas", this);
+			this.effectHitCanvas = uni.createCanvasContext("effectHitCanvas", this);
+			// this.SystemInfo = this.systemInfo; // uni.getSystemInfoSync();
+			this.canvasW = this.systemInfo.windowWidth; // 画布宽度
+			this.canvasH = 147.68;
+			this.onLoadImage();
+
+			//更新一次状态
+			const value = uni.getStorageSync('levelButtonPrompt');
+			if (value) {
+				_self.bTipLevel = !value.isSelected;
+			} else {
+				_self.bTipLevel = true;
+			}
+
+			if (this.averageSpeedInterval) {
+				clearInterval(this.averageSpeedInterval);
+				this.averageSpeedInterval = null;
+			}
+			//计算平均速度
+			this.averageSpeedInterval = setInterval(() => {
+				this.averageSpeed = this.tempHitCount;
+				this.tempHitCount = 0;
+			}, 3000)
+
+			// console.log("组件创建")
+		},
+		// destroyed() { //Vue 实例销毁后调用
+		// 	console.log("组件销毁")
+		// },
+		methods: {
+			...mapMutations(['onWriteBLEConnectionValue', 'onConvertDeviceData']),
+			//更新新手状态提示
+			onUpdateTipLevelValue(value) {
+				this.bTipLevel = value;
+			},
+			//load 相关图片
+			onLoadImage() {
+				let _self = this;
+				uni.getImageInfo({
+					src: "../../../static/modal/boxing-post/left-hook-m@2x.png",
+					success: function(image) {
+						_self.directionJumpLeft = image;
+					}
+				});
+				uni.getImageInfo({
+					src: "../../../static/modal/boxing-post/right-hook-m@2x.png",
+					success: function(image) {
+						_self.directionJumpRight = image;
+					}
+				});
+				uni.getImageInfo({
+					src: "../../../static/modal/boxing-post/straight-m@2x.png",
+					success: function(image) {
+						_self.midJump = image;
+					}
+				});
+
+				uni.getImageInfo({
+					src: "../../../static/modal/boxing-post/right-hook-h@2x.png",
+					success: function(image) {
+						_self.directionJumpWhiteRight = image;
+					}
+				});
+				uni.getImageInfo({
+					src: "../../../static/modal/boxing-post/left-hook-h@2x.png",
+					success: function(image) {
+						_self.directionJumpWhiteLeft = image;
+					}
+				});
+				uni.getImageInfo({
+					src: "../../../static/modal/boxing-post/straight-h@2x.png",
+					success: function(image) {
+						_self.midJumpWhite = image;
+					}
+				});
+
+				uni.getImageInfo({
+					src: "../../../static/modal/action-jump/jumpTip.png",
+					success: function(image) {
+						_self.jumpTipImage = image;
+					}
+				});
+				uni.getImageInfo({
+					src: "../../../static/modal/action-jump/jump-tip-orange@2x.png",
+					success: function(image) {
+						_self.JumpTipOrange = image;
+					}
+				})
+				uni.getImageInfo({
+					src: "../../../static/modal/action-jump/progress-tip.png",
+					success: function(image) {
+						_self.jumpProgressTip = image;
+					}
+				})
+
+				uni.getImageInfo({
+					src: "../../../static/modal/action-jump/jumpNormal-line.png",
+					success: function(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) {
+						_self.cankao = image;
+					}
+				});
+
+				/**
+				 * 烟花照片
+				 */
+				uni.getImageInfo({
+					src: "../../../static/modal/action-jump/boom.png",
+					success: function(image) {
+						_self.fireworkImage = image;
+					}
+				});
+
+			},
+			/**
+			 * 重置生成数组,重置倒计时
+			 */
+			resetJumpGame() {
+
+				this.spawnArray = [];
+				this.templatePool = [];
+				if (this.countdownInterval) {
+					clearInterval(this.countdownInterval);
+					this.countdownInterval = null;
+				}
+
+				// this.resetCountdown(60);
+
+			},
+			startJumpGame() {
+				this.isGameOver = false;
+				this.resetJumpGame();
+				//开始游戏
+				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 < 30; i++) {
+						//再对象池里面生成一组对象
+						this.addTemplatePoolFromType(true, _spawnList[0][0]);
+					}
+					//先生成spawnCount个
+					for (let i = 0; i < spawnCount; i++) {
+						this.spawnArray.push(this.templatePool[this.index]);
+						this.index++;
+					}
+
+				} else if (this.levelType == 1) {
+					//生成一组 左跳右跳
+					let _spawnList = this.template[1].spawnList;
+					for (let i = 0; i < 30; i++) {
+						let ran = Math.floor(Math.random() * 2);
+						for (let j = 0; j < _spawnList[ran].length; j++) {
+							//再对象池里面生成一组对象
+							this.addTemplatePoolFromType(true, _spawnList[ran][j]);
+						}
+					}
+					//先生成spawnCount个
+					for (let i = 0; i < spawnCount; i++) {
+						this.spawnArray.push(this.templatePool[this.index]);
+						this.index++;
+					}
+
+					console.log(this.spawnArray)
+
+				} else if (this.levelType == 2) {
+					//生成一组 左跳右跳原地
+					let _spawnList = this.template[2].spawnList;
+					for (let i = 0; i < 30; i++) {
+						let ran = Math.floor(Math.random() * 2);
+						for (let j = 0; j < _spawnList[ran].length; j++) {
+							//再对象池里面生成一组对象
+							this.addTemplatePoolFromType(true, _spawnList[ran][j]);
+						}
+					}
+					//先生成spawnCount个
+					for (let i = 0; i < spawnCount; i++) {
+						this.spawnArray.push(this.templatePool[this.index]);
+						this.index++;
+					}
+
+
+				} else if (this.levelType == 3) {
+					//生成一组 左旋跳右旋跳
+					let _spawnList = this.template[1].spawnList;
+					for (let i = 0; i < 30; i++) {
+						let ran = Math.floor(Math.random() * 2) + 2;
+						for (let j = 0; j < _spawnList[ran].length; j++) {
+							//再对象池里面生成一组对象
+							this.addTemplatePoolFromType(true, _spawnList[ran][j]);
+						}
+					}
+					//先生成spawnCount个
+					for (let i = 0; i < spawnCount; i++) {
+						this.spawnArray.push(this.templatePool[this.index]);
+						this.index++;
+					}
+				} else if (this.levelType == 4) {
+					//生成一组 左旋跳右旋跳
+					let _spawnList = this.template[2].spawnList;
+					for (let i = 0; i < 30; i++) {
+						let ran = Math.floor(Math.random() * 2) + 2;
+						for (let j = 0; j < _spawnList[ran].length; j++) {
+							//再对象池里面生成一组对象
+							this.addTemplatePoolFromType(true, _spawnList[ran][j]);
+						}
+					}
+					//先生成spawnCount个
+					for (let i = 0; i < spawnCount; i++) {
+						this.spawnArray.push(this.templatePool[this.index]);
+						this.index++;
+					}
+
+				} else if (this.levelType == 5) {
+					for (let i = 0; i < 20; i++) {
+						//随便生成三组数据
+						let _newArray = [];
+						let _spawnList2 = this.template[2].spawnList;
+						let ran2 = Math.floor(Math.random() * 2);
+						let ran3 = Math.floor(Math.random() * 2);
+						if (_ranType >= 1) {
+							ran2 += 2;
+							ran3 += 2;
+						}
+						_newArray = _newArray.concat(_spawnList2[ran2]);
+						_newArray = _newArray.concat(_spawnList2[ran3]);
+						for (let j = 0; j < _newArray.length; j++) {
+							this.addTemplatePoolFromType(true, _newArray[j]);
+						}
+					}
+					//先生成spawnCount个
+					for (let i = 0; i < spawnCount; i++) {
+						this.spawnArray.push(this.templatePool[this.index]);
+						this.index++;
+					}
+				}
+				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,
+							bInit: true,
+							position: 0,
+							animation: null, //动画
+						});
+						this.templatePool.push(_jumpPrefab);
+						break;
+					}
+				}
+			},
+			//单纯的绘制八个背景
+			onDrawBg(bDraw) {
+				this.spawnPos = [];
+
+				if (bDraw) {
+					this.actionHitCanvas.clearRect(0, 0, this.canvasW, this.canvasH);
+				}
+
+				let _currentBgStartX = this.canvasW / 2;
+				let count = 7;
+				let _currentPos = -12,
+					_addPos = 0;
+
+				for (let i = 0; i < count; i++) {
+					if (0 !== i) {
+						_currentPos += this.jumpNormalWidth;
+					} else {
+						_currentPos -= this.jumpNormalWidth;
+					}
+
+					if (2 === i) {
+						//结尾时候快消除完绘制一次大图背景。不然会为空白
+						if (this.spawnArray.length < 3)
+							this.actionHitCanvas.drawImage(this.jumpTipImage.path, _currentPos, 0, 120, this
+								.canvasH);
+
+						if (bDraw) {
+							this.actionHitCanvas.drawImage(this.JumpTipOrange.path, _currentPos + 3, 7, 113, this
+								.canvasH -
+								14);
+						}
+						//添加对应生成点
+						this.spawnPos.push({
+							center: _currentPos + 30
+						})
+						_currentPos += 50;
+					} else {
+						this.actionHitCanvas.drawImage(this.jumpNormalLine.path, _currentPos, 0, this
+							.jumpNormalWidth,
+							this.canvasH);
+						if (bDraw) {
+							this.actionHitCanvas.drawImage(this.jumpNormalRect.path, _currentPos, 0, this
+								.jumpNormalWidth,
+								this.canvasH);
+						}
+						//添加对应生成点
+						this.spawnPos.push({
+							center: _currentPos + 16
+						})
+					}
+
+				}
+				if (bDraw) {
+					this.actionHitCanvas.draw();
+				}
+			},
+			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.actionHitCanvas.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') {
+						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;
+						}
+					}
+					this.actionHitCanvas.save();
+
+					let _currentPos = this.spawnPos[i].center;
+					let _currentCenterPos = 0;
+
+					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.actionHitCanvas.drawImage(this.jumpNormalRect.path, tempPosition - 16, 0, this
+								.jumpNormalWidth,
+								this.canvasH);
+							this.actionHitCanvas.clearRect(this.spawnPos[i].center - 30, 0, 120, this.canvasH);
+						}
+						let _width = 40 + 20 * _self.spawnProcess;
+						this.actionHitCanvas.drawImage(_temp.path, tempPosition, 55 - 9 * _self.spawnProcess,
+							_width,
+							_width);
+
+						//绘制多一次背景
+						this.actionHitCanvas.drawImage(this.jumpTipImage.path, this.spawnPos[i].center - 30, 0,
+							120, this
+							.canvasH);
+
+						this.actionHitCanvas.drawImage(this.JumpTipOrange.path, this.spawnPos[i].center - 27, 7,
+							113, this
+							.canvasH -
+							14);
+					} else {
+						//小图
+						let _otherObj = this.spawnArray[i];
+						let tempPosition = _currentPos;
+						if (!bAnimation || _otherObj.bInit) {
+							_otherObj.position = _currentPos;
+							_otherObj.bInit = false;
+						} else {
+							tempPosition = _otherObj.position - Math.abs(_currentPos - _otherObj.position) * _self
+								.spawnProcess;
+						}
+						if (1 === this.spawnProcess) {
+							_otherObj.position = tempPosition;
+						}
+						this.actionHitCanvas.drawImage(this.jumpNormalRect.path, tempPosition - 16, 0, this
+							.jumpNormalWidth,
+							this.canvasH);
+						if (this.spawnArray[i].bShow) {
+							this.actionHitCanvas.drawImage(_temp.path, tempPosition, 55, 40, 40);
+						}
+
+					}
+					this.actionHitCanvas.restore();
+				}
+
+				this.actionHitCanvas.draw();
+			},
+			/**
+			 * 消除时候显示的特效
+			 * @param {Object} _temp
+			 */
+			onDrawEffect(_temp) {
+				if (!this.bRuning) {
+					this.bRuning = true;
+					if (this.yellowRuningTimeout) {
+						clearTimeout(this.yellowRuningTimeout)
+						this.yellowRuningTimeout = null;
+					}
+					this.yellowRuningTimeout = setTimeout(() => {
+						this.bRuning = false;
+					}, 1000)
+				}
+
+
+				//根据当前消除的生成一个
+				let spawnTemp = this.midJump;
+				let offest = 5;
+				if (_temp.icon == 'directionJump') {
+					spawnTemp = _temp.jumpName == "RIGHT" ? this.directionJumpRight : this.directionJumpLeft;
+				}
+				let tempFirework = new Firework(this.fireworkImage,
+					spawnTemp, _temp.scaleX, this.effectSpawnPosX, 0, this.canvasW, 164, offest, true);
+				this.fireworks.push(tempFirework);
+				this.bDrawBoomEffect = true;
+				this.onInitFirework();
+			},
+			onClear() {
+				this.resetJumpGame();
+
+				this.onDrawBg(true);
+
+				this.xA = 0;
+				this.yA = 0;
+				this.zA = 0;
+
+			},
+
+			/**
+			 * 统一绘制 效果 背景,交互,烟花
+			 */
+			onInitFirework() {
+				if (this.loop != null) {
+					return;
+				}
+
+				this.loop = setInterval(() => {
+					if (!this.bDrawBoomEffect) {
+						clearInterval(this.loop);
+						this.loop = null;
+						// console.log("结束绘制");
+						this.effectHitCanvas.clearRect(0, 0, this.canvasW, 164);
+						this.effectHitCanvas.draw();
+						return;
+					}
+					this.effectHitCanvas.clearRect(0, 0, this.canvasW, 164);
+					if (this.bDrawBoomEffect) {
+						// loop over each firework, draw it, update it
+						var i = this.fireworks.length;
+						while (i--) {
+							this.fireworks[i].draw(this.effectHitCanvas, () => {
+								this.fireworks.splice(i, 1);
+								if (this.fireworks.length == 0) {
+									this.bDrawBoomEffect = false;
+								}
+							});
+
+						}
+					}
+					this.effectHitCanvas.draw();
+				}, 30)
+			},
+			onJumpType(event) {
+				// console.log("onJumpType:", event);
+				if (this.isGameOver || !this.bJumpPlay) return;
+				this.eliminateJumpPrefab(event);
+			},
+
+			// update (dt) {}
+			//模拟测试调用
+			eliminateJumpPrefab(_jumpType) {
+				//只触发第二个
+				if (this.spawnArray.length < 3 || this.spawnAnimation != null) {
+					return;
+				}
+				let _temp = this.spawnArray[2];
+				//如果当前的跳类型和预制目标一样
+				if (_jumpType == _temp.jumpCode) {
+					_temp.bTrigger = true;
+					this.deleteSpawn = this.spawnArray.splice(0, 1);
+
+					if (this.index < this.templatePool.length) {
+						this.spawnArray.push(this.templatePool[this.index]);
+						this.index++;
+					}
+					//这里更新特效
+					let _endTemp = Object.assign({}, _temp);
+					this.onDrawEffect(_endTemp);
+					//绘制新触发状态
+					this.onDraw('tipHit', true);
+					//成功
+					this.setEliminationCount(1);
+					//替换数组
+					// console.log(this.index + " == " + this.spawnArray.length);
+					if (this.spawnArray.length < 3 && this.index > 3) {
+						clearInterval(this.countdownInterval);
+						this.countdownInterval = null;
+						//绘制新触发状态
+						this.onDraw("normal", false);
+						setTimeout(() => {
+							this.startJumpGame();
+						}, 2000)
+					}
+				} else {
+					//失误
+					this.setFaultCount(1);
+				}
+			},
+
+			//设置倒计时
+			setCountdown(value) {
+				this.countdown -= value;
+				// this.countdownLabel.string = '倒计时:' + this.countdown;
+				this.$emit('actionJumpCountDownUpdate', {
+					countDown: this.countdown
+				});
+			},
+			resetCountdown(value) {
+				this.countdown = value;
+				// this.countdownLabel.string = '倒计时:' + this.countdown;
+				this.$emit('actionJumpCountDownUpdate', {
+					countDown: this.countdown
+				});
+			},
+			//设置ui信息
+			setEliminationCount(value) {
+				this.tempHitCount++;
+				this.taskSignCurCount++;
+				this.roundingCount += this.addShowCountUnit;
+				this.eliminationCount += value;
+
+				// this.eliminationLabel.string = '消除数量:' + this.eliminationCount.toString();
+				this.$emit('actionJumpDataUpdate', {
+					eliminationCount: this.eliminationCount,
+					faultCount: this.faultCount
+				});
+				this.jumpCalorie += puchConfig.getJumpCalorie(this.eliminationCount + this.faultCount);
+
+				//如果是pk模式。不走下面判断
+				if (this.currentMode == 'pkMode') return;
+
+				if (CONDITIONPASSED.ENERGYBARFULL == this.taskConditionPassed.limitType) {
+					//能量条的条件下才显示能量条动
+					//取两位后计算Math floor,不然会有偏差值问题  Math.floor(39.9999999+ 0.1111111) = 39
+					this.showCurCount = Math.floor(this.roundingCount.toFixed(2));
+					//1.能量槽满的时候,说明踩中次数到达	
+					if (this.taskSignCurCount >= this.taskSignCount)
+						this.onGameOver("energyBarFull");
+				} else if (CONDITIONPASSED.SKIPALLFLAGWITHINTIME == this.taskConditionPassed.limitType) {
+					//规定时间下也给显示能量条
+					this.showCurCount = Math.floor(this.roundingCount.toFixed(2));
+					//2.规定时间内跳完所有标志块
+					if (this.taskSignCurCount >= this.taskSignCount)
+						this.onGameOver("skipAllFlagWithinTime");
+				} else if (this.taskConditionPassed.isScore) {
+					//3.达到一定分数
+					//如果是用分数判断
+					//分数是 跳对的加1分,错的扣1分,0不扣分。
+					let curScore = this.eliminationCount - this.faultCount;
+					curScore = curScore < 0 ? 0 : curScore;
+					//当前分数达到,胜利
+					if (curScore >= this.taskConditionPassed.limitScore)
+						this.onGameOver("score");
+				}
+			},
+			onGameOver(type) {
+				this.isGameOver = true;
+				//处理参数
+				this.onClear();
+				this.onClearData();
+				this.bJumpPlay = false;
+				/**
+				 * 判断胜利和失败
+				 */
+				let myWin = false; //默认失败
+				//比如, 1.充满左右两边蓄能槽.2.规定时间内跳完所有标志块.
+				if (type == "energyBarFull") {
+					//1.能量槽满的时候,说明踩中次数到达	
+					if (this.taskSignCurCount >= this.taskSignCount) {
+						myWin = true;
+					}
+				} else if (type == 'skipAllFlagWithinTime') {
+					myWin = true;
+				} else if (type == "timeUp") {
+					//2.规定时间内跳完所有标志块
+					//查看消除数量是否到达总数,未达成就是未完成
+					if (this.taskSignCurCount >= this.taskSignCount) {
+						myWin = true;
+					}
+				} else if (type == "score") {
+					myWin = true;
+				}
+				console.log(type, {
+					myWin: myWin
+				});
+				this.$emit('gameOver', {
+					myWin: myWin,
+					type: 'calorieMode',
+					isOffEvent: true
+				});
+			},
+			//pk模式下结束游戏关卡
+			onPKModeGameOver(type) {
+				this.isGameOver = true;
+				//处理参数
+				this.onClear();
+				this.onClearData();
+				this.bJumpPlay = false;
+
+				this.$emit('gameOver', {
+					type: 'pkMode',
+					isOffEvent: true
+				});
+			},
+			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);
+
+			},
+
+			//控制播放
+			onControllerPlay() {
+				if (this.bJumpPlay) {
+					//仅仅暂停,没有清空数据
+					this._changePlay(false);
+					this.$emit("actionJumpControllerPlay", false);
+				} else {
+					this.$emit("actionJumpCheck");
+				}
+			},
+			onContinueGame() {
+				this._changePlay(true);
+			},
+			onClearActionJumpData() {
+				console.log("onClearActionJumpData");
+				this.onClear();
+				this.onClearData();
+			},
+			//修改状态
+			_changePlay(bPlaying) {
+				if (bPlaying) {
+					this.bJumpPlay = bPlaying;
+				} else {
+					this.bJumpPlay = !this.bJumpPlay;
+				}
+			},
+
+			onActionPlay() {
+				this.onClear();
+				this.onClearData();
+				this.startJumpGame();
+				this._changePlay(true);
+
+				//reset 对应计算数据
+				this.taskSignCurCount = 0;
+				this.showCurCount = 0;
+				this.roundingCount = 0;
+
+				this.faultCount = 0;
+				this.eliminationCount = 0;
+			},
+
+			getCurrentJumpType() {
+				let _temp = this.spawnArray[2];
+				return _temp.jumpCode;
+			},
+
+			//监听跳的状态数据
+			listenStateDataOfJump(data) {
+
+				if (this.spawnArray.length < 3) return;
+				let _jumpType = this.getCurrentJumpType();
+				//初始全部默认状态
+				let _tempState = [{
+						jumpName: 'NORMAL',
+						jumpCode: 0,
+						bTrigger: false,
+						describe: '正常跳'
+					},
+					{
+						jumpName: 'LEFT',
+						jumpCode: 1,
+						bTrigger: false,
+						describe: '左直跳'
+					},
+					{
+						jumpName: 'RIGHT',
+						jumpCode: 2,
+						bTrigger: false,
+						describe: '右直跳'
+					},
+					{
+						jumpName: 'LEFT_ROTATE',
+						jumpCode: 3,
+						bTrigger: false,
+						describe: '左旋转跳'
+					},
+					{
+						jumpName: 'RIGHT_ROTATE',
+						jumpCode: 4,
+						bTrigger: false,
+						describe: '右旋转跳'
+					}
+				];
+
+
+				let {
+					currentMaxValue,
+					oGyroValue,
+					peakOfWaveMaxValue,
+					valleyOfWaveMinValue
+				} = data
+				// console.log('stateDataOfJump:');
+				// console.log(JSON.stringify(data));
+				this.onLogData = data;
+				let _rotateLimit = 4;
+				let _jumpLimit = 0;
+
+				switch (_jumpType) {
+					case 0:
+						//JumpType.NORMAL = 0
+						_tempState[0].bTrigger = true;
+						this.eliminateJumpPrefabFormTemp(_tempState);
+						break;
+					case 1:
+						if (currentMaxValue < -_jumpLimit) {
+							//left jump
+							_tempState[1].bTrigger = true;
+						}
+						this.eliminateJumpPrefabFormTemp(_tempState);
+						break;
+					case 2:
+						if (currentMaxValue > _jumpLimit) {
+							//right jump
+							_tempState[2].bTrigger = true;
+						}
+						this.eliminateJumpPrefabFormTemp(_tempState);
+						break;
+					case 4:
+						if (oGyroValue > _rotateLimit) {
+							_tempState[4].bTrigger = true;
+						}
+						this.eliminateJumpPrefabFormTemp(_tempState);
+						break;
+					case 3:
+						if (oGyroValue < -_rotateLimit) {
+							_tempState[3].bTrigger = true;
+						}
+						this.eliminateJumpPrefabFormTemp(_tempState);
+						break;
+					default:
+						console.log('没有对应的_jumpType', _jumpType);
+						break;
+				}
+
+
+			},
+			eliminateJumpPrefabFormTemp(_tempState) {
+				//只触发第三个
+				if (this.spawnArray.length < 3) {
+					return;
+				}
+				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(this.eliminationCount + ',识别跳的类型:' + _state.describe + ',当前预制类型:' + _temp
+							.jumpName +
+							"\n直跳判断值:" + this.onLogData.currentMaxValue + ",旋转跳值:" + this.onLogData.oGyroValue);
+					}
+					//如果当前的跳类型和预制目标一样
+					if (_state.jumpCode == _temp.jumpCode && _state.bTrigger) {
+						//成功
+						bSuccess = true;
+						break;
+					}
+				}
+				//如果存在其中一个为true
+				if (bSuccess) {
+					_temp.bTrigger = true;
+					this.canSpawnTemp = _temp;
+					setTimeout(() => {
+						//这里更新特效
+						this.onDrawEffect(this.canSpawnTemp);
+					}, 150);
+					this.deleteSpawn = this.spawnArray.splice(0, 1);
+
+					if (this.index < this.templatePool.length) {
+						this.spawnArray.push(this.templatePool[this.index]);
+						this.index++;
+					}
+					//成功
+					this.setEliminationCount(1);
+					//替换数组
+					// console.log(this.index + " == " + this.spawnArray.length);
+					if (this.spawnArray.length < 3 && this.index > 3) {
+						clearInterval(this.countdownInterval);
+						this.countdownInterval = null;
+						//绘制新触发状态
+						this.canGoNext = true;
+					} else {
+						//绘制新触发状态
+						this.canOnDraw = true;
+					}
+
+				} else {
+					//失误
+					this.setFaultCount(1);
+				}
+
+
+			},
+
+
+			/**
+			 * @param {Object} gameData
+			 * 识别跳部分数据处理
+			 */
+			onBLEHitUpdate(gameData) {
+				console.log("gameData:",gameData);
+				if (!this.bJumpPlay || this.isGameOver || this.spawnAnimation != null) return;
+
+				// if (curAngleCeil < 30) {
+				// 	directionPunch = "straightPunch";
+				// 	name = "正向的直拳";
+				// 	ename = "front-straight";
+				// } else if (direction.x < 0) {
+				// 	directionPunch = "rightPunch";
+				// 	name = "正向的右拳";
+				// 	ename = "front-right";
+				// } else if (direction.x > 0) {
+				// 	directionPunch = "leftPunch";
+				// 	name = "正向的左拳";
+				// 	ename = "front-left";
+				// }
+				if (gameData.direction == "straightPunch") {
+					this.eliminateJumpPrefab(0);
+				} else if (gameData.direction == "leftPunch") {
+					this.eliminateJumpPrefab(1);
+				} else if (gameData.direction == "rightPunch") {
+					this.eliminateJumpPrefab(2);
+				}
+
+				this.BLEAccIndex++;
+			},
+			onClearData() {
+				this.BLEAccIndex = 0;
+			},
+			onChangeY() {
+				this.isY = true;
+			},
+			onChangeX() {
+				this.isY = false;
+			},
+			onGetActionJumpPlayView(callback) {
+				let view = uni.createSelectorQuery().select('#ActionJumpPlay');
+				view.boundingClientRect(data => {
+					if (callback)
+						callback(data);
+				}).exec();
+			},
+
+			onTipLevel() {
+				this.$emit("tipLevel", {
+					hiddenType: 'normal'
+				});
+				console.log("**************22");
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.mid-absolute {
+		position: absolute;
+		top: 0;
+		bottom: 0;
+		right: 0;
+		left: 0;
+		margin: auto;
+	}
+
+	.action-jump-timer {
+		position: absolute;
+		top: -150rpx;
+	}
+
+	.grid-progress-vertical-container {
+		min-height: 376rpx;
+	}
+
+	.grid-progress-vertical-bar {
+		max-height: 376rpx;
+	}
+
+	.grid-progress-vertical-child {
+		width: 35px;
+		height: 7.36px;
+		margin: 7.36px 0 0 0;
+		position: relative;
+	}
+
+	.grid-progress-vertical-active {
+		width: 28rpx;
+	}
+
+	.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>

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

@@ -32,7 +32,7 @@
 				</view>
 			</view>
 		</view>
-		<view class="position-relative">
+		<view style="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> -->
 			<view class="position-absolute-left-top flex justify-center align-center " style="width: 86.12px;height:55.96px; 
@@ -59,9 +59,17 @@
 
 				</view>
 			</view>
+			<!-- class="position-absolute-center" -->
 			<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>
+		</view>
+		<view style="position: absolute;
+				top: 30px;
+				bottom: 0;
+				left: 0;
+				right: 0;
+				justify-content: center;
+				align-items: center;">
+			<canvas canvas-id="effectCanvas" :style="{ width: canvasW + 'px', height: '164px' }"></canvas>
 		</view>
 		<view class="flex align-center justify-center" style="font-size: 14px; width:750rpx;">
 			<view style="position: relative;">
@@ -429,7 +437,7 @@
 			},
 			onListenActionJump() {
 				let _self = this;
-				console.log("*****************onListenActionJump*****************************");
+				console.log("*****************onListenActionHit*****************************");
 				_self.actionJumpObj = new ActionJump();
 				_self.actionJumpObj.addEventListener('resultant', (e) => {
 					if (e.type == 'stateDataOfJump') {

+ 74 - 52
pages/personal-page/devices-hardware/devices-hardware.vue

@@ -24,7 +24,8 @@
 						<view style="margin: 20rpx 0rpx; font-weight: bold; font-size: 18px; color: #565656;">
 							{{item.cname}}
 						</view>
-						<view style="font-size: 12px; white-space:pre-wrap;" class="make-text-bPurple">{{item.describe}}{{item.bOldDevice?'(旧手柄)':''}}
+						<view style="font-size: 12px; white-space:pre-wrap;" class="make-text-bPurple">
+							{{item.describe}}{{item.bOldDevice?'(旧手柄)':''}}
 						</view>
 					</view>
 
@@ -34,7 +35,12 @@
 					mode="aspectFit" @tap="_onRadio(item,$event)"></image>
 			</view>
 		</view>
-
+		
+		<!-- <view style="display: flex;justify-content: space-between;" class="margin-top margin-bottom">
+			<button @click="switchList(1)">jumpList</button>
+			<button @click="switchList(2)">hitList</button>
+		</view> -->
+	
 
 
 		<view v-if="currentIndex<5" class="position-absolute-center" style="z-index: 1; width: 750rpx;display: flex;">
@@ -143,7 +149,7 @@
 
 <script>
 	import config from '@/common/config.js';
-	import reqUtil from '@/util/util-js/requstUtil.js';
+	import reqUtil from '@/util/util-js/requstUtil.js';
 	import ble from '@/util/util-js/BLE.js';
 
 	import {
@@ -154,7 +160,7 @@
 	export default {
 		computed: mapState(['bOpenBluetooth', 'bOpenSuccess', 'bListenAdapterStateChange', 'bListenDeviceFound',
 			'BLEConnectDevice', 'BLEGetServices', 'cIndex', 'bConnection', 'bVerifiedConnection', 'BLEInfoList',
-			'BLEDeviceShowList', 'finallyUseDevice', 'systemInfo', 'guideUnlockState'
+			'BLEDeviceShowList', 'finallyUseDevice', 'systemInfo', 'guideUnlockState','currentModeIndex'
 		]),
 		data() {
 			return {
@@ -210,9 +216,11 @@
 			// 	})
 			// }
 			this.BLEInfoList.forEach((item, index, selfarr) => {
-				//item.deviceType == 'BLEHandle' || 
-				if (item.deviceType == 'BLERope') {
-					let item = Object.assign({}, selfarr[index],{bOldDevice:false});
+				if ((item.deviceType == 'BLEHandle' && item.usageMode == 'hotman') || item.deviceType ==
+					'BLERope') {
+					let item = Object.assign({}, selfarr[index], {
+						bOldDevice: false
+					});
 					this.devicesList.push(item);
 				}
 			})
@@ -290,8 +298,14 @@
 			...mapMutations(['initAdapter', 'onCreateBLESuccess', 'onGetBLEDeviceServices', 'onOnlyCloseBLEConnection',
 				'onGetRSSITransDistance',
 				'addBLEDevice', 'onWriteBLEConnectionValue', 'deleteBLEDevice', 'B_GetBondedDevices',
-				'B_OpenBLESetting', 'setGuideUnlockState'
+				'B_OpenBLESetting', 'setGuideUnlockState', 'switchLevelList'
 			]),
+			//测试切换关卡
+			switchList(event) {
+				this.switchLevelList(event);
+				//刷新首页事件
+				uni.$emit("onSwitchTaskList");
+			},
 			//
 			onClearTimeout() {
 				// 退出后,清除计时器
@@ -366,15 +380,15 @@
 									// console.log('BLEBIND:', res);
 									if (res.code == 0) {
 										//绑定成功,添加设备
-										if (_self.saveObj == null) return;
-										
-										//添加一个mac地址到saveObj
-										console.log('添加了mac前saveObj',_self.saveObj);
-										_self.saveObj = Object.assign({}, _self.saveObj, {
-											deviceMac: mac,
-											bOldDevice: res.data!=null?res.data.bOldDevice:false
-										});
-										console.log('添加了mac后saveObj:',_self.saveObj);
+										if (_self.saveObj == null) return;
+
+										//添加一个mac地址到saveObj
+										console.log('添加了mac前saveObj', _self.saveObj);
+										_self.saveObj = Object.assign({}, _self.saveObj, {
+											deviceMac: mac,
+											bOldDevice: res.data != null ? res.data.bOldDevice : false
+										});
+										console.log('添加了mac后saveObj:', _self.saveObj);
 										_self.addBLEDevice(_self.saveObj);
 										_self.ConnectionSuccess();
 									}
@@ -395,14 +409,14 @@
 						} else if (res.code == 721) {
 							// console.log("~~:",_self.saveObj);
 							//是自己绑定的,添加设备
-							if (_self.saveObj == null) return;
-							//添加一个mac地址到saveObj
-							console.log('code=721,添加了mac前saveObj',_self.saveObj);
-							_self.saveObj = Object.assign({}, _self.saveObj, {
-								deviceMac: mac,
-								bOldDevice: res.data!=null?res.data.bOldDevice:false
-							});
-							console.log('code=721,添加了mac后saveObj:',_self.saveObj);
+							if (_self.saveObj == null) return;
+							//添加一个mac地址到saveObj
+							console.log('code=721,添加了mac前saveObj', _self.saveObj);
+							_self.saveObj = Object.assign({}, _self.saveObj, {
+								deviceMac: mac,
+								bOldDevice: res.data != null ? res.data.bOldDevice : false
+							});
+							console.log('code=721,添加了mac后saveObj:', _self.saveObj);
 							_self.addBLEDevice(_self.saveObj);
 							_self.ConnectionSuccess();
 
@@ -441,6 +455,14 @@
 						(eq.ename.indexOf("BLEHandle") > -1 && this.BLEConnectDevice.id == 2) ||
 						(eq.ename.indexOf("rope") > -1 && this.BLEConnectDevice.id == 3)) {
 
+						if (eq.ename.indexOf("hotman") > -1) {
+							//拳击
+							this.switchList(2);
+						} else if (eq.ename.indexOf("rope") > -1) {
+							//跳绳
+							this.switchList(1);
+						}
+
 						eq.bRatio = true;
 						this.currentItem = eq;
 						/**
@@ -449,23 +471,23 @@
 						this.$store.state.bVerifiedConnection = true;
 						/**
 						 * 根据名字兼容旧设备
-						 */
-						let _tempMac = this.saveObj.deviceMac.replace(/:/g,"");
-						let _fourStr = _tempMac.substring(_tempMac.length - 4,_tempMac.length);
-						console.log("格式化去掉冒号后mac:",_tempMac,"==",_fourStr);
-						let _tempInt = ble.hex2int(_fourStr);
-						console.log("格式化去掉冒号后_tempInt:",_tempInt);
-						//这里判断旧设备,因为目前这批新设备,用的也是202012的名字,所以这里处理兼容旧设备就行了
-						//用mac判断区分,一起有100个是旧设备,还有部分非标准的mac,根据后台字段判断
+						 */
+						let _tempMac = this.saveObj.deviceMac.replace(/:/g, "");
+						let _fourStr = _tempMac.substring(_tempMac.length - 4, _tempMac.length);
+						console.log("格式化去掉冒号后mac:", _tempMac, "==", _fourStr);
+						let _tempInt = ble.hex2int(_fourStr);
+						console.log("格式化去掉冒号后_tempInt:", _tempInt);
+						//这里判断旧设备,因为目前这批新设备,用的也是202012的名字,所以这里处理兼容旧设备就行了
+						//用mac判断区分,一起有100个是旧设备,还有部分非标准的mac,根据后台字段判断
 						//如果后台存在bOldDevice 字段,则根据字段判断是否是旧设备
-						if (this.saveObj.name === "BGBox_202012" 
-						&& _tempInt<=101 && _tempInt >=0 || this.saveObj.bOldDevice) {
-							this.$store.state.bOldDeviceType = true;
+						if (this.saveObj.name === "BGBox_202012" &&
+							_tempInt <= 101 && _tempInt >= 0 || this.saveObj.bOldDevice) {
+							this.$store.state.bOldDeviceType = true;
 							eq.bOldDevice = true;
 							console.log("旧设备:", this.$store.state.bOldDeviceType);
-						}else{
-							console.log("旧设备",this.$store.state.bOldDeviceType);
-							eq.bOldDevice = false;
+						} else {
+							console.log("旧设备", this.$store.state.bOldDeviceType);
+							eq.bOldDevice = false;
 						}
 
 						uni.hideToast();
@@ -670,20 +692,20 @@
 				if (_self.searchTimeOut) {
 					clearTimeout(_self.searchTimeOut);
 					_self.searchTimeOut = null;
-				}
-				//搜索一段时间后,停止搜索
-				if (plus.os.name == 'iOS') {
-					_self.searchTimeOut = setTimeout(() => {
-						_self.stopBluetoothDevicesDiscovery();
-						//搜索失败后,再检查是否和手机配对的设备连接
-						_self.onBondedDeviceConnect();
-					}, 4000)
-				} else {
-					_self.searchTimeOut = setTimeout(() => {
-						_self.stopBluetoothDevicesDiscovery();
-					}, 8000)
 				}
-				
+				//搜索一段时间后,停止搜索
+				if (plus.os.name == 'iOS') {
+					_self.searchTimeOut = setTimeout(() => {
+						_self.stopBluetoothDevicesDiscovery();
+						//搜索失败后,再检查是否和手机配对的设备连接
+						_self.onBondedDeviceConnect();
+					}, 4000)
+				} else {
+					_self.searchTimeOut = setTimeout(() => {
+						_self.stopBluetoothDevicesDiscovery();
+					}, 8000)
+				}
+
 			},
 			/**
 			 * 停止搜索蓝牙设备

+ 307 - 158
pages/personal-page/personal/personal.vue

@@ -16,14 +16,16 @@
 						<image class="png-more-black" style="margin-right: 16rpx;"
 							src="/static/common/sideBar/gold_black@2x.png">
 						</image>
-						<view class="text-15px text-center" style="line-height: 56rpx; min-width: 100rpx;">{{cGold}}</view>
+						<view class="text-15px text-center" style="line-height: 56rpx; min-width: 100rpx;">{{cGold}}
+						</view>
 					</view>
 					<view class="flex align-center justify-between"
 						style="padding: 0 16rpx; height: 56rpx; background-color: rgba(255, 153, 0, 1); border-radius: 13.5px;">
 						<image class="png-more-black" style="margin-right: 16rpx; width: 36rpx; height: 38rpx;"
 							src="/static/common/sideBar/diamond_black@2x.png">
 						</image>
-						<view class="text-15px text-center" style="line-height: 56rpx; min-width: 100rpx;">{{cDiamond}}</view>
+						<view class="text-15px text-center" style="line-height: 56rpx; min-width: 100rpx;">{{cDiamond}}
+						</view>
 					</view>
 				</view>
 			</view>
@@ -37,7 +39,7 @@
 					<scroll-view scroll-y="true" style="height: 100%; width: 100%;">
 						<view class="plan-view">
 							<!-- 拳击模块 -->
-							<view v-if="currentMode == 'pkMode' && 0 === currentModeIndex"
+							<!-- <view v-if="currentMode == 'pkMode' && 0 === currentModeIndex"
 								style="display: flex; flex-direction: row; height: 200rpx; margin-top: 140rpx; justify-content: space-around;align-items: center;">
 								<view>
 									<view class="cu-avatar-group" style="position: relative;">
@@ -70,19 +72,21 @@
 									<HitFistEffect ref="hitFistRef"></HitFistEffect>
 								</view>
 
-							</view>
+							</view> -->
 
-							<!-- pk模式下的跳绳 -->
-							<block v-if="1 === currentModeIndex">
+							<!-- pk模式下的跳绳 v-if="1 === currentModeIndex"-->
+							<block>
 								<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="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>
+													: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">
@@ -102,7 +106,8 @@
 											@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;">
+													:style="[{ backgroundImage:'url('+finallySelectFriendInfo.avatarUrl+')' }]"
+													style="width: 102.4rpx ;height: 102.4rpx;">
 												</view>
 											</view>
 											<view style="margin-top: 8rpx; width: 165rpx;"
@@ -127,10 +132,8 @@
 								<view v-else style="height:14rpx; background-color: RGBA(30, 30, 85, 1);"> </view>
 							</block>
 
-							<!-- 圆形进度条 -->
-							<view
-								v-if="(currentMode == 'pkMode' && 1 === currentModeIndex)||currentMode== 'calorieMode'"
-								class="qiun-charts-arcbar">
+							<!-- 进度条 -->
+							<view class="qiun-charts-arcbar">
 								<!-- 进度条 -->
 								<canvas v-show="false" canvas-id="canvasArcbar" id="canvasArcbar"
 									class="charts-arcbar "></canvas>
@@ -145,7 +148,6 @@
 									<view class="text-13px text-white" style="margin-top: -50px;">
 										失误:{{AJData.faultCount}}</view>
 								</view> -->
-
 								<!-- 跳动次数 -->
 								<view class="position-absolute-center-bottom flex justify-center"
 									style="align-items: flex-end; height: 276rpx; bottom: 40rpx;">
@@ -169,9 +171,9 @@
 
 							</view>
 							<!-- 用于定位 -->
-							<view id="boxingHitID" v-if="0 === currentModeIndex" class="charts-pring-bottom">
+							<view id="boxingHitID" class="charts-pring-bottom" v-if="0 === currentModeIndex">
 								<!-- 添加一个 ConnectBindingDevice 测试 -->
-								<boxing-hit ref="boxingPostRef"
+								<!-- <boxing-hit ref="boxingPostRef"
 									:bUpdate="!bHide&&(ConnectBindingDevice!=null)||(cIndex!=-1 && BLEConnectDevice!=null &&
 								 (BLEConnectDevice.deviceType == 'mySelf'||BLEConnectDevice.deviceType == 'BLEHandle' || BLEConnectDevice.deviceType == 'BLERope' ))"
 									:showTime="localSportTime"
@@ -181,11 +183,16 @@
 									@boxingGuideFinish="onBoxingGuideFinish"
 									@boxingPostControlPlay="onActionControlPlay" @modeEvent="onModeEvent"
 									@hitEvent="onHitEvent" @aiHitEvent="onAiHitEvent" @gameOver="onBoxingGameOver"
-									@closeBoxingControl="onCloseBoxingHit"></boxing-hit>
-
+									@closeBoxingControl="onCloseBoxingHit"></boxing-hit> -->
+								<action-hit ref="actionHitRef"
+									:levelData="currentJumpTask!=null?currentJumpTask.item:null"
+									:currentMode="currentMode" @actionJumpCheck="onPersonalCheck"
+									@actionJumpControllerPlay="onActionControlPlay"
+									@actionJumpDataUpdate="onActionJumpDataUpdate" @gameOver="onActionJumpGameOver"
+									@tipLevel="onTipLevel">
+								</action-hit>
 							</view>
-
-							<view id='actionJumpID' v-if="1 === currentModeIndex" class="charts-pring-bottom">
+							<view id='actionJumpID' class="charts-pring-bottom" v-if="1 === currentModeIndex">
 								<action-jump ref="actionJumpRef"
 									:levelData="currentJumpTask!=null?currentJumpTask.item:null"
 									:currentMode="currentMode" @actionJumpCheck="onPersonalCheck"
@@ -222,7 +229,7 @@
 												hiddenType: 'firstInstallation'
 											})">计划</button>
 			</view> -->
-			
+
 			<view style="height: 50rpx;"></view>
 		</scroll-view>
 
@@ -532,8 +539,11 @@
 
 	import boxingHit from "@/components/modal/boxing-hit/boxing-hit.vue"
 
+	import actionHit from "@/components/modal/action-hit/action-hit.vue"
+
 	import actionJump from "@/components/modal/action-jump/action-jump.vue"
 
+
 	import AccAndOri from "@/util/util-js/AccAndOri.js"
 
 	import AvatarConfig from "@/util/util-js/avatar.js"
@@ -603,6 +613,7 @@
 			ModalTip,
 			keyboardListener,
 
+			actionHit,
 			actionJump,
 			LEDFont,
 			arcbarCountDown,
@@ -775,8 +786,8 @@
 				 * 任务关卡相关
 				 */
 				tempSelectedLevel: null,
-				
-				bShowComplete:false,
+
+				bShowComplete: false,
 
 			};
 		},
@@ -900,7 +911,8 @@
 
 
 			uni.$on("onLog", this.onLog);
-
+			//人物列表变化处理监听
+			uni.$on("onSwitchTaskList", this.onSwitchTaskList);
 		},
 		onShow() {
 			_self.bHide = false;
@@ -921,20 +933,28 @@
 				// 		this.bGetBondTesting = false;
 				// 	}
 				// }, 5000)
-
 			}
+
 			//如果是测试数据
-			if (this.ConnectBindingDevice) {
-				if (this.$refs.boxingPostRef) {
-					this.$refs.boxingPostRef.onSetMode('pkMode');
-				} else {
-					setTimeout(() => {
-						this.$refs.boxingPostRef.onSetMode('pkMode');
-					}, 500)
-				}
-			}
+			// if (this.ConnectBindingDevice) {
+			// 	if (this.$refs.boxingPostRef) {
+			// 		this.$refs.boxingPostRef.onSetMode('pkMode');
+			// 	} else {
+			// 		setTimeout(() => {
+			// 			this.$refs.boxingPostRef.onSetMode('pkMode');
+			// 		}, 500)
+			// 	}
+			// }
 
 			console.log('personal show');
+			//刷新canvas绘制背景
+			if (0 === this.currentModeIndex) {
+				if (this.$refs.actionHitRef)
+					this.$refs.actionHitRef.onDrawBg(true);
+			} else if (1 === this.currentModeIndex) {
+				if (this.$refs.actionJumpRef)
+					this.$refs.actionJumpRef.onDrawBg(true);
+			}
 
 			this.bLimitReconnection = false;
 
@@ -968,10 +988,10 @@
 		},
 		onReady() {
 			//限制开始点击播放
-			setTimeout(()=>{
+			setTimeout(() => {
 				_self.bShowComplete = true;
-				console.log("=============>",_self.bShowComplete);
-			},500)
+				console.log("=============>", _self.bShowComplete);
+			}, 500)
 			// 计算屏幕剩余高度  填补剩余高度
 			// 计算组件的高度
 			_self.scrollviewHight = this.systemInfo.windowHeight - this.navHeight - this.tabbarHeight - 10 - this
@@ -994,7 +1014,8 @@
 		onUnload() {
 			console.log("personal ********* onUnload *********");
 			uni.$off("onLog", this.onLog);
-
+			//人物列表变化处理监听
+			uni.$off("onSwitchTaskList", this.onSwitchTaskList);
 			// #ifndef APP-PLUS||H5
 			//监听
 			console.log('移除监听');
@@ -1038,7 +1059,7 @@
 				'getUserWallets', 'setGoldAndDiamond',
 				'onConvertDeviceData',
 				'showDrawerById', 'showPopupById', 'showGuideById',
-				'closeDrawerById', 'closePopupById','closeGuideById',
+				'closeDrawerById', 'closePopupById', 'closeGuideById',
 				'getSignInList', 'onUserSignIn',
 				'setGuideUnlockState'
 			]),
@@ -1075,12 +1096,12 @@
 					return;
 				}
 
-
 				this.modalName = e.currentTarget.dataset.target;
 				this.$store.state.bCanvasShow = false;
 
 				if (this.modalName == "slideUpModal") {
 					this.updateTaskScroll();
+					this.switchTaskInfo();
 				}
 			},
 			hideModal(e) {
@@ -1110,7 +1131,19 @@
 			 */
 			arcbarCountDownTimeUp() {
 				//todo,涉及到倒计时的关卡。时间到。游戏结束
-				if (1 === this.currentModeIndex) {
+				if (0 === this.currentModeIndex) {
+					if (this.currentMode == "pkMode") {
+						this.$refs.actionHitRef.onPKModeGameOver("timeUp");
+					} else {
+						uni.showToast({
+							title: '时间到,游戏结束。',
+							icon: 'none',
+							duration: 2000,
+							mask: true
+						})
+						this.$refs.actionHitRef.onGameOver("timeUp");
+					}
+				} else if (1 === this.currentModeIndex) {
 					if (this.currentMode == "pkMode") {
 						this.$refs.actionJumpRef.onPKModeGameOver("timeUp");
 					} else {
@@ -1389,13 +1422,13 @@
 					}
 
 					if (eq.ename.indexOf("hotman") > -1 && this.BLEConnectDevice.id == 1) {
-						if (this.$refs.boxingPostRef) {
-							this.$refs.boxingPostRef.onSetMode('pkMode');
-						} else {
-							setTimeout(() => {
-								this.$refs.boxingPostRef.onSetMode('pkMode');
-							}, 500)
-						}
+						// if (this.$refs.boxingPostRef) {
+						// 	this.$refs.boxingPostRef.onSetMode('pkMode');
+						// } else {
+						// 	setTimeout(() => {
+						// 		this.$refs.boxingPostRef.onSetMode('pkMode');
+						// 	}, 500)
+						// }
 
 					} else if (eq.ename.indexOf("BLEHandle") > -1 && this.BLEConnectDevice.id == 2) {
 						if (this.$refs.boxingPostRef) {
@@ -1422,10 +1455,10 @@
 			 * 蓝牙断开连接时候
 			 */
 			callbackCloseBLE() {
-				if (0 == this.currentModeIndex) {
-					//蓝牙断开连接后,直接关闭
-					this.$refs.boxingPostRef.onCloseDevices();
-				} 
+				// if (0 == this.currentModeIndex) {
+				// 	//蓝牙断开连接后,直接关闭
+				// 	this.$refs.boxingPostRef.onCloseDevices();
+				// }
 			},
 			//蓝牙状态回调
 			callbackBLEState(res) {
@@ -1438,28 +1471,37 @@
 				if (_self.bHide) return;
 				// console.log("callbackDeviceState==", data);
 
-				if (this.ConnectBindingDevice) {
-					this.gUpdateSandbagAlgorithm({
-						data: data,
-						callback: (res) => {
-							if (res.type == 'hit') {
-								this.$refs.boxingPostRef.onBLEHotmanUpdate(res);
-							}
-						}
-					});
-					return;
-				}
+				// if (this.ConnectBindingDevice) {
+				// 	this.gUpdateSandbagAlgorithm({
+				// 		data: data,
+				// 		callback: (res) => {
+				// 			if (res.type == 'hit') {
+				// 				this.$refs.boxingPostRef.onBLEHotmanUpdate(res);
+				// 			}
+				// 		}
+				// 	});
+				// 	return;
+				// }
 
 				//连接了手柄模式
 				//没有开启指令不刷新
 				if (!this.instructionState.bOpen) return;
 
 				if (this.BLEConnectDevice.usageMode == "hotman") {
-					this.gUpdateFilter({
+					// this.gUpdateFilter({
+					// 	data: data,
+					// 	callback: (res) => {
+					// 		if (res.type == 'hit') {
+					// 			// this.$refs.boxingPostRef.onBLEHotmanUpdate(res);
+					// 			this.$refs.actionHitRef.onBLEHitUpdate(res);
+					// 		}
+					// 	}
+					// });
+					this.gUpdateSandbagAlgorithm({
 						data: data,
 						callback: (res) => {
 							if (res.type == 'hit') {
-								this.$refs.boxingPostRef.onBLEHotmanUpdate(res);
+								this.$refs.actionHitRef.onBLEHitUpdate(res);
 							}
 						}
 					});
@@ -1764,7 +1806,25 @@
 				//#ifdef H5
 				// 直接走测试,如果是h5 APP-PLUS
 				if (0 === this.currentModeIndex) {
-					this.onBoxingGuideFinish();
+					// this.onBoxingGuideFinish();
+					if (this.currentJumpTask == null) {
+						uni.showToast({
+							title: '先选一个挑战关卡',
+							icon: 'none',
+							duration: 2000,
+						})
+						return;
+					}
+					if (this.currentMode == 'pkMode' && this.finallySelectFriendInfo == null) {
+						uni.showToast({
+							title: '选择一个pk好友',
+							icon: 'none',
+							duration: 2000,
+						})
+						return;
+					}
+					//调用开始
+					this.onActionHitPlay();
 				} else if (1 === this.currentModeIndex) {
 					if (this.currentJumpTask == null) {
 						uni.showToast({
@@ -1789,43 +1849,67 @@
 
 				return;
 				//#endif
-				//分类型判断
-				if (0 === this.currentModeIndex) {
-					//拳击运动类型
-					// 1.检测是否有对应设备,没有ConnectBindingDevice,再进行下一步
-					if (this.ConnectBindingDevice == null) {
+				
+				//#ifdef APP-PLUS
+				if (1 === this.currentModeIndex || 0 === this.currentModeIndex) {
+					if (this.currentJumpTask == null) {
 						uni.showToast({
-							title: '开启连接数据',
-							icon: 'none'
+							title: '先选一个挑战关卡',
+							icon: 'none',
+							duration: 2000,
 						})
-						this.toView = "openAccGyroView";
 						return;
-
 					}
-					// TODO,目前去掉蓝牙设备
-					// //2.检测是否有设备
-					// if (this.BLEDeviceShowList.length == 0) {
-					// 	this.$store.state.bGuidePages = true;
-					// 	this.guideCurrent = 3;
-					// 	uni.showToast({
-					// 		title: '请添加蓝牙设备',
-					// 		icon: 'none'
-					// 	})
-					// 	this.toView = "addDeviceView";
-					// 	return;
-					// }
-					// //2.检测是否连接设备 || this.BLEConnectDevice.ename !== 'BT04'
-					// if (this.cIndex == -1) {
-					// 	//没有连接设备,提示去连接设备
-					// 	uni.showToast({
-					// 		title: '请连接蓝牙设备',
-					// 		icon: 'none'
-					// 	})
-					// 	this.toView = "addDeviceView";
-					// 	return;
-					// }
+					if (this.currentMode == 'pkMode' && this.finallySelectFriendInfo == null) {
+						uni.showToast({
+							title: '选择一个pk好友',
+							icon: 'none',
+							duration: 2000,
+						})
+						return;
+					}
+				
+				}
+				//#endif
+				//分类型判断
+				// if (0 === this.currentModeIndex) {
+				// 	//拳击运动类型
+				// 	// 1.检测是否有对应设备,没有ConnectBindingDevice,再进行下一步
+				// 	if (this.ConnectBindingDevice == null) {
+				// 		uni.showToast({
+				// 			title: '开启连接数据',
+				// 			icon: 'none'
+				// 		})
+				// 		this.toView = "openAccGyroView";
+				// 		return;
 
-				} else if (1 === this.currentModeIndex) {
+				// 	}
+				// 	// TODO,目前去掉蓝牙设备
+				// 	// //2.检测是否有设备
+				// 	// if (this.BLEDeviceShowList.length == 0) {
+				// 	// 	this.$store.state.bGuidePages = true;
+				// 	// 	this.guideCurrent = 3;
+				// 	// 	uni.showToast({
+				// 	// 		title: '请添加蓝牙设备',
+				// 	// 		icon: 'none'
+				// 	// 	})
+				// 	// 	this.toView = "addDeviceView";
+				// 	// 	return;
+				// 	// }
+				// 	// //2.检测是否连接设备 || this.BLEConnectDevice.ename !== 'BT04'
+				// 	// if (this.cIndex == -1) {
+				// 	// 	//没有连接设备,提示去连接设备
+				// 	// 	uni.showToast({
+				// 	// 		title: '请连接蓝牙设备',
+				// 	// 		icon: 'none'
+				// 	// 	})
+				// 	// 	this.toView = "addDeviceView";
+				// 	// 	return;
+				// 	// }
+
+				// } else 
+				//跳和拳击进入
+				if (1 === this.currentModeIndex || 0 === this.currentModeIndex) {
 
 					//2.检测是否连接设备 || this.BLEConnectDevice.ename !== 'BT04'
 					if (this.cIndex == -1) {
@@ -1881,52 +1965,53 @@
 					return;
 				}
 
-				if (0 === this.currentModeIndex) {
-
-					//如果新手,调用新手教程
-					console.log("this.bNewGuide:", this.bNewGuide);
-					if (this.bNewGuide) {
-						// 拳击的新手提示
-						this.$store.state.bGuidePages = true;
-						this.guideCurrent = 5;
-						this.toView = "boxingHitID";
-						this.$store.state.bNewGuide = false;
-					} else {
-						if (this.ConnectBindingDevice) {
-							//假如有连接bingding设备
-							this.gCreateSandbagAlgorithm();
-							this.gStartSimulateBLEUpdate();
-						} else {
-							//todo 跳绳模式 发送开启指令
-							if (this.BLEConnectDevice.usageMode == "ropeSkipping") {
-								//打开跳绳模式
-								this.B_OpenRopeSkipping();
-							} else {
-								//初始化filter快速打击对象
-								if (this.BLEConnectDevice.usageMode == "hotman") {
-									this.gCreateFilterObj();
-								}
-								//打开加速计
-								this.onWriteBLEConnectionValue({
-									value: "3"
-								});
-
-								// setTimeout(() => {
-								// 	//设置加速计b:20ms a:10ms
-								// 	this.onWriteBLEConnectionValue({
-								// 		value: config.refreshRate
-								// 	});
-
-								// }, 1000)
-							}
-
-						}
-						//监听蓝牙回调
-						uni.$on('updateBLEDeviceData', this.callbackUpdateBLEData);
-						this.onBoxingGuideFinish();
-					}
+				// if (0 === this.currentModeIndex) {
+
+				// 	//如果新手,调用新手教程
+				// 	console.log("this.bNewGuide:", this.bNewGuide);
+				// 	if (this.bNewGuide) {
+				// 		// 拳击的新手提示
+				// 		this.$store.state.bGuidePages = true;
+				// 		this.guideCurrent = 5;
+				// 		this.toView = "boxingHitID";
+				// 		this.$store.state.bNewGuide = false;
+				// 	} else {
+				// 		if (this.ConnectBindingDevice) {
+				// 			//假如有连接bingding设备
+				// 			this.gCreateSandbagAlgorithm();
+				// 			this.gStartSimulateBLEUpdate();
+				// 		} else {
+				// 			//todo 跳绳模式 发送开启指令
+				// 			if (this.BLEConnectDevice.usageMode == "ropeSkipping") {
+				// 				//打开跳绳模式
+				// 				this.B_OpenRopeSkipping();
+				// 			} else {
+				// 				//初始化filter快速打击对象
+				// 				if (this.BLEConnectDevice.usageMode == "hotman") {
+				// 					this.gCreateFilterObj();
+				// 				}
+				// 				//打开加速计
+				// 				this.onWriteBLEConnectionValue({
+				// 					value: "3"
+				// 				});
+
+				// 				// setTimeout(() => {
+				// 				// 	//设置加速计b:20ms a:10ms
+				// 				// 	this.onWriteBLEConnectionValue({
+				// 				// 		value: config.refreshRate
+				// 				// 	});
+
+				// 				// }, 1000)
+				// 			}
+
+				// 		}
+				// 		//监听蓝牙回调
+				// 		uni.$on('updateBLEDeviceData', this.callbackUpdateBLEData);
+				// 		this.onBoxingGuideFinish();
+				// 	}
 
-				} else if (1 == this.currentModeIndex) {
+				// } else 
+				if (1 == this.currentModeIndex || 0 === this.currentModeIndex) {
 					if (data) {
 						let {
 							bStartCountDown
@@ -1946,7 +2031,12 @@
 									this.personalAudioContext.play();
 
 									//倒计时结束后开始游戏
-									if (this.BLEConnectDevice.usageMode == "ropeSkipping") {
+									//初始化一个沙袋打击对象
+									if(this.BLEConnectDevice.usageMode == "hotman"){
+										this.gCreateSandbagAlgorithm();
+									}
+									if (this.BLEConnectDevice.usageMode == "ropeSkipping"
+									|| this.BLEConnectDevice.usageMode == "hotman") {
 										//打开跳绳模式
 										// this.B_OpenRopeSkipping();
 										this.onWriteBLEConnectionValue({
@@ -1956,7 +2046,14 @@
 									//监听蓝牙回调
 									uni.$on('updateBLEDeviceData', this.callbackUpdateBLEData);
 									//调用开始
-									this.onActionJumpPlay();
+									if (0 === this.currentModeIndex) {
+										//调用开始
+										this.onActionHitPlay();
+									} else if (1 === this.currentModeIndex) {
+										//调用开始
+										this.onActionJumpPlay();
+									}
+									
 
 									this.bStartCountDown = false;
 								}, 800)
@@ -1965,7 +2062,8 @@
 							this.BoxingPostCountDownText--;
 						}, 1000)
 					} else {
-						if (this.BLEConnectDevice.usageMode == "ropeSkipping") {
+						if (this.BLEConnectDevice.usageMode == "ropeSkipping"
+						|| this.BLEConnectDevice.usageMode == "hotman") {
 							//打开跳绳模式
 							// this.B_OpenRopeSkipping();
 							this.onWriteBLEConnectionValue({
@@ -1975,7 +2073,13 @@
 						//监听蓝牙回调
 						uni.$on('updateBLEDeviceData', this.callbackUpdateBLEData);
 						//调用开始
-						this.onActionJumpPlay();
+						if (0 === this.currentModeIndex) {
+							//调用开始
+							this.onActionHitPlay();
+						} else if (1 === this.currentModeIndex) {
+							//调用开始
+							this.onActionJumpPlay();
+						}
 					}
 
 				}
@@ -1988,10 +2092,10 @@
 			},
 			//检测是否符合要求,没有的话进行新手提示
 			onPersonalCheck(data) {
-				if(!this.bShowComplete){
+				if (!this.bShowComplete) {
 					// console.log('不要点击这么快!!');
 					return;
-				}else{
+				} else {
 					console.error('点击!!');
 				}
 				this.bShowComplete = false;
@@ -2294,10 +2398,15 @@
 						// } else {
 						// }
 						if (0 === this.currentModeIndex) {
-							this.$refs.boxingPostRef.onBoxingPostStop();
-							//停止时候,重置ai信息
-							this.aiObj.name = this.aiOldObj.name;
-							this.aiObj.avatar = this.aiOldObj.avatar;
+							// this.$refs.boxingPostRef.onBoxingPostStop();
+							// //停止时候,重置ai信息
+							// this.aiObj.name = this.aiOldObj.name;
+							// this.aiObj.avatar = this.aiOldObj.avatar;
+							if (this.currentMode == "calorieMode") {
+								this.$refs.actionHitRef.onGameOver("none");
+							} else {
+								this.$refs.actionHitRef.onPKModeGameOver("none");
+							}
 						} else if (1 === this.currentModeIndex) {
 							//todo actionJump
 							if (this.currentMode == "calorieMode") {
@@ -2326,7 +2435,12 @@
 				} else {
 					//如果不是,继续调用播放
 					if (0 === this.currentModeIndex) {
-						this.$refs.boxingPostRef.onBoxingPostPlay(true);
+						// this.$refs.boxingPostRef.onBoxingPostPlay(true);
+						this.$refs.actionHitRef.onContinueGame();
+						if (0 !== this.currentJumpTask.item.limitTime) {
+							//0默认不限时,所以限时的才走计时间
+							this.arcbarCountDownPlay(false);
+						}
 					} else if (1 === this.currentModeIndex) {
 						//actionJump
 						this.$refs.actionJumpRef.onContinueGame();
@@ -2797,6 +2911,22 @@
 					this.arcbarCountDownPlay(true);
 				}
 			},
+			//actionHit 模块跳关卡开始处理
+			onActionHitPlay() {
+				//开始时候,设置默认参数
+				if (this.AJData.isFinish) {
+					//如果下一局,重新设置一下默认参数
+					this.onResetDefaultActionJumpData();
+				}
+				this.onSetActionJumpData();
+				this.$refs.actionHitRef.onActionPlay();
+				this.bGamePlaying = true;
+				//todo 首先判断时间处理
+				if (0 !== this.currentJumpTask.item.limitTime) {
+					//0默认不限时,所以限时的才走计时间
+					this.arcbarCountDownPlay(true);
+				}
+			},
 			//重置actionJump数据
 			onResetDefaultActionJumpData() {
 				this.AJData = Object.assign({}, this.defaultAJData);
@@ -2810,7 +2940,7 @@
 					perCountDown: 0,
 					gameCountDown: 0,
 					gameLimitTime: _item.limitTime,
-					targetCount:_item.signCount,
+					targetCount: _item.signCount,
 				})
 				// console.log('onSetActionJumpData'+JSON.stringify(this.AJData)+JSON.stringify(_item));
 			},
@@ -3059,6 +3189,15 @@
 
 				this.switchTaskInfo();
 			},
+			/**
+			 * 处理监听数据,比如切换列表后,重置action jump an action hit 等操作;
+			 */
+			onSwitchTaskList() {
+				this.currentMode = 'calorieMode';
+				this.switchTaskInfo();
+				console.log(1);
+			},
+
 			/**
 			 * @deprecated Test 测试通过关卡
 			 */
@@ -3212,10 +3351,10 @@
 
 				uni.$on('guide-popup-page', (data) => {
 					console.log('guide-popup-page', JSON.stringify(data));
-					setTimeout(()=>{
+					setTimeout(() => {
 						this.bShowComplete = true;
 						console.log('this.bShowComplete', this.bShowComplete);
-					},250);
+					}, 250);
 					switch (data.type) {
 						case 'button':
 							if (data.messageType == 'plan') {
@@ -3328,7 +3467,7 @@
 				this.closeDrawerById();
 				this.closePopupById();
 				this.closeGuideById();
-				
+
 				uni.$off('reward-popup-page')
 				uni.$off('drawer-page')
 				uni.$off('guide-popup-page')
@@ -4045,4 +4184,14 @@
 		height: 104rpx;
 		/* border: 1rpx solid #000000; */
 	}
+
+	.canvas-hidden {
+		/* display: none; */
+		left: -1000px;
+
+	}
+
+	.canvas-show {
+		/* display: block; */
+	}
 </style>

+ 4 - 4
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,offest) {
+var Firework = function Firework(image, typeImage, direction, tx, ty, cw, ch, offest, hiddenMidImage) {
 	this.event = new Event();
 	//图片信息
 	this.image = image;
@@ -74,7 +74,7 @@ var Firework = function Firework(image, typeImage, direction, tx, ty, cw, ch,off
 
 	this.cw = cw;
 	this.ch = ch;
-	
+
 	this.offest = offest;
 
 	this.index = 0;
@@ -90,7 +90,7 @@ var Firework = function Firework(image, typeImage, direction, tx, ty, cw, ch,off
 	// 		_this.event.trigger('renderComplete');
 	// 	}
 	// });
-	this.hiddenMidImage = false;
+	this.hiddenMidImage = hiddenMidImage || false;
 
 
 	const innerAudioContext = uni.createInnerAudioContext();
@@ -138,7 +138,7 @@ Firework.prototype.draw = function(ctx, callback) {
 		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 +  this.offest;
+			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);

+ 65 - 28
util/util-js/store.js

@@ -51,12 +51,12 @@ const store = new Vuex.Store({
 		//解锁状态,和首次安装app相关
 		//注意添加新字段时候。需要到 platform-page/guide.vue 确认需不需要添加新的reset
 		guideUnlockState: {
-			firstInstallation: true,		//是否首次安装
-			firstDisconnectBluetooth: true,	//是否首次连接蓝牙
-			firstUnlockJumpUp: true,        //是否首次向上跳
-			firstUnlockLeftAndRightJump: true,//是否首次左右跳
+			firstInstallation: true, //是否首次安装
+			firstDisconnectBluetooth: true, //是否首次连接蓝牙
+			firstUnlockJumpUp: true, //是否首次向上跳
+			firstUnlockLeftAndRightJump: true, //是否首次左右跳
 			firstUnlockLeftAndRightRotationJump: true,
-			firstPromptSelectLevel:true //是否首次提示选择关卡
+			firstPromptSelectLevel: true //是否首次提示选择关卡
 		},
 
 
@@ -196,7 +196,7 @@ const store = new Vuex.Store({
 		/**
 		 * 默认不是旧设备,旧设备使用的轴向不一样,名字为 BGBox_202012 ,新设备为 BGBox_202112
 		 */
-		bOldDeviceType:false,
+		bOldDeviceType: false,
 
 		/**
 		 * Android 出现不匹配的情况下,判断
@@ -368,7 +368,12 @@ const store = new Vuex.Store({
 		BluetoothAdapter: null,
 
 		//版本状态,用于区分部分特定的环境
-		versionCodeState: {showGame:false,showVideo:false,versionCode:0,title:'none'},
+		versionCodeState: {
+			showGame: false,
+			showVideo: false,
+			versionCode: 0,
+			title: 'none'
+		},
 
 		//显示蓝牙是否断开连接Modal
 		bShowBLEConnectModal: false,
@@ -388,6 +393,7 @@ const store = new Vuex.Store({
 		currentJumpTask: null,
 		multiPersonList: [],
 		singlePersonList: [],
+		levels: [],
 
 		/**
 		 * 校准识别部分
@@ -1272,12 +1278,12 @@ const store = new Vuex.Store({
 						//新用户重置一下新手教程数据
 						self.commit('setGuideUnlockState', {
 							//是否首次安装
-							firstInstallation: true,		//是否首次安装
-							firstDisconnectBluetooth: true,	//是否首次连接蓝牙
-							firstUnlockJumpUp: true,        //是否首次向上跳
-							firstUnlockLeftAndRightJump: true,//是否首次左右跳
+							firstInstallation: true, //是否首次安装
+							firstDisconnectBluetooth: true, //是否首次连接蓝牙
+							firstUnlockJumpUp: true, //是否首次向上跳
+							firstUnlockLeftAndRightJump: true, //是否首次左右跳
 							firstUnlockLeftAndRightRotationJump: true,
-							firstPromptSelectLevel:true //是否首次提示选择关卡
+							firstPromptSelectLevel: true //是否首次提示选择关卡
 						});
 					}
 
@@ -2096,7 +2102,7 @@ const store = new Vuex.Store({
 				gy,
 				gz
 			} = data.gyro;
-			let [hit, dir] = state.sandbagAlgorithm.Update(ax / 10, az / 10, gz, -gx, data.ms);
+			let [hit, dir] = state.sandbagAlgorithm.Update(-ax / 10, -az / 10, gz, -gx, data.ms);
 			if (dir != undefined) {
 				let temp = state.sandbagAlgorithm.getTempValue(dir);
 				if (callback) {
@@ -3254,26 +3260,26 @@ const store = new Vuex.Store({
 		//获取versionCode状态,用于处理特定的信息显示
 		getVersionCode(state) {
 			let self = this;
-			console.log("state.versionCode:"+state.versionCode);
+			console.log("state.versionCode:" + state.versionCode);
 			reqUtil.requestData(config.URL.GETVERSIONCODE, {
 				code: state.versionCode
 			}).then(res => {
-					console.log('获取版本控制信息 ====='+ JSON.stringify(res));
+					console.log('获取版本控制信息 =====' + JSON.stringify(res));
 					if (res.code == 0) {
-						state.versionCodeState = Object.assign({},state.versionCodeState,res.data);
+						state.versionCodeState = Object.assign({}, state.versionCodeState, res.data);
 						/**
 						 * 初始化配置表方案
 						 * 搞一个区分平台上线显示等,根据版本版本号,是否显示,平台限制等区别
 						 */
 						//显示,隐藏游戏栏目
 						uni.setTabBarItem({
-							index:2,
-							visible:state.versionCodeState.showGame
+							index: 2,
+							visible: state.versionCodeState.showGame
 						})
 						//显示,隐藏视频栏目
 						uni.setTabBarItem({
-							index:3,
-							visible:state.versionCodeState.showVideo
+							index: 3,
+							visible: state.versionCodeState.showVideo
 						})
 					}
 				},
@@ -3290,13 +3296,26 @@ const store = new Vuex.Store({
 		getLevelList(state, callback) {
 			let self = this;
 			reqUtil
-				.requestData(config.URL.GETLEVELJUMPLIST, {})
+				.requestData(config.URL.GETLEVELLIST, {}) //GETLEVELJUMPLIST
 				.then(
 					res => {
 						if (res.code == 0) {
-							// console.log('GETLEVELJUMPLIST:' + JSON.stringify(res.data.singlePerson));
-							state.singlePersonList = res.data.singlePerson;
-							state.multiPersonList = res.data.multiPerson;
+							// state.singlePersonList = res.data.singlePerson;
+							// state.multiPersonList = res.data.multiPerson;
+							console.log(res.data);
+							let levels = res.data;
+							state.levels = levels;
+							
+							if (1 === state.currentModeIndex) {
+								//关卡是跳绳
+								state.singlePersonList = levels.singlePersonMap[0];
+								state.multiPersonList = levels.multiPersonMap[0];
+							} else if (0 === state.currentModeIndex) {
+								//关卡是拳击
+								state.singlePersonList = levels.singlePersonMap[1];
+								state.multiPersonList = levels.multiPersonMap[1];
+							}
+							
 							//获取到数据时候,重置actionJump
 							self.commit('resetActionJumpTask');
 							if (callback)
@@ -3309,6 +3328,24 @@ const store = new Vuex.Store({
 				);
 		},
 
+		//切换关卡列表信息K
+		switchLevelList(state, _levelType) {
+			// console.log( state.levels.multiPersonMap)
+			// console.log( state.levels.singlePersonMap)
+			if (state.levels.singlePersonMap && state.levels.singlePersonMap.length >= _levelType)
+				state.singlePersonList = state.levels.singlePersonMap[_levelType - 1];
+			if (state.levels.multiPersonMap && state.levels.multiPersonMap.length >= _levelType)
+				state.multiPersonList = state.levels.multiPersonMap[_levelType - 1];
+			if (1 === _levelType) {
+				//关卡是跳绳
+				state.currentModeIndex = 1;
+			} else if (2 === _levelType) {
+				//关卡是拳击
+				state.currentModeIndex = 0;
+			}
+			// console.log(state.currentModeIndex)
+		},
+
 		/**
 		 * 获取钱包信息
 		 * @param {Object} state
@@ -3355,7 +3392,7 @@ const store = new Vuex.Store({
 			//personal-drawer
 			uni.getSubNVueById('personal-drawer').show('slide-in-left', 200);
 		},
-		closeDrawerById(state, context){
+		closeDrawerById(state, context) {
 			const subNVue = uni.getSubNVueById('personal-drawer');
 			subNVue.close();
 			console.log('销毁侧滑栏子窗体');
@@ -3434,7 +3471,7 @@ const store = new Vuex.Store({
 			subNVue.show('zoom-out', 250)
 			// #endif
 		},
-		closePopupById(state, context){
+		closePopupById(state, context) {
 			const subNVue = uni.getSubNVueById('personal-popup')
 			subNVue.close();
 			console.log('销毁奖励子窗体');
@@ -3454,8 +3491,8 @@ const store = new Vuex.Store({
 			const subNVue = uni.getSubNVueById('personal-guide')
 			subNVue.show('fade-in', 250)
 		},
-		
-		closeGuideById(){
+
+		closeGuideById() {
 			const subNVue = uni.getSubNVueById('personal-guide')
 			subNVue.close();
 			console.log('销毁新手指引子窗体');