Showing
6 changed files
with
29 additions
and
9 deletions
| 1 | <!--components/seller-card/seller-card.wxml--> | 1 | <!--components/seller-card/seller-card.wxml--> |
| 2 | +<wxs src="../../utils/util.wxs" module="util" /> | ||
| 2 | <view class="card {{hasOnlineReserve?'online':''}}"> | 3 | <view class="card {{hasOnlineReserve?'online':''}}"> |
| 3 | <formids url="{{hasOnlineReserve?'':('/pages/reserve/detail?id='+seller.id)}}" catchtap=""> | 4 | <formids url="{{hasOnlineReserve?'':('/pages/reserve/detail?id='+seller.id)}}" catchtap=""> |
| 4 | <view class="seller flex-lr"> | 5 | <view class="seller flex-lr"> |
| @@ -20,12 +21,15 @@ | @@ -20,12 +21,15 @@ | ||
| 20 | <view class="context flex-lr"> | 21 | <view class="context flex-lr"> |
| 21 | <view class="left info Medium"> | 22 | <view class="left info Medium"> |
| 22 | <view class="label">时间</view> | 23 | <view class="label">时间</view> |
| 23 | - <view class="value">{{rdateStr}}</view> | 24 | + <view class="value" wx:if="{{hasOnlineReserve || detail.hasUpdateDate}}"> |
| 25 | + {{util.unixtoTime(detail.ddate,'MM月DD日')}} {{util.reserveTimeSpace(detail.section||detail.ddate_solt)}} | ||
| 26 | + </view> | ||
| 27 | + <view class="value" wx:else="">{{rdateStr}}</view> | ||
| 24 | </view> | 28 | </view> |
| 25 | <view class="line"></view> | 29 | <view class="line"></view> |
| 26 | - <view class="right info Medium" wx:if="{{hasOnlineReserve || (detail.type==1 && (detail.status==0 || detail.status==6))}}"> | ||
| 27 | - <view class="label">人数</view> | ||
| 28 | - <view class="value">{{detail.pnum}}人包间</view> | 30 | + <view class="right info Medium" wx:if="{{hasOnlineReserve}}"> |
| 31 | + <view class="label">包间</view> | ||
| 32 | + <view class="value">{{util.getRoomName(detail.selectroom)}}</view> | ||
| 29 | </view> | 33 | </view> |
| 30 | <view class="right info Medium" wx:else=""> | 34 | <view class="right info Medium" wx:else=""> |
| 31 | <view class="label">包间{{detail.tables.length>1?(" ("+detail.tables.length+"个)"):""}}</view> | 35 | <view class="label">包间{{detail.tables.length>1?(" ("+detail.tables.length+"个)"):""}}</view> |
| @@ -24,6 +24,7 @@ Page({ | @@ -24,6 +24,7 @@ Page({ | ||
| 24 | options:null, | 24 | options:null, |
| 25 | onLoad: function (options) { | 25 | onLoad: function (options) { |
| 26 | console.log(options) | 26 | console.log(options) |
| 27 | + options.selectroom=JSON.parse(decodeURIComponent(options.selectroom)) | ||
| 27 | this.options=options | 28 | this.options=options |
| 28 | this.GetSellerDetail(); | 29 | this.GetSellerDetail(); |
| 29 | App.Customer.GetCustomerInfo().then(res=>{ | 30 | App.Customer.GetCustomerInfo().then(res=>{ |
| @@ -91,10 +92,7 @@ Page({ | @@ -91,10 +92,7 @@ Page({ | ||
| 91 | let seller = res.data | 92 | let seller = res.data |
| 92 | this.setData({ | 93 | this.setData({ |
| 93 | seller: seller, | 94 | seller: seller, |
| 94 | - detail:{ | ||
| 95 | - ddate:options.ddate, | ||
| 96 | - pnum:options.pnum, | ||
| 97 | - } | 95 | + detail:options |
| 98 | }) | 96 | }) |
| 99 | } | 97 | } |
| 100 | }) | 98 | }) |
| @@ -464,7 +464,7 @@ | @@ -464,7 +464,7 @@ | ||
| 464 | "id": 55, | 464 | "id": 55, |
| 465 | "name": "pages/reserve/submit", | 465 | "name": "pages/reserve/submit", |
| 466 | "pathName": "pages/reserve/submit", | 466 | "pathName": "pages/reserve/submit", |
| 467 | - "query": "sid=1&ddate=1234567890&pnum=10", | 467 | + "query": "date=2019-09-28§ion=noon&time=15%3A00&selectroom=%5B%7B%22id%22%3A1%2C%22name%22%3A%226%E4%BA%BA%E9%97%B4%22%2C%22mostpnum%22%3A8%2C%22lastmoney%22%3A3000%2C%22isfull%22%3A0%2C%22selectnum%22%3A2%7D%2C%7B%22id%22%3A1%2C%22name%22%3A%226%E4%BA%BA%E9%97%B4%22%2C%22mostpnum%22%3A8%2C%22lastmoney%22%3A3000%2C%22isfull%22%3A0%2C%22selectnum%22%3A2%7D%5D&sid=1&ddate=1569654000", |
| 468 | "scene": null | 468 | "scene": null |
| 469 | }, | 469 | }, |
| 470 | { | 470 | { |
| @@ -28,6 +28,8 @@ export default { | @@ -28,6 +28,8 @@ export default { | ||
| 28 | detail.hasCancel=detail.status==4; | 28 | detail.hasCancel=detail.status==4; |
| 29 | detail.hasOvered=detail.status!=0 && detail.status!=6; | 29 | detail.hasOvered=detail.status!=0 && detail.status!=6; |
| 30 | } | 30 | } |
| 31 | + //是否可以修改到店时间 | ||
| 32 | + detail.hasUpdateDate=detail.type==1 && detail.is_set_ddate==0 | ||
| 31 | detail.getStatusStr=''; | 33 | detail.getStatusStr=''; |
| 32 | if(detail.status>=0){ | 34 | if(detail.status>=0){ |
| 33 | detail.getStatusStr=status[detail.status]; | 35 | detail.getStatusStr=status[detail.status]; |
| @@ -52,4 +52,19 @@ function unixtoTime(ns,format="YYYY-MM-DD HH:II:SS") { | @@ -52,4 +52,19 @@ function unixtoTime(ns,format="YYYY-MM-DD HH:II:SS") { | ||
| 52 | 52 | ||
| 53 | module.exports = { | 53 | module.exports = { |
| 54 | unixtoTime: unixtoTime, | 54 | unixtoTime: unixtoTime, |
| 55 | + reserveTimeSpace:function(enspace){ | ||
| 56 | + var names=['早餐','午餐','晚餐','夜宵']; | ||
| 57 | + if(typeof enspace=='string'){ | ||
| 58 | + enspace={morning: 0, noon: 1, night: 2}[enspace] | ||
| 59 | + } | ||
| 60 | + return names[enspace]||names[3] | ||
| 61 | + }, | ||
| 62 | + getRoomName:function(rooms=[]){ | ||
| 63 | + if(rooms.length<1) return "" | ||
| 64 | + var name=rooms[0].name | ||
| 65 | + if(rooms.length>1){ | ||
| 66 | + name+=" 等"+rooms.length+'间' | ||
| 67 | + } | ||
| 68 | + return name | ||
| 69 | + }, | ||
| 55 | }; | 70 | }; |
-
Please register or login to post a comment