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
996811b5
Commit
996811b5
authored
Aug 13, 2024
by
潘永坪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
组合票首页兼容支付宝小程序,订单页面日历报错处理
parent
4b74e396
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
21 deletions
+76
-21
distributionCombiChoose.vue
...ation/distributionCombiChoose/distributionCombiChoose.vue
+74
-19
scenicCombiOrder.vue
pages/scenic/scenicCombiOrder/scenicCombiOrder.vue
+1
-1
scenicSingleOrder.vue
pages/scenic/scenicSingleOrder/scenicSingleOrder.vue
+1
-1
No files found.
pages/combination/distributionCombiChoose/distributionCombiChoose.vue
View file @
996811b5
...
@@ -345,7 +345,6 @@ export default {
...
@@ -345,7 +345,6 @@ export default {
let
token
=
uni
.
getStorageSync
(
'token'
)
let
token
=
uni
.
getStorageSync
(
'token'
)
if
(
token
)
{
if
(
token
)
{
uni
.
getLocation
({
uni
.
getLocation
({
type
:
'wgs84'
,
success
:
res
=>
{
success
:
res
=>
{
let
latitude
=
res
.
latitude
//纬度
let
latitude
=
res
.
latitude
//纬度
let
longitude
=
res
.
longitude
//经度
let
longitude
=
res
.
longitude
//经度
...
@@ -444,12 +443,23 @@ export default {
...
@@ -444,12 +443,23 @@ export default {
//清空数组
//清空数组
this
.
heightArr
=
[]
this
.
heightArr
=
[]
//获取中间盒子需要滚动时的高度
//获取中间盒子需要滚动时的高度
// #ifdef MP-WEIXIN
uni
.
createSelectorQuery
().
in
(
this
).
select
(
'.middle-top'
).
boundingClientRect
(
data
=>
{
uni
.
createSelectorQuery
().
in
(
this
).
select
(
'.middle-top'
).
boundingClientRect
(
data
=>
{
if
(
data
){
if
(
data
){
this
.
middleTopHeight
=
data
.
height
this
.
middleTopHeight
=
data
.
height
}
}
}).
exec
()
}).
exec
()
// #endif
// #ifdef MP-ALIPAY
uni
.
createSelectorQuery
().
select
(
'.middle-top'
).
boundingClientRect
(
data
=>
{
if
(
data
){
this
.
middleTopHeight
=
data
.
height
}
}).
exec
()
// #endif
//获取中间盒子原本高度
//获取中间盒子原本高度
// #ifdef MP-WEIXIN
uni
.
createSelectorQuery
().
in
(
this
).
select
(
'.middle-right'
).
boundingClientRect
(
data
=>
{
uni
.
createSelectorQuery
().
in
(
this
).
select
(
'.middle-right'
).
boundingClientRect
(
data
=>
{
//获取中间盒子原本高度,默认中间盒子等于原本高度,滚动之后等于滚动高度
//获取中间盒子原本高度,默认中间盒子等于原本高度,滚动之后等于滚动高度
if
(
data
){
if
(
data
){
...
@@ -457,29 +467,64 @@ export default {
...
@@ -457,29 +467,64 @@ export default {
this
.
middleHeight
=
data
.
height
this
.
middleHeight
=
data
.
height
}
}
}).
exec
()
}).
exec
()
// #endif
//不要这样 多个的时候就会循环 varquery = uni.createSelectorQuery()
// #ifdef MP-ALIPAY
uni
.
createSelectorQuery
().
select
(
'.middle-right'
).
boundingClientRect
(
data
=>
{
//获取中间盒子原本高度,默认中间盒子等于原本高度,滚动之后等于滚动高度
if
(
data
){
this
.
originHeight
=
data
.
height
this
.
middleHeight
=
data
.
height
}
}).
exec
()
// #endif
//不要这样 var query = uni.createSelectorQuery() query.in(this)放入循环里面会多次循环
for
(
let
i
=
0
;
i
<
this
.
scenicList
.
length
;
i
++
){
for
(
let
i
=
0
;
i
<
this
.
scenicList
.
length
;
i
++
){
uni
.
createSelectorQuery
().
in
(
this
).
select
(
`#merchant
${
i
}
`
).
boundingClientRect
(
data
=>
{
// #ifdef MP-WEIXIN
//获取商家列表各个元素的高度,并且把他们前后相加添加到一个数组里面
uni
.
createSelectorQuery
().
in
(
this
).
select
(
`#merchant
${
i
}
`
).
boundingClientRect
(
data
=>
{
//获取商家列表各个元素的高度,并且把他们前后相加添加到一个数组里面
if
(
data
){
if
(
data
){
if
(
i
==
0
){
//取整,由于高度多数为小数,防止点击左边,滚动右边时出现bug
this
.
heightArr
.
push
(
parseInt
(
data
.
height
))
}
else
{
this
.
heightArr
.
push
(
parseInt
(
data
.
height
)
+
this
.
heightArr
[
i
-
1
])
}
}
}).
exec
()
// #endif
// #ifdef MP-ALIPAY
uni
.
createSelectorQuery
().
select
(
`#merchant
${
i
}
`
).
boundingClientRect
(
data
=>
{
//获取商家列表各个元素的高度,并且把他们前后相加添加到一个数组里面
if
(
data
){
if
(
i
==
0
){
if
(
i
==
0
){
//取整,由于高度多数为小数,防止点击左边,滚动右边时出现bug
//取整,由于高度多数为小数,防止点击左边,滚动右边时出现bug
this
.
heightArr
.
push
(
parseInt
(
data
.
height
))
this
.
heightArr
.
push
(
parseInt
(
data
.
height
))
}
else
{
}
else
{
this
.
heightArr
.
push
(
parseInt
(
data
.
height
)
+
this
.
heightArr
[
i
-
1
])
this
.
heightArr
.
push
(
parseInt
(
data
.
height
)
+
this
.
heightArr
[
i
-
1
])
}
}
}
}
}).
exec
()
}).
exec
()
// #endif
}
}
uni
.
getSystemInfo
({
uni
.
getSystemInfo
({
complete
:(
info
)
=>
{
complete
:(
info
)
=>
{
let
windowHeight
=
info
.
windowHeight
||
844
let
windowHeight
=
info
.
windowHeight
||
844
// #ifdef MP-WEIXIN
uni
.
createSelectorQuery
().
in
(
this
).
select
(
'.bottom'
).
boundingClientRect
(
data
=>
{
uni
.
createSelectorQuery
().
in
(
this
).
select
(
'.bottom'
).
boundingClientRect
(
data
=>
{
if
(
data
){
if
(
data
){
this
.
scrollHeight
=
windowHeight
-
data
.
height
-
this
.
topHeight
this
.
scrollHeight
=
windowHeight
-
data
.
height
-
this
.
topHeight
}
}
}).
exec
()
}).
exec
()
// #endif
// #ifdef MP-ALIPAY
uni
.
createSelectorQuery
().
select
(
'.bottom'
).
boundingClientRect
(
data
=>
{
if
(
data
){
this
.
scrollHeight
=
windowHeight
-
data
.
height
-
this
.
topHeight
}
}).
exec
()
// #endif
}
}
})
})
...
@@ -569,22 +614,32 @@ export default {
...
@@ -569,22 +614,32 @@ export default {
setTimeout
(()
=>
{
setTimeout
(()
=>
{
let
height
=
0
let
height
=
0
let
scrollTop
=
e
.
detail
.
scrollTop
let
scrollTop
=
e
.
detail
.
scrollTop
let
selectFun
=
(
data
)
=>
{
if
(
data
){
//20为中间盒子的top-20
height
=
data
.
height
+
this
.
middleTopHeight
-
20
-
this
.
topHeight
let
opacity
=
scrollTop
/
(
data
.
height
)
this
.
tabbarOpacity
=
parseFloat
(
opacity
.
toFixed
(
2
))
if
(
scrollTop
>=
height
){
//中间上部分固定,中间下部分可滚动,全屏不滚动
this
.
middleHeight
=
this
.
scrollHeight
}
else
{
//中间上部分不固定,中间下部分不可滚动,全屏滚动'
this
.
middleHeight
=
this
.
originHeight
}
}
}
// #ifdef MP-WEIXIN
uni
.
createSelectorQuery
().
in
(
this
).
select
(
'.banner'
).
boundingClientRect
(
data
=>
{
uni
.
createSelectorQuery
().
in
(
this
).
select
(
'.banner'
).
boundingClientRect
(
data
=>
{
if
(
data
){
selectFun
(
data
)
//20为中间盒子的top-20
}).
exec
()
height
=
data
.
height
+
this
.
middleTopHeight
-
20
-
this
.
topHeight
// #endif
let
opacity
=
scrollTop
/
(
data
.
height
)
// #ifdef MP-ALIPAY
this
.
tabbarOpacity
=
parseFloat
(
opacity
.
toFixed
(
2
))
uni
.
createSelectorQuery
().
select
(
'.banner'
).
boundingClientRect
(
data
=>
{
if
(
scrollTop
>=
height
){
selectFun
(
data
)
//中间上部分固定,中间下部分可滚动,全屏不滚动
this
.
middleHeight
=
this
.
scrollHeight
}
else
{
//中间上部分不固定,中间下部分不可滚动,全屏滚动'
this
.
middleHeight
=
this
.
originHeight
}
}
}).
exec
()
}).
exec
()
// #endif
},
5
)
},
5
)
},
},
...
...
pages/scenic/scenicCombiOrder/scenicCombiOrder.vue
View file @
996811b5
...
@@ -84,7 +84,7 @@
...
@@ -84,7 +84,7 @@
</view>
</view>
</scroll-view>
</scroll-view>
<text
v-else
class=
"no-date"
>
不可购买
</text>
<text
v-else
class=
"no-date"
>
不可购买
</text>
<view
class=
"dateMore"
@
click=
"showCalendar(index)"
>
<view
class=
"dateMore"
@
click=
"showCalendar(index)"
v-if=
"item.priceStockList&&item.priceStockList.length > 0"
>
<view
class=
"date-more-content"
>
<view
class=
"date-more-content"
>
<view>
更多
</view>
<view>
更多
</view>
<view>
日期
</view>
<view>
日期
</view>
...
...
pages/scenic/scenicSingleOrder/scenicSingleOrder.vue
View file @
996811b5
...
@@ -83,7 +83,7 @@
...
@@ -83,7 +83,7 @@
</view>
</view>
</scroll-view>
</scroll-view>
<text
v-else
class=
"no-date"
>
不可购买
</text>
<text
v-else
class=
"no-date"
>
不可购买
</text>
<view
class=
"dateMore"
@
click=
"showCalendar()"
>
<view
class=
"dateMore"
@
click=
"showCalendar()"
v-if=
"dateList.length > 0"
>
<view
class=
"date-more-content"
>
<view
class=
"date-more-content"
>
<view>
更多
</view>
<view>
更多
</view>
<view>
日期
</view>
<view>
日期
</view>
...
...
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