Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jz_Travel
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhengke
jz_Travel
Commits
fee8de57
Commit
fee8de57
authored
Jul 15, 2025
by
youjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
bc552add
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
24 deletions
+39
-24
header.vue
pages/teamLeader/components/schedule/header.vue
+34
-6
schedule.vue
pages/teamLeader/schedule.vue
+5
-18
No files found.
pages/teamLeader/components/schedule/header.vue
View file @
fee8de57
...
...
@@ -38,11 +38,11 @@
</
style
>
<
template
>
<view>
<
scroll-view
class=
"scheduleTsBox"
:scroll-x=
"true"
:scrollLeft=
"scrollLeft
"
>
<
!-- :scroll-left="scrollLeft" -->
<scroll-view
class=
"scheduleTsBox"
:scroll-x=
"true
"
>
<view
class=
"scheduleT-text row-aic-n"
>
<template
v-for=
"(item,index) in list"
>
<view
class=
"scheduleText"
:id=
"
item.val
"
<view
class=
"scheduleText"
:id=
"
`refs_$
{index+1}`
"
:class="[params.type==item.id?'active':'']"
:key="index"
@click="getType(item)">
...
...
@@ -60,24 +60,52 @@
data
(){
return
{
list
:
[],
scrollLeft
:
''
scrollLeft
:
0
}
},
watch
:{
titles
:
{
handler
(
newVal
,
oldVal
)
{
this
.
list
=
JSON
.
parse
(
JSON
.
stringify
(
newVal
))
// 使用 $nextTick 等待 DOM 渲染完成
this
.
$nextTick
(()
=>
{
this
.
list
.
forEach
((
x
,
index
)
=>
{
// 查询当前元素的位置
uni
.
createSelectorQuery
()
.
in
(
this
)
// 限定在当前组件内查询(关键!)
.
select
(
`#refs_
${
index
+
1
}
`
)
// 匹配元素的 id
.
fields
({
position
:
true
,
// 获取位置信息(left/top)
size
:
true
// 获取尺寸(width/height)
})
.
exec
((
res
)
=>
{
if
(
res
[
0
])
{
const
{
left
,
top
,
width
,
height
}
=
res
[
0
];
// console.log(`元素 ${index} 的横向位置(left):`, left); // 单位:px
// console.log(`元素 ${index} 的宽度:`, width);
x
.
left
=
width
*
(
index
)
}
else
{
console
.
log
(
`未找到元素 refs_
${
index
+
1
}
`
);
}
});
});
});
},
deep
:
true
,
immediate
:
true
},
params
:
{
handler
(
newVal
,
oldVal
)
{
this
.
$nextTick
(()
=>
{
let
findIndex
=
this
.
list
.
findIndex
(
x
=>
x
.
id
==
newVal
.
type
)
if
(
findIndex
!=
-
1
)
{
this
.
scrollLeft
=
this
.
list
[
findIndex
].
left
}
})
},
deep
:
true
,
immediate
:
true
}
}
,
},
components
:
{
...
...
pages/teamLeader/schedule.vue
View file @
fee8de57
...
...
@@ -116,26 +116,11 @@
</view>
</view>
<scheduleHeader
:titles=
"titles"
:params=
"params"
@
change=
"getType"
></scheduleHeader>
<!--
<scroll-view
class=
"scheduleTsBox"
:scroll-x=
"true"
:scroll-left=
"scrollLeft"
@
scroll=
"scrollHandler"
>
<view
class=
"scheduleT-text row-aic-n"
>
<view
class=
"scheduleText"
:class=
"[params.type==item.id?'active':'']"
v-for=
"(item,index) in titles"
:key=
"index"
@
click=
"getType(item)"
>
<text>
{{
item
.
name
}}
</text>
<view></view>
</view>
</view>
</scroll-view>
-->
</view>
<view
class=
"scheduleTitle fixed"
:style=
"
{ opacity: boxOption + '%' ,'display':boxOption
<
=
0
?'
none
'
:
'
show
'}"
>
<headers
textAlign=
"left"
:title=
"pageTitle"
color=
"#fff"
></headers>
<scheduleHeader
:titles=
"titles"
:params=
"params"
@
change=
"getType"
></scheduleHeader>
<scheduleHeader
v-if=
"boxOption>0"
:titles=
"titles"
:params=
"params"
@
change=
"getType"
></scheduleHeader>
</view>
</view>
<infor1
v-if=
"params.type==1"
:data=
"inforData1"
></infor1>
...
...
@@ -255,7 +240,7 @@ export default {
},
datas
:
{},
params
:{
type
:
1
type
:
1
,
},
scrollLeft
:
0
,
currencyList
:
[],
...
...
@@ -309,7 +294,9 @@ export default {
this
.
optionObj
=
this
.
optionList
[
findIndex
]
},
getType
(
item
){
this
.
params
.
type
=
item
.
id
this
.
params
=
{
type
:
item
.
id
,
}
},
init
()
{
uni
.
showLoading
()
...
...
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