|
@@ -38,116 +38,65 @@
|
|
|
<!-- 计划显示 区域 topScrollHight :style="{ height: + '100%' }"-->
|
|
|
<scroll-view scroll-y="true" style="height: 100%; width: 100%;">
|
|
|
<view class="plan-view">
|
|
|
- <!-- 拳击模块 -->
|
|
|
- <!-- <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;">
|
|
|
- <view class="cu-avatar round xl" :class="bAiHitShake?' screen-jitter':''"
|
|
|
- :style="[{ backgroundImage:'url('+avatarUrl+')' }]"></view>
|
|
|
- <HitEffect ref="aiHitEffectRef"></HitEffect>
|
|
|
- </view>
|
|
|
- <view style="margin-top: 20rpx; width: 165rpx;" class="text-cut text-white">
|
|
|
- {{userName}}{{AJData.isLeftPlayer?'':'当前玩家'}}
|
|
|
+ <!-- pk模式下的跳绳 v-if="1 === currentModeIndex"-->
|
|
|
+ <view v-if="currentMode == 'pkMode'" class="position-relative"
|
|
|
+ style="height: 128rpx; background-color: RGBA(30, 30, 85, 1); z-index: 10;">
|
|
|
+ <view style="height: 14rpx;"></view>
|
|
|
+ <view class="position-absolute-center-top flex justify-center" style="height: 148rpx;">
|
|
|
+ <view class="flex flex-direction justify-center align-center">
|
|
|
+ <view class="cu-avatar-group" style="position: relative;">
|
|
|
+ <view class="cu-avatar round xl" :class="bAiHitShake?' screen-jitter':''"
|
|
|
+ :style="[{ backgroundImage:'url('+avatarUrl+')' }]"
|
|
|
+ style="width: 102.4rpx ;height: 102.4rpx;"></view>
|
|
|
+ </view>
|
|
|
+ <view style="margin-top: 8rpx; width: 165rpx; "
|
|
|
+ class="text-cut text-white text-center">
|
|
|
+ {{userName}}
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
|
|
|
- <view>
|
|
|
- <image style="width: 104rpx; height: 42rpx ;margin-bottom: 60rpx;"
|
|
|
- src="/static/personal/pk@2x.png"></image>
|
|
|
- </view>
|
|
|
- <view>
|
|
|
- <view class="cu-avatar-group" style="position: relative;">
|
|
|
- <view class="cu-avatar round xl" :class="bHitShake?' screen-jitter':''"
|
|
|
- :style="[{ backgroundImage:'url('+aiObj.avatar+')' }]"></view>
|
|
|
- <HitEffect ref="hitEffectRef"></HitEffect>
|
|
|
- </view>
|
|
|
- <view style="margin-top: 20rpx; width: 165rpx;" class="text-cut text-white">
|
|
|
- {{aiObj.name}}{{AJData.isLeftPlayer?'':'当前玩家'}}
|
|
|
+ <view class="flex justify-center align-center " style=" width: 300rpx;">
|
|
|
+ <LEDFont style="" :showValue='AJData.myScore' :size="30" color='#FFFFFF'>
|
|
|
+ </LEDFont>
|
|
|
+ <view class="text-white text-bold">:</view>
|
|
|
+ <LEDFont style="" :showValue='AJData.otherScore' :size="30" color='#FFFFFF'>
|
|
|
+ </LEDFont>
|
|
|
</view>
|
|
|
- </view>
|
|
|
-
|
|
|
- <view
|
|
|
- style="position: absolute;left: 0;right: 0;top: 0;bottom: 0; height: 200rpx; margin-top: 120rpx;">
|
|
|
- <HitFistEffect ref="hitFistRef"></HitFistEffect>
|
|
|
- </view>
|
|
|
-
|
|
|
- </view> -->
|
|
|
-
|
|
|
- <!-- 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="flex flex-direction justify-center align-center">
|
|
|
- <view class="cu-avatar-group" style="position: relative;">
|
|
|
- <view class="cu-avatar round xl"
|
|
|
- :class="bAiHitShake?' screen-jitter':''"
|
|
|
- :style="[{ backgroundImage:'url('+avatarUrl+')' }]"
|
|
|
- style="width: 102.4rpx ;height: 102.4rpx;"></view>
|
|
|
- </view>
|
|
|
- <view style="margin-top: 8rpx; width: 165rpx; "
|
|
|
- class="text-cut text-white text-center">
|
|
|
- {{userName}}
|
|
|
+ <view v-if="finallySelectFriendInfo"
|
|
|
+ class="flex flex-direction justify-center align-center"
|
|
|
+ @click="onNavToSelectFriend()">
|
|
|
+ <view class="cu-avatar-group" style="position: relative;">
|
|
|
+ <view class="cu-avatar round xl" :class="bHitShake?' screen-jitter':''"
|
|
|
+ :style="[{ backgroundImage:'url('+finallySelectFriendInfo.avatarUrl+')' }]"
|
|
|
+ style="width: 102.4rpx ;height: 102.4rpx;">
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
- <view class="flex justify-center align-center " style=" width: 300rpx;">
|
|
|
- <LEDFont style="" :showValue='AJData.myScore' :size="30" color='#FFFFFF'>
|
|
|
- </LEDFont>
|
|
|
- <view class="text-white text-bold">:</view>
|
|
|
- <LEDFont style="" :showValue='AJData.otherScore' :size="30" color='#FFFFFF'>
|
|
|
- </LEDFont>
|
|
|
+ <view style="margin-top: 8rpx; width: 165rpx;"
|
|
|
+ class="text-cut text-white text-center">
|
|
|
+ {{finallySelectFriendInfo.username}}
|
|
|
</view>
|
|
|
- <view v-if="finallySelectFriendInfo"
|
|
|
- class="flex flex-direction justify-center align-center"
|
|
|
- @click="onNavToSelectFriend()">
|
|
|
- <view class="cu-avatar-group" style="position: relative;">
|
|
|
- <view class="cu-avatar round xl" :class="bHitShake?' screen-jitter':''"
|
|
|
- :style="[{ backgroundImage:'url('+finallySelectFriendInfo.avatarUrl+')' }]"
|
|
|
- style="width: 102.4rpx ;height: 102.4rpx;">
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view style="margin-top: 8rpx; width: 165rpx;"
|
|
|
- class="text-cut text-white text-center">
|
|
|
- {{finallySelectFriendInfo.username}}
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view v-else class="flex flex-direction justify-center align-center"
|
|
|
- @click="onNavToSelectFriend()">
|
|
|
- <image style="width: 102.4rpx ;height: 102.4rpx;"
|
|
|
- src="/static/friend/friend-add.png">
|
|
|
- </image>
|
|
|
- <view style="margin-top: 8rpx; width: 165rpx;"
|
|
|
- class="text-cut text-white text-center">
|
|
|
- 选择好友
|
|
|
- </view>
|
|
|
+ </view>
|
|
|
+ <view v-else class="flex flex-direction justify-center align-center"
|
|
|
+ @click="onNavToSelectFriend()">
|
|
|
+ <image style="width: 102.4rpx ;height: 102.4rpx;"
|
|
|
+ src="/static/friend/friend-add.png">
|
|
|
+ </image>
|
|
|
+ <view style="margin-top: 8rpx; width: 165rpx;"
|
|
|
+ class="text-cut text-white text-center">
|
|
|
+ 选择好友
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
</view>
|
|
|
- <!-- 80rpx -->
|
|
|
- <view v-else style="height:14rpx; background-color: RGBA(30, 30, 85, 1);"> </view>
|
|
|
- </block>
|
|
|
+
|
|
|
+ </view>
|
|
|
+ <!-- 80rpx -->
|
|
|
+ <view v-else style="height:14rpx; background-color: RGBA(30, 30, 85, 1);"> </view>
|
|
|
|
|
|
<!-- 进度条 -->
|
|
|
<view class="qiun-charts-arcbar">
|
|
|
<!-- 进度条 -->
|
|
|
<canvas v-show="false" canvas-id="canvasArcbar" id="canvasArcbar"
|
|
|
class="charts-arcbar "></canvas>
|
|
|
- <!-- 图标 -->
|
|
|
- <!-- <view class="personal-fruit-container">
|
|
|
- <image style="width: 36rpx;height: 56rpx; margin-top: -120px;"
|
|
|
- src="../../../static/modal/action-jump/arcbarJumpIcon.png"></image>
|
|
|
- </view> -->
|
|
|
-
|
|
|
- <!-- 图标 -->
|
|
|
- <!-- <view class="personal-fruit-container">
|
|
|
- <view class="text-13px text-white" style="margin-top: -50px;">
|
|
|
- 失误:{{AJData.faultCount}}</view>
|
|
|
- </view> -->
|
|
|
<!-- 跳动次数 -->
|
|
|
<view class="position-absolute-center-bottom flex justify-center"
|
|
|
style="align-items: flex-end; height: 276rpx; bottom: 40rpx;">
|
|
@@ -236,15 +185,10 @@
|
|
|
<!-- 底部中间上滑按钮 -->
|
|
|
<view class="flex flex-direction justify-start align-center task-up-button" @tap="showModal"
|
|
|
data-target="slideUpModal">
|
|
|
- <!-- <image style="width: 156rpx; height: 32rpx;" src="../../../static/personal/slideUp.png" @tap="showModal"
|
|
|
- data-target="slideUpModal"></image> -->
|
|
|
<image style="width: 248rpx;height: 104rpx;" class="position-absolute-center"
|
|
|
src="../../../static/modal/level-tip/level-tip-bg-orange.png"></image>
|
|
|
<view class="text-blue bg-white radius "
|
|
|
style="z-index: 10; margin-top: 20rpx; width: 72rpx; height: 12rpx;"></view>
|
|
|
- <!-- <image style="width: 30px;height: 23px; " src="../../../static/modal/level-tip/level-tip-logo@2x.png">
|
|
|
- </image> -->
|
|
|
- <!-- <view style="width: 100%;height: 16rpx; background-color: #FFFFFF; color: #FFFFFF;"></view> -->
|
|
|
</view>
|
|
|
|
|
|
<!-- 右下角导航栏 -->
|
|
@@ -330,8 +274,8 @@
|
|
|
</view>
|
|
|
|
|
|
<!-- 引导蒙层 bGuidePages guideCurrent-->
|
|
|
- <code-elf-guide ref="codeElfGuide" v-if="bGuidePages" @hide="guideHide" @change="onGuideChange"
|
|
|
- :current="guideCurrent" :currentMode="currentMode"></code-elf-guide>
|
|
|
+ <!-- <code-elf-guide ref="codeElfGuide" v-if="bGuidePages" @hide="guideHide" @change="onGuideChange"
|
|
|
+ :current="guideCurrent" :currentMode="currentMode"></code-elf-guide> -->
|
|
|
|
|
|
<view v-if="bStartCountDown" class="CountDownMask">
|
|
|
{{BoxingPostCountDownText}}
|
|
@@ -789,6 +733,11 @@
|
|
|
|
|
|
bShowComplete: false,
|
|
|
|
|
|
+ /**
|
|
|
+ * 记录一个旧的index
|
|
|
+ */
|
|
|
+ oldModeIndex: 1
|
|
|
+
|
|
|
};
|
|
|
},
|
|
|
onLoad() {
|
|
@@ -947,14 +896,6 @@
|
|
|
// }
|
|
|
|
|
|
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;
|
|
|
|
|
@@ -1061,7 +1002,8 @@
|
|
|
'showDrawerById', 'showPopupById', 'showGuideById',
|
|
|
'closeDrawerById', 'closePopupById', 'closeGuideById',
|
|
|
'getSignInList', 'onUserSignIn',
|
|
|
- 'setGuideUnlockState'
|
|
|
+ 'setGuideUnlockState',
|
|
|
+ 'resetActionJumpTask'
|
|
|
]),
|
|
|
BasicsSteps() {
|
|
|
this.basics = this.basics == this.basicsList.length - 1 ? 0 : this.basics + 1
|
|
@@ -1186,23 +1128,7 @@
|
|
|
color: '#2fc25b'
|
|
|
}];
|
|
|
//这里区分进度条数据
|
|
|
- if (0 == this.currentModeIndex) {
|
|
|
- showCal = _planData.calorie;
|
|
|
- showLCal = _planData.allCalorie;
|
|
|
- LCalTip = '大卡';
|
|
|
- showTip = '(未达标)';
|
|
|
-
|
|
|
- // 如果运动的卡路里大于目标卡路里,设置为目标卡路里值,即为Max
|
|
|
- if (showLCal >= showCal) {
|
|
|
- showTip = '(达标)';
|
|
|
- }
|
|
|
-
|
|
|
- series = [{
|
|
|
- name: showTip,
|
|
|
- data: _planData.allCalorie == 0 ? 0 : _planData.allCalorie / showCal,
|
|
|
- color: '#2fc25b'
|
|
|
- }];
|
|
|
- } else if (1 == this.currentModeIndex) {
|
|
|
+ if (1 == this.currentModeIndex || 0 == this.currentModeIndex) {
|
|
|
showCal = _planData.calorie;
|
|
|
showLCal = _planData.allCalorie;
|
|
|
LCalTip = '大卡';
|
|
@@ -1219,8 +1145,6 @@
|
|
|
.gameLimitTime,
|
|
|
color: '#2fc25b'
|
|
|
}];
|
|
|
-
|
|
|
- // console.log(series);
|
|
|
}
|
|
|
|
|
|
return {
|
|
@@ -1295,17 +1219,6 @@
|
|
|
});
|
|
|
},
|
|
|
updateArcbarData(data) {
|
|
|
- // if (data == "plan") {
|
|
|
- // // 加入设置的卡路里小于本地,则更新本地最小值
|
|
|
- // _self.addlocalCalorie(0);
|
|
|
- // console.log("**************updateArcbarData");
|
|
|
- // // 如果是计划设置好后
|
|
|
- // // this.$store.state.bPlanFinish = true;
|
|
|
- // // setTimeout(() => {
|
|
|
- // // this.$store.state.bPlanFinish = false;
|
|
|
- // // }, 10000)
|
|
|
- // }
|
|
|
- // console.log("updateArcbarData:",this.planData);
|
|
|
let {
|
|
|
showCal,
|
|
|
showLCal,
|
|
@@ -1323,18 +1236,7 @@
|
|
|
_self.$store.state.oldArcbarProCalorie = showCal;
|
|
|
|
|
|
canvaArcbar1.updateData({
|
|
|
- series: series,
|
|
|
- // title: {
|
|
|
- // //这里的文案是自定义的,不写是不变的
|
|
|
- // name: showLCal,
|
|
|
- // molecularUnit: LCalTip, //单位的分子部分
|
|
|
- // denominatorUnit: showCal, //单位的分母部分
|
|
|
- // }
|
|
|
- //,
|
|
|
- // subtitle: {
|
|
|
- // //这里的文案是自定义的,不写是不变的
|
|
|
- // name: series[0].name
|
|
|
- // }
|
|
|
+ series: series
|
|
|
});
|
|
|
},
|
|
|
updateArcbarDataFromActionJump(data) {
|
|
@@ -1364,23 +1266,11 @@
|
|
|
_self.$store.state.oldArcbarProCalorie = showCal;
|
|
|
|
|
|
canvaArcbar1.updateData({
|
|
|
- series: series,
|
|
|
- // title: {
|
|
|
- // //这里的文案是自定义的,不写是不变的
|
|
|
- // name: showLCal,
|
|
|
- // molecularUnit: LCalTip, //单位的分子部分
|
|
|
- // denominatorUnit: showCal, //单位的分母部分
|
|
|
- // }
|
|
|
- // ,
|
|
|
- // subtitle: {
|
|
|
- // //这里的文案是自定义的,不写是不变的
|
|
|
- // name: series[0].name
|
|
|
- // }
|
|
|
+ series: series
|
|
|
});
|
|
|
},
|
|
|
// 跳转计划页面
|
|
|
openPlan(e) {
|
|
|
- // console.log(e);
|
|
|
uni.navigateTo({
|
|
|
url: '../plan/plan?newsid=' + 11,
|
|
|
success: res => {},
|
|
@@ -1388,7 +1278,6 @@
|
|
|
complete: () => {}
|
|
|
});
|
|
|
},
|
|
|
-
|
|
|
// 跳转转换页面
|
|
|
onNavConver() {
|
|
|
uni.reLaunch({
|
|
@@ -1529,115 +1418,6 @@
|
|
|
}
|
|
|
|
|
|
|
|
|
- },
|
|
|
- //绑定设备函数
|
|
|
- onBindingDevice(item, index) {
|
|
|
- if (item == null) {
|
|
|
- item = this.DeviceBindingList[0];
|
|
|
- }
|
|
|
- if (this.BLEConnectDevice) {
|
|
|
- uni.showToast({
|
|
|
- icon: "none",
|
|
|
- title: "已连接硬件设备",
|
|
|
- duration: 1000
|
|
|
- })
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- if (this.ConnectBindingDevice) {
|
|
|
- this.$store.state.ConnectBindingDevice = null;
|
|
|
- setTimeout(() => {
|
|
|
- uni.showToast({
|
|
|
- icon: "none",
|
|
|
- title: "断开连接",
|
|
|
- duration: 1000
|
|
|
- })
|
|
|
- }, 300)
|
|
|
- } else {
|
|
|
- this.$store.state.ConnectBindingDevice = item;
|
|
|
- setTimeout(() => {
|
|
|
- uni.showToast({
|
|
|
- icon: "none",
|
|
|
- title: "已连接",
|
|
|
- duration: 1000
|
|
|
- })
|
|
|
- }, 300)
|
|
|
- //连接后保存最近连接的设备
|
|
|
- }
|
|
|
-
|
|
|
- //刷新状态
|
|
|
- this.$refs.boxingPostRef.onSetMode('pkMode');
|
|
|
-
|
|
|
- },
|
|
|
- //关闭设备函数
|
|
|
- onCloseBindingDevice(item, e) {
|
|
|
- if (e.currentTarget.dataset.index == this.cIndex) {
|
|
|
- uni.showModal({
|
|
|
- title: '设备状态',
|
|
|
- content: '是否断开连接',
|
|
|
- ConfirmColor: '#A488DC',
|
|
|
- success: res => {
|
|
|
- if (res.confirm) {
|
|
|
- this.$store.state.cIndex = -1;
|
|
|
- this.$store.state.ConnectBindingDevice = null;
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
- onNavBindingDevice() {
|
|
|
- this.toView = "addDeviceView";
|
|
|
- },
|
|
|
- onDevice(item, e) {
|
|
|
- if (this.ConnectBindingDevice) {
|
|
|
- uni.showToast({
|
|
|
- title: '当前已开启数据',
|
|
|
- icon: 'none',
|
|
|
- mask: true
|
|
|
- })
|
|
|
- return;
|
|
|
- }
|
|
|
- if (this.cIndex !== -1) {
|
|
|
- uni.showToast({
|
|
|
- title: '当前已连接设备',
|
|
|
- icon: 'none',
|
|
|
- mask: true
|
|
|
- })
|
|
|
- return;
|
|
|
- }
|
|
|
- //连接蓝牙
|
|
|
- this.onCreateBLEConnection({
|
|
|
- item: item,
|
|
|
- index: e.currentTarget.dataset.index,
|
|
|
- initItem: true,
|
|
|
- getinitAdapter: () => {
|
|
|
- this.onDevice(item, e);
|
|
|
- },
|
|
|
- getSuccess: () => {
|
|
|
- if (this.bHide) {
|
|
|
- //弹出框时候,是隐藏状态
|
|
|
- this.bGetBondTesting = true;
|
|
|
- } else {
|
|
|
- //没有弹出框时候,直接检测
|
|
|
- // setTimeout(() => {
|
|
|
- // this.onGetBondDevice();
|
|
|
- // }, 5000)
|
|
|
- }
|
|
|
-
|
|
|
- //刷新状态
|
|
|
- if (this.cIndex != -1) {
|
|
|
- let eq = this.BLEDeviceShowList[this.cIndex];
|
|
|
- // console.log(eq,this.BLEConnectDevice);
|
|
|
- if (eq.ename.indexOf("hotman") > -1 && this.BLEConnectDevice.id == 1) {
|
|
|
- this.$refs.boxingPostRef.onSetMode('pkMode');
|
|
|
- } else if (eq.ename.indexOf("BLEHandle") > -1 && this.BLEConnectDevice.id == 2) {
|
|
|
- this.$refs.boxingPostRef.onSetMode('calorieMode');
|
|
|
- } else if (eq.ename.indexOf("rope") > -1 && this.BLEConnectDevice.id == 3) {
|
|
|
- // this.$refs.boxingPostRef.onSetMode('ropeMode');
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
},
|
|
|
/**
|
|
|
* 检测获取匹配的设备
|
|
@@ -1849,28 +1629,6 @@
|
|
|
|
|
|
return;
|
|
|
//#endif
|
|
|
-
|
|
|
- //#ifdef APP-PLUS
|
|
|
- if (1 === this.currentModeIndex || 0 === 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;
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- //#endif
|
|
|
//分类型判断
|
|
|
// if (0 === this.currentModeIndex) {
|
|
|
// //拳击运动类型
|
|
@@ -1921,7 +1679,6 @@
|
|
|
this.onGetBluetoothConnectView({
|
|
|
hiddenType: 'none'
|
|
|
});
|
|
|
- // this.toView = "addDeviceView";
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
@@ -1952,16 +1709,6 @@
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
- // this.$store.state.bGuidePages = true;
|
|
|
- // setTimeout(() => {
|
|
|
- // this.$refs.codeElfGuide.setCurrent(0);
|
|
|
- // }, 0)
|
|
|
- // this.toView = "projectButtonView";
|
|
|
- // // #ifdef APP-PLUS
|
|
|
- // this.showGuide('plan', null)
|
|
|
- // // #endif
|
|
|
-
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -2032,11 +1779,11 @@
|
|
|
|
|
|
//倒计时结束后开始游戏
|
|
|
//初始化一个沙袋打击对象
|
|
|
- if(this.BLEConnectDevice.usageMode == "hotman"){
|
|
|
+ if (this.BLEConnectDevice.usageMode == "hotman") {
|
|
|
this.gCreateSandbagAlgorithm();
|
|
|
}
|
|
|
- if (this.BLEConnectDevice.usageMode == "ropeSkipping"
|
|
|
- || this.BLEConnectDevice.usageMode == "hotman") {
|
|
|
+ if (this.BLEConnectDevice.usageMode == "ropeSkipping" ||
|
|
|
+ this.BLEConnectDevice.usageMode == "hotman") {
|
|
|
//打开跳绳模式
|
|
|
// this.B_OpenRopeSkipping();
|
|
|
this.onWriteBLEConnectionValue({
|
|
@@ -2053,7 +1800,7 @@
|
|
|
//调用开始
|
|
|
this.onActionJumpPlay();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
|
|
|
this.bStartCountDown = false;
|
|
|
}, 800)
|
|
@@ -2062,8 +1809,8 @@
|
|
|
this.BoxingPostCountDownText--;
|
|
|
}, 1000)
|
|
|
} else {
|
|
|
- if (this.BLEConnectDevice.usageMode == "ropeSkipping"
|
|
|
- || this.BLEConnectDevice.usageMode == "hotman") {
|
|
|
+ if (this.BLEConnectDevice.usageMode == "ropeSkipping" ||
|
|
|
+ this.BLEConnectDevice.usageMode == "hotman") {
|
|
|
//打开跳绳模式
|
|
|
// this.B_OpenRopeSkipping();
|
|
|
this.onWriteBLEConnectionValue({
|
|
@@ -2100,7 +1847,7 @@
|
|
|
}
|
|
|
this.bShowComplete = false;
|
|
|
// #ifdef APP-PLUS
|
|
|
- if (1 === this.currentModeIndex) {
|
|
|
+ if (1 === this.currentModeIndex || 0 === this.currentModeIndex) {
|
|
|
if (this.currentJumpTask == null) {
|
|
|
// console.log("**************11");
|
|
|
this.onTipLevel({
|
|
@@ -2132,38 +1879,40 @@
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- let _item = this.currentJumpTask.item;
|
|
|
- //第一次选择关卡时候判断
|
|
|
- if (this.guideUnlockState.firstUnlockJumpUp && _item.id == 1) {
|
|
|
- this.showGuide('level-game-tip', {
|
|
|
- levelType: 'midJump',
|
|
|
- hiddenType: 'firstUnlockJumpUp'
|
|
|
- })
|
|
|
- let guideUnlockState = Object.assign(this.guideUnlockState, {
|
|
|
- firstUnlockJumpUp: false
|
|
|
- });
|
|
|
- this.setGuideUnlockState(guideUnlockState);
|
|
|
- return;
|
|
|
- } else if (this.guideUnlockState.firstUnlockLeftAndRightJump && _item.id == 6) {
|
|
|
- this.showGuide('level-game-tip', {
|
|
|
- levelType: 'directionJump',
|
|
|
- hiddenType: 'firstUnlockLeftAndRightJump'
|
|
|
- })
|
|
|
- let guideUnlockState = Object.assign(this.guideUnlockState, {
|
|
|
- firstUnlockLeftAndRightJump: false
|
|
|
- });
|
|
|
- this.setGuideUnlockState(guideUnlockState);
|
|
|
- return;
|
|
|
- } else if (this.guideUnlockState.firstUnlockLeftAndRightRotationJump && _item.id == 9) {
|
|
|
- this.showGuide('level-game-tip', {
|
|
|
- levelType: 'rotationJump',
|
|
|
- hiddenType: 'firstUnlockLeftAndRightRotationJump'
|
|
|
- })
|
|
|
- let guideUnlockState = Object.assign(this.guideUnlockState, {
|
|
|
- firstUnlockLeftAndRightRotationJump: false
|
|
|
- });
|
|
|
- this.setGuideUnlockState(guideUnlockState);
|
|
|
- return;
|
|
|
+ if (1 === this.currentModeIndex) {
|
|
|
+ let _item = this.currentJumpTask.item;
|
|
|
+ //第一次选择关卡时候判断
|
|
|
+ if (this.guideUnlockState.firstUnlockJumpUp && _item.id == 1) {
|
|
|
+ this.showGuide('level-game-tip', {
|
|
|
+ levelType: 'midJump',
|
|
|
+ hiddenType: 'firstUnlockJumpUp'
|
|
|
+ })
|
|
|
+ let guideUnlockState = Object.assign(this.guideUnlockState, {
|
|
|
+ firstUnlockJumpUp: false
|
|
|
+ });
|
|
|
+ this.setGuideUnlockState(guideUnlockState);
|
|
|
+ return;
|
|
|
+ } else if (this.guideUnlockState.firstUnlockLeftAndRightJump && _item.id == 6) {
|
|
|
+ this.showGuide('level-game-tip', {
|
|
|
+ levelType: 'directionJump',
|
|
|
+ hiddenType: 'firstUnlockLeftAndRightJump'
|
|
|
+ })
|
|
|
+ let guideUnlockState = Object.assign(this.guideUnlockState, {
|
|
|
+ firstUnlockLeftAndRightJump: false
|
|
|
+ });
|
|
|
+ this.setGuideUnlockState(guideUnlockState);
|
|
|
+ return;
|
|
|
+ } else if (this.guideUnlockState.firstUnlockLeftAndRightRotationJump && _item.id == 9) {
|
|
|
+ this.showGuide('level-game-tip', {
|
|
|
+ levelType: 'rotationJump',
|
|
|
+ hiddenType: 'firstUnlockLeftAndRightRotationJump'
|
|
|
+ })
|
|
|
+ let guideUnlockState = Object.assign(this.guideUnlockState, {
|
|
|
+ firstUnlockLeftAndRightRotationJump: false
|
|
|
+ });
|
|
|
+ this.setGuideUnlockState(guideUnlockState);
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
// #endif
|
|
@@ -2312,7 +2061,7 @@
|
|
|
onActionControlPlay(bPlay) {
|
|
|
if (!bPlay) {
|
|
|
//跳模块的情况下,暂停计时器
|
|
|
- if (1 == this.currentModeIndex)
|
|
|
+ if (1 == this.currentModeIndex || 0 == this.currentModeIndex)
|
|
|
this.arcbarCountDownTimeReset();
|
|
|
|
|
|
if (this.planData.allCalorie < this.planData.calorie) {
|
|
@@ -2452,19 +2201,6 @@
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- /**
|
|
|
- * 新手任务引导
|
|
|
- */
|
|
|
- onGuideChange(e) {
|
|
|
- let tempCurrent = e.detail.current;
|
|
|
- if (tempCurrent == 1) {
|
|
|
- _self.toView = "addDeviceView";
|
|
|
- } else if (tempCurrent == 0) {
|
|
|
- _self.toView = "projectButtonView";
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
guideHide(e) {
|
|
|
this.$store.state.bGuidePages = false;
|
|
|
if (e.current == 0 && !e.onlyHide) {
|
|
@@ -2483,17 +2219,6 @@
|
|
|
// });
|
|
|
// 跳转连接蓝牙页面
|
|
|
this.openDeviceList();
|
|
|
- } else if (e.current == 4 && !e.onlyHide) {
|
|
|
- //连接绑定设备
|
|
|
- // this.openQRCode();
|
|
|
- console.log(e);
|
|
|
- let _index = Number(e.device.dataset.index);
|
|
|
- this.onBindingDevice(this.DeviceBindingList[_index], _index);
|
|
|
-
|
|
|
- //连接设备后,再
|
|
|
- setTimeout(() => {
|
|
|
- this.onPersonalCheck();
|
|
|
- }, 200);
|
|
|
} else if (e.current == 5 && !e.onlyHide) {
|
|
|
console.log("==:", e);
|
|
|
//todo 跳绳模式 新手引导
|
|
@@ -2525,34 +2250,7 @@
|
|
|
},
|
|
|
|
|
|
mainScroll(e) {
|
|
|
- if (_self.toView == "addDeviceView") {
|
|
|
- _self.toView = "";
|
|
|
- if (!_self.bGuidePages) return;
|
|
|
- let view = uni.createSelectorQuery().select('#addDeviceView');
|
|
|
- view.boundingClientRect(data => {
|
|
|
- _self.$refs.codeElfGuide.setDeviceObj(data);
|
|
|
- }).exec();
|
|
|
- } else if (_self.toView == "projectButtonView") {
|
|
|
- _self.toView = "";
|
|
|
- if (!_self.bGuidePages) return;
|
|
|
- _self.onGetProjectView();
|
|
|
- } else if (_self.toView == "QRDeviceView") {
|
|
|
- _self.toView = "";
|
|
|
- if (!_self.bGuidePages) return;
|
|
|
- let view = uni.createSelectorQuery().select('#QRDeviceView');
|
|
|
- view.boundingClientRect(data => {
|
|
|
- _self.$refs.codeElfGuide.setDeviceObj(data);
|
|
|
- }).exec();
|
|
|
- } else if (_self.toView == "bing-boxingPost") {
|
|
|
- _self.toView = "";
|
|
|
- if (!_self.bGuidePages) return;
|
|
|
- let view = uni.createSelectorQuery().select('#bing-boxingPost');
|
|
|
- view.boundingClientRect(data => {
|
|
|
- _self.$refs.codeElfGuide.setDeviceObj(data);
|
|
|
-
|
|
|
- console.log(data);
|
|
|
- }).exec();
|
|
|
- } else if (_self.toView == "boxingHitID") {
|
|
|
+ if (_self.toView == "boxingHitID") {
|
|
|
_self.toView = "";
|
|
|
|
|
|
// let view = uni.createSelectorQuery().select('#boxingHitID');
|
|
@@ -2566,13 +2264,6 @@
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- onGetProjectView() {
|
|
|
- let view = uni.createSelectorQuery().select('#projectButtonView');
|
|
|
- view.boundingClientRect(data => {
|
|
|
- _self.$refs.codeElfGuide.setProjectObj(data);
|
|
|
- }).exec();
|
|
|
- },
|
|
|
-
|
|
|
onGetActionJumpView() {
|
|
|
|
|
|
this.$nextTick(() => {
|
|
@@ -2749,72 +2440,17 @@
|
|
|
onKeyInput: function(event) {
|
|
|
this.$store.state.LocationGameUrl = event.target.value
|
|
|
},
|
|
|
-
|
|
|
onNavFcGame() {
|
|
|
// console.log(0);
|
|
|
uni.navigateTo({
|
|
|
url: "../../fc-page/fc/fc"
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
onNavAppInfo() {
|
|
|
uni.navigateTo({
|
|
|
url: '../../info-page/app-info/app-info'
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
- getBLEDeviceServices() {
|
|
|
- console.log("getBLEDeviceServices");
|
|
|
-
|
|
|
- // uni.getBLEDeviceServices({
|
|
|
- // deviceId: "C5:5C:19:04:00:30",
|
|
|
- // success: res => {
|
|
|
- // console.log("getBLEDeviceServices==", JSON.stringify(res));
|
|
|
- // },
|
|
|
- // fail: failRes => {
|
|
|
- // console.log('device services:', failRes)
|
|
|
-
|
|
|
- // }
|
|
|
- // });
|
|
|
- },
|
|
|
-
|
|
|
- // testAsyncFunc() {
|
|
|
- // // 调用异步方法
|
|
|
- // testModule.testAsyncFunc({
|
|
|
- // 'name': 'unimp',
|
|
|
- // 'age': 1
|
|
|
- // },
|
|
|
- // (ret) => {
|
|
|
- // modal.toast({
|
|
|
- // message: ret,
|
|
|
- // duration: 1.5
|
|
|
- // });
|
|
|
- // })
|
|
|
- // },
|
|
|
- // startSyncFunc() {
|
|
|
- // // 调用同步方法
|
|
|
- // var ret = testModule.onStartAccAndGyro({
|
|
|
- // 'name': 'unimp',
|
|
|
- // 'age': 1
|
|
|
- // })
|
|
|
- // modal.toast({
|
|
|
- // message: ret,
|
|
|
- // duration: 1.5
|
|
|
- // });
|
|
|
- // },
|
|
|
-
|
|
|
- // stopSyncFunc() {
|
|
|
- // // 调用同步方法
|
|
|
- // var ret = testModule.onStopAccAndGyro({
|
|
|
- // 'name': 'unimp',
|
|
|
- // 'age': 1
|
|
|
- // })
|
|
|
- // modal.toast({
|
|
|
- // message: ret,
|
|
|
- // duration: 1.5
|
|
|
- // });
|
|
|
- // },
|
|
|
-
|
|
|
onNavToSelectFriend() {
|
|
|
uni.navigateTo({
|
|
|
url: '../../friend-page/select/select'
|
|
@@ -2825,20 +2461,6 @@
|
|
|
*/
|
|
|
fabClick() {
|
|
|
//如果第一次点击悬停按钮
|
|
|
- // if (this.guideUnlockState.firstDisconnectBluetooth) {
|
|
|
-
|
|
|
- // this.onGetBluetoothConnectView({
|
|
|
- // hiddenType: 'firstDisconnectBluetooth'
|
|
|
- // });
|
|
|
- // let guideUnlockState = Object.assign(this.guideUnlockState, {
|
|
|
- // firstDisconnectBluetooth: false
|
|
|
- // });
|
|
|
- // this.setGuideUnlockState(guideUnlockState);
|
|
|
- // return;
|
|
|
- // }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
if (this.cIndex != -1 && this.BLEConnectDevice != null) {
|
|
|
//先检测
|
|
|
uni.showModal({
|
|
@@ -2859,7 +2481,6 @@
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
-
|
|
|
this.openDeviceList();
|
|
|
}
|
|
|
|
|
@@ -3193,9 +2814,30 @@
|
|
|
* 处理监听数据,比如切换列表后,重置action jump an action hit 等操作;
|
|
|
*/
|
|
|
onSwitchTaskList() {
|
|
|
- this.currentMode = 'calorieMode';
|
|
|
+ if (this.currentModeIndex != this.oldModeIndex) {
|
|
|
+ this.oldModeIndex = this.currentModeIndex;
|
|
|
+ this.tempSelectedLevel = null;
|
|
|
+ //清空当前选择的任务
|
|
|
+ this.resetActionJumpTask();
|
|
|
+ this.currentMode = 'calorieMode';
|
|
|
+ }
|
|
|
this.switchTaskInfo();
|
|
|
- console.log(1);
|
|
|
+ console.log("onSwitchTaskList");
|
|
|
+ //切换时候,清空当前的任务进度
|
|
|
+ this.arcbarCountDownTimeReset();
|
|
|
+ this.bGamePlaying = false;
|
|
|
+
|
|
|
+ this.$nextTick(() => {
|
|
|
+ if (0 === this.currentModeIndex) {
|
|
|
+ this.$refs.actionHitRef.onStopAndClearAction(true);
|
|
|
+ //用于刷新 drawBg
|
|
|
+ this.$refs.actionHitRef.onDrawBg(true);
|
|
|
+ } else if (1 === this.currentModeIndex) {
|
|
|
+ this.$refs.actionJumpRef.onStopAndClearAction(true);
|
|
|
+ this.$refs.actionJumpRef.onDrawBg(true);
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
},
|
|
|
|
|
|
/**
|