Commit 7c2660d7522fa8ebf47d397af8772c102094bfca

Authored by wangfan
1 parent 246996fe

快速预定

@@ -77,7 +77,7 @@ @@ -77,7 +77,7 @@
77 background-color: #353535; 77 background-color: #353535;
78 } 78 }
79 .hasListModel .line2more{ 79 .hasListModel .line2more{
80 - height: 84rpx; 80 + height: 90rpx;
81 width:140rpx; 81 width:140rpx;
82 vertical-align: middle; 82 vertical-align: middle;
83 overflow: hidden; 83 overflow: hidden;
@@ -86,6 +86,7 @@ Page({ @@ -86,6 +86,7 @@ Page({
86 submitOrder(){ 86 submitOrder(){
87 App.Advance.PlaceOrder({ 87 App.Advance.PlaceOrder({
88 orderid:this.data.order.id||this.data.options.oid, 88 orderid:this.data.order.id||this.data.options.oid,
  89 + rid:this.data.options.rid,
89 identity:this.data.options.identity, 90 identity:this.data.options.identity,
90 }).then(res=>{ 91 }).then(res=>{
91 wx.redirectTo({ 92 wx.redirectTo({
@@ -248,7 +248,41 @@ Page({ @@ -248,7 +248,41 @@ Page({
248 url: util.http_build_query(this.data.options,'./cart') 248 url: util.http_build_query(this.data.options,'./cart')
249 }) 249 })
250 }, 250 },
251 - bindscroll(e){ 251 + getClassNameFlag:true,
  252 + async bindscroll(e){
  253 + if(!this.getClassNameFlag) return;
252 console.log(e); 254 console.log(e);
253 - } 255 + this.getClassNameFlag=false;
  256 + let activeId=await this.getClassName();
  257 + this.getClassNameFlag=true;
  258 + this.setData({
  259 + activeId:activeId,
  260 + })
  261 + },
  262 + getClassName(){
  263 + let that=this;
  264 + return new Promise(function(success,fail){
  265 + let activeId='';
  266 + let activeTop=-100000;
  267 + var query = wx.createSelectorQuery();
  268 + query.selectAll('.list-model-masonry').boundingClientRect()
  269 + query.exec(function (res) {
  270 + for(let i=0;i<res[0].length;i++){
  271 + let x=res[0][i];
  272 + if(x.top<150){
  273 + console.log(x)
  274 + if(x.top>activeTop){
  275 + activeTop=x.top
  276 + activeId=x.id
  277 + }
  278 + }
  279 + }
  280 + console.log('class_name-activeId',activeId,activeTop);
  281 + if(activeId==that.data.cookbooklist[0].id && activeTop<150){
  282 + activeId='';
  283 + }
  284 + success(activeId)
  285 + })
  286 + })
  287 + },
254 }) 288 })
@@ -12,10 +12,10 @@ @@ -12,10 +12,10 @@
12 > 12 >
13 <view style = "padding-left:180rpx;"> 13 <view style = "padding-left:180rpx;">
14 <view class="section" wx:for="{{cookbooklist}}" wx:key="cookbooklist-key"> 14 <view class="section" wx:for="{{cookbooklist}}" wx:key="cookbooklist-key">
15 - <view id="{{'inToView'+item.id}}" class="class_name"> 15 + <view id="{{'inToView'+item.id}}" class="class_name {{activeId==item.id?'class_name-active':''}}">
16 <view class="text">{{item.class_name}}</view> 16 <view class="text">{{item.class_name}}</view>
17 </view> 17 </view>
18 - <view class="list-model-masonry" > 18 + <view class="list-model-masonry" id="{{item.id}}">
19 <view class="list-model-column"> 19 <view class="list-model-column">
20 <block wx:for="{{item.cookbooklist[0]}}" wx:key="{{item.id}}" wx:for-index="itemIndex" > 20 <block wx:for="{{item.cookbooklist[0]}}" wx:key="{{item.id}}" wx:for-index="itemIndex" >
21 <view class="item"> 21 <view class="item">
@@ -234,6 +234,8 @@ @@ -234,6 +234,8 @@
234 height: 120rpx; 234 height: 120rpx;
235 line-height: 120rpx; 235 line-height: 120rpx;
236 position: relative; 236 position: relative;
  237 + width: 100%;
  238 + background-color: #fefefe;
237 } 239 }
238 .class_name .text{ 240 .class_name .text{
239 background-color: #fefefe; 241 background-color: #fefefe;
@@ -251,4 +253,10 @@ @@ -251,4 +253,10 @@
251 width: 100%; 253 width: 100%;
252 height: 2rpx; 254 height: 2rpx;
253 background-color: #F5F5F5; 255 background-color: #F5F5F5;
  256 +}
  257 +.class_name-active{
  258 + position: fixed;
  259 + top:120rpx;
  260 + z-index: 999;
  261 + left:200rpx;
254 } 262 }