Commit 7c2660d7522fa8ebf47d397af8772c102094bfca

Authored by wangfan
1 parent 246996fe

快速预定

... ... @@ -77,7 +77,7 @@
background-color: #353535;
}
.hasListModel .line2more{
height: 84rpx;
height: 90rpx;
width:140rpx;
vertical-align: middle;
overflow: hidden;
... ...
... ... @@ -86,6 +86,7 @@ Page({
submitOrder(){
App.Advance.PlaceOrder({
orderid:this.data.order.id||this.data.options.oid,
rid:this.data.options.rid,
identity:this.data.options.identity,
}).then(res=>{
wx.redirectTo({
... ...
... ... @@ -248,7 +248,41 @@ Page({
url: util.http_build_query(this.data.options,'./cart')
})
},
bindscroll(e){
getClassNameFlag:true,
async bindscroll(e){
if(!this.getClassNameFlag) return;
console.log(e);
}
this.getClassNameFlag=false;
let activeId=await this.getClassName();
this.getClassNameFlag=true;
this.setData({
activeId:activeId,
})
},
getClassName(){
let that=this;
return new Promise(function(success,fail){
let activeId='';
let activeTop=-100000;
var query = wx.createSelectorQuery();
query.selectAll('.list-model-masonry').boundingClientRect()
query.exec(function (res) {
for(let i=0;i<res[0].length;i++){
let x=res[0][i];
if(x.top<150){
console.log(x)
if(x.top>activeTop){
activeTop=x.top
activeId=x.id
}
}
}
console.log('class_name-activeId',activeId,activeTop);
if(activeId==that.data.cookbooklist[0].id && activeTop<150){
activeId='';
}
success(activeId)
})
})
},
})
\ No newline at end of file
... ...
... ... @@ -12,10 +12,10 @@
>
<view style = "padding-left:180rpx;">
<view class="section" wx:for="{{cookbooklist}}" wx:key="cookbooklist-key">
<view id="{{'inToView'+item.id}}" class="class_name">
<view id="{{'inToView'+item.id}}" class="class_name {{activeId==item.id?'class_name-active':''}}">
<view class="text">{{item.class_name}}</view>
</view>
<view class="list-model-masonry" >
<view class="list-model-masonry" id="{{item.id}}">
<view class="list-model-column">
<block wx:for="{{item.cookbooklist[0]}}" wx:key="{{item.id}}" wx:for-index="itemIndex" >
<view class="item">
... ...
... ... @@ -234,6 +234,8 @@
height: 120rpx;
line-height: 120rpx;
position: relative;
width: 100%;
background-color: #fefefe;
}
.class_name .text{
background-color: #fefefe;
... ... @@ -251,4 +253,10 @@
width: 100%;
height: 2rpx;
background-color: #F5F5F5;
}
.class_name-active{
position: fixed;
top:120rpx;
z-index: 999;
left:200rpx;
}
\ No newline at end of file
... ...