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