Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
飞
飞鹤小程序
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
FH
飞鹤小程序
Commits
c44f6126
Commit
c44f6126
authored
Nov 06, 2025
by
王炽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
任务修改动态布局
parent
7f2fbf2e
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
209 additions
and
7 deletions
+209
-7
TaskPop.less
components/renwu/TaskPop.less
+4
-3
TaskPop.vue
components/renwu/TaskPop.vue
+29
-3
getSigninAndTaskInMock.json
mock/getSigninAndTaskInMock.json
+176
-1
No files found.
components/renwu/TaskPop.less
View file @
c44f6126
...
@@ -12,12 +12,14 @@
...
@@ -12,12 +12,14 @@
.task_pop_container {
.task_pop_container {
width: 100%;
width: 100%;
height: 1092rpx;
// height 通过动态样式设置
background: #F7F7F7;
background: #F7F7F7;
border-radius: 24rpx 24rpx 0 0;
border-radius: 24rpx 24rpx 0 0;
padding: 0rpx 30rpx 0rpx 30rpx;
padding: 0rpx 30rpx 0rpx 30rpx;
box-shadow: 0 -4rpx 20rpx rgba(0, 0, 0, 0.1);
box-shadow: 0 -4rpx 20rpx rgba(0, 0, 0, 0.1);
animation: slideUp 0.3s ease-out;
animation: slideUp 0.3s ease-out;
display: flex;
flex-direction: column;
.task_pop_header {
.task_pop_header {
display: flex;
display: flex;
...
@@ -54,8 +56,7 @@
...
@@ -54,8 +56,7 @@
}
}
.task_list {
.task_list {
height: 964rpx;
// height 和 overflow-y 通过动态样式设置
overflow-y: auto;
.task_item {
.task_item {
display: flex;
display: flex;
...
...
components/renwu/TaskPop.vue
View file @
c44f6126
<
template
>
<
template
>
<view
class=
"task_pop_overlay"
v-if=
"visible"
@
click
.
stop
>
<view
class=
"task_pop_overlay"
v-if=
"visible"
@
click
.
stop
>
<view
class=
"task_pop_container"
@
click
.
stop
>
<view
class=
"task_pop_container"
:style=
"
{ height: containerHeight + 'rpx' }"
@click.stop>
<!-- 弹窗头部 -->
<!-- 弹窗头部 -->
<view
class=
"task_pop_header"
>
<view
class=
"task_pop_header"
>
<text
class=
"task_pop_title"
>
做任务赚积分
</text>
<text
class=
"task_pop_title"
>
做任务赚积分
</text>
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
</view>
</view>
<!-- 任务列表 -->
<!-- 任务列表 -->
<view
class=
"task_list"
>
<view
class=
"task_list"
:style=
"
{ height: taskListHeight + 'rpx', 'overflow-y': canScroll ? 'auto' : 'hidden' }"
>
<view
<view
class=
"task_item"
class=
"task_item"
v-for=
"(task, index) in props.taskTodo"
v-for=
"(task, index) in props.taskTodo"
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
</
template
>
</
template
>
<
script
setup
>
<
script
setup
>
import
{
defineProps
,
defineEmits
,
ref
,
onMounted
,
watch
}
from
'vue'
;
import
{
defineProps
,
defineEmits
,
ref
,
onMounted
,
watch
,
computed
}
from
'vue'
;
import
{
useIntegralStore
}
from
'../../stores/integral'
;
import
{
useIntegralStore
}
from
'../../stores/integral'
;
import
md
from
'../../md.js'
;
import
md
from
'../../md.js'
;
...
@@ -58,6 +58,32 @@ const props = defineProps({
...
@@ -58,6 +58,32 @@ const props = defineProps({
}
}
});
});
// 计算任务条数
const
taskCount
=
computed
(()
=>
{
return
props
.
taskTodo
?.
length
||
0
;
});
// 计算弹窗容器高度:100 + 条数 * 170,最多6条
const
containerHeight
=
computed
(()
=>
{
const
count
=
Math
.
min
(
taskCount
.
value
,
6
);
return
100
+
count
*
170
;
});
// 计算任务列表高度:根据条数动态变化,最多6条时固定高度
const
taskListHeight
=
computed
(()
=>
{
const
count
=
taskCount
.
value
;
if
(
count
<=
6
)
{
return
count
*
170
;
}
// 超过6条时,固定为6条的高度,内容可滚动
return
6
*
170
;
});
// 判断是否可滚动:超过6条时可滚动
const
canScroll
=
computed
(()
=>
{
return
taskCount
.
value
>
6
;
});
onMounted
(()
=>
{
onMounted
(()
=>
{
props
.
taskTodo
.
forEach
(
item
=>
{
props
.
taskTodo
.
forEach
(
item
=>
{
md
.
sensorComponentLogTake
({
md
.
sensorComponentLogTake
({
...
...
mock/getSigninAndTaskInMock.json
View file @
c44f6126
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment