<ion-content>
    <div class="cart_wrapper" *ngIf="data">
        <div class="cart_head">
            <div class="nav_header">
                <ion-grid class="no-gutter">
                    <ion-row class="no-gutter">
                        <ion-col class="no-gutter" size="2">
                            <button class="nav_btn nav_back_white floatLeft" (click)="goBack()">
                                <img src="../assets/arrow_white.png" />
                            </button>
                        </ion-col>
                        <ion-col class="no-gutter" size="8">
                            <div class="nav_title floatLeft">
                                <h4></h4>
                            </div>
                        </ion-col>
                        <ion-col class="no-gutter" size="2">
                            <button class="nav_btn floatRight"></button>
                        </ion-col>
                    </ion-row>
                </ion-grid>
            </div>
            <img src="../assets/white_tick.png" />
            <h4>ORDER IS PLACED</h4>
            <p>{{ data.bookDate.seconds * 1000 | date:'MMMM dd, y' }}</p>
        </div>
        <div class="order_status">
            <div class="clear"></div>
            <div class="status_div go_green">
                <h4>{{data.orderCode}}</h4>
                <h6>{{ data.bookDate.seconds * 1000 | date:'MMMM dd, y' }}</h6>
            </div>
            <!-- <div class="status_gap go_green">
            </div>
            <div class="status_div go_green">
                <h4>Retailer Accepted</h4>
                <h6>June 26th 2019, 03:05PM</h6>
            </div>
            <div class="status_gap go_green">
            </div>
            <div class="status_div go_green">
                <div class="floatLeft">
                    <h4>Product Packed</h4>
                    <h6>June 26th 2019, 03:10PM</h6>
                </div>
                <button class="track_btn floatRight" (click)="goToPage('trackorder')">Track Order</button>
                <div class="clear"></div>
            </div>
            <div class="status_gap go_green">
            </div>
            <div class="status_div go_green">
                <h4>Rider is assigned to shop</h4>
                <h6>June 26th 2019, 03:12PM</h6>
            </div>
            <div class="status_gap go_green">
            </div>
            <div class="status_div go_green">
                <h4>Rider has picked up your product and on the way</h4>
                <h6>June 26th 2019, 03:15PM</h6>
            </div>
            <div class="status_gap">
            </div>
            <div class="status_div">
                <h4>Your product is delivered</h4>
            </div> -->
        </div>
        <div class="nearby_shop_list">
            <ul>
                <li *ngFor="let product of data.product; let i = index">
                    <div class="nearby_image">
                        <img [src]="product.image" onerror="this.src='../assets/5bf42c4220000057060294f8@3x.png'" />
                    </div>
                    <div class="nearby_detail">
                        <h5>
                            <span class="floatLeft">{{unEscape(product.prodName)}}</span>
                            <span class="floatRight">0
                                <img src="../assets/Path61_2.png" />
                            </span>
                            <div class="clear"></div>
                        </h5>
                        <p class="prodName"></p>
                    </div>
                    <div class="clear"></div>
                    <div class="product_detail">
                        <h5 *ngIf="data.orderStatus >= 3 || data.orderStatus < 7 && i == 0">
                            Delivery time : <span><b>{{deliveryTime}}</b></span>
                        </h5>
                        <h6>
                            <!-- <span *ngIf="product.color !== 'No-Color'">Product: {{unEscape(product.prodName)}},
                            </span> -->
                            <span *ngIf="product.color !== 'No-Color'">Color: {{product.color}}, </span>
                            <span *ngIf="product.size !== 'Any-Size'">Size: {{product.size}}</span>
                        </h6>
                        <h5>Quantity : <span>{{product.qty}}</span></h5>
                        <h5>
                            Amount : <strong>A$ {{service.formatNumber(product.price)}}</strong>
                        </h5>

                        <h5>Order Status : <span>{{getStatus(data.orderStatus)}}</span></h5>
                    </div>
                </li>
            </ul>
        </div>


        <div class="product_detail">

            <div class="delivery-wrap">
                <h4 class="floatLeft">DELIVERY</h4>
                <span class="floatRight" *ngIf="cancelDelivery > 0 && data.orderStatus != 0 && data.orderStatus != 8"><img
                        class="ng-tns-c3-0" src="../../assets/edit.png" (click)="changeAddress(data.orderId)" /></span>

                <div class="clear"></div>
            </div>

            <h5 *ngIf="data.deliveryAddress">
                {{data.deliveryAddress.addressType}}
                <!-- ,<br />{{data.deliveryAddress.address}} -->,
                <br /> {{data.deliveryAddress.building}}<span *ngIf="data.deliveryAddress.landmark && data.deliveryAddress.landmark!==''"><br />,
                    {{data.deliveryAddress.landmark}}</span>
            </h5>
            <!-- <hr /> -->
        </div>

        <!-- <div class="related_product_slider">
            <h5>
                <span class="floatLeft">Related Products</span><span class="floatRight">MORE</span>
                <div class="clear"></div>
            </h5>
            <ul>
                <ion-slides pager="false" [options]="relatedProd">
                    <ion-slide>
                        <li (click)="goToPage('productdetail')">
                            <div class="product_image">
                                <img src="../assets/model1@3x.png">
                                <div class="fav_icon">
                                </div>
                            </div>
                            <h5>European Style V Neck</h5>
                            <p>AU$99.00</p>
                        </li>
                    </ion-slide>
                    <ion-slide>
                        <li (click)="goToPage('productdetail')">
                            <div class="product_image">
                                <img src="../assets/Recommended-Ball-Gown-Floor-Length-V-Neck-Lace-Organza-Prom-Dress-OD850662@3x.png">
                                <div class="fav_icon">
                                </div>
                            </div>
                            <h5>European Style V Neck</h5>
                            <p>AU$99.00</p>
                        </li>
                    </ion-slide>
                    <ion-slide>
                        <li (click)="goToPage('productdetail')">
                            <div class="product_image">
                                <img src="../assets/51oNoK8JdCL._UY550_@3x.png">
                                <div class="fav_icon">
                                </div>
                            </div>
                            <h5>European Style V Neck</h5>
                            <p>AU$99.00 <span class="offer">-8%</span></p>
                        </li>
                    </ion-slide>
                    <ion-slide>
                        <li (click)="goToPage('productdetail')">
                            <div class="product_image">
                                <img src="../assets/DOGTS033-111-495x660@3x.png">
                                <div class="fav_icon">
                                </div>
                                <div class="featured_badge">Featured</div>
                            </div>
                            <h5>European Style V Neck</h5>
                            <p>AU$99.00<span>AU$110.00</span></p>
                        </li>
                    </ion-slide>
                </ion-slides>
            </ul>
        </div> -->
    </div>
</ion-content>

<ion-footer>
    <div class="footer-btn">
        <button class="cancel_btn" (click)="cancelOrder(data.orderId)" *ngIf="cancelDelivery > 0 && data.orderStatus != 0 && data.orderStatus != 8">
            CANCEL THIS ORDER
        </button>
    </div>
</ion-footer>