Showing
7 changed files
with
134 additions
and
29 deletions
| @@ -16,7 +16,7 @@ Component({ | @@ -16,7 +16,7 @@ Component({ | ||
| 16 | pi: 0, | 16 | pi: 0, |
| 17 | dot:0, | 17 | dot:0, |
| 18 | hasEditorFlag:false,//添加预订 | 18 | hasEditorFlag:false,//添加预订 |
| 19 | - hasReserveOrder:false,//处理在线预订 | 19 | + hasReserveOrder:true,//运营处理在线预订 |
| 20 | tabsHidden:true, | 20 | tabsHidden:true, |
| 21 | }, | 21 | }, |
| 22 | attached(){ | 22 | attached(){ |
| 1 | // pack-book/pages/book/b_reserve.js | 1 | // pack-book/pages/book/b_reserve.js |
| 2 | +// pages/book/setting/index.js | ||
| 3 | +import util from '../../../utils/util'; | ||
| 4 | +import App from '../../../utils/api'; | ||
| 5 | +const {regeneratorRuntime} = global | ||
| 6 | +import PubSub from '../../../utils/PubSub' | ||
| 7 | +import RS from '../../../utils/reserveStatus' | ||
| 2 | Page({ | 8 | Page({ |
| 3 | - | 9 | + offset: 1, |
| 10 | + limit: 10, | ||
| 11 | + hasMore: true, | ||
| 12 | + list:[], | ||
| 4 | /** | 13 | /** |
| 5 | * 页面的初始数据 | 14 | * 页面的初始数据 |
| 6 | */ | 15 | */ |
| 7 | data: { | 16 | data: { |
| 8 | - | 17 | + list:[], |
| 18 | + hasMore:true, | ||
| 9 | }, | 19 | }, |
| 10 | 20 | ||
| 11 | /** | 21 | /** |
| 12 | * 生命周期函数--监听页面加载 | 22 | * 生命周期函数--监听页面加载 |
| 13 | */ | 23 | */ |
| 24 | + enter_params: {}, | ||
| 14 | onLoad: function (options) { | 25 | onLoad: function (options) { |
| 15 | - | 26 | + this.enter_params = util.cache('enter_params'); |
| 27 | + this.seller_id=options.seller_id||this.enter_params.seller_id; | ||
| 28 | + this.getMembers(); | ||
| 16 | }, | 29 | }, |
| 17 | 30 | ||
| 18 | /** | 31 | /** |
| @@ -35,32 +48,47 @@ Page({ | @@ -35,32 +48,47 @@ Page({ | ||
| 35 | onHide: function () { | 48 | onHide: function () { |
| 36 | 49 | ||
| 37 | }, | 50 | }, |
| 38 | - | ||
| 39 | - /** | ||
| 40 | - * 生命周期函数--监听页面卸载 | ||
| 41 | - */ | ||
| 42 | - onUnload: function () { | 51 | + onUnload(){ |
| 43 | 52 | ||
| 44 | }, | 53 | }, |
| 45 | - | ||
| 46 | - /** | ||
| 47 | - * 页面相关事件处理函数--监听用户下拉动作 | ||
| 48 | - */ | ||
| 49 | - onPullDownRefresh: function () { | ||
| 50 | - | ||
| 51 | - }, | ||
| 52 | - | ||
| 53 | /** | 54 | /** |
| 54 | * 页面上拉触底事件的处理函数 | 55 | * 页面上拉触底事件的处理函数 |
| 55 | */ | 56 | */ |
| 56 | onReachBottom: function () { | 57 | onReachBottom: function () { |
| 57 | - | 58 | + if(this.hasMore){ |
| 59 | + this.getMembers(true); | ||
| 60 | + } | ||
| 61 | + }, | ||
| 62 | + getMembers(hasReachBottom=false){ | ||
| 63 | + let params={ | ||
| 64 | + sid:this.seller_id, | ||
| 65 | + x:this.offset, | ||
| 66 | + y:this.limit, | ||
| 67 | + rdate:'1234567890-9999999999', | ||
| 68 | + sort:1, | ||
| 69 | + } | ||
| 70 | + App.Reserve.GetReserveList(params).then((res)=>{ | ||
| 71 | + let list = res.data | ||
| 72 | + if(list.length>0){ | ||
| 73 | + list.forEach((r,i)=>{ | ||
| 74 | + list[i]=RS.reserve(r) | ||
| 75 | + }) | ||
| 76 | + } | ||
| 77 | + this.list=this.list.concat(list) | ||
| 78 | + let obj={list:this.list}; | ||
| 79 | + if(list.length<this.limit && hasReachBottom){ | ||
| 80 | + this.hasMore=false; | ||
| 81 | + obj.hasMore=false; | ||
| 82 | + }else{ | ||
| 83 | + this.offset++; | ||
| 84 | + } | ||
| 85 | + this.setData(obj) | ||
| 86 | + }).catch(e=>{}) | ||
| 87 | + }, | ||
| 88 | + gotoDetail(e){ | ||
| 89 | + let url='./b_detail?id='+util.attr(e,'id') | ||
| 90 | + return wx.navigateTo({ | ||
| 91 | + url:url | ||
| 92 | + }) | ||
| 58 | }, | 93 | }, |
| 59 | - | ||
| 60 | - /** | ||
| 61 | - * 用户点击右上角分享 | ||
| 62 | - */ | ||
| 63 | - onShareAppMessage: function () { | ||
| 64 | - | ||
| 65 | - } | ||
| 66 | }) | 94 | }) |
| 1 | <!--pack-book/pages/book/b_reserve.wxml--> | 1 | <!--pack-book/pages/book/b_reserve.wxml--> |
| 2 | -<text>pack-book/pages/book/b_reserve.wxml</text> | 2 | +<wxs src="../../../utils/util.wxs" module="util" /> |
| 3 | +<nav id="nav" backgroundColor="#199095" color="#fefefe">在线预定</nav> | ||
| 4 | +<view class="pages"> | ||
| 5 | + <block wx:if="{{list.length>0}}"> | ||
| 6 | + <view class="row" wx:for="{{list}}" wx:key="list.key" data-id="{{item.id}}" bindtap="gotoDetail"> | ||
| 7 | + <view class="flex-ll"> | ||
| 8 | + <view class="label">包间需求:</view> | ||
| 9 | + <view class="content">{{item.room_demand_str||''}}</view> | ||
| 10 | + </view> | ||
| 11 | + <view class="flex-ll"> | ||
| 12 | + <view class="label">就餐时间:</view> | ||
| 13 | + <view class="content">{{util.unixtoTime(item.ddate,'YYYY-MM-DD HH:II')}}</view> | ||
| 14 | + </view> | ||
| 15 | + <view class="flex-lr"> | ||
| 16 | + <view class="flex-ll"> | ||
| 17 | + <view class="label">预订客户:</view> | ||
| 18 | + <view class="content">{{item.rname}}</view> | ||
| 19 | + </view> | ||
| 20 | + <view class="button">立即处理</view> | ||
| 21 | + </view> | ||
| 22 | + </view> | ||
| 23 | + </block> | ||
| 24 | + <view wx:else="" class="history-is-empty flex-vc Medium"> | ||
| 25 | + <image src="http://qn.colorcun.com/custom/lite-yd/image/history-is-empty.png"></image> | ||
| 26 | + <view>暂时还没有客户</view> | ||
| 27 | + </view> | ||
| 28 | + <view wx:if="{{!hasMore}}" class="row flex-vc">已经到底了</view> | ||
| 29 | +</view> |
| 1 | -/* pack-book/pages/book/b_reserve.wxss */ | ||
| 1 | +/* pack-book/pages/book/b_reserve.wxss */ | ||
| 2 | +.pages{ | ||
| 3 | + width: 90%; | ||
| 4 | + margin: 0 auto 50rpx; | ||
| 5 | + color: #353535; | ||
| 6 | + overflow-y: auto; | ||
| 7 | +} | ||
| 8 | +.row{ | ||
| 9 | + font-size: 34rpx; | ||
| 10 | + border-bottom: 2rpx solid #F1F0F4; | ||
| 11 | + padding-top: 34rpx; | ||
| 12 | + padding-bottom: 34rpx; | ||
| 13 | +} | ||
| 14 | + | ||
| 15 | +.history-is-empty{ | ||
| 16 | + margin: 200rpx auto; | ||
| 17 | + font-size: 34rpx; | ||
| 18 | + | ||
| 19 | +} | ||
| 20 | +.history-is-empty image{ | ||
| 21 | + width: 376rpx; | ||
| 22 | + height: 310rpx; | ||
| 23 | + margin-bottom: 122rpx; | ||
| 24 | +} | ||
| 25 | +.button{ | ||
| 26 | + background-color: #199095; | ||
| 27 | + color: #fefefe; | ||
| 28 | + border-radius: 10rpx; | ||
| 29 | + padding: 2rpx 10rpx; | ||
| 30 | +} |
| @@ -220,7 +220,7 @@ | @@ -220,7 +220,7 @@ | ||
| 220 | "id": 21, | 220 | "id": 21, |
| 221 | "name": "预订本-80商家", | 221 | "name": "预订本-80商家", |
| 222 | "pathName": "pack-book/pages/book/b_index", | 222 | "pathName": "pack-book/pages/book/b_index", |
| 223 | - "query": "seller_id=80&seller_openid=oGefL4qKBWIh5xwyg3LVfkMbDumA&manager_id=763&rid=33347", | 223 | + "query": "seller_id=80&seller_openid=oGefL4qKBWIh5xwyg3LVfkMbDumA&manager_id=763&rid=33354", |
| 224 | "scene": 1001 | 224 | "scene": 1001 |
| 225 | }, | 225 | }, |
| 226 | { | 226 | { |
| @@ -501,6 +501,13 @@ | @@ -501,6 +501,13 @@ | ||
| 501 | "pathName": "pack-book/pages/book/b_detail", | 501 | "pathName": "pack-book/pages/book/b_detail", |
| 502 | "query": "id=33284", | 502 | "query": "id=33284", |
| 503 | "scene": null | 503 | "scene": null |
| 504 | + }, | ||
| 505 | + { | ||
| 506 | + "id": -1, | ||
| 507 | + "name": "pack-book/pages/book/b_reserve", | ||
| 508 | + "pathName": "pack-book/pages/book/b_reserve", | ||
| 509 | + "query": "", | ||
| 510 | + "scene": null | ||
| 504 | } | 511 | } |
| 505 | ] | 512 | ] |
| 506 | } | 513 | } |
| @@ -42,6 +42,15 @@ export default { | @@ -42,6 +42,15 @@ export default { | ||
| 42 | return $1+'**'+$3 | 42 | return $1+'**'+$3 |
| 43 | }) | 43 | }) |
| 44 | } | 44 | } |
| 45 | + //room_demand | ||
| 46 | + if(detail.room_demand && typeof detail.room_demand=='string'){ | ||
| 47 | + detail.room_demand=JSON.parse(detail.room_demand) | ||
| 48 | + detail.room_demand_str=detail.room_demand[0].name | ||
| 49 | + let how=detail.room_demand.length | ||
| 50 | + if(how>1){ | ||
| 51 | + detail.room_demand_str+=' 等'+how+'间' | ||
| 52 | + } | ||
| 53 | + } | ||
| 45 | return detail; | 54 | return detail; |
| 46 | }, | 55 | }, |
| 47 | hasRunningFlag(detail){//判断订单正在运行 | 56 | hasRunningFlag(detail){//判断订单正在运行 |
-
Please register or login to post a comment