Pārlūkot izejas kodu

修改任务栏,调整多人pk模式和相关后台

slambb 4 gadi atpakaļ
vecāks
revīzija
519f87394a

+ 2 - 0
common/config.js

@@ -153,6 +153,8 @@ const URL = {
 	PASSTHELEVEL: `${host}/level/passTheLevel`,//通用处理过关操作
 	UNLOCKLEVEL: `${host}/level/unlockLevel`,//通用处理解锁关卡操作
 	
+	PKLEVELREWARD:`${host}/level/pkLevelReward`,//pk奖励
+	
 	/**
 	 * 奖励,荣誉,金币,钻石等
 	 */

+ 87 - 17
components/modal/action-jump/action-jump.vue

@@ -76,7 +76,7 @@
 		<!-- <view style="height: 41px;"></view> -->
 
 		<!-- 测试按钮 -->
-	<!-- 	<view style="display: flex;justify-content: space-between;">
+		<!-- 	<view style="display: flex;justify-content: space-between;">
 			<view>{{isY?'Y':'X'}}</view>
 			<button @click="onChangeY">Y为旋转轴</button>
 			<button @click="onChangeX">X为旋转轴</button>
@@ -102,6 +102,9 @@
 
 <script>
 	import ActionJump from "@/util/util-js/action/jump.js"
+	import {
+		CONDITIONPASSED
+	} from "@/util/util-js/enum.js"
 
 	import {
 		mapMutations
@@ -119,6 +122,10 @@
 			levelData: {
 				type: Object,
 				default: null
+			},
+			currentMode: {
+				type: String,
+				default: ''
 			}
 		},
 		data() {
@@ -240,7 +247,13 @@
 				showCurCount: 0,
 				roundingCount: 0,
 				//游戏结束
-				isGameOver: false
+				isGameOver: false,
+				
+				
+				//pk模式下操作
+				leftShowCurCount:0,
+				rightShowCurCount:0,
+				isleftPlayer:true
 			}
 		},
 		watch: {
@@ -257,8 +270,13 @@
 					this.showCount = 0;
 					//用signType 做等级类型
 					this.levelType = val.signType;
+
+					console.log(JSON.stringify(this.taskConditionPassed));
 				}
 
+			},
+			currentMode(val) {
+				console.log('==========> action jump currentMode:', val);
 			}
 		},
 		created() {
@@ -271,9 +289,11 @@
 			this.onLoadImage();
 
 			this.onListenActionJump();
+
+			console.log('==========>1 action jump currentMode:', this.currentMode);
 		},
 		methods: {
-			...mapMutations(['onWriteBLEConnectionValue','onConvertDeviceData']),
+			...mapMutations(['onWriteBLEConnectionValue', 'onConvertDeviceData']),
 			onListenActionJump() {
 				let _self = this;
 				_self.actionJumpObj = new ActionJump();
@@ -711,8 +731,6 @@
 			setEliminationCount(value) {
 				this.taskSignCurCount++;
 				this.roundingCount += this.addShowCountUnit;
-				//取两位后计算Math floor,不然会有偏差值问题  Math.floor(39.9999999+ 0.1111111) = 39
-				this.showCurCount = Math.floor(this.roundingCount.toFixed(2));
 				this.eliminationCount += value;
 
 				// this.eliminationLabel.string = '消除数量:' + this.eliminationCount.toString();
@@ -720,13 +738,35 @@
 					eliminationCount: this.eliminationCount,
 					faultCount: this.faultCount
 				});
-
-				//todo 能量槽满的时候,说明踩中次数到达	
-				if (this.taskSignCurCount >= this.taskSignCount) {
-					this.onGameOver();
+				
+				//如果是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() {
+			onGameOver(type) {
 				this.isGameOver = true;
 				//处理参数
 				this.onClear();
@@ -736,15 +776,42 @@
 				 * 判断胜利和失败
 				 */
 				let myWin = false; //默认失败
-				//比如,1 规定时间内跳完所有标志块.2 充满左右两边蓄能槽
-				if (this.taskSignCurCount >= this.taskSignCount) {
-					//todo 有情况是2条件情况和1 其实这里处理一样,判断跳的完成度是否符合条件
+				//比如, 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;
 				}
-
-				this.$emit('gameOver', {
+				console.log(type, {
 					myWin: myWin
 				});
+				this.$emit('gameOver', {
+					myWin: myWin,
+					type:'calorieMode'
+				});
+			},
+			//pk模式下结束游戏关卡
+			onPKModeGameOver(type) {
+				this.isGameOver = true;
+				//处理参数
+				this.onClear();
+				this.onClearData();
+				this._changePlay();
+				
+				this.$emit('gameOver', {
+					type:'pkMode'
+				});
 			},
 			setFaultCount(value) {
 				this.faultCount += value;
@@ -791,6 +858,9 @@
 				this.taskSignCurCount = 0;
 				this.showCurCount = 0;
 				this.roundingCount = 0;
+
+				this.faultCount = 0;
+				this.eliminationCount = 0;
 			},
 
 			getCurrentJumpType() {
@@ -841,7 +911,7 @@
 					currentMaxValue,
 					oGyroValue
 				} = data
-				console.log('stateDataOfJump:',JSON.stringify(data));
+				console.log('stateDataOfJump:', JSON.stringify(data));
 				if (currentMaxValue == 0) {
 					//JumpType.NORMAL = 0
 					if (_jumpType == 0) {
@@ -866,7 +936,7 @@
 					if (currentMaxValue < -5) {
 						//left jump
 						_tempState[1].bTrigger = true;
-					} else if (currentMaxValue > 5 ) {
+					} else if (currentMaxValue > 5) {
 						//right jump
 						_tempState[2].bTrigger = true;
 					}

+ 1 - 6
components/uni-count-down/uni-count-down.vue

@@ -87,7 +87,6 @@
 			}
 		},
 		created: function(e) {
-			this.startData();
 		},
 		beforeDestroy() {
 			clearInterval(this.timer);
@@ -99,11 +98,6 @@
 			},
 			//开始计时
 			timePlay(data){
-				// console.log(data);
-				if (this.seconds <= 0) {
-					// this.seconds = this.startSeconds;
-					this.startData();
-				}
 				console.log('seconds:',this.seconds,this.startSeconds);
 				this.timer = setInterval(() => {
 					this.seconds--
@@ -163,6 +157,7 @@
 				this.countDown();
 			},
 			changeFlag() {
+				console.log('changeFlag');
 				this.seconds = this.toSeconds(this.day, this.hour, this.minute, this.second);
 				this.countDown();
 			}

+ 1 - 1
pages/friend-page/main/main.vue

@@ -95,7 +95,7 @@
 					mask: true
 				})
 				reqUtil.requestData(config.URL.DELETEFIRENDINFO, {
-					id: item.friendId
+					friendId: item.friendId
 				}).then(
 					res => {
 						console.log(JSON.stringify(res));

+ 1 - 1
pages/friend-page/search/search.vue

@@ -111,7 +111,7 @@
 					username: this.inputValue
 				}).then(
 					res => {
-						// console.log(JSON.stringify(res));
+						console.log(JSON.stringify(res));
 						this.friends = res.data.friends;
 
 					},

+ 233 - 289
pages/personal-page/personal/personal.vue

@@ -60,7 +60,7 @@
 										<HitEffect ref="aiHitEffectRef"></HitEffect>
 									</view>
 									<view style="margin-top: 20rpx; width: 165rpx;" class="text-cut text-white">
-										{{userName}}
+										{{userName}}{{AJData.isLeftPlayer?'':'当前玩家'}}
 									</view>
 								</view>
 
@@ -75,7 +75,7 @@
 										<HitEffect ref="hitEffectRef"></HitEffect>
 									</view>
 									<view style="margin-top: 20rpx; width: 165rpx;" class="text-cut text-white">
-										{{aiObj.name}}
+										{{aiObj.name}}{{AJData.isLeftPlayer?'':'当前玩家'}}
 									</view>
 								</view>
 
@@ -105,7 +105,7 @@
 										<LEDFont style="" :showValue='AJData.myScore' :size="30" color='#FFFFFF'>
 										</LEDFont>
 										<view class="text-white text-bold">:</view>
-										<LEDFont style="" :showValue='AJData.othreScore' :size="30" color='#FFFFFF'>
+										<LEDFont style="" :showValue='AJData.otherScore' :size="30" color='#FFFFFF'>
 										</LEDFont>
 									</view>
 									<view v-if="finallySelectFriendInfo"
@@ -231,7 +231,8 @@
 							<view id='actionJumpID' v-if="1 === currentModeIndex" class="charts-pring-bottom">
 								<action-jump ref="actionJumpRef"
 									:levelData="currentJumpTask!=null?currentJumpTask.item:null"
-									@actionJumpCheck="onPersonalCheck" @actionJumpControllerPlay="onActionControlPlay"
+									:currentMode="currentMode" @actionJumpCheck="onPersonalCheck"
+									@actionJumpControllerPlay="onActionControlPlay"
 									@actionJumpDataUpdate="onActionJumpDataUpdate"
 									@actionJumpCountDownUpdate="onActionJumpCountDownUpdate"
 									@gameOver="onActionJumpGameOver"></action-jump>
@@ -276,7 +277,7 @@
 		<sideBar ref="sideBar"></sideBar>
 
 		<!-- 训练卡 -->
-		<view class="cu-modal" :class="modalName == 'sportCompletion' ? 'show' : ''">
+		<view class="cu-modal " :class="modalName == 'sportCompletion' ? '' : ''">
 
 			<view style="
 			position: relative; 
@@ -731,17 +732,23 @@
 				/**
 				 * actionJump 模块对应的交互参数
 				 */
-				//pk部分参数
 				AJData: {
 					allCount: 0,
 					faultCount: 0,
 					perCountDown: 0,
 					gameCountDown: 0,
-					myScore: 0,
-					othreScore: 0,
+					//pk部分参数
+					myScore: 0, //左边自己的分数
+					otherScore: 0, //右边好友的分数
+					myUsageTime: 0,
+					otherUsageTime: 0,
+					isLeftPlayer: true,
+					isFinish:false,
 					gameLimitTime: 0,
 					describe: '', //关卡说明
+					
 				},
+				defaultAJData:null,
 
 				/**
 				 * 任务参数
@@ -855,12 +862,14 @@
 			});
 			//钱包信息
 			this.getUserWallets();
-			
+
 			//测试socket
 			// console.log('test*******************************');
 			// this.$testWS.connectSocket(()=>{
 			// 	this.$testWS.sendSocketMessage('unity');
 			// });
+			//复制一个默认参数
+			this.defaultAJData = Object.assign({},this.AJData);
 		},
 		onShow() {
 			_self.bHide = false;
@@ -923,9 +932,10 @@
 			// 计算屏幕剩余高度  填补剩余高度
 			let phoneHeight = this.systemInfo.windowHeight;
 
-			console.log('计算屏幕剩余高度 ===:', phoneHeight,this.systemInfo);
+			console.log('计算屏幕剩余高度 ===:', phoneHeight, this.systemInfo);
 			// 计算组件的高度
-			_self.scrollviewHight = phoneHeight - this.navHeight - this.tabbarHeight - 16 - this.systemInfo.statusBarHeight;
+			_self.scrollviewHight = phoneHeight - this.navHeight - this.tabbarHeight - 16 - this.systemInfo
+				.statusBarHeight;
 			// let view = uni.createSelectorQuery().select('#nav-bar');
 			// view.boundingClientRect(data => {
 			// 	// console.log('data===:', data);
@@ -979,7 +989,7 @@
 				'setActionJumpTask', 'getLevelList',
 				'getUserWallets', 'setGoldAndDiamond',
 				'onConvertDeviceData',
-				'showDrawerById','showPopupById'
+				'showDrawerById', 'showPopupById'
 			]),
 			BasicsSteps() {
 				this.basics = this.basics == this.basicsList.length - 1 ? 0 : this.basics + 1
@@ -1026,7 +1036,12 @@
 			arcbarCountDownTimeUp() {
 				//todo,涉及到倒计时的关卡。时间到。游戏结束
 				if (1 === this.currentModeIndex) {
-					this.$refs.actionJumpRef.onGameOver();
+					if (this.currentMode == "pkMode") {
+						this.$refs.actionJumpRef.onPKModeGameOver("timeUp");
+					} else {
+						this.$refs.actionJumpRef.onGameOver("timeUp");
+					}
+
 				}
 
 			},
@@ -1038,7 +1053,10 @@
 				//清除时间计时器
 				this.$refs.arcbarCountDownRef.timePause();
 			},
-			arcbarCountDownPlay() {
+			arcbarCountDownPlay(bResetTime) {
+				if (bResetTime) {
+					this.$refs.arcbarCountDownRef.startData();
+				}
 				this.$refs.arcbarCountDownRef.timePlay();
 			},
 			// 进度条数据
@@ -1367,7 +1385,7 @@
 					//这个是普通打击模式
 					this.$refs.boxingPostRef.onBLEHandleUpdate(data);
 				} else if (this.BLEConnectDevice.usageMode == "ropeSkipping") {
-					
+
 					this.onConvertDeviceData({
 						data: data,
 						callback: (outData) => {
@@ -1380,7 +1398,7 @@
 							data.gyro = outData.convertGyro;
 							//跳绳蓝牙反馈
 							this.$refs.actionJumpRef.onBLERopeUpdate(data);
-							
+
 						}
 					});
 
@@ -1661,7 +1679,7 @@
 
 			//判断是否有其他限制
 			onStartCheck() {
-				//#ifdef H5
+				//#ifdef H5 || APP-PLUS
 				// 直接走测试,如果是h5
 				if (0 === this.currentModeIndex) {
 					this.onBoxingGuideFinish();
@@ -1674,6 +1692,14 @@
 						})
 						return;
 					}
+					if (this.currentMode == 'pkMode' && this.finallySelectFriendInfo==null) {
+						uni.showToast({
+							title: '选择一个pk好友',
+							icon: 'none',
+							duration: 2000,
+						})
+						return;
+					}
 					//调用开始
 					this.onActionJumpPlay();
 				}
@@ -1827,13 +1853,23 @@
 			//检测是否符合要求,没有的话进行新手提示
 			onPersonalCheck() {
 
-				if (1 === this.currentModeIndex && this.currentJumpTask == null) {
-					uni.showToast({
-						title: '先选一个挑战关卡',
-						icon: 'none',
-						duration: 2000,
-					})
-					return;
+				if (1 === this.currentModeIndex) {
+					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.onStartCheck();
@@ -1977,6 +2013,10 @@
 			//点击暂停时候,判断一下是否完成目标
 			onActionControlPlay(bPlay) {
 				if (!bPlay) {
+					//跳模块的情况下,暂停计时器
+					if (1 == this.currentModeIndex)
+						this.arcbarCountDownTimeReset();
+
 					if (this.planData.allCalorie < this.planData.calorie) {
 						this.modalName = 'showPlanTipModal';
 						this.planTipIndex = 1;
@@ -2068,6 +2108,7 @@
 						} else if (1 === this.currentModeIndex) {
 							//todo actionJump
 							this.$refs.actionJumpRef.onClearActionJumpData();
+
 						}
 						//停止蓝牙加速计
 						this.onWriteBLEConnectionValue({
@@ -2076,11 +2117,22 @@
 
 					}
 					uni.$off('updateBLEDeviceData', this.callbackUpdateBLEData);
-					this.syncRequestEvent({
-						success: () => {
-							this.updateArcbarData();
+					if(1 === this.currentModeIndex){
+						if(this.currentMode == "calorieMode"){
+							this.syncRequestEvent({
+								success: () => {
+									this.updateArcbarData();
+								}
+							});
 						}
-					});
+					}else{
+						this.syncRequestEvent({
+							success: () => {
+								this.updateArcbarData();
+							}
+						});
+					}
+					
 				} else {
 					//如果不是,继续调用播放
 					if (0 === this.currentModeIndex) {
@@ -2088,6 +2140,10 @@
 					} else if (1 === this.currentModeIndex) {
 						//actionJump
 						this.$refs.actionJumpRef.onContinueGame();
+						if (0 !== this.currentJumpTask.item.limitTime) {
+							//0默认不限时,所以限时的才走计时间
+							this.arcbarCountDownPlay(false);
+						}
 					}
 					// if (this.BLEConnectDevice.usageMode == "ropeSkipping") {
 
@@ -2462,12 +2518,24 @@
 			},
 
 			/**
-			 * action 模块相关数据更新
+			 * action 模块相关数据更新,实时更新
 			 */
 			onActionJumpDataUpdate(obj) {
 				// console.log(obj);
 				this.AJData.allCount = obj.eliminationCount + obj.faultCount;
 				this.AJData.faultCount = obj.faultCount;
+
+				//如果pk模式下,区分两个人的分数
+				if (this.currentMode == "pkMode") {
+					if (this.AJData.isLeftPlayer) {
+						this.AJData.myScore = obj.eliminationCount - obj.faultCount;
+						this.AJData.myUsageTime = this.AJData.gameLimitTime - this.AJData.perCountDown;
+					} else {
+						this.AJData.otherScore = obj.eliminationCount - obj.faultCount;
+						this.AJData.otherUsageTime = this.AJData.gameLimitTime - this.AJData.perCountDown;
+					}
+				}
+
 			},
 			onActionJumpCountDownUpdate(obj) {
 				// console.log(obj);
@@ -2475,258 +2543,171 @@
 			},
 			//actionJump 模块跳关卡开始处理
 			onActionJumpPlay() {
+				//开始时候,设置默认参数
+				if(this.AJData.isFinish){
+					//如果下一局,重新设置一下默认参数
+					this.onResetDefaultActionJumpData();
+				}
+				this.onSetActionJumpData();
 				this.$refs.actionJumpRef.onActionJumpPlay();
 				//todo 首先判断时间处理
 				if (0 !== this.currentJumpTask.item.limitTime) {
 					//0默认不限时,所以限时的才走计时间
-
-					this.arcbarCountDownPlay();
+					this.arcbarCountDownPlay(true);
 				}
-				//开始时候,设置默认参数
-				this.onSetActionJumpData();
 			},
 			//重置actionJump数据
-			onResetActionJumpData() {
-				this.AJData = {
-					allCount: 0,
-					faultCount: 0,
-					perCountDown: 0,
-					gameCountDown: 0,
-					myScore: 0,
-					othreScore: 0,
-					gameLimitTime: 0,
-					describe: '', //关卡说明
-				}
+			onResetDefaultActionJumpData() {
+				this.AJData = Object.assign({},this.defaultAJData);
 			},
 			onSetActionJumpData() {
 				let _item = this.currentJumpTask.item;
-				this.AJData = {
+				//这里set只是对应关卡的数据
+				this.AJData = Object.assign({}, this.AJData, {
 					allCount: 0,
 					faultCount: 0,
 					perCountDown: 0,
 					gameCountDown: 0,
-					myScore: 0,
-					othreScore: 0,
-					gameLimitTime: _item.limitTime,
-					describe: '', //关卡说明
-				}
+					gameLimitTime: _item.limitTime
+				})
 				console.log('onSetActionJumpData', JSON.stringify(this.AJData), JSON.stringify(_item));
 			},
 			onActionJumpGameOver(data) {
-				// console.log('onActionJumpGameOver');
+				//游戏结束,重置时间
+				this.arcbarCountDownTimeReset();
 				//todo 可能区分 levelJump 关卡类型
-				// if (this.currentMode == "calorieMode") {
-
-				// }
-
-				if (data.myWin) {
-					//通过关卡,处理逻辑
-					let _item = this.currentJumpTask.item;
-					reqUtil
-						.requestData(config.URL.PASSTHELEVEL, {
-							levelId: _item.id,
-							levelType: 1,
+				if (this.currentMode == "pkMode") {
+					//pk模式下面
+					if (this.AJData.isLeftPlayer) {
+						//如果是左边的.切换下一个玩家
+						this.AJData.isLeftPlayer = false;
+						uni.showModal({
+							title: '切换下一个玩家',
+							showCancel: false,
+							success: (res) => {
+								if (res.confirm) {
+									//重新开始计算
+									this.onActionJumpPlay();
+								}
+							}
 						})
-						.then(
-							res => {
-								if (res.code == 0) {
-									console.log('PASSTHELEVEL:' + JSON.stringify(res.data));
-									//处理 列表数据
-									this.nextTaskCanUnlock = false;
-									for (let i = 0; i < this.currentTaskList.length; i++) {
-										if (this.currentTaskList[i].id == _item.id) {
-											this.currentTaskList[i].isPassed = true;
-											break;
+					} else {
+						this.AJData.isFinish = true;
+						let isMyWin = true;
+						//如果是右边好友,即判断结束。计算胜负关系
+						if (this.AJData.myScore > this.AJData.otherScore) {
+							//规定时间内,跳得最多
+							uni.showToast({
+								title: '我赢!!',
+								duration: 2000
+							})
+							isMyWin = true;
+						} else {
+							uni.showToast({
+								title: '好友赢或者平局',
+								duration: 2000
+							})
+							isMyWin = false;
+						}
+						//奖励赢的人 PKLEVELREWARD
+						let _item = this.currentJumpTask.item;
+						let _curFriend = this.finallySelectFriendInfo;
+						console.log('this.finallySelectFriendInfo:',this.finallySelectFriendInfo);
+						reqUtil
+							.requestData(config.URL.PKLEVELREWARD, {
+								levelId: _item.id,
+								levelType: 1,
+								isMyWin:isMyWin,
+								friendId:_curFriend.friendId
+							})
+							.then(
+								res => {
+									if (res.code == 0) {
+										console.log('PKLEVELREWARD:' + JSON.stringify(res.data));
+										if(isMyWin){
+											//只有isMyWin的情况下才有这两个字段返回,更新本地金币和钻石
+											this.setGoldAndDiamond({
+												gold: res.data.gold,
+												diamond: res.data.diamond
+											});
 										}
+						
 									}
-									let _title = data.myWin ? "胜利" : "失败";
-									let _context = data.myWin ? "通关关卡成功!" : "通关关卡失败!";
-									this.modalName = "showModalTip"
-									if (0 !== res.data.rewardHonor.type || 0 !== res.data.rewardGold || 0 !== res.data
-										.rewardDiamond) {
-										//todo
-										this.$refs.modalTipRef.setShowData({
-											title: _title,
-											context: _context,
-											operationItem: res.data,
-											type: 'PASSTHELEVEL'
-										});
-									} else {
-										//没有奖励数据
-										this.$refs.modalTipRef.setShowData({
-											title: _title,
-											context: _context,
-											operationItem: null,
-											type: 'none'
-										});
-									}
-
-
-
-
-
+								},
+								e => {
+									console.log(e);
+								}
+							);
+					}
+				} else {
+					this.AJData.isFinish = true;
+					if (data.myWin) {
+						//通过关卡,处理逻辑
+						let _item = this.currentJumpTask.item;
+						reqUtil
+							.requestData(config.URL.PASSTHELEVEL, {
+								levelId: _item.id,
+								levelType: 1,
+							})
+							.then(
+								res => {
+									if (res.code == 0) {
+										console.log('PASSTHELEVEL:' + JSON.stringify(res.data));
+										//处理 列表数据
+										this.nextTaskCanUnlock = false;
+										for (let i = 0; i < this.currentTaskList.length; i++) {
+											if (this.currentTaskList[i].id == _item.id) {
+												this.currentTaskList[i].isPassed = true;
+												break;
+											}
+										}
+										let _title = data.myWin ? "胜利" : "失败";
+										let _context = data.myWin ? "通关关卡成功!" : "通关关卡失败!";
+										this.modalName = "showModalTip"
+										if (0 !== res.data.rewardHonor.type || 0 !== res.data.rewardGold || 0 !== res.data
+											.rewardDiamond) {
+											//todo
+											this.$refs.modalTipRef.setShowData({
+												title: _title,
+												context: _context,
+												operationItem: res.data,
+												type: 'PASSTHELEVEL'
+											});
+											//存在任何奖励的情况下直接更新一下返回的金币和钻石数据
+											this.setGoldAndDiamond({
+												gold: res.data.gold,
+												diamond: res.data.diamond
+											});
+										} else {
+											//没有奖励数据
+											this.$refs.modalTipRef.setShowData({
+												title: _title,
+												context: _context,
+												operationItem: null,
+												type: 'none'
+											});
+										}
 
-									//
-									this.arcbarCountDownTimeReset();
 
-									//todo 通过关卡后,处理荣誉值,解锁成就
+									}
+								},
+								e => {
+									console.log(e);
 								}
-							},
-							e => {
-								console.log(e);
-							}
-						);
+							);
+					}
 				}
-
-
 			},
 			showDrawer() {
-				// uni.getSubNVueById('personal-drawer').show('slide-in-left', 200);
-				// {id:'personal-drawer'}
 				this.showDrawerById();
 			},
 			showPopup(type, item) {
-				console.log(type, item);
 				this.showPopupById({type,item});
-				// switch (type) {
-				// 	case 'levelReward':
-				// 		uni.$emit('reward-popup', {
-				// 			title: '奖励',
-				// 			content: '',
-				// 			type: type,
-				// 			item: {
-				// 				gold: item.rewardGold,
-				// 				diamond: item.rewardDiamond,
-				// 				honor: item.rewardHonor
-				// 			},
-				// 			operationItem: item
-				// 		});
-				// 		break;
-				// 	case 'prompt':
-				// 		// 向 popup 传递消息
-				// 		uni.$emit('reward-popup', {
-				// 			title: '奖励',
-				// 			content: '',
-				// 			type: type,
-				// 			item: {
-				// 				gold: item.rewardGold,
-				// 				diamond: item.rewardDiamond,
-				// 				honor: item.rewardHonor
-				// 			},
-				// 			operationItem: item
-				// 		});
-				// 		break;
-				// 	case 'unlock':
-				// 		// 向 popup 传递消息
-				// 		uni.$emit('reward-popup', {
-				// 			title: '解锁关卡',
-				// 			content: '',
-				// 			type: type,
-				// 			item: {
-				// 				consumeGold: item.consumeGold,
-				// 				consumeDiamond: item.consumeDiamond
-				// 			},
-				// 			operationItem: item
-				// 		});
-				// 		break;
-				// 	case 'signIn':
-				// 		// 向 popup 传递消息
-				// 		uni.$emit('reward-popup', {
-				// 			title: '每日签到',
-				// 			content: '',
-				// 			type: type,
-				// 			lists: [{
-				// 					name: 'gold',
-				// 					width: 28,
-				// 					height: 28,
-				// 					url: '../../../static/common/sideBar/sGold.png',
-				// 					selectedUrl: '../../../static/common/subNVue/sign/sign-grey-gold@2x.png',
-				// 					explain: '',
-				// 					value: 20,
-				// 					isSelect: true
-				// 				},
-				// 				{
-				// 					name: 'diamond',
-				// 					width: 28,
-				// 					height: 28,
-				// 					url: '../../../static/common/sideBar/sDiamond.png',
-				// 					selectedUrl: '../../../static/common/subNVue/sign/sign-grey-diamond@2x.png',
-				// 					explain: '',
-				// 					value: 20,
-				// 					isSelect: true
-				// 				},
-				// 				{
-				// 					name: 'gold',
-				// 					width: 28,
-				// 					height: 28,
-				// 					url: '../../../static/common/sideBar/sGold.png',
-				// 					selectedUrl: '../../../static/common/subNVue/sign/sign-grey-gold@2x.png',
-				// 					explain: '',
-				// 					value: 20,
-				// 					isSelect: true
-				// 				},
-				// 				{
-				// 					name: 'gold',
-				// 					width: 28,
-				// 					height: 28,
-				// 					url: '../../../static/common/sideBar/sGold.png',
-				// 					selectedUrl: '../../../static/common/subNVue/sign/sign-grey-gold@2x.png',
-				// 					explain: '',
-				// 					value: 20,
-				// 					isSelect: false
-				// 				},
-				// 				{
-				// 					name: 'diamond',
-				// 					width: 28,
-				// 					height: 28,
-				// 					url: '../../../static/common/sideBar/sDiamond.png',
-				// 					selectedUrl: '../../../static/common/subNVue/sign/sign-grey-diamond@2x.png',
-				// 					explain: '',
-				// 					value: 20,
-				// 					isSelect: false
-				// 				},
-				// 				{
-				// 					name: 'gold',
-				// 					width: 28,
-				// 					height: 28,
-				// 					url: '../../../static/common/sideBar/sGold.png',
-				// 					selectedUrl: '../../../static/common/subNVue/sign/sign-grey-gold@2x.png',
-				// 					explain: '',
-				// 					value: 20,
-				// 					isSelect: false
-				// 				},
-				// 				{
-				// 					name: 'gold',
-				// 					width: 28,
-				// 					height: 28,
-				// 					url: '../../../static/common/sideBar/sGold.png',
-				// 					selectedUrl: '../../../static/common/subNVue/sign/sign-grey-gold@2x.png',
-				// 					explain: '',
-				// 					value: 20,
-				// 					isSelect: false
-				// 				}
-				// 			]
-				// 		});
-				// 		break;
-
-				// 	default:
-				// 		uni.showToast({
-				// 			title: 'showPopup 类型为空',
-				// 		})
-				// 		break;
-				// }
-
-				// // #ifdef APP-PLUS
-				// const subNVue = uni.getSubNVueById('personal-popup')
-				// subNVue.show('zoom-out', 250)
-				// // #endif
 			},
-
 			/**
 			 * 任务相关
 			 */
 			selectTask(_index, _item) {
-				// console.log('taskSelect=', _index, JSON.stringify(_item));
 				if (_item.isUnlock) {
 					let _data = {
 						modeName: this.currentMode, //记录时候记录当前的mode 
@@ -2738,49 +2719,8 @@
 					let isCanUnlock = _index == 0 || (_index >= 1 && this.currentTaskList[_index - 1].isUnlock && this
 						.currentTaskList[_index - 1].isPassed) ? true : false;
 					if (!isCanUnlock) return;
-
 					this.showPopup('unlock', _item);
-					// return;
-					// let _content = '条件:';
-
-					// for (let i = 0; i < _item.conditionUnlock.length; i++) {
-					// 	let _condition = _item.conditionUnlock[i];
-					// 	let _consume = '';
-					// 	if (_condition.limitType == 2) {
-					// 		_consume = _item.consumeGold;
-					// 	} else if (_condition.limitType == 3) {
-					// 		_consume = _item.consumeDiamond;
-					// 	}
-					// 	_content += _consume + _condition.explain;
-					// 	if (i == _item.conditionUnlock.length - 1) {
-					// 		_content += '.';
-					// 	} else {
-					// 		_content += ',';
-					// 	}
-					// }
-					// //解锁关卡
-					// uni.showModal({
-					// 	title: '解锁-' + _item.name,
-					// 	content: _content,
-					// 	/**
-					// 	 * 如果需要强制,不显示取消按钮
-					// 	 */
-					// 	showCancel: true,
-					// 	ConfirmColor: '#A488DC',
-					// 	confirmText: '解锁',
-					// 	success: res => {
-					// 		if (res.confirm) {
-
-
-
-					// 		} else if (res.cancel) {
-					// 			//todo
-					// 		}
-
-					// 	}
-					// });
 				}
-
 			},
 			updateTaskScroll() {
 				/**
@@ -2930,11 +2870,15 @@
 				uni.$off('reward-popup-page')
 				uni.$off('drawer-page')
 			},
-			
-			onNavToDirection(){
+
+			onNavToDirection() {
 				uni.navigateTo({
-					url:'../directionOfDetection/directionOfDetection'
+					url: '../directionOfDetection/directionOfDetection'
 				})
+			},
+
+			moveBoxingHandle() {
+				return;
 			}
 		}
 	};

+ 10 - 0
util/util-js/enum.js

@@ -0,0 +1,10 @@
+var CONDITIONPASSED = {
+	SCORE:0,//分数解锁
+	ENERGYBARFULL: 10000,//充满左右两边蓄能槽
+	SKIPALLFLAGWITHINTIME: 10001,//规定时间内跳完所有标志块
+	JUMPTHEMOSTWITHINTIME: 10002,//规定时间内跳最多
+}
+
+module.exports = {
+	CONDITIONPASSED:CONDITIONPASSED
+} 

+ 1 - 0
util/util-js/store.js

@@ -486,6 +486,7 @@ const store = new Vuex.Store({
 
 		setFinallSelectFriendInfo(state, friendInfo) {
 			state.finallySelectFriendInfo = friendInfo;
+			console.log('finallySelectFriendInfo',JSON.stringify(friendInfo));
 		},
 		clearFinallFriendInfo(state) {
 			state.finallySelectFriendInfo = null;