Commit b94ca266fdd272c0d5cb3eb18094590f3f99eac0

Authored by vking
1 parent 77b36e67

预订卡片调整

@@ -22,12 +22,12 @@ @@ -22,12 +22,12 @@
22 <view class="left info Medium"> 22 <view class="left info Medium">
23 <view class="label">时间</view> 23 <view class="label">时间</view>
24 <view class="value" wx:if="{{hasOnlineReserve || detail.hasUpdateDate}}"> 24 <view class="value" wx:if="{{hasOnlineReserve || detail.hasUpdateDate}}">
25 - {{util.unixtoTime(detail.ddate,'MM月DD日')}} {{util.reserveTimeSpace(detail.section||detail.ddate_solt)}} 25 + {{util.unixtoTime(detail.ddate,'MM月DD日')}} {{util.reserveTimeSpace(detail.ddate_solt||detail.section)}}
26 </view> 26 </view>
27 <view class="value" wx:else="">{{rdateStr}}</view> 27 <view class="value" wx:else="">{{rdateStr}}</view>
28 </view> 28 </view>
29 <view class="line"></view> 29 <view class="line"></view>
30 - <view class="right info Medium" wx:if="{{hasOnlineReserve}}"> 30 + <view class="right info Medium" wx:if="{{hasOnlineReserve || detail.status==0}}">
31 <view class="label">包间</view> 31 <view class="label">包间</view>
32 <view class="value">{{util.getRoomName(detail.room_demand)}}</view> 32 <view class="value">{{util.getRoomName(detail.room_demand)}}</view>
33 </view> 33 </view>
1 // pages/customer/list.js 1 // pages/customer/list.js
2 import util from '../../utils/util'; 2 import util from '../../utils/util';
3 import App from '../../utils/api'; 3 import App from '../../utils/api';
  4 +import RS from '../../utils/reserveStatus'
4 5
5 const {regeneratorRuntime} = global 6 const {regeneratorRuntime} = global
6 Page({ 7 Page({
@@ -23,7 +24,7 @@ Page({ @@ -23,7 +24,7 @@ Page({
23 * 生命周期函数--监听页面加载 24 * 生命周期函数--监听页面加载
24 */ 25 */
25 onLoad: function (options) { 26 onLoad: function (options) {
26 - 27 + this.selectComponent('#getpos').getPos();
27 }, 28 },
28 29
29 /** 30 /**
@@ -37,7 +38,7 @@ Page({ @@ -37,7 +38,7 @@ Page({
37 * 生命周期函数--监听页面显示 38 * 生命周期函数--监听页面显示
38 */ 39 */
39 onShow: function () { 40 onShow: function () {
40 - this.selectComponent('#getpos').getPos(); 41 +
41 }, 42 },
42 43
43 /** 44 /**
@@ -82,6 +83,7 @@ Page({ @@ -82,6 +83,7 @@ Page({
82 list.forEach(row => { 83 list.forEach(row => {
83 row.rdateStr = util.unixtoTime(row.ddate, 'MM月DD日 WW HH:II'); 84 row.rdateStr = util.unixtoTime(row.ddate, 'MM月DD日 WW HH:II');
84 row.navigator = row.openid == openid ? 'detail_owner' : 'detail_customer'; 85 row.navigator = row.openid == openid ? 'detail_owner' : 'detail_customer';
  86 + row=RS.reserve(row)
85 dlist.push(row); 87 dlist.push(row);
86 }) 88 })
87 return dlist; 89 return dlist;
@@ -30,6 +30,7 @@ export default { @@ -30,6 +30,7 @@ export default {
30 } 30 }
31 //是否可以修改到店时间 31 //是否可以修改到店时间
32 detail.hasUpdateDate=detail.type==1 && detail.is_set_ddate==0 32 detail.hasUpdateDate=detail.type==1 && detail.is_set_ddate==0
  33 + console.log('detail.hasUpdateDate',detail.hasUpdateDate)
33 detail.getStatusStr=''; 34 detail.getStatusStr='';
34 if(detail.status>=0){ 35 if(detail.status>=0){
35 detail.getStatusStr=status[detail.status]; 36 detail.getStatusStr=status[detail.status];
@@ -53,17 +53,21 @@ function unixtoTime(ns,format="YYYY-MM-DD HH:II:SS") { @@ -53,17 +53,21 @@ function unixtoTime(ns,format="YYYY-MM-DD HH:II:SS") {
53 module.exports = { 53 module.exports = {
54 unixtoTime: unixtoTime, 54 unixtoTime: unixtoTime,
55 reserveTimeSpace:function(enspace){ 55 reserveTimeSpace:function(enspace){
56 - var names=['早餐','午餐','晚餐','夜宵'];  
57 - if(typeof enspace=='string'){  
58 - enspace={morning: 1, noon: 2, night: 3}[enspace] 56 + var names=['','早餐','午餐','晚餐','夜宵'];
  57 + if(enspace>=0 && enspace<=4){
  58 + return names[(enspace*1)]
59 } 59 }
60 - return names[enspace-1]||names[3] 60 + enspace={morning: 1, noon: 2, night: 3}[enspace]
  61 + return names[enspace]||names[4]
61 }, 62 },
62 getRoomName:function(rooms=[]){ 63 getRoomName:function(rooms=[]){
63 if(rooms.length<1) return "" 64 if(rooms.length<1) return ""
64 var name=rooms[0].name 65 var name=rooms[0].name
65 if(rooms.length>1){ 66 if(rooms.length>1){
66 - name+=" 等"+rooms.length+'间' 67 + if(name.length>4){
  68 + name=name.substring(0,4)+'...'
  69 + }
  70 + name+=" 等"+rooms.length+'间'
67 } 71 }
68 return name 72 return name
69 }, 73 },