index.js中
scroll: function(e, res) {
if (e.detail.scrollTop > 1) {
this.setData({
isfixed: true
});
} else {
this.setData({
floorstatus: false
});
}
},
index.xhtml中
<block wx:for="{{currentCity}}" catchtap="cityclick " data-id="{{item.id}}" bindscroll="scroll">
<text >{{item.city_name}}</text>
</block>