change UI and add expected waiting time

This commit is contained in:
phyusin
2018-05-02 11:59:35 +06:30
parent 027550121e
commit 7c6d842a31
8 changed files with 145 additions and 116 deletions

View File

@@ -12,7 +12,7 @@ App.checkin = App.cable.subscriptions.create('OrderReservationChannel', {
$.each(order, function(key,value){
var rowCount = key+1;
var date = new Date(value.created_at);
var deliveries = value["delivery"];
var isPM = date.getHours() >= 12;
var isMidday = date.getHours() == 12;
var time = [date.getHours() - (isPM && !isMidday ? 12 : 0),
@@ -20,6 +20,15 @@ App.checkin = App.cable.subscriptions.create('OrderReservationChannel', {
(isPM ? ' PM' : 'AM');
var created_at = date.getFullYear() +'-'+ (date.getMonth() > 10? date.getMonth() : '0' + (date.getMonth() + 1)) +'-'+ date.getDate();
var delivery_type = "";
if(deliveries.delivery_type == "service"){
delivery_type = "DELIVERY";
}else if(deliveries.delivery_type == "pick_up"){
delivery_type = "PICK-UP";
}else{
delivery_type = "DIRECT DELIVERY";
}
row = '<tr class="custom-tr first-'+rowCount+'" style="" data-id="'+value.order_reservation_id+'" data-sr-no="'+rowCount+'">'
+'<td width ="5%" class="align-left">'+rowCount
+'</td>'
@@ -30,7 +39,7 @@ App.checkin = App.cable.subscriptions.create('OrderReservationChannel', {
+'<td width ="20%" class="align-center">'+value.grand_total
+'</td>'
+'<td width ="30%" class="align-center">'
+'<span class="font-10 col-blue">'+ value.status +'</span>'
+'<span class="font-10 col-blue">'+ delivery_type +'</span>'
+'</td>'
+' </tr>'