Commit 70ced662 authored by 潘永坪's avatar 潘永坪

组合票优化

parent 479829b5
...@@ -331,9 +331,15 @@ export default { ...@@ -331,9 +331,15 @@ export default {
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.getWindowInfo().statusBarHeight // 状态栏高度 let statusBarHeight = uni.getWindowInfo().statusBarHeight||0 // 状态栏高度
let capsule = uni.getMenuButtonBoundingClientRect() // 胶囊大小、位置数据 let capsule = uni.getMenuButtonBoundingClientRect() // 胶囊大小、位置数据
this.topHeight =statusBarHeight+(capsule.top - statusBarHeight) * 2 + capsule.height//整个上部分总高度 if(capsule){
//防止部分手机获取不到胶囊信息时,出现页面抖动bug,加上该逻辑
this.topHeight =statusBarHeight+(capsule.top - statusBarHeight) * 2 + capsule.height//整个上部分总高度
}else{
this.topHeight=statusBarHeight
}
}, },
onShow() { onShow() {
//清空之前选中的数据以及状态 //清空之前选中的数据以及状态
...@@ -504,7 +510,7 @@ export default { ...@@ -504,7 +510,7 @@ export default {
// #endif // #endif
// #ifdef MP-ALIPAY // #ifdef MP-ALIPAY
uni.createSelectorQuery().select('.middle-right').boundingClientRect(data => { uni.createSelectorQuery().select('.middle-right').boundingClientRect(data =>{
//获取右边盒子原本高度,默认右边盒子等于原本高度,滚动之后等于滚动高度 //获取右边盒子原本高度,默认右边盒子等于原本高度,滚动之后等于滚动高度
if(data){ if(data){
this.originHeight=data.height this.originHeight=data.height
...@@ -542,7 +548,7 @@ export default { ...@@ -542,7 +548,7 @@ export default {
}).exec() }).exec()
// #endif // #endif
} }
let windowHeight=uni.getWindowInfo().screenHeight||1000 let windowHeight=uni.getWindowInfo().screenHeight||1100
//60为底部高度 //60为底部高度
this.scrollHeight=windowHeight-60-this.topHeight this.scrollHeight=windowHeight-60-this.topHeight
}) })
...@@ -628,34 +634,37 @@ export default { ...@@ -628,34 +634,37 @@ export default {
//---全屏滚动 //---全屏滚动
scrollFull(e){ scrollFull(e){
setTimeout(()=>{ setTimeout(()=>{
let height=0 //由于下面三个值可能在这个这个方法之后生成,故加上这个判断条件
let scrollTop=e.detail.scrollTop if(this.middleTopHeight&&this.scrollHeight&&this.originHeight){
let selectFun=(data)=>{ let height=0
if(data){ let scrollTop=e.detail.scrollTop
//10为中间盒子的top-10 let selectFun=(data)=>{
height=data.height+this.middleTopHeight-10-this.topHeight if(data){
let opacity=scrollTop/(data.height) //10为中间盒子的top-10
this.tabbarOpacity=parseFloat(opacity.toFixed(2)) height=data.height+this.middleTopHeight-10-this.topHeight
//下面值取整数,防止部分手机取值太多小数,出现抖动的bug let opacity=scrollTop/(data.height)
if(parseInt(scrollTop)>=parseInt(height)){ this.tabbarOpacity=parseFloat(opacity.toFixed(2))
//中间上部分固定,中间下部分可滚动,全屏不滚动 //下面值取整数,防止部分手机取值太多小数,出现抖动的bug
this.rightHeight=this.scrollHeight if(parseInt(scrollTop)>=parseInt(height)){
}else{ //中间上部分固定,中间下部分可滚动,全屏不滚动
//中间上部分不固定,中间下部分不可滚动,全屏滚动' this.rightHeight=this.scrollHeight
this.rightHeight=this.originHeight }else{
//中间上部分不固定,中间下部分不可滚动,全屏滚动'
this.rightHeight=this.originHeight
}
} }
} }
// #ifdef MP-WEIXIN
uni.createSelectorQuery().in(this).select('.banner').boundingClientRect(data => {
selectFun(data)
}).exec()
// #endif
// #ifdef MP-ALIPAY
uni.createSelectorQuery().select('.banner').boundingClientRect(data => {
selectFun(data)
}).exec()
// #endif
} }
// #ifdef MP-WEIXIN
uni.createSelectorQuery().in(this).select('.banner').boundingClientRect(data => {
selectFun(data)
}).exec()
// #endif
// #ifdef MP-ALIPAY
uni.createSelectorQuery().select('.banner').boundingClientRect(data => {
selectFun(data)
}).exec()
// #endif
},10) },10)
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment