update:对接节奏训练
This commit is contained in:
@@ -15,9 +15,9 @@ const trainingModeRouteMap = {
|
||||
endurance: "endurance",
|
||||
precision: "precision",
|
||||
rhythm: "rhythm",
|
||||
strength: "power",
|
||||
stability: "power",
|
||||
};
|
||||
const unavailableTrainingIds = new Set(["strength"]);
|
||||
const unavailableTrainingIds = new Set(["stability"]);
|
||||
// 训练项目卡片右侧主图标。
|
||||
const trainingModeIconMap = {
|
||||
base_bow:
|
||||
@@ -39,21 +39,22 @@ const trainingModeTitleImageMap = {
|
||||
"https://static.shelingxingqiu.com/shootmini/static/training-home/jingzhunxunlian.png",
|
||||
rhythm:
|
||||
"https://static.shelingxingqiu.com/shootmini/static/training-home/jiezouxunlian.png",
|
||||
strength:
|
||||
stability:
|
||||
"https://static.shelingxingqiu.com/shootmini/static/training-home/wendingxunlian.png",
|
||||
};
|
||||
const defaultWeekDays = ["周一", "周二", "周三", "周四", "周五", "周六", "周日"];
|
||||
const defaultRadarDimensions = [
|
||||
{ name: "基础", score: 0 },
|
||||
{ name: "精准", score: 0 },
|
||||
{ name: "力量", score: 0 },
|
||||
{ name: "稳定", score: 0 },
|
||||
{ name: "节奏", score: 0 },
|
||||
{ name: "耐力", score: 0 },
|
||||
];
|
||||
const radarDimensionTrainingIdMap = Object.freeze({
|
||||
基础: "base",
|
||||
精准: "precision",
|
||||
力量: "strength",
|
||||
稳定: "stability",
|
||||
力量: "stability",
|
||||
节奏: "rhythm",
|
||||
耐力: "endurance",
|
||||
});
|
||||
@@ -66,7 +67,7 @@ const createDefaultTrainingData = () => ({
|
||||
total_arrows: 0,
|
||||
target_rate: 0,
|
||||
ten_ring_count: 0,
|
||||
total_calories: 0,
|
||||
average_ring: 0,
|
||||
},
|
||||
beat_percent: 0,
|
||||
radar_max: 0,
|
||||
@@ -137,7 +138,6 @@ const getLevelText = (item) => {
|
||||
return `当前进度 LV${level} >`;
|
||||
};
|
||||
|
||||
// 接口字段暂时沿用 total_calories,页面按平均环数展示。
|
||||
const getAverageRingValue = (value) => formatValue(value);
|
||||
|
||||
const getTrainingIcon = (item = {}) =>
|
||||
@@ -289,7 +289,7 @@ const loadPersonalTrainingData = async () => {
|
||||
total_arrows: result?.stats?.total_arrows ?? 0,
|
||||
target_rate: result?.stats?.target_rate ?? 0,
|
||||
ten_ring_count: result?.stats?.ten_ring_count ?? 0,
|
||||
total_calories: result?.stats?.total_calories ?? 0,
|
||||
average_ring: result?.stats?.average_ring ?? 0,
|
||||
},
|
||||
beat_percent: result?.beat_percent ?? 0,
|
||||
radar_max: result?.radar_max ?? 0,
|
||||
@@ -458,7 +458,7 @@ onShow(async () => {
|
||||
<view class="stats-value-row">
|
||||
<view class="stats-value-group">
|
||||
<text class="stats-value">
|
||||
{{ getAverageRingValue(trainingData.stats.total_calories) }}
|
||||
{{ getAverageRingValue(trainingData.stats.average_ring) }}
|
||||
</text>
|
||||
<text class="stats-unit">环</text>
|
||||
<view class="stats-value-decoration"></view>
|
||||
@@ -531,19 +531,26 @@ onShow(async () => {
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="featured-card" @click="$clickSound(openRoutineTraining)">
|
||||
<image
|
||||
class="featured-card-bg"
|
||||
src="https://static.shelingxingqiu.com/shootmini/static/training-home/img_22.png"
|
||||
mode="widthFix"
|
||||
/>
|
||||
<view class="featured-card-mask"></view>
|
||||
<view class="featured-card-copy">
|
||||
<text class="featured-card-subtitle">12箭练习</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="mode-grid">
|
||||
<view
|
||||
class="mode-card"
|
||||
@click="$clickSound(openRoutineTraining)"
|
||||
>
|
||||
<view class="mode-card-copy">
|
||||
<image
|
||||
class="mode-card-title-image"
|
||||
src="https://static.shelingxingqiu.com/shootmini/static/training-home/ziyouxunlian.png"
|
||||
mode="widthFix"
|
||||
/>
|
||||
<text class="mode-card-progress">无级别限制</text>
|
||||
</view>
|
||||
<image
|
||||
class="mode-card-icon"
|
||||
src="https://static.shelingxingqiu.com/shootmini/static/training-home/img_2.png"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<view
|
||||
v-for="item in visibleTrainingItems"
|
||||
:key="item.id"
|
||||
@@ -861,51 +868,6 @@ onShow(async () => {
|
||||
width: 92rpx;
|
||||
}
|
||||
|
||||
.featured-card {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 130rpx;
|
||||
margin-top: 38rpx;
|
||||
border-radius: 16rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.featured-card-bg {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.featured-card-mask {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 278rpx;
|
||||
height: 130rpx;
|
||||
}
|
||||
|
||||
.featured-card-copy {
|
||||
position: absolute;
|
||||
left: 174rpx;
|
||||
top: 60rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.featured-card-title {
|
||||
display: block;
|
||||
color: #895409;
|
||||
font-size: 34rpx;
|
||||
font-family: "AlimamaShuHeiTi-Bold", "PingFang SC", sans-serif;
|
||||
font-weight: 700;
|
||||
line-height: 42rpx;
|
||||
}
|
||||
|
||||
.featured-card-subtitle {
|
||||
display: block;
|
||||
color: #895409;
|
||||
font-size: 20rpx;
|
||||
line-height: 28rpx;
|
||||
}
|
||||
|
||||
.mode-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
@@ -919,7 +881,7 @@ onShow(async () => {
|
||||
box-shadow: inset 2rpx 2rpx 6rpx 0rpx rgba(255, 255, 255, 0.27);
|
||||
border-radius: 16rpx;
|
||||
border: 2rpx solid rgba(235, 184, 123, 0.5);
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
/* background: rgba(0, 0, 0, 0.5); */
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user