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
dbfbb65d
Commit
dbfbb65d
authored
Jul 18, 2024
by
潘永坪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
组合票优化
parent
96876d54
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
33 deletions
+62
-33
pages.json
pages.json
+2
-1
distributionCombiChoose.vue
...ation/distributionCombiChoose/distributionCombiChoose.vue
+60
-32
No files found.
pages.json
View file @
dbfbb65d
...
@@ -54,7 +54,8 @@
...
@@ -54,7 +54,8 @@
"path"
:
"pages/combination/distributionCombiChoose/distributionCombiChoose"
,
"path"
:
"pages/combination/distributionCombiChoose/distributionCombiChoose"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"产品选择"
,
"navigationBarTitleText"
:
"产品选择"
,
"enablePullDownRefresh"
:
false
"enablePullDownRefresh"
:
false
,
"navigationStyle"
:
"custom"
}
}
},
},
{
{
...
...
pages/combination/distributionCombiChoose/distributionCombiChoose.vue
View file @
dbfbb65d
<!-- 修改这个页面时,需要同步更新combiChoose页面的代码 -->
<!-- 修改这个页面时,需要同步更新combiChoose页面的代码 -->
<
template
>
<
template
>
<view
class=
"wrap"
>
<view
class=
"wrap"
>
<scroll-view
@
scroll=
"scrollFull"
style=
"height: 100%;"
:scroll-into-view=
"toViewFull"
scroll-y
>
<scroll-view
@
scroll=
"scrollFull"
style=
"height: 100%;"
:scroll-into-view=
"toViewFull"
scroll-y
>
<view
class=
"banner"
>
<view
class=
"banner"
>
<u-swiper
:list=
"imgList"
@
change=
"e => currentNum = e.current"
indicatorStyle=
"right: 20px;bottom:25px"
height=
"400"
circular
>
<u-swiper
:list=
"imgList"
@
change=
"e => currentNum = e.current"
indicatorStyle=
"right: 20px;bottom:25px"
height=
"400"
circular
>
<view
slot=
"indicator"
class=
"indicator-num"
>
<view
slot=
"indicator"
class=
"indicator-num"
>
...
@@ -13,10 +13,10 @@
...
@@ -13,10 +13,10 @@
<!-- 中间上面部分 -->
<!-- 中间上面部分 -->
<view
class=
"middle-top"
:style=
"middleTopStyle"
>
<view
class=
"middle-top"
:style=
"middleTopStyle"
>
<view
class=
"merchant-name"
>
<view
class=
"merchant-name"
>
{{
merchantTitl
e
||
''
}}
{{
currentMerchant
.
nam
e
||
''
}}
</view>
</view>
<u-transition
:show=
"showTransition"
:duration=
'600'
>
<u-transition
:show=
"showTransition"
:duration=
'600'
>
<view
class=
"merchant-info-bottom"
>
<view
class=
"merchant-info-bottom"
id=
'info-bottom'
>
<view
class=
"merchant-bottom-left"
>
<view
class=
"merchant-bottom-left"
>
<view>
<view>
<text
style=
"color: #00B42B;"
>
营业时间
</text>
<text
style=
"color: #00B42B;"
>
营业时间
</text>
...
@@ -95,7 +95,7 @@
...
@@ -95,7 +95,7 @@
<text
class=
"product-status"
v-if=
"items.status == 2"
>
{{ items.statusName }}
</text>
<text
class=
"product-status"
v-if=
"items.status == 2"
>
{{ items.statusName }}
</text>
</view>
</view>
<view
class=
"product-rule"
>
<view
class=
"product-rule"
>
<
text>
随买随用
</text
>
<
!-- <text>随买随用</text> --
>
<
template
v-if=
"items.productRefundRuleVo"
>
<
template
v-if=
"items.productRefundRuleVo"
>
<text
v-if=
"items.productRefundRuleVo.refundType == 0"
>
不可退
</text>
<text
v-if=
"items.productRefundRuleVo.refundType == 0"
>
不可退
</text>
<text
v-if=
"items.productRefundRuleVo.refundType == 1"
>
有条件退
</text>
<text
v-if=
"items.productRefundRuleVo.refundType == 1"
>
有条件退
</text>
...
@@ -188,6 +188,14 @@
...
@@ -188,6 +188,14 @@
</view>
</view>
</view>
</view>
</u-popup>
</u-popup>
<!-- 自定义导航栏 -->
<view
class=
"tabbar"
:style=
"{height:topHeight+'px',opacity:tabbarOpacity}"
>
<view
class=
"tabbar-title"
>
<u-icon
name=
"arrow-left"
color=
"#333333"
size=
"48"
></u-icon>
<text>
选择产品
</text>
<text></text>
</view>
</view>
</view>
</view>
</template>
</template>
...
@@ -207,7 +215,6 @@ export default {
...
@@ -207,7 +215,6 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
merchantTitle
:
''
,
//商家标题
currentMerchant
:
''
,
//当前入口商家信息
currentMerchant
:
''
,
//当前入口商家信息
showTip
:
false
,
//系统调不通或者崩了跳出弹窗
showTip
:
false
,
//系统调不通或者崩了跳出弹窗
detailData
:
''
,
//详情数据
detailData
:
''
,
//详情数据
...
@@ -228,14 +235,17 @@ export default {
...
@@ -228,14 +235,17 @@ export default {
merchantIndex
:
0
,
//选中的商家下标
merchantIndex
:
0
,
//选中的商家下标
middleHeight
:
0
,
//中间列表盒子高度
middleHeight
:
0
,
//中间列表盒子高度
heightArr
:[],
//元素高度数组
heightArr
:[],
//元素高度数组
scrollHeight
:
0
,
//中间盒子滚动时的高度
originHeight
:
0
,
//中间盒子原本高度
middleTopStyle
:
''
,
//中间盒子上部分样式
middleTopStyle
:
''
,
//中间盒子上部分样式
middleBottomStyle
:
''
,
//中间盒子下部分样式
middleBottomStyle
:
''
,
//中间盒子下部分样式
toViewRight
:
''
,
//右边滚动到某个元素
toViewRight
:
''
,
//右边滚动到某个元素
toViewLeft
:
''
,
//左边滚动到某个元素
toViewLeft
:
''
,
//左边滚动到某个元素
toViewFull
:
''
,
//全屏滚动到某个元素
toViewFull
:
''
,
//全屏滚动到某个元素
showTransition
:
true
,
//控制动画显示隐藏
showTransition
:
true
,
//控制动画显示隐藏
scrollHeight
:
0
,
//中间盒子滚动时的高度
originHeight
:
0
,
//中间盒子原本高度
middleTopHeight
:
0
,
//中间盒子上部分高度
topHeight
:
0
,
//上面状态栏+上面导航栏总高度
tabbarOpacity
:
0
,
//导航栏透明度
}
}
},
},
watch
:
{
watch
:
{
...
@@ -295,21 +305,24 @@ export default {
...
@@ -295,21 +305,24 @@ export default {
}
}
},
},
onLoad
(
option
)
{
onLoad
(
option
)
{
//如果是索道
if
(
this
.
merchantId
==
'z0015605022691a5945bbe463141668c'
){
this
.
showSuodaoImg
=
true
setTimeout
(()
=>
{
this
.
showSuodaoImg
=
false
},
2500
)
}
//获取公司Id,保存到本地,支付等逻辑需要入口companyId
//获取公司Id,保存到本地,支付等逻辑需要入口companyId
this
.
companyId
=
this
.
$commonjs
.
getCompanyId
(
option
)
||
''
this
.
companyId
=
this
.
$commonjs
.
getCompanyId
(
option
)
||
''
this
.
merchantId
=
this
.
$commonjs
.
getKey
(
option
,
'merchantId'
)
||
''
this
.
merchantId
=
this
.
$commonjs
.
getKey
(
option
,
'merchantId'
)
||
''
this
.
channelId
=
this
.
$commonjs
.
getKey
(
option
,
'channelId'
)
||
''
this
.
channelId
=
this
.
$commonjs
.
getKey
(
option
,
'channelId'
)
||
''
this
.
groupId
=
this
.
$commonjs
.
getKey
(
option
,
'groupId'
)
||
''
this
.
groupId
=
this
.
$commonjs
.
getKey
(
option
,
'groupId'
)
||
''
this
.
groupChannelId
=
this
.
$commonjs
.
getKey
(
option
,
'groupChannelId'
)
||
''
this
.
groupChannelId
=
this
.
$commonjs
.
getKey
(
option
,
'groupChannelId'
)
||
''
let
statusBarHeight
=
uni
.
getSystemInfoSync
().
statusBarHeight
// 状态栏高度
let
capsule
=
uni
.
getMenuButtonBoundingClientRect
()
// 胶囊大小、位置数据
this
.
topHeight
=
statusBarHeight
+
(
capsule
.
top
-
statusBarHeight
)
*
2
+
capsule
.
height
//整个上部分总高度
},
},
onShow
()
{
onShow
()
{
//如果是索道
if
(
this
.
merchantId
==
'z0015605022691a5945bbe463141668c'
){
this
.
showSuodaoImg
=
true
setTimeout
(()
=>
{
this
.
showSuodaoImg
=
false
},
2500
)
}
//清空之前选中的数据以及状态
//清空之前选中的数据以及状态
this
.
detailData
=
''
this
.
detailData
=
''
this
.
chooseProduct
=
[]
this
.
chooseProduct
=
[]
...
@@ -394,7 +407,6 @@ export default {
...
@@ -394,7 +407,6 @@ export default {
item
.
productListCopy
=
item
.
productList
item
.
productListCopy
=
item
.
productList
//获取当前商家信息
//获取当前商家信息
this
.
currentMerchant
=
item
this
.
currentMerchant
=
item
this
.
merchantTitle
=
item
.
name
}
else
{
}
else
{
// item.productListCopy = item.productList.slice(0, 2)不要更多,暂时注释
// item.productListCopy = item.productList.slice(0, 2)不要更多,暂时注释
item
.
productListCopy
=
item
.
productList
item
.
productListCopy
=
item
.
productList
...
@@ -426,11 +438,13 @@ export default {
...
@@ -426,11 +438,13 @@ export default {
this
.
heightArr
=
[]
this
.
heightArr
=
[]
uni
.
getSystemInfo
({
uni
.
getSystemInfo
({
complete
:(
info
)
=>
{
complete
:(
info
)
=>
{
let
windowHeight
=
info
.
windowHeight
||
753
let
windowHeight
=
info
.
windowHeight
||
844
//获取中间盒子需要滚动时的高度
//获取中间盒子需要滚动时的高度
uni
.
createSelectorQuery
().
in
(
this
).
select
(
'.middle-top'
).
boundingClientRect
(
data
=>
{
uni
.
createSelectorQuery
().
in
(
this
).
select
(
'.middle-top'
).
boundingClientRect
(
data
=>
{
if
(
data
){
if
(
data
){
this
.
scrollHeight
=
windowHeight
-
data
.
height
//40为middle的top-20值,还有middle-bottom盒子距离顶部的距离20
this
.
middleTopHeight
=
data
.
height
this
.
scrollHeight
=
windowHeight
-
data
.
height
-
40
}
}
}).
exec
()
}).
exec
()
//获取中间盒子原本高度
//获取中间盒子原本高度
...
@@ -438,7 +452,7 @@ export default {
...
@@ -438,7 +452,7 @@ export default {
//获取中间盒子原本高度,默认中间盒子等于原本高度,滚动之后等于滚动高度
//获取中间盒子原本高度,默认中间盒子等于原本高度,滚动之后等于滚动高度
if
(
data
){
if
(
data
){
this
.
originHeight
=
data
.
height
this
.
originHeight
=
data
.
height
this
.
middleHeight
=
this
.
originH
eight
this
.
middleHeight
=
data
.
h
eight
}
}
}).
exec
()
}).
exec
()
...
@@ -541,25 +555,18 @@ export default {
...
@@ -541,25 +555,18 @@ export default {
scrollFull
(
e
){
scrollFull
(
e
){
setTimeout
(()
=>
{
setTimeout
(()
=>
{
let
height
=
0
let
height
=
0
let
scrollTop
=
e
.
detail
.
scrollTop
uni
.
createSelectorQuery
().
in
(
this
).
select
(
'.banner'
).
boundingClientRect
(
data
=>
{
uni
.
createSelectorQuery
().
in
(
this
).
select
(
'.banner'
).
boundingClientRect
(
data
=>
{
if
(
data
){
if
(
data
){
//20=中间盒子top:-20的值
//middleTopHeight中间盒子上部分高度,topHeight为顶部导航栏和状态栏高度和,20为中间盒子的top-20
// height=data.height-70
height
=
data
.
height
+
this
.
middleTopHeight
-
this
.
topHeight
-
20
height
=
data
.
height
-
20
this
.
tabbarOpacity
=
scrollTop
/
(
data
.
height
-
this
.
topHeight
)
if
(
e
.
detail
.
scrollTop
>=
height
){
if
(
scrollTop
>=
height
){
//中间上部分固定,中间下部分可滚动,全屏不滚动
//中间上部分固定,中间下部分可滚动,全屏不滚动
this
.
middleTopStyle
=
'top:0;position:fixed;'
this
.
middleBottomStyle
=
'margin-top:50px;'
this
.
middleHeight
=
this
.
scrollHeight
this
.
middleHeight
=
this
.
scrollHeight
this
.
showTransition
=
false
this
.
merchantTitle
=
'组合购买更省钱'
}
else
{
}
else
{
//中间上部分不固定,中间下部分不可滚动,全屏滚动
//中间上部分不固定,中间下部分不可滚动,全屏滚动'
this
.
middleTopStyle
=
'position:relative;'
this
.
middleBottomStyle
=
'margin-top:0;'
this
.
middleHeight
=
this
.
originHeight
this
.
middleHeight
=
this
.
originHeight
this
.
showTransition
=
true
this
.
merchantTitle
=
this
.
scenicList
[
0
].
name
}
}
}
}
}).
exec
()
}).
exec
()
...
@@ -838,6 +845,8 @@ export default {
...
@@ -838,6 +845,8 @@ export default {
//中间下部分
//中间下部分
.middle-bottom
{
.middle-bottom
{
display
:
flex
;
display
:
flex
;
background
:
#f7f7f7
;
z-index
:
1
;
}
}
.scroll-left
{
.scroll-left
{
width
:
130rpx
;
width
:
130rpx
;
...
@@ -1078,4 +1087,23 @@ export default {
...
@@ -1078,4 +1087,23 @@ export default {
left
:
0
;
left
:
0
;
top
:
0
;
top
:
0
;
}
}
.tabbar
{
background
:
#fff
;
position
:
fixed
;
top
:
0
;
width
:
100%
;
opacity
:
0
;
}
.tabbar-title
{
position
:
absolute
;
bottom
:
10px
;
text-align
:
center
;
display
:
flex
;
width
:
100%
;
font-size
:
32rpx
;
font-weight
:
500
;
color
:
#000000
;
padding
:
0
24rpx
;
justify-content
:
space-between
;
}
</
style
>
</
style
>
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