Commit 26319630a6204652d8ebd281162ce9c64a924d8d

Authored by vking
1 parent c7b4f969

周到安排

@@ -16,6 +16,7 @@ Page({ @@ -16,6 +16,7 @@ Page({
16 data: { 16 data: {
17 list:[], 17 list:[],
18 hasMore:true, 18 hasMore:true,
  19 + activeType:1,
19 }, 20 },
20 21
21 /** 22 /**
@@ -67,6 +68,11 @@ Page({ @@ -67,6 +68,11 @@ Page({
67 rdate:'1234567890-9999999999', 68 rdate:'1234567890-9999999999',
68 sort:1, 69 sort:1,
69 } 70 }
  71 + if(this.data.activeType==1){
  72 + params.status='0,0'
  73 + }else{
  74 + params.status='1,2,3,4,5,6'
  75 + }
70 App.Reserve.GetReserveList(params).then((res)=>{ 76 App.Reserve.GetReserveList(params).then((res)=>{
71 let list = res.data 77 let list = res.data
72 if(list.length>0){ 78 if(list.length>0){
@@ -91,4 +97,27 @@ Page({ @@ -91,4 +97,27 @@ Page({
91 url:url 97 url:url
92 }) 98 })
93 }, 99 },
  100 + switchTab(e){
  101 + let activeType=util.attr(e,'type')
  102 + this.setData({
  103 + activeType:activeType,
  104 + hasMore:true,
  105 + })
  106 + this.list=[]
  107 + this.offset= 1
  108 + this.limit= 10
  109 + this.hasMore=true
  110 + this.pageScrollToTop()
  111 + setTimeout(()=>{
  112 + this.getMembers()
  113 + },300)
  114 + },
  115 + pageScrollToTop: function () {
  116 + wx.createSelectorQuery().select('.pages').boundingClientRect(function (rect) {
  117 + // 使页面滚动到底部
  118 + wx.pageScrollTo({
  119 + scrollTop: rect.top
  120 + })
  121 + }).exec()
  122 + },
94 }) 123 })
1 <!--pack-book/pages/book/b_reserve.wxml--> 1 <!--pack-book/pages/book/b_reserve.wxml-->
2 <wxs src="../../../utils/util.wxs" module="util" /> 2 <wxs src="../../../utils/util.wxs" module="util" />
3 <nav id="nav" backgroundColor="#199095" color="#fefefe">在线预定</nav> 3 <nav id="nav" backgroundColor="#199095" color="#fefefe">在线预定</nav>
  4 +<view class="tabs flex-lr">
  5 + <view class="item {{activeType==1?'active':''}}" bindtap="switchTab" data-type="1">待处理</view>
  6 + <view class="item {{activeType==2?'active':''}}" bindtap="switchTab" data-type="2">已处理</view>
  7 +</view>
4 <view class="pages"> 8 <view class="pages">
5 <block wx:if="{{list.length>0}}"> 9 <block wx:if="{{list.length>0}}">
6 <view class="row" wx:for="{{list}}" wx:key="list.key" data-id="{{item.id}}" bindtap="gotoDetail"> 10 <view class="row" wx:for="{{list}}" wx:key="list.key" data-id="{{item.id}}" bindtap="gotoDetail">
1 /* pack-book/pages/book/b_reserve.wxss */ 1 /* pack-book/pages/book/b_reserve.wxss */
2 .pages{ 2 .pages{
3 width: 90%; 3 width: 90%;
4 - margin: 0 auto 50rpx; 4 + margin: 80rpx auto 50rpx;
5 color: #353535; 5 color: #353535;
6 overflow-y: auto; 6 overflow-y: auto;
7 } 7 }
@@ -11,7 +11,6 @@ @@ -11,7 +11,6 @@
11 padding-top: 34rpx; 11 padding-top: 34rpx;
12 padding-bottom: 34rpx; 12 padding-bottom: 34rpx;
13 } 13 }
14 -  
15 .history-is-empty{ 14 .history-is-empty{
16 margin: 200rpx auto; 15 margin: 200rpx auto;
17 font-size: 34rpx; 16 font-size: 34rpx;
@@ -27,4 +26,31 @@ @@ -27,4 +26,31 @@
27 color: #fefefe; 26 color: #fefefe;
28 border-radius: 10rpx; 27 border-radius: 10rpx;
29 padding: 2rpx 10rpx; 28 padding: 2rpx 10rpx;
  29 +}
  30 +.tabs{
  31 + background-color: #199095;
  32 + margin-top: -2rpx;
  33 + position: fixed;
  34 + width: 100%;
  35 +}
  36 +.tabs .item{
  37 + height: 80rpx;
  38 + line-height: 80rpx;
  39 + text-align: center;
  40 + width: 50%;
  41 + box-sizing: border-box;
  42 + font-weight: bold;
  43 + font-size: 34rpx;
  44 + color: #fefefe;
  45 +}
  46 +.tabs .item:first-child{
  47 + border-radius: 0 8rpx 0 0 ;
  48 +}
  49 +.tabs .item:last-child{
  50 + border-radius: 8rpx 0 0 0 ;
  51 +}
  52 +.tabs .item.active{
  53 + background-color: #fefefe;
  54 + color: #199095;
  55 + width: 75%;
30 } 56 }