<!--pages/mine/order/orderlist.wxml-->
<cu-custom isBack="{{true}}" isRelaunch="{{false}}">
    <view slot="content">我的订单</view>
</cu-custom>
<view class="tab">
    <view class="tab-box {{tab == 0 ? 'active':''}}" data-tab="0" bindtap="changeTab">待付款</view>
    <view class="tab-box {{tab == 1 ? 'active':''}}" data-tab="1" bindtap="changeTab">交易中</view>
    <view class="tab-box {{tab == 3 ? 'active':''}}" data-tab="3" bindtap="changeTab">已完成</view>
    <view class="tab-box {{tab == 2 ? 'active':''}}" data-tab="2" bindtap="changeTab">售后/退款</view>
    <view class="tab-box {{tab == 4 ? 'active':''}}" data-tab="" bindtap="changeTab">全部</view>
</view>
<scroll-view scroll-y="true" bindscrolltolower="doLoadMore" style="height:{{contentHeight}}px;margin-top:85rpx;">
    <view class="cu-list menu-avatar" wx:if="{{orderList.length>0}}">
        <view class="cu-item bg-white margin-top-xs" wx:for="{{orderList}}" wx:key="index" data-item="{{item}}"
            bindtap="toDetail">
            <view class="cu-avatar radius lg" style="background-image:url({{imgUrl+item.shopLogo}});"></view>
            <view class="content">
                <view class="text-pink">
                    <text class="text-cut">{{item.shopName}}</text>
                </view>
                <view class="text-gray text-sm flex flex-direction">
                    <text class="text-cut text-gray">下单时间:{{item.gmtCreate}}</text>
                    <view class="flex">
                        <text>订单金额:</text>
                        <text class="text-cut text-red">¥{{item.amountMoney}}</text>
                    </view>
                </view>
            </view>
            <view>
                <image wx:if="{{item.orderStatus==0}}" mode="scaleToFill" src="/images/ic_order_wait_pay.png"
                    style="width:90rpx;height:80rpx">
                </image>
                <image wx:elif="{{item.orderStatus==1}}" src="/images/ic_order_pay.png" mode="scaleToFill"
                    style="width:90rpx;height:80rpx">
                </image>
                <image wx:elif="{{item.orderStatus==2}}" src="/images/ic_order_close.png" mode="scaleToFill"
                    style="width:90rpx;height:80rpx">
                </image>
                <image wx:elif="{{item.orderStatus==3}}" src="/images/ic_order_finish.png" mode="scaleToFill"
                    style="width:90rpx;height:80rpx">
                </image>
            </view>
        </view>
    </view>
    <van-empty description="暂无订单" wx:else />
</scroll-view>