Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
U
uni-pdtravel
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
panyongping
uni-pdtravel
Commits
3bfaf4d5
Commit
3bfaf4d5
authored
Jul 15, 2024
by
潘永坪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug处理
parent
5b45ed41
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
15 deletions
+29
-15
distributionCombiChoose.vue
...ation/distributionCombiChoose/distributionCombiChoose.vue
+29
-15
No files found.
pages/combination/distributionCombiChoose/distributionCombiChoose.vue
View file @
3bfaf4d5
...
...
@@ -224,6 +224,8 @@ export default {
middleInfoStyle
:
''
,
//中间盒子上部分样式
middleBottomStyle
:
''
,
//中间盒子下部分样式
infoHeight
:
0
,
//middle-info盒子高度
scrlllHeight
:
0
,
//中间盒子滚动时的高度
originHeight
:
0
,
//中间盒子原本高度
}
},
watch
:
{
...
...
@@ -428,15 +430,22 @@ export default {
uni
.
getSystemInfo
({
complete
:(
info
)
=>
{
let
windowHeight
=
info
.
windowHeight
||
753
//获取
元素都用 uni.createSelectorQuery(),不要用变量代替,不然会循环。
//获取
中间盒子需要滚动时的高度
uni
.
createSelectorQuery
().
in
(
this
).
select
(
'.merchant-info'
).
boundingClientRect
(
data
=>
{
//获取中间盒子的高度
if
(
data
){
this
.
infoHeight
=
data
.
height
this
.
xxx
=
windowHeight
-
this
.
infoHeight
this
.
middleHeight
=
3000
this
.
scrlllHeight
=
windowHeight
-
this
.
infoHeight
}
}).
exec
()
//获取中间盒子原本高度
uni
.
createSelectorQuery
().
in
(
this
).
select
(
'.middle-right'
).
boundingClientRect
(
data
=>
{
//获取中间盒子原本高度,默认中间盒子等于原本高度,滚动之后等于滚动高度
if
(
data
){
this
.
originHeight
=
data
.
height
this
.
middleHeight
=
this
.
originHeight
}
}).
exec
()
//不要这样 多个的时候就会循环 varquery = uni.createSelectorQuery()
for
(
let
i
=
0
;
i
<
this
.
scenicList
.
length
;
i
++
){
uni
.
createSelectorQuery
().
in
(
this
).
select
(
`#merchant
${
i
}
`
).
boundingClientRect
(
data
=>
{
...
...
@@ -513,10 +522,13 @@ export default {
},
//---商家下标切换
merchantTabChange
(
index
){
this
.
merchantIndex
=
index
//点击右边可滚动
this
.
middleHeight
=
this
.
xxx
this
.
toViewRight
=
'merchant'
+
index
this
.
middleHeight
=
this
.
scrlllHeight
//加个延时,防止第一次点击时无效果
this
.
$nextTick
(()
=>
{
this
.
merchantIndex
=
index
this
.
toViewRight
=
'merchant'
+
index
})
},
//---展示明细弹窗
showDetail
()
{
...
...
@@ -531,13 +543,15 @@ export default {
//20=中间盒子top:-20的值
height
=
data
.
height
-
20
if
(
e
.
detail
.
scrollTop
>
height
){
//商家信息固定,中间可滚动,全屏不滚动
this
.
middleInfoStyle
=
'top:0;position:fixed;'
this
.
middleBottomStyle
=
`margin-top:
${
this
.
infoHeight
}
px`
this
.
middleHeight
=
this
.
xxx
this
.
middleHeight
=
this
.
scrlllHeight
}
else
{
//商家不固定,中间不可滚动,全屏滚动
this
.
middleInfoStyle
=
'position:relative;'
this
.
middleBottomStyle
=
'margin-top:0'
this
.
middleHeight
=
3000
this
.
middleHeight
=
this
.
originHeight
}
}
}).
exec
()
...
...
@@ -548,12 +562,12 @@ export default {
scrollRight
(
e
)
{
setTimeout
(()
=>
{
let
scrollTop
=
e
.
detail
.
scrollTop
if
(
scrollTop
==
0
){
//当滑到顶部时,上面固定元素还原
this
.
middleInfoStyle
=
'position:relative;'
this
.
middleBottomStyle
=
'margin-top:0'
this
.
middleHeight
=
3000
}
//
if(scrollTop==0){
//
//当滑到顶部时,上面固定元素还原
//
this.middleInfoStyle='position:relative;'
//
this.middleBottomStyle='margin-top:0'
//
this.middleHeight=3000
//
}
//通过滚动值获取下标
this
.
heightArr
.
forEach
((
item
,
i
)
=>
{
if
(
i
==
0
){
...
...
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