|
...
|
...
|
@@ -27,21 +27,17 @@ |
|
|
|
</view>
|
|
|
|
|
|
|
|
<template v-if="resdailyData.length > 0">
|
|
|
|
<!-- Tab 按钮:如���有多个训记,用来源名作为标签 -->
|
|
|
|
<!-- Tab 按钮:如果有多个训记,用来源名作为标签 -->
|
|
|
|
<scroll-view class="plan-tabs" scroll-x v-if="resdailyData.length > 1">
|
|
|
|
<button class="tab-btn" :class="{ active: currentPlanIndex === index }" v-for="(item, index) in resdailyData"
|
|
|
|
:key="index" @click.stop="switchPlan(index)">
|
|
|
|
{{ item.sourceType === 1 || item.sourceType === 2 ? (item.sourceName || item.name) : (item.name || '训记' + (index + 1)) }}
|
|
|
|
{{ item.sourceType === 1 || item.sourceType === 2 ? (item.sourceName || item.name) : (item.name || '训记' +
|
|
|
|
(index + 1)) }}
|
|
|
|
</button>
|
|
|
|
</scroll-view>
|
|
|
|
<!-- 训练内容区域 -->
|
|
|
|
<view v-if="resdailyData.length > 0 && currentPlan" class="training-container">
|
|
|
|
<!-- 训练来源标签 -->
|
|
|
|
<view class="source-tag-row" :class="getSourceClass(currentPlan.sourceType || 4)">
|
|
|
|
<text class="source-text">
|
|
|
|
{{ currentPlan.sourceType === 1 || currentPlan.sourceType === 2 ? (currentPlan.sourceName || currentPlan.name) : getSourceLabel(currentPlan.sourceType || 4) }}
|
|
|
|
</text>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<view class="unitCart">
|
|
|
|
<!-- 训练计划头部卡片 -->
|
|
|
|
<view class="plan-header-card">
|
|
...
|
...
|
@@ -60,8 +56,10 @@ |
|
|
|
<view class="plan-header-btns">
|
|
|
|
<button class="plan-btn more-btn" @click="handlePlanMore">更多</button>
|
|
|
|
<button class="plan-btn copy-btn" @click="openCopyCalendarPopup(currentPlan?.templateId)">复制到</button>
|
|
|
|
<button class="plan-btn go-train-btn-small" @click="handleTrainAgain">
|
|
|
|
<text class="go-train-text-sm">今日再练</text>
|
|
|
|
<button class="plan-btn go-train-btn-small" :class="{ locked: trainAgainDisabled }"
|
|
|
|
@click="handleTrainAgain">
|
|
|
|
<text class="go-train-text-sm">{{ trainAgainText }}</text>
|
|
|
|
<up-icon v-if="trainAgainText == '当日开练'" name="lock" size="15"></up-icon>
|
|
|
|
</button>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
...
|
...
|
@@ -88,7 +86,7 @@ |
|
|
|
}}kg</text>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<!-- 下半部分:组次行 → 向左对齐图片 ✅核心-->
|
|
|
|
<!-- 下半部分:组次行 → 向左对齐图片 ✅核心 -->
|
|
|
|
<view class="action-bottom">
|
|
|
|
<view class="action-sets">
|
|
|
|
<view class="set-item" v-for="(set, setIdx) in unit.exercises[0]?.sets || []" :key="setIdx">
|
|
...
|
...
|
@@ -175,7 +173,7 @@ |
|
|
|
<!-- 空状态区域 -->
|
|
|
|
<view v-else class="empty-section">
|
|
|
|
<image class="empty-img"
|
|
|
|
src="https://fitness-hcxtec-bucket.oss-cn-shenzhen.aliyuncs.com/20260724/空状态自助_1784875704380.png"
|
|
|
|
src="https://fitness-hcxtec-bucket.oss-cn-shenzhen.aliyuncs.com/20260727/空状态自助_1785117390333.png"
|
|
|
|
mode="aspectFit">
|
|
|
|
</image>
|
|
|
|
<text class="empty-tip">今天没有安排</text>
|
|
...
|
...
|
@@ -184,7 +182,7 @@ |
|
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<AddTrainPopup v-model:visible="showAddTrainPopup" @successAddTrain="handleAddTrain" />
|
|
|
|
<AddTrainPopup v-model:visible="showAddTrainPopup" :date="selectedDate" @successAddTrain="handleAddTrain" />
|
|
|
|
|
|
|
|
<!-- 日期备注弹窗 -->
|
|
|
|
<RiliRiqibeizhu v-model:visible="showRiqibeizhu" :date="date" :note-id="currentEditId"
|
|
...
|
...
|
@@ -230,7 +228,7 @@ |
|
|
|
<!-- 复制到弹窗/移动到/添加到 -->
|
|
|
|
<AddToCalendarPopup ref="calendarPopupRef" :template-id="currentPlan?.templateId ?? 0"
|
|
|
|
@success="handleCalendarSuccess" :mask-click="true" @click.stop
|
|
|
|
:daily-template-id="currentPlan?.dailyTemplateId" :is-copy="isCopyMode" />
|
|
|
|
:daily-template-id="currentPlan?.id" :is-copy="isCopyMode" />
|
|
|
|
<!-- 设置日历颜色弹窗 -->
|
|
|
|
<CalendarColorPicker v-model:visible="showColorPopup" :daily-template-id="selectedPlanId"
|
|
|
|
:current-color="currentPlan?.templateBackgroundColor || '#ffffff'" @success="calendarColorPickerSuccess" />
|
|
...
|
...
|
@@ -242,7 +240,7 @@ |
|
|
|
|
|
|
|
<script setup>
|
|
|
|
import dayjs from 'dayjs';
|
|
|
|
import { ref, onMounted, watch, computed, nextTick } from 'vue';
|
|
|
|
import { ref, watch, computed, nextTick, onMounted, onBeforeUnmount } from 'vue';
|
|
|
|
import dailytemplateApi from '@/sheep/api/Template/Dailytemplate';
|
|
|
|
import TemplatesApi from '@/sheep/api/Template/Templates';
|
|
|
|
import RiliRiqibeizhu from '@/pages/xunji/components/rili-components/rili-riqibeizhu.vue'
|
|
...
|
...
|
@@ -278,7 +276,7 @@ const moreShow = ref(false); |
|
|
|
const showColorPopup = ref(false);
|
|
|
|
const calendarPopupRef = ref(null);
|
|
|
|
const currentEditId = ref(null);
|
|
|
|
const selectedPlanId = ref(null);
|
|
|
|
const selectedPlanId = ref(0);
|
|
|
|
|
|
|
|
// Store / 子组件引用
|
|
|
|
const trainingStore = useTrainingStore();
|
|
...
|
...
|
@@ -325,7 +323,7 @@ const openXiuGai = (unit, idx) => { |
|
|
|
|
|
|
|
// 打开日历弹窗
|
|
|
|
const openColorPopup = () => {
|
|
|
|
if (!currentPlan.value) { // 加这个
|
|
|
|
if (!currentPlan.value) {
|
|
|
|
uni.showToast({ title: '空白状态无法操作', icon: 'none' })
|
|
|
|
return
|
|
|
|
}
|
|
...
|
...
|
@@ -340,11 +338,10 @@ const openColorPopup = () => { |
|
|
|
|
|
|
|
const handleAddTrain = async () => {
|
|
|
|
await loaddailytemplate();
|
|
|
|
// 更新主页面
|
|
|
|
emit('refreshCalendar');
|
|
|
|
}
|
|
|
|
|
|
|
|
// ===== 计算属性 =====
|
|
|
|
// 当前正在显示的训记
|
|
|
|
const currentPlan = computed(() => {
|
|
|
|
if (!resdailyData.value.length) return null;
|
|
|
|
return resdailyData.value[currentPlanIndex.value] || null;
|
|
...
|
...
|
@@ -353,29 +350,19 @@ const currentPlan = computed(() => { |
|
|
|
// ===== API:加载每日模板数据 =====
|
|
|
|
const loaddailytemplate = async () => {
|
|
|
|
if (!selectedDate.value) return;
|
|
|
|
console.log('【子组件】开始加载数据...');
|
|
|
|
try {
|
|
|
|
const resdaily = await dailytemplateApi.getdailytemplate(String(selectedDate.value));
|
|
|
|
console.log('打印每日模板数据:resdaily', resdaily);
|
|
|
|
|
|
|
|
const noteListFromApi = resdaily.data.notes;
|
|
|
|
noteList.value = noteListFromApi;
|
|
|
|
console.log('打印每日模板详情的备注列表:noteList', noteList.value);
|
|
|
|
|
|
|
|
const historyFromApi = resdaily.data.noteHistoryList || [];
|
|
|
|
console.log('打印历史备注:', historyFromApi);
|
|
|
|
noteHistoryList.value = historyFromApi;
|
|
|
|
|
|
|
|
resdailyData.value = resdaily.data.templates || [];
|
|
|
|
|
|
|
|
// 切换回第一个训记
|
|
|
|
const oldIndex = currentPlanIndex.value;
|
|
|
|
if (resdailyData.value.length > oldIndex) {
|
|
|
|
currentPlanIndex.value = oldIndex;
|
|
|
|
} else {
|
|
|
|
currentPlanIndex.value = 0;
|
|
|
|
}
|
|
|
|
console.log('+++++【子组件】+++++加载完成,训记列表:', resdailyData.value)
|
|
|
|
} catch (error) {
|
|
|
|
console.error('加载训练模板失败:', error);
|
|
|
|
resdailyData.value = [];
|
|
...
|
...
|
@@ -383,21 +370,18 @@ const loaddailytemplate = async () => { |
|
|
|
};
|
|
|
|
|
|
|
|
const handleRenderSuccess = async () => {
|
|
|
|
|
|
|
|
await loaddailytemplate();
|
|
|
|
await nextTick()
|
|
|
|
emit('refreshCalendar');
|
|
|
|
uni.$emit('calendarDataRefresh');
|
|
|
|
}
|
|
|
|
|
|
|
|
const switchPlan = (index) => {
|
|
|
|
currentPlanIndex.value = index;
|
|
|
|
console.log('【切换标签后 - currentPlan】', currentPlan.value);
|
|
|
|
};
|
|
|
|
|
|
|
|
// ===== 更多弹窗:操作项 =====
|
|
|
|
const handlePlanMore = () => {
|
|
|
|
if (!currentPlan.value) { // 加这个
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if (!currentPlan.value) return
|
|
|
|
moreShow.value = true;
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -407,28 +391,20 @@ const closeMorePopup = () => { |
|
|
|
|
|
|
|
// 一键打勾(完成训练)
|
|
|
|
const handleCompleteCheck = async () => {
|
|
|
|
// 日期校验:只能对今天及以前的日期一键打勾
|
|
|
|
const today = dayjs().format('YYYY-MM-DD');
|
|
|
|
if (selectedDate.value > today) {
|
|
|
|
uni.showToast({ title: '一键打勾只能用于今天及以前的日期', icon: 'none' });
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!currentPlan.value?.id) {
|
|
|
|
uni.showToast({ title: '未找到训练ID', icon: 'none' })
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
console.log('进入一键打勾函数训练id=', currentPlan.value.id);
|
|
|
|
|
|
|
|
try {
|
|
|
|
// 2. 调用接口
|
|
|
|
await dailytemplateApi.completeDailyTemplate(currentPlan.value.id)
|
|
|
|
emit('refreshCalendar');
|
|
|
|
uni.showToast({ title: '一键打勾成功', icon: 'success' })
|
|
|
|
closeMorePopup()
|
|
|
|
|
|
|
|
// 刷新页面数据
|
|
|
|
await loaddailytemplate(selectedDate.value)
|
|
|
|
} catch (err) {
|
|
|
|
console.error('一键打勾失败:', err)
|
|
...
|
...
|
@@ -438,54 +414,39 @@ const handleCompleteCheck = async () => { |
|
|
|
|
|
|
|
// ===== 保存训练为个人模板 =====
|
|
|
|
const openSaveTemplateDialog = async (item) => {
|
|
|
|
// 关闭所有可能遮挡的弹窗
|
|
|
|
moreShow.value = false;
|
|
|
|
showColorPopup.value = false;
|
|
|
|
showAddTrainPopup.value = false;
|
|
|
|
showRiqibeizhu.value = false;
|
|
|
|
show.value = false
|
|
|
|
// 等待 DOM 更新后再弹出模板名称输入框,确保弹窗完全关闭
|
|
|
|
await nextTick();
|
|
|
|
|
|
|
|
// uni弹窗输入框:只填模板名称
|
|
|
|
uni.showModal({
|
|
|
|
title: '确认保存为你的训练模板?',
|
|
|
|
content: '',
|
|
|
|
editable: true, // 开启输入框
|
|
|
|
editable: true,
|
|
|
|
placeholderText: '请输入模板名称',
|
|
|
|
success: async (res) => {
|
|
|
|
// 点击确定
|
|
|
|
if (res.confirm) {
|
|
|
|
const templateName = res.content.trim()
|
|
|
|
// 非名校验
|
|
|
|
if (!templateName) {
|
|
|
|
return uni.showToast({ title: '请填写模板名称', icon: 'none' })
|
|
|
|
}
|
|
|
|
// 调用封装的数据转换函数,组装后端需要的入参
|
|
|
|
const reqData = formatTrainToTemplate(item, templateName)
|
|
|
|
// 发起创建接口
|
|
|
|
console.log('reqData', reqData);
|
|
|
|
await submitCreateTemplate(reqData)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
*/
|
|
|
|
const formatTrainToTemplate = (item, templateName) => {
|
|
|
|
// 初始化基础结构
|
|
|
|
const params = {
|
|
|
|
templateId: item.templateId,
|
|
|
|
// groupId: 0, // 默认存入根目录,后续选文件夹再传对应groupId
|
|
|
|
templateName: templateName,
|
|
|
|
scene: item.scene || 0,
|
|
|
|
templateCover: item.urlCover || '', // 封面取自训练封面
|
|
|
|
templateIntroduction: item.templateIntroduction || '', // 简介留空,可后续扩展
|
|
|
|
templateCover: item.urlCover || '',
|
|
|
|
templateIntroduction: item.templateIntroduction || '',
|
|
|
|
units: []
|
|
|
|
}
|
|
|
|
|
|
|
|
// 循环转换 units 结构(训练组→模板unit)
|
|
|
|
params.units = item.units.map(unit => {
|
|
|
|
return {
|
|
|
|
id: unit.unitId,
|
|
...
|
...
|
@@ -495,16 +456,11 @@ const formatTrainToTemplate = (item, templateName) => { |
|
|
|
exercises: unit.exercises
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
console.log('params', params);
|
|
|
|
|
|
|
|
|
|
|
|
return params
|
|
|
|
}
|
|
|
|
|
|
|
|
const submitCreateTemplate = async (reqData) => {
|
|
|
|
try {
|
|
|
|
// 调用创建个人模板接口
|
|
|
|
const res = await TemplatesApi.createCustTemplate(reqData)
|
|
|
|
if (res.code === 0) {
|
|
|
|
uni.showToast({ title: '模板保存成功' })
|
|
...
|
...
|
@@ -521,9 +477,6 @@ const submitCreateTemplate = async (reqData) => { |
|
|
|
const openAddTrainPopup = () => {
|
|
|
|
showAddTrainPopup.value = true;
|
|
|
|
};
|
|
|
|
const closeAddTrainPopup = () => {
|
|
|
|
showAddTrainPopup.value = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
// ===== 工具函数 =====
|
|
|
|
const formatSecondsToHms = (seconds) => {
|
|
...
|
...
|
@@ -531,7 +484,6 @@ const formatSecondsToHms = (seconds) => { |
|
|
|
return dayjs.duration(parseInt(seconds, 10), 'seconds').format('HH:mm:ss');
|
|
|
|
}
|
|
|
|
|
|
|
|
// ===== 工具函数:根据动作类型生成组次显示文本 =====
|
|
|
|
const getSetDisplayText = (set, exerciseType) => {
|
|
|
|
if (!set) return '';
|
|
|
|
switch (exerciseType) {
|
|
...
|
...
|
@@ -546,7 +498,6 @@ const getSetDisplayText = (set, exerciseType) => { |
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
// 超级组中的动作显示(与普通动作在 type 4/5 上的展示略有差异)
|
|
|
|
const getSuperSetDisplayText = (set, exerciseType) => {
|
|
|
|
if (!set) return '';
|
|
|
|
switch (exerciseType) {
|
|
...
|
...
|
@@ -561,17 +512,6 @@ const getSuperSetDisplayText = (set, exerciseType) => { |
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
// 返回按钮逻辑
|
|
|
|
const goBack = () => {
|
|
|
|
uni.navigateBack({
|
|
|
|
delta: 1,
|
|
|
|
fail: () => {
|
|
|
|
uni.redirectTo({ url: '/pages/xunji/xunji-rili' });
|
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
// 日期格式化(使用 dayjs 处理,兼容性更好)
|
|
|
|
const formatDateWithWeek = (dateStr) => {
|
|
|
|
if (!dateStr) return '';
|
|
|
|
const d = dayjs(dateStr);
|
|
...
|
...
|
@@ -582,18 +522,13 @@ const formatDateWithWeek = (dateStr) => { |
|
|
|
// ===== 日期备注相关 =====
|
|
|
|
const handleDateNote = () => {
|
|
|
|
if (noteList.value.length >= 5) {
|
|
|
|
uni.showToast({
|
|
|
|
title: '最多添加5条,已超出数量无法添加',
|
|
|
|
icon: 'none',
|
|
|
|
duration: 2000
|
|
|
|
});
|
|
|
|
uni.showToast({ title: '最多添加5条,已超出数量无法添加', icon: 'none', duration: 2000 });
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
showRiqibeizhu.value = true
|
|
|
|
}
|
|
|
|
|
|
|
|
const handleEditNote = (note) => {
|
|
|
|
console.log('准备编辑备注,ID:', note.id);
|
|
|
|
currentEditId.value = note.id;
|
|
|
|
showRiqibeizhu.value = true;
|
|
|
|
};
|
|
...
|
...
|
@@ -608,8 +543,6 @@ const handleCloseNotePopup = () => { |
|
|
|
|
|
|
|
// ===== 复制到 / 移动到 =====
|
|
|
|
const openCalendarPopup = (templateId) => {
|
|
|
|
console.log('点击了添加到日历按钮', templateId); // 新增日志
|
|
|
|
console.log('子组件实例', calendarPopupRef.value); // 新增日志
|
|
|
|
if (calendarPopupRef.value && typeof calendarPopupRef.value.open === 'function') {
|
|
|
|
calendarPopupRef.value.open();
|
|
|
|
} else {
|
|
...
|
...
|
@@ -617,19 +550,47 @@ const openCalendarPopup = (templateId) => { |
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
// 今日再练 / 去训练 / 当日开练
|
|
|
|
const trainAgainText = computed(() => {
|
|
|
|
const today = dayjs().format('YYYY-MM-DD');
|
|
|
|
if (!selectedDate.value) return '今日再练';
|
|
|
|
if (selectedDate.value === today) return '今日再练';
|
|
|
|
if (selectedDate.value > today) return '当日开练';
|
|
|
|
return '去训练';
|
|
|
|
});
|
|
|
|
|
|
|
|
const trainAgainDisabled = computed(() => {
|
|
|
|
const today = dayjs().format('YYYY-MM-DD');
|
|
|
|
return !!selectedDate.value && selectedDate.value > today;
|
|
|
|
});
|
|
|
|
|
|
|
|
// 2. 今日再练方法
|
|
|
|
const handleTrainAgain = async () => {
|
|
|
|
const today = dayjs().format('YYYY-MM-DD');
|
|
|
|
const planDate = selectedDate.value || today;
|
|
|
|
|
|
|
|
if (planDate > today) {
|
|
|
|
uni.showToast({ title: '训练将在当日解锁', icon: 'none' });
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (planDate < today) {
|
|
|
|
trainingStore.isSystem = currentPlan.value.isSystem || false;
|
|
|
|
trainingStore.loadDailyTemplateForEdit(currentPlan.value);
|
|
|
|
trainingStore.initDailyTemplateRecords();
|
|
|
|
uni.navigateTo({
|
|
|
|
url: `/pages4/pages/xunji/xunji-dongzuo-lianxi?id=${currentPlan.value.templateId}&type=3&dailyTemplateId=${currentPlan.value.id}&isTraining=true`,
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!currentPlan.value?.templateId) {
|
|
|
|
uni.showToast({ title: '未找到训练计划', icon: 'none' });
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
const todayDate = new Date().toISOString().split('T')[0]; // 格式:2026-05-19
|
|
|
|
const reqData = {
|
|
|
|
id: currentPlan.value.templateId,
|
|
|
|
// planId: currentPlan.value.planId || 0,
|
|
|
|
trainDateList: [todayDate] // 训练日期列表,这里只传今天
|
|
|
|
trainDateList: [today],
|
|
|
|
};
|
|
|
|
|
|
|
|
try {
|
|
...
|
...
|
@@ -637,7 +598,7 @@ const handleTrainAgain = async () => { |
|
|
|
if (res.code === 0) {
|
|
|
|
uni.showToast({ title: '今日再练成功', icon: 'success' });
|
|
|
|
loaddailytemplate(props.date);
|
|
|
|
emit('refreshCalendar')
|
|
|
|
emit('refreshCalendar');
|
|
|
|
} else {
|
|
|
|
uni.showToast({ title: res.msg || '添加失败', icon: 'none' });
|
|
|
|
}
|
|
...
|
...
|
@@ -646,22 +607,19 @@ const handleTrainAgain = async () => { |
|
|
|
uni.showToast({ title: '网络异常,请重试', icon: 'none' });
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
// 删除训练
|
|
|
|
const handleDeleteTemplate = async () => {
|
|
|
|
// 先判断有没有ID
|
|
|
|
if (!currentPlan.value?.id) {
|
|
|
|
uni.showToast({ title: '未找到模板ID', icon: 'none' });
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
// 关闭所有可能遮挡的弹窗
|
|
|
|
moreShow.value = false;
|
|
|
|
showColorPopup.value = false;
|
|
|
|
showAddTrainPopup.value = false;
|
|
|
|
showRiqibeizhu.value = false;
|
|
|
|
show.value = false
|
|
|
|
// 等待 DOM 更新后再弹出模板名称输入框,确保弹窗完全关闭
|
|
|
|
await nextTick();
|
|
|
|
// 弹出确认框
|
|
|
|
uni.showModal({
|
|
|
|
title: '确认删除',
|
|
|
|
content: '确定要删除这条训练记录吗?删除后无法恢复',
|
|
...
|
...
|
@@ -674,8 +632,8 @@ const handleDeleteTemplate = async () => { |
|
|
|
await dailytemplateApi.deleteDailyTemplate(currentPlan.value.id);
|
|
|
|
emit('refreshCalendar');
|
|
|
|
uni.showToast({ title: '删除成功', icon: 'success' });
|
|
|
|
loaddailytemplate(props.date); // 刷新数据
|
|
|
|
moreShow.value = false; // 关闭弹窗
|
|
|
|
loaddailytemplate(props.date);
|
|
|
|
moreShow.value = false;
|
|
|
|
} catch (err) {
|
|
|
|
console.error('删除失败', err);
|
|
|
|
uni.showToast({ title: '删除失败,请重试', icon: 'none' });
|
|
...
|
...
|
@@ -687,13 +645,8 @@ const handleDeleteTemplate = async () => { |
|
|
|
// 更多弹窗的结束整个计划
|
|
|
|
const confirmDelete = async (id) => {
|
|
|
|
try {
|
|
|
|
console.log('打印计划个人id:', id);
|
|
|
|
|
|
|
|
const res = await QueryPlanApi.deletePlan(id);
|
|
|
|
console.log('删除结果:', res);
|
|
|
|
|
|
|
|
if (res.code === 0 && res.data) {
|
|
|
|
// 2. 删除成功,从列表移除
|
|
|
|
uni.showToast({ title: '计划已结束', icon: 'success' });
|
|
|
|
emit('refreshCalendar');
|
|
|
|
} else {
|
|
...
|
...
|
@@ -710,18 +663,12 @@ const confirmDelete = async (id) => { |
|
|
|
|
|
|
|
// 移动到:只打开弹窗
|
|
|
|
const handleMoveTo = async () => {
|
|
|
|
console.log('点击了更多弹窗的移动到');
|
|
|
|
|
|
|
|
// 安全判断
|
|
|
|
if (!currentPlan.value) {
|
|
|
|
uni.showToast({ title: '未找到训练信息', icon: 'none' });
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
isMoveMode.value = true;
|
|
|
|
// 关闭更多弹窗
|
|
|
|
moreShow.value = false;
|
|
|
|
|
|
|
|
// 只做一件事:打开日期选择
|
|
|
|
nextTick(() => {
|
|
|
|
openCalendarPopup(currentPlan.value.templateId);
|
|
|
|
});
|
|
...
|
...
|
@@ -730,9 +677,8 @@ const handleMoveTo = async () => { |
|
|
|
// 复制到
|
|
|
|
const openCopyCalendarPopup = (templateId) => {
|
|
|
|
if (!templateId) return uni.showToast({ title: '模板ID不存在', icon: 'none' })
|
|
|
|
console.log('currentPlan?.dailyTemplateId=', currentPlan?.dailyTemplateId);
|
|
|
|
isCopyMode.value = true
|
|
|
|
isMoveMode.value = false // 清空移动标记,互斥
|
|
|
|
isMoveMode.value = false
|
|
|
|
moreShow.value = false
|
|
|
|
nextTick(() => {
|
|
|
|
calendarPopupRef.value.open();
|
|
...
|
...
|
@@ -740,35 +686,13 @@ const openCopyCalendarPopup = (templateId) => { |
|
|
|
}
|
|
|
|
|
|
|
|
const handleCalendarSuccess = () => {
|
|
|
|
// console.log('✅ 添加日历成功,当前模式:', isMoveMode.value ? '移动' : '复制');
|
|
|
|
// 复制模式:只提示成功,不用删原数据
|
|
|
|
// if (!isMoveMode.value) {
|
|
|
|
// uni.showToast({
|
|
|
|
// title: '复制成功',
|
|
|
|
// icon: 'success'
|
|
|
|
// });
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
console.log('✅ 添加日历成功', {
|
|
|
|
move: isMoveMode.value,
|
|
|
|
copy: isCopyMode.value
|
|
|
|
});
|
|
|
|
|
|
|
|
// 复制模式:仅刷新日历,不删除原数据
|
|
|
|
if (isCopyMode.value) {
|
|
|
|
uni.showToast({
|
|
|
|
title: '复制成功',
|
|
|
|
icon: 'success'
|
|
|
|
});
|
|
|
|
// 重置标记
|
|
|
|
uni.showToast({ title: '复制成功', icon: 'success' });
|
|
|
|
isCopyMode.value = false
|
|
|
|
emit('refreshCalendar')
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
// 移动模式:子组件已把数据新增到新日期,这里删除原日期的训练记录
|
|
|
|
if (!currentPlan.value?.id) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (!currentPlan.value?.id) return;
|
|
|
|
dailytemplateApi.deleteDailyTemplate(currentPlan.value.id)
|
|
|
|
.then(() => {
|
|
|
|
uni.showToast({ title: '移动成功', icon: 'success' });
|
|
...
|
...
|
@@ -788,15 +712,10 @@ const calendarColorPickerSuccess = () => { |
|
|
|
|
|
|
|
// ===== 去训练 / 每日模板编辑 =====
|
|
|
|
const startTraining = () => {
|
|
|
|
|
|
|
|
if (trainingStore.isTraining) {
|
|
|
|
uni.showToast({
|
|
|
|
title: '当前已有正在进行的训练',
|
|
|
|
icon: 'none'
|
|
|
|
});
|
|
|
|
uni.showToast({ title: '当前已有正在进行的训练', icon: 'none' });
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
trainingStore.isTraining = true;
|
|
|
|
if (resdailyData.value.length > 0) {
|
|
|
|
trainingStore.isSystem = currentPlan.value.isSystem || false;
|
|
...
|
...
|
@@ -805,52 +724,44 @@ const startTraining = () => { |
|
|
|
uni.navigateTo({
|
|
|
|
url: `/pages4/pages/xunji/xunji-dongzuo-lianxi?id=${currentPlan.value.templateId}&type=3&dailyTemplateId=${currentPlan.value.id}&isTraining=true`,
|
|
|
|
});
|
|
|
|
console.log('去训练开始进入编辑模板页面,模板ID:', currentPlan.value.templateId, '每日模板ID:', currentPlan.value.id);
|
|
|
|
|
|
|
|
console.log('打印传递给动作训练页面的模板id', currentPlan.value.templateId);
|
|
|
|
} else {
|
|
|
|
uni.navigateTo({ url: '/pages4/pages/xunji/xunji-dongzuo-lianxi' })
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
// 每日模板编辑
|
|
|
|
const templateEdit = (plan) => {
|
|
|
|
trainingStore.isSystem = plan.isSystem;
|
|
|
|
trainingStore.loadDailyTemplateForEdit(plan);
|
|
|
|
trainingStore.initDailyTemplateRecords()
|
|
|
|
uni.navigateTo({
|
|
|
|
url: `/pages4/pages/xunji/xunji-dongzuo-lianxi?id=${plan.templateId}&type=3&dailyTemplateId=${plan.id}`,
|
|
|
|
url: `/pages4/pages/xunji/xunji-dongzuo-lianxi?id=${plan.templateId}&type=3&dailyTemplateId=${plan.id}&isEdit=true`,
|
|
|
|
});
|
|
|
|
console.log('开始进入编辑模板页面,模板ID:', plan.templateId, '每日模板ID:', plan.id);
|
|
|
|
};
|
|
|
|
|
|
|
|
// ===== 监听 & 生命周期 =====
|
|
|
|
// 监听父组件传进来的 date 变化
|
|
|
|
watch(
|
|
|
|
() => props.date,
|
|
|
|
(newDate) => {
|
|
|
|
if (newDate && newDate.trim()) {
|
|
|
|
console.log('子组件监听到日期变化:', newDate);
|
|
|
|
selectedDate.value = newDate;
|
|
|
|
displayDate.value = formatDateWithWeek(newDate);
|
|
|
|
loaddailytemplate(newDate);
|
|
|
|
console.log('+++++++currentPlan:+++++++++++++++++', currentPlan.value)
|
|
|
|
// console.log('props.noteList=', props.noteList);
|
|
|
|
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ immediate: true }
|
|
|
|
);
|
|
|
|
|
|
|
|
// 监听来自编辑/训练页面的数据刷新事件,自动刷新弹窗数据
|
|
|
|
const handleCalendarDataRefresh = () => {
|
|
|
|
loaddailytemplate();
|
|
|
|
};
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
console.log('【rilicell子组件】已挂载!!!');
|
|
|
|
console.log('【子组件】props.date:', props.date);
|
|
|
|
// loaddailytemplate(props.date);
|
|
|
|
uni.$on('calendarDataRefresh', handleCalendarDataRefresh);
|
|
|
|
});
|
|
|
|
|
|
|
|
onBeforeUnmount(() => {
|
|
|
|
uni.$off('calendarDataRefresh', handleCalendarDataRefresh);
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
...
|
...
|
@@ -860,13 +771,6 @@ $color-primary: #333; |
|
|
|
$color-accent: #ffc107;
|
|
|
|
$color-bg: #f2f3f5;
|
|
|
|
$color-white: #fff;
|
|
|
|
$color-danger: #ff4d4f;
|
|
|
|
$color-muted: #a2a2a2;
|
|
|
|
$color-card-bg: #f9f9f9;
|
|
|
|
$radius-sm: 8rpx;
|
|
|
|
$radius-md: 12rpx;
|
|
|
|
$radius-lg: 16rpx;
|
|
|
|
$radius-round: 40rpx;
|
|
|
|
|
|
|
|
/* 全局容器 */
|
|
|
|
.container {
|
|
...
|
...
|
@@ -888,108 +792,70 @@ $radius-round: 40rpx; |
|
|
|
justify-content: space-between;
|
|
|
|
padding: 24rpx 20rpx;
|
|
|
|
background-color: #fff;
|
|
|
|
// position: sticky;
|
|
|
|
top: 0;
|
|
|
|
z-index: 10;
|
|
|
|
gap: 16rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.back-btn {
|
|
|
|
width: 60rpx;
|
|
|
|
height: 60rpx;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
flex-shrink: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.date-wrapper {
|
|
|
|
flex-grow: 1;
|
|
|
|
text-align: left;
|
|
|
|
}
|
|
|
|
|
|
|
|
.close-btn {
|
|
|
|
width: 50rpx;
|
|
|
|
height: 50rpx;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
background: #f2f3f5;
|
|
|
|
border-radius: 50%;
|
|
|
|
flex-shrink: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.date-text {
|
|
|
|
font-size: 28rpx;
|
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
}
|
|
|
|
|
|
|
|
.date-note-btn {
|
|
|
|
display: inline-flex;
|
|
|
|
align-items: center;
|
|
|
|
font-size: 28rpx;
|
|
|
|
color: #333;
|
|
|
|
background: #e7e7e9;
|
|
|
|
border-radius: 40rpx;
|
|
|
|
padding: 12rpx 28rpx;
|
|
|
|
border: none;
|
|
|
|
margin-right: 0;
|
|
|
|
flex-shrink: 0;
|
|
|
|
}
|
|
|
|
.close-btn {
|
|
|
|
width: 50rpx;
|
|
|
|
height: 50rpx;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
background: #f2f3f5;
|
|
|
|
border-radius: 50%;
|
|
|
|
flex-shrink: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.go-train-btn {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
background: #ffc107;
|
|
|
|
border-radius: 40rpx;
|
|
|
|
padding: 12rpx 24rpx;
|
|
|
|
border: none;
|
|
|
|
flex-shrink: 0;
|
|
|
|
}
|
|
|
|
.date-wrapper {
|
|
|
|
flex-grow: 1;
|
|
|
|
text-align: left;
|
|
|
|
}
|
|
|
|
|
|
|
|
.go-train-text {
|
|
|
|
font-size: 28rpx;
|
|
|
|
color: #000;
|
|
|
|
margin-right: 8rpx;
|
|
|
|
font-weight: 500;
|
|
|
|
}
|
|
|
|
.date-text {
|
|
|
|
font-size: 28rpx;
|
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
}
|
|
|
|
|
|
|
|
.go-train-tag {
|
|
|
|
font-size: 22rpx;
|
|
|
|
color: #ffc107;
|
|
|
|
background: #000;
|
|
|
|
border-radius: 50%;
|
|
|
|
padding: 4rpx 8rpx;
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
.date-note-btn {
|
|
|
|
display: inline-flex;
|
|
|
|
align-items: center;
|
|
|
|
font-size: 28rpx;
|
|
|
|
color: #333;
|
|
|
|
background: #e7e7e9;
|
|
|
|
border-radius: 40rpx;
|
|
|
|
padding: 12rpx 28rpx;
|
|
|
|
border: none;
|
|
|
|
margin-right: 0;
|
|
|
|
flex-shrink: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 训练来源标签 */
|
|
|
|
.source-tag-row {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
padding: 16rpx 24rpx;
|
|
|
|
margin: 0rpx 20rpx;
|
|
|
|
border-radius: 12rpx;
|
|
|
|
font-size: 24rpx;
|
|
|
|
font-weight: 500;
|
|
|
|
.go-train-btn {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
background: #ffc107;
|
|
|
|
border-radius: 40rpx;
|
|
|
|
padding: 12rpx 24rpx;
|
|
|
|
border: none;
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
|
|
|
.source-text {
|
|
|
|
color: #fff;
|
|
|
|
}
|
|
|
|
.go-train-text {
|
|
|
|
font-size: 28rpx;
|
|
|
|
color: #000;
|
|
|
|
margin-right: 8rpx;
|
|
|
|
font-weight: 500;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.source-plan {
|
|
|
|
background: #3b82f6; /* 蓝色 - 计划 */
|
|
|
|
}
|
|
|
|
&.source-tpl {
|
|
|
|
background: #8b5cf6; /* 紫色 - 模板 */
|
|
|
|
}
|
|
|
|
&.source-custom {
|
|
|
|
background: #f59e0b; /* 橙色 - 自定义 */
|
|
|
|
}
|
|
|
|
&.source-free {
|
|
|
|
background: #10b981; /* 绿色 - 自由 */
|
|
|
|
.go-train-tag {
|
|
|
|
font-size: 22rpx;
|
|
|
|
color: #ffc107;
|
|
|
|
background: #000;
|
|
|
|
border-radius: 50%;
|
|
|
|
padding: 4rpx 8rpx;
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -1003,102 +869,84 @@ $radius-round: 40rpx; |
|
|
|
padding: 32rpx 24rpx;
|
|
|
|
margin: 20rpx;
|
|
|
|
margin-bottom: 24rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.plan-header-img {
|
|
|
|
display: none;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.plan-header-info {
|
|
|
|
flex-grow: 1;
|
|
|
|
margin-bottom: 32rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.plan-header-top {
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
align-items: center;
|
|
|
|
margin-bottom: 12rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.plan-heander {
|
|
|
|
display: flex;
|
|
|
|
}
|
|
|
|
|
|
|
|
.plan-title {
|
|
|
|
font-size: 36rpx;
|
|
|
|
font-weight: bold;
|
|
|
|
display: block;
|
|
|
|
margin-bottom: 12rpx;
|
|
|
|
color: #fff;
|
|
|
|
}
|
|
|
|
.plan-header-img {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
// 卡片头部的编辑按钮
|
|
|
|
.editButton {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
gap: 4rpx;
|
|
|
|
color: #fff;
|
|
|
|
font-size: 26rpx;
|
|
|
|
opacity: 0.8;
|
|
|
|
/* 让文字和图标稍微淡一点,和例图更像 */
|
|
|
|
border: 1rpx solid rgba(255, 255, 255, 0.7);
|
|
|
|
border-radius: 25rpx;
|
|
|
|
padding: 6rpx 12rpx;
|
|
|
|
}
|
|
|
|
.plan-header-info {
|
|
|
|
flex-grow: 1;
|
|
|
|
margin-bottom: 32rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.plan-header-top {
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
align-items: center;
|
|
|
|
margin-bottom: 12rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.plan-meta {
|
|
|
|
font-size: 26rpx;
|
|
|
|
color: #ccc;
|
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
.plan-title {
|
|
|
|
font-size: 36rpx;
|
|
|
|
font-weight: bold;
|
|
|
|
display: block;
|
|
|
|
margin-bottom: 12rpx;
|
|
|
|
color: #fff;
|
|
|
|
}
|
|
|
|
|
|
|
|
.plan-header-btns {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
align-items: center;
|
|
|
|
gap: 20rpx;
|
|
|
|
justify-content: flex-start;
|
|
|
|
}
|
|
|
|
.editButton {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
gap: 4rpx;
|
|
|
|
color: #fff;
|
|
|
|
font-size: 26rpx;
|
|
|
|
opacity: 0.8;
|
|
|
|
border: 1rpx solid rgba(255, 255, 255, 0.7);
|
|
|
|
border-radius: 25rpx;
|
|
|
|
padding: 6rpx 12rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.plan-btn {
|
|
|
|
font-size: 26rpx;
|
|
|
|
border-radius: 40rpx;
|
|
|
|
border: none;
|
|
|
|
padding: 12rpx 28rpx;
|
|
|
|
line-height: 1;
|
|
|
|
}
|
|
|
|
.plan-meta {
|
|
|
|
font-size: 26rpx;
|
|
|
|
color: #ccc;
|
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
|
|
|
|
.more-btn,
|
|
|
|
.copy-btn {
|
|
|
|
background: #fff;
|
|
|
|
color: #000;
|
|
|
|
border: none;
|
|
|
|
}
|
|
|
|
.plan-header-btns {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
align-items: center;
|
|
|
|
gap: 20rpx;
|
|
|
|
justify-content: flex-start;
|
|
|
|
|
|
|
|
.plan-btn {
|
|
|
|
font-size: 26rpx;
|
|
|
|
border-radius: 40rpx;
|
|
|
|
border: none;
|
|
|
|
padding: 12rpx 28rpx;
|
|
|
|
line-height: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
.go-train-btn-small {
|
|
|
|
color: #000;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
padding: 12rpx 20rpx;
|
|
|
|
background: inherit;
|
|
|
|
}
|
|
|
|
.more-btn,
|
|
|
|
.copy-btn {
|
|
|
|
background: #fff;
|
|
|
|
color: #000;
|
|
|
|
border: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.go-train-text-sm {
|
|
|
|
font-size: 24rpx;
|
|
|
|
margin-right: 4rpx;
|
|
|
|
font-weight: 500;
|
|
|
|
}
|
|
|
|
.go-train-btn-small {
|
|
|
|
color: #000;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
padding: 12rpx 20rpx;
|
|
|
|
|
|
|
|
.go-train-tag-sm {
|
|
|
|
font-size: 20rpx;
|
|
|
|
background: #000;
|
|
|
|
color: #ffc107;
|
|
|
|
border-radius: 4rpx;
|
|
|
|
padding: 2rpx 6rpx;
|
|
|
|
font-weight: bold;
|
|
|
|
.go-train-text-sm {
|
|
|
|
font-size: 24rpx;
|
|
|
|
margin-right: 4rpx;
|
|
|
|
font-weight: 500;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 训练动作列表 */
|
|
...
|
...
|
@@ -1114,29 +962,49 @@ $radius-round: 40rpx; |
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
gap: 12rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.set-index {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
.set-content {
|
|
|
|
flex-grow: 1;
|
|
|
|
color: inherit;
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
white-space: nowrap;
|
|
|
|
}
|
|
|
|
|
|
|
|
.set-item {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
font-size: 26rpx;
|
|
|
|
color: #666;
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
|
|
.set-left {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
gap: 8rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.set-content {
|
|
|
|
flex-grow: 1;
|
|
|
|
color: inherit;
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
white-space: nowrap;
|
|
|
|
.set-right {
|
|
|
|
display: flex;
|
|
|
|
gap: 20rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
.rest-time {
|
|
|
|
font-size: 24rpx;
|
|
|
|
margin-left: 40rpx;
|
|
|
|
flex-shrink: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.detai-data {
|
|
|
|
white-space: nowrap;
|
|
|
|
.check {
|
|
|
|
font-size: 26rpx;
|
|
|
|
color: #333;
|
|
|
|
margin-left: 20rpx;
|
|
|
|
flex-shrink: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// 主卡片:横向排列
|
|
|
|
/* 主卡片:横向排列 */
|
|
|
|
.action-item {
|
|
|
|
display: flex;
|
|
|
|
align-items: flex-start;
|
|
...
|
...
|
@@ -1145,153 +1013,71 @@ $radius-round: 40rpx; |
|
|
|
padding: 24rpx 20rpx;
|
|
|
|
position: relative;
|
|
|
|
gap: 20rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
// 左侧:序号 + 图片
|
|
|
|
.action-left {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
gap: 16rpx;
|
|
|
|
flex-shrink: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// 大序号
|
|
|
|
.action-index {
|
|
|
|
font-size: 34rpx;
|
|
|
|
font-weight: 600;
|
|
|
|
color: #333;
|
|
|
|
line-height: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// 动作图片
|
|
|
|
.action-img {
|
|
|
|
width: 80rpx;
|
|
|
|
height: 80rpx;
|
|
|
|
border-radius: 8rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
// 中间区域
|
|
|
|
.action-middle {
|
|
|
|
flex: 1;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
}
|
|
|
|
|
|
|
|
// 上半部分:名称 + 重量(左对齐)
|
|
|
|
.action-top {
|
|
|
|
margin-bottom: 8rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.action-name {
|
|
|
|
font-size: 32rpx;
|
|
|
|
font-weight: 500;
|
|
|
|
color: #111;
|
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
|
|
|
|
.action-totalWeight {
|
|
|
|
font-size: 26rpx;
|
|
|
|
color: #333;
|
|
|
|
margin-top: 6rpx;
|
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
|
|
|
|
// 下半部分:组次行 → 向左对齐图片 ✅ 核心
|
|
|
|
.action-bottom {
|
|
|
|
margin-top: 6rpx;
|
|
|
|
margin-left: -96rpx;
|
|
|
|
/* 往左移动,对齐图片位置 */
|
|
|
|
}
|
|
|
|
|
|
|
|
.action-left {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
gap: 16rpx;
|
|
|
|
flex-shrink: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.set-item {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
font-size: 26rpx;
|
|
|
|
color: #666;
|
|
|
|
justify-content: space-between;
|
|
|
|
}
|
|
|
|
.action-index {
|
|
|
|
font-size: 34rpx;
|
|
|
|
font-weight: 600;
|
|
|
|
color: #333;
|
|
|
|
line-height: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
.set-left {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
gap: 8rpx;
|
|
|
|
/* 控制 indexData、set-content、rest-time 之间的间距 */
|
|
|
|
}
|
|
|
|
.action-img {
|
|
|
|
width: 80rpx;
|
|
|
|
height: 80rpx;
|
|
|
|
border-radius: 8rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.set-right {
|
|
|
|
display: flex;
|
|
|
|
gap: 20rpx;
|
|
|
|
}
|
|
|
|
.action-middle {
|
|
|
|
flex: 1;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
}
|
|
|
|
|
|
|
|
// 灰色小圆点序号
|
|
|
|
.indexData {
|
|
|
|
width: 32rpx;
|
|
|
|
height: 32rpx;
|
|
|
|
border-radius: 50%;
|
|
|
|
background: #f2f3f5;
|
|
|
|
font-size: 22rpx;
|
|
|
|
color: #999;
|
|
|
|
display: inline-flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
margin-right: 12rpx;
|
|
|
|
flex-shrink: 0;
|
|
|
|
}
|
|
|
|
.action-top {
|
|
|
|
margin-bottom: 8rpx;
|
|
|
|
|
|
|
|
// .set-content {
|
|
|
|
// color: #333;
|
|
|
|
// }
|
|
|
|
.action-name {
|
|
|
|
font-size: 32rpx;
|
|
|
|
font-weight: 500;
|
|
|
|
color: #111;
|
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
|
|
|
|
.rest-time {
|
|
|
|
// margin-left: 100rpx;
|
|
|
|
font-size: 24rpx;
|
|
|
|
// color: inherit;
|
|
|
|
margin-left: 40rpx;
|
|
|
|
flex-shrink: 0;
|
|
|
|
}
|
|
|
|
.action-totalWeight {
|
|
|
|
font-size: 26rpx;
|
|
|
|
color: #333;
|
|
|
|
margin-top: 6rpx;
|
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.check {
|
|
|
|
font-size: 26rpx;
|
|
|
|
color: #333;
|
|
|
|
margin-left: 20rpx;
|
|
|
|
/* 这里控制和左边内容的距离,数值你可以自己调 */
|
|
|
|
flex-shrink: 0;
|
|
|
|
/* 防止被压缩 */
|
|
|
|
}
|
|
|
|
.action-bottom {
|
|
|
|
margin-top: 6rpx;
|
|
|
|
margin-left: -96rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
// 右侧:修改 + 对勾
|
|
|
|
// .action-right {
|
|
|
|
// display: flex;
|
|
|
|
// flex-direction: column;
|
|
|
|
// align-items: center;
|
|
|
|
// justify-content: space-between;
|
|
|
|
// height: 100%;
|
|
|
|
// }
|
|
|
|
.action-right {
|
|
|
|
flex-shrink: 0;
|
|
|
|
}
|
|
|
|
.action-right {
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
|
|
|
.modify-btn {
|
|
|
|
font-size: 26rpx;
|
|
|
|
color: #333;
|
|
|
|
background: #f2f3f5;
|
|
|
|
border: none;
|
|
|
|
border-radius: 40rpx;
|
|
|
|
padding: 8rpx 20rpx;
|
|
|
|
line-height: 1;
|
|
|
|
.modify-btn {
|
|
|
|
font-size: 26rpx;
|
|
|
|
color: #333;
|
|
|
|
background: #f2f3f5;
|
|
|
|
border: none;
|
|
|
|
border-radius: 40rpx;
|
|
|
|
padding: 8rpx 20rpx;
|
|
|
|
line-height: 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// .check-icon {
|
|
|
|
// font-size: 30rpx;
|
|
|
|
// color: #333;
|
|
|
|
// margin-top: 24rpx;
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//=========================
|
|
|
|
|
|
|
|
/* 空状态区域 */
|
|
|
|
.empty-section {
|
|
|
|
flex: 1;
|
|
...
|
...
|
@@ -1301,32 +1087,32 @@ $radius-round: 40rpx; |
|
|
|
justify-content: center;
|
|
|
|
padding: 80rpx 40rpx 120rpx;
|
|
|
|
box-sizing: border-box;
|
|
|
|
}
|
|
|
|
|
|
|
|
.empty-img {
|
|
|
|
width: 360rpx;
|
|
|
|
height: 360rpx;
|
|
|
|
margin-bottom: 40rpx;
|
|
|
|
transform: scale(3);
|
|
|
|
}
|
|
|
|
.empty-img {
|
|
|
|
width: 360rpx;
|
|
|
|
height: 360rpx;
|
|
|
|
margin-bottom: 40rpx;
|
|
|
|
transform: scale(1.5);
|
|
|
|
}
|
|
|
|
|
|
|
|
.empty-tip {
|
|
|
|
font-size: 32rpx;
|
|
|
|
color: #666;
|
|
|
|
font-weight: 500;
|
|
|
|
margin-bottom: 80rpx;
|
|
|
|
letter-spacing: 2rpx;
|
|
|
|
}
|
|
|
|
.empty-tip {
|
|
|
|
font-size: 32rpx;
|
|
|
|
color: #666;
|
|
|
|
font-weight: 500;
|
|
|
|
margin-bottom: 80rpx;
|
|
|
|
letter-spacing: 2rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.add-train-btn {
|
|
|
|
font-size: 30rpx;
|
|
|
|
color: #000;
|
|
|
|
background: $color-accent;
|
|
|
|
border-radius: $radius-round;
|
|
|
|
padding: 24rpx 80rpx;
|
|
|
|
border: none;
|
|
|
|
font-weight: 500;
|
|
|
|
box-shadow: 0 4rpx 12rpx rgba(255, 193, 7, 0.3);
|
|
|
|
.add-train-btn {
|
|
|
|
font-size: 30rpx;
|
|
|
|
color: #000;
|
|
|
|
background: $color-accent;
|
|
|
|
border-radius: 40rpx;
|
|
|
|
padding: 24rpx 80rpx;
|
|
|
|
border: none;
|
|
|
|
font-weight: 500;
|
|
|
|
box-shadow: 0 4rpx 12rpx rgba(255, 193, 7, 0.3);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 底部课程类型区域 */
|
|
...
|
...
|
@@ -1346,25 +1132,25 @@ $radius-round: 40rpx; |
|
|
|
background: #fff;
|
|
|
|
border-radius: 12rpx;
|
|
|
|
padding: 30rpx 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.course-icon {
|
|
|
|
width: 100rpx;
|
|
|
|
height: 100rpx;
|
|
|
|
border-radius: 50%;
|
|
|
|
margin-bottom: 16rpx;
|
|
|
|
}
|
|
|
|
.course-icon {
|
|
|
|
width: 100rpx;
|
|
|
|
height: 100rpx;
|
|
|
|
border-radius: 50%;
|
|
|
|
margin-bottom: 16rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.course-title {
|
|
|
|
font-size: 28rpx;
|
|
|
|
color: #333;
|
|
|
|
margin-bottom: 8rpx;
|
|
|
|
font-weight: 500;
|
|
|
|
}
|
|
|
|
.course-title {
|
|
|
|
font-size: 28rpx;
|
|
|
|
color: #333;
|
|
|
|
margin-bottom: 8rpx;
|
|
|
|
font-weight: 500;
|
|
|
|
}
|
|
|
|
|
|
|
|
.course-desc {
|
|
|
|
font-size: 24rpx;
|
|
|
|
color: #999;
|
|
|
|
.course-desc {
|
|
|
|
font-size: 24rpx;
|
|
|
|
color: #999;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 添加自助训练底部弹窗 */
|
|
...
|
...
|
@@ -1389,14 +1175,6 @@ $radius-round: 40rpx; |
|
|
|
box-sizing: border-box;
|
|
|
|
}
|
|
|
|
|
|
|
|
// .popup-indicator {
|
|
|
|
// width: 80rpx;
|
|
|
|
// height: 8rpx;
|
|
|
|
// background: #ddd;
|
|
|
|
// border-radius: 4rpx;
|
|
|
|
// margin: 0 auto 30rpx;
|
|
|
|
// }
|
|
|
|
|
|
|
|
.popup-title {
|
|
|
|
font-size: 34rpx;
|
|
|
|
color: #333;
|
|
...
|
...
|
@@ -1410,46 +1188,41 @@ $radius-round: 40rpx; |
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
gap: 20rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.popup-option-btn {
|
|
|
|
width: 100%;
|
|
|
|
height: 80rpx;
|
|
|
|
font-size: 30rpx;
|
|
|
|
// color: #ffffff;
|
|
|
|
// background: #f5f5f5;
|
|
|
|
border: none;
|
|
|
|
// border-radius: 12rpx;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
gap: 15rpx;
|
|
|
|
.popup-option-btn {
|
|
|
|
width: 100%;
|
|
|
|
height: 80rpx;
|
|
|
|
font-size: 30rpx;
|
|
|
|
border: none;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
gap: 15rpx;
|
|
|
|
|
|
|
|
.small {
|
|
|
|
font-size: 18rpx;
|
|
|
|
.small {
|
|
|
|
font-size: 18rpx;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// 更多弹窗
|
|
|
|
/* ========== 更多弹窗样式 ========== */
|
|
|
|
:deep(.up-popup__content) {
|
|
|
|
border-radius: 10rpx 10rpx 0 0;
|
|
|
|
background: #f5f5f5;
|
|
|
|
padding: 30rpx 20rpx;
|
|
|
|
}
|
|
|
|
/* 更多弹窗 */
|
|
|
|
// ::deep(.up-popup__content) {
|
|
|
|
// border-radius: 10rpx 10rpx 0 0;
|
|
|
|
// background: #f5f5f5;
|
|
|
|
// padding: 30rpx 20rpx;
|
|
|
|
// }
|
|
|
|
|
|
|
|
.popup-header {
|
|
|
|
text-align: center;
|
|
|
|
margin-top: 30rpx;
|
|
|
|
margin-bottom: 30rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.popup-title {
|
|
|
|
font-size: 34rpx;
|
|
|
|
font-weight: 600;
|
|
|
|
color: #111;
|
|
|
|
.popup-title {
|
|
|
|
font-size: 34rpx;
|
|
|
|
font-weight: 600;
|
|
|
|
color: #111;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.popup-list {
|
|
...
|
...
|
@@ -1464,15 +1237,23 @@ $radius-round: 40rpx; |
|
|
|
padding: 24rpx 20rpx;
|
|
|
|
background: transparent;
|
|
|
|
gap: 16rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.popup-item:not(:last-child) {
|
|
|
|
border-bottom: 1rpx solid #eee;
|
|
|
|
}
|
|
|
|
&:not(:last-child) {
|
|
|
|
border-bottom: 1rpx solid #eee;
|
|
|
|
}
|
|
|
|
|
|
|
|
.item-text {
|
|
|
|
font-size: 30rpx;
|
|
|
|
color: #333;
|
|
|
|
.item-text {
|
|
|
|
font-size: 30rpx;
|
|
|
|
color: #333;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.delete-item {
|
|
|
|
background: #fff;
|
|
|
|
|
|
|
|
.item-text {
|
|
|
|
color: #ff4d4f;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.popup-divider {
|
|
...
|
...
|
@@ -1481,56 +1262,46 @@ $radius-round: 40rpx; |
|
|
|
margin: 20rpx 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.delete-item {
|
|
|
|
background: #fff;
|
|
|
|
}
|
|
|
|
|
|
|
|
.delete-text {
|
|
|
|
color: #ff4d4f;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 按钮通用重置 */
|
|
|
|
button {
|
|
|
|
line-height: 1;
|
|
|
|
}
|
|
|
|
.container {
|
|
|
|
/* 按钮通用重置 */
|
|
|
|
button {
|
|
|
|
line-height: 1;
|
|
|
|
|
|
|
|
button::after {
|
|
|
|
border: none;
|
|
|
|
&::after {
|
|
|
|
border: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* 训记切换标签 */
|
|
|
|
.plan-tabs {
|
|
|
|
white-space: nowrap;
|
|
|
|
padding: 16rpx 20rpx;
|
|
|
|
background: #fff;
|
|
|
|
|
|
|
|
// 给内部的标签留出间距,同时让它不换行
|
|
|
|
// display: flex;
|
|
|
|
gap: 16rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.tab-btn {
|
|
|
|
display: inline-block;
|
|
|
|
padding: 10rpx 24rpx;
|
|
|
|
border-radius: 32rpx;
|
|
|
|
font-size: 26rpx;
|
|
|
|
background: #f2f2f2;
|
|
|
|
border: none;
|
|
|
|
flex-shrink: 0;
|
|
|
|
white-space: nowrap;
|
|
|
|
}
|
|
|
|
.tab-btn {
|
|
|
|
display: inline-block;
|
|
|
|
padding: 10rpx 24rpx;
|
|
|
|
border-radius: 32rpx;
|
|
|
|
font-size: 26rpx;
|
|
|
|
background: #f2f2f2;
|
|
|
|
border: none;
|
|
|
|
flex-shrink: 0;
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
|
|
.tab-btn.active {
|
|
|
|
background: #000;
|
|
|
|
color: #fff;
|
|
|
|
&.active {
|
|
|
|
background: #000;
|
|
|
|
color: #fff;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ========== 超级组样式 ========== */
|
|
|
|
/* 超级组样式 */
|
|
|
|
.superset-wrapper {
|
|
|
|
margin-bottom: 20rpx;
|
|
|
|
background: $color-white;
|
|
|
|
border-radius: $radius-md;
|
|
|
|
border-radius: 12rpx;
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
|
|
.super-head {
|
|
...
|
...
|
@@ -1613,9 +1384,8 @@ button::after { |
|
|
|
width: 37rpx;
|
|
|
|
height: 37rpx;
|
|
|
|
text-align: center;
|
|
|
|
flex-shrink: 0; // /* 不被父容器挤压变形,保持固定大小 */
|
|
|
|
flex-shrink: 0;
|
|
|
|
border-radius: 50%;
|
|
|
|
// line-height: 60rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.set-column {
|
|
...
|
...
|
@@ -1624,23 +1394,20 @@ button::after { |
|
|
|
}
|
|
|
|
|
|
|
|
.action-in-set {
|
|
|
|
// display: flex;
|
|
|
|
// flex-direction: column;
|
|
|
|
width: 100%;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
margin-bottom: 8rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.action-in-set:last-child {
|
|
|
|
margin-bottom: 0;
|
|
|
|
&:last-child {
|
|
|
|
margin-bottom: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.action-letter {
|
|
|
|
display: inline-block;
|
|
|
|
font-size: 26rpx;
|
|
|
|
color: #666;
|
|
|
|
// width: 35rpx;
|
|
|
|
white-space: nowrap;
|
|
|
|
margin-right: 12rpx;
|
|
|
|
flex-shrink: 0;
|
|
...
|
...
|
@@ -1650,11 +1417,14 @@ button::after { |
|
|
|
font-size: 26rpx;
|
|
|
|
color: inherit;
|
|
|
|
flex: 1;
|
|
|
|
|
|
|
|
.detai-data {
|
|
|
|
white-space: nowrap;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.rest-time {
|
|
|
|
font-size: 24rpx;
|
|
|
|
// color: inherit;
|
|
|
|
margin-left: 10rpx;
|
|
|
|
flex-shrink: 0;
|
|
|
|
}
|
|
...
|
...
|
@@ -1665,44 +1435,43 @@ button::after { |
|
|
|
margin-left: 275rpx !important;
|
|
|
|
flex-shrink: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.superset-title {
|
|
|
|
font-size: 28rpx;
|
|
|
|
font-weight: bold;
|
|
|
|
padding: 12rpx 20rpx;
|
|
|
|
background: #fff6cc;
|
|
|
|
border-radius: 12rpx;
|
|
|
|
margin-bottom: 12rpx;
|
|
|
|
.superset-title {
|
|
|
|
font-size: 28rpx;
|
|
|
|
font-weight: bold;
|
|
|
|
padding: 12rpx 20rpx;
|
|
|
|
background: #fff6cc;
|
|
|
|
border-radius: 12rpx;
|
|
|
|
margin-bottom: 12rpx;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// 日程备注
|
|
|
|
/* 日程备注 */
|
|
|
|
.noteContent {
|
|
|
|
display: flex;
|
|
|
|
align-items: flex-start;
|
|
|
|
gap: 12rpx;
|
|
|
|
padding: 20rpx;
|
|
|
|
background: $color-white;
|
|
|
|
}
|
|
|
|
|
|
|
|
.noteTitle {
|
|
|
|
font-size: 26rpx;
|
|
|
|
color: #666;
|
|
|
|
flex-shrink: 0;
|
|
|
|
width: 150rpx;
|
|
|
|
}
|
|
|
|
.noteTitle {
|
|
|
|
font-size: 26rpx;
|
|
|
|
color: #666;
|
|
|
|
flex-shrink: 0;
|
|
|
|
width: 150rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.noteTags {
|
|
|
|
flex: 1;
|
|
|
|
display: flex;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
gap: 12rpx;
|
|
|
|
.noteTags {
|
|
|
|
flex: 1;
|
|
|
|
display: flex;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
gap: 12rpx;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// u-tag 微调
|
|
|
|
:deep(.noteTag) {
|
|
|
|
width: auto !important;
|
|
|
|
font-size: 24rpx;
|
|
|
|
border-radius: 10rpx;
|
|
|
|
}
|
|
|
|
</style> |
|
|
\ No newline at end of file |
|
|
|
// ::deep(.noteTag) {
|
|
|
|
// width: auto !important;
|
|
|
|
// font-size: 24rpx;
|
|
|
|
// border-radius: 10rpx;
|
|
|
|
// }
|
|
|
|
</style> |
...
|
...
|
|