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

组合票优化

parent 479829b5
......@@ -331,9 +331,15 @@ export default {
this.channelId=this.$commonjs.getKey(option,'channelId')||''
this.groupId=this.$commonjs.getKey(option,'groupId')||''
this.groupChannelId=this.$commonjs.getKey(option,'groupChannelId')||''
let statusBarHeight = uni.getWindowInfo().statusBarHeight // 状态栏高度
let statusBarHeight = uni.getWindowInfo().statusBarHeight||0 // 状态栏高度
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() {
//清空之前选中的数据以及状态
......@@ -504,7 +510,7 @@ export default {
// #endif
// #ifdef MP-ALIPAY
uni.createSelectorQuery().select('.middle-right').boundingClientRect(data => {
uni.createSelectorQuery().select('.middle-right').boundingClientRect(data =>{
//获取右边盒子原本高度,默认右边盒子等于原本高度,滚动之后等于滚动高度
if(data){
this.originHeight=data.height
......@@ -542,7 +548,7 @@ export default {
}).exec()
// #endif
}
let windowHeight=uni.getWindowInfo().screenHeight||1000
let windowHeight=uni.getWindowInfo().screenHeight||1100
//60为底部高度
this.scrollHeight=windowHeight-60-this.topHeight
})
......@@ -628,34 +634,37 @@ export default {
//---全屏滚动
scrollFull(e){
setTimeout(()=>{
let height=0
let scrollTop=e.detail.scrollTop
let selectFun=(data)=>{
if(data){
//10为中间盒子的top-10
height=data.height+this.middleTopHeight-10-this.topHeight
let opacity=scrollTop/(data.height)
this.tabbarOpacity=parseFloat(opacity.toFixed(2))
//下面值取整数,防止部分手机取值太多小数,出现抖动的bug
if(parseInt(scrollTop)>=parseInt(height)){
//中间上部分固定,中间下部分可滚动,全屏不滚动
this.rightHeight=this.scrollHeight
}else{
//中间上部分不固定,中间下部分不可滚动,全屏滚动'
this.rightHeight=this.originHeight
//由于下面三个值可能在这个这个方法之后生成,故加上这个判断条件
if(this.middleTopHeight&&this.scrollHeight&&this.originHeight){
let height=0
let scrollTop=e.detail.scrollTop
let selectFun=(data)=>{
if(data){
//10为中间盒子的top-10
height=data.height+this.middleTopHeight-10-this.topHeight
let opacity=scrollTop/(data.height)
this.tabbarOpacity=parseFloat(opacity.toFixed(2))
//下面值取整数,防止部分手机取值太多小数,出现抖动的bug
if(parseInt(scrollTop)>=parseInt(height)){
//中间上部分固定,中间下部分可滚动,全屏不滚动
this.rightHeight=this.scrollHeight
}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)
},
......
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