Authored by 肖亚东

品牌列表a-z位置调整以及点击#无反应修改

... ... @@ -17,7 +17,6 @@ Page({
scrollToView: '',
floatViewTop: 70,
alphanetTop: 120,
showFloatView: false,
brandsList: [],
... ... @@ -93,12 +92,14 @@ Page({
handlerAlphaTap(e) {
let { ap } = e.target.dataset;
let query = '#alphanet' + ap;
if (ap === 'last') {
query = '#last';
}
let pixelRatio = windowWidth/750;
let that = this;
wx.createSelectorQuery().selectAll(query).boundingClientRect(function (res) {
if(res && res[0] && !that.data.showFloatView) {
var floatViewTop = res[0].top / pixelRatio - that.data.alphanetTop - 20;
var floatViewTop = res[0].top / pixelRatio;
that.setData({
scrollToView: ap,
floatViewTop,
... ...
... ... @@ -24,7 +24,7 @@
</scroll-view>
<view class="alphanet-selector" style="top:{{alphanetTop}}rpx;}};" data-id="selector" catchtouchstart="handlerAlphaTap" catchtouchmove="handlerMove">
<view class="alphanet-selector" data-id="selector" catchtouchstart="handlerAlphaTap" catchtouchmove="handlerMove">
<view class="float-view" style="top:{{floatViewTop}}rpx;display:{{showFloatView?'':'none'}};">
<image class="bubble" src="../../static/images/bubble@3x.png">
<view class="float-letter">{{scrollToView}}</view>
... ...
... ... @@ -58,14 +58,13 @@
.alphanet-selector {
position: fixed;
/* bottom: 0px; */
top: 0;
width: 40rpx;
/* height: 728rpx; */
height: 100%;
right: 0;
display: flex;
flex-direction: column;
/* justify-content: center; */
justify-content: center;
align-items: center;
}
... ...