Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
mlaj
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2025-09-30 18:11:56 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a6a42172fb603daec27f97077f68cd108df0abbd
a6a42172
1 parent
4fa58b1a
feat(打卡): 在打卡详情页添加日期参数并支持编辑模式
在跳转打卡详情页时添加当前日期参数,确保数据正确显示 为打卡详情页添加编辑模式判断,禁用非当前类型的切换
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
5 deletions
src/views/checkin/CheckinDetailPage.vue
src/views/checkin/IndexCheckInPage.vue
src/views/checkin/CheckinDetailPage.vue
View file @
a6a4217
...
...
@@ -40,8 +40,11 @@
<div
v-for="option in attachmentTypeOptions"
:key="option.key"
@click="switchType(option.key)"
:class="['tab-item', { active: activeType === option.key }]"
@click="!isEditMode ? switchType(option.key) : null"
:class="['tab-item', {
active: activeType === option.key,
disabled: isEditMode && activeType !== option.key
}]"
>
<van-icon
:name="getIconName(option.key)"
...
...
@@ -154,6 +157,9 @@ const taskDetail = ref({})
// 作品类型选项
const attachmentTypeOptions = ref([])
// 是否为编辑模式
const isEditMode = computed(() => route.query.status === 'edit')
/**
* 返回上一页
*/
...
...
@@ -231,7 +237,12 @@ const getTaskDetail = async (month) => {
*/
onMounted(async () => {
// 获取任务详情
getTaskDetail(dayjs().format('YYYY-MM'))
const current_date = route.query.date;
if (current_date) {
getTaskDetail(dayjs(current_date).format('YYYY-MM'));
} else {
getTaskDetail(dayjs().format('YYYY-MM'));
}
// 获取作品类型数据
try {
...
...
@@ -353,6 +364,16 @@ onMounted(async () => {
font-weight: 600;
}
}
&.disabled {
opacity: 0.5;
cursor: not-allowed;
&:hover {
border-color: #e8f5e8;
background-color: #fafffe;
}
}
}
.tab-text {
...
...
src/views/checkin/IndexCheckInPage.vue
View file @
a6a4217
<!--
* @Date: 2025-05-29 15:34:17
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-09-30 1
7:58:09
* @LastEditTime: 2025-09-30 1
8:03:55
* @FilePath: /mlaj/src/views/checkin/IndexCheckInPage.vue
* @Description: 文件描述
-->
...
...
@@ -540,10 +540,12 @@ const handleCheckinTypeClick = (type) => {
* 跳转到打卡详情页面
*/
const goToCheckinDetailPage = () => {
const current_date = route.query.date || dayjs().format('YYYY-MM-DD');
router.push({
path: '/checkin/detail',
query: {
id: route.query.id
id: route.query.id,
date: current_date
}
})
}
...
...
Please
register
or
login
to post a comment