<!--pages/order/order.wxml-->
<view class='page-order'>
	<view class="swiper-tab">
		<view
		 class="swiper-tab-item {{currentIndex == item.type ? 'active' : ''}}"
		 wx:for="{{swiperItem}}"
		 wx:key="{{index}}"
		 bindtap="switchTab"
		 data-type="{{item.type}}"
		 data-status="{{item.status}}"
		>
			{{item.name}}
		</view>
	</view>
	<view class="order-content" wx:if="{{orderList.length}}">
		<block
		 wx:for="{{orderList}}"
		 wx:for-item="item"
		 wx:for-index="k"
		 wx:key="{{k}}"
		>
			<view class="order-list">
				<view class="order-header">
					<view class="order-number">
						<text>订单号</text>
						<text class="number">{{item.id}}</text>
					</view>
					<!--订单状态(C:取消;N:新建,P:已支付;D:已发货;R:已收货)  关闭 取消  新建 待付款  已支付 待发货  已发货 待收货 已完成 已收货 交易关闭 取消-->
					<!--退单状态(C:取消;N:新建;A:已审核;R:已拒绝;R:退货已发;D:退货已收货)-->
					<!-- RJ-退款驳回  R-退货中 N-待审核  A-待寄回  C-退款取消 D-退款成功 退款中 -->
					<view wx:if="{{currentIndex == 5}}">
						<text class="order-status" wx-if="{{item.status == 'C'}}">退款取消</text>
						<text class="order-status" wx-if="{{item.status == 'N'}}">待审核</text>
						<text class="order-status" wx-if="{{item.status == 'A'}}">待寄回</text>
						<text class="order-status" wx-if="{{item.status == 'R'}}">退货中</text>
						<text class="order-status" wx-if="{{item.status == 'RJ'}}">退款驳回</text>
						<text class="order-status" wx-if="{{item.status == 'D'}}">退款成功</text>
					</view>
					<view wx:else>
						<text class="order-status" wx-if="{{item.status == 'C'}}">交易关闭</text>
						<text class="order-status" wx-if="{{item.status == 'N'}}">待付款</text>
						<text class="order-status" wx-if="{{item.status == 'P'}}">待发货</text>
						<text class="order-status" wx-if="{{item.status == 'D'}}">待收货</text>
						<text class="order-status" wx-if="{{item.status == 'R'}}">已完成</text>
					</view>
				</view>
				<!-- 类型 -->
				<view wx:if="{{currentIndex == 5}}">
					<view
					 class="pro-list"
					 data-detail="{{item}}"
					 data-id="{{item.id}}"
					 bindtap="handelDetailRf"
					>
						<scroll-view scroll-x="true">
							<view class="uploadWrap" scroll-x="true">
								<block wx:for='{{item.tradeVO.skuVOList}}' wx:for-item="sub" wx:key="s">
									<view class="upload_Item">
										<image
										 class="upload_Item_img"
										 src="{{sub.mainImgUrl}}"
										 bindtap='goProDetail'
										 data-id='{{sub.goodsId}}'
										/>
									</view>
								</block>
							</view>
						</scroll-view>
					</view>
					<view class="pro-number">
						<text class="total-pro">共{{item.tradeVO.skuCount}}件商品</text>
						<view class="total-price">
							实付
							<text class="price">￥{{item.tradeVO.payAmount}}</text>
						</view>
					</view>
				</view>
				<view wx:else>
					<view
					 class="pro-list"
					 data-detail="{{item}}"
					 data-id="{{item.id}}"
					 bindtap="handelDetail"
					>
						<scroll-view scroll-x="true">
							<view class="uploadWrap" scroll-x="true">
								<block wx:for='{{item.skuVOList}}' wx:for-item="sub" wx:key="s">
									<view class="upload_Item">
										<image
										 class="upload_Item_img"
										 src="{{sub.mainImgUrl}}"
										 bindtap='goProDetail'
										 data-id='{{sub.goodsId}}'
										/>
									</view>
								</block>
							</view>
						</scroll-view>
					</view>
					<view class="pro-number">
						<text class="total-pro">共{{item.skuCount}}件商品</text>
						<view class="total-price">
							实付
							<text class="price">￥{{item.payAmount}}</text>
						</view>
					</view>
				</view>

				<view wx:if="{{currentIndex == 5}}">
					<view class="btn-group">
						<view class="order-status-rf" wx-if="{{item.status == 'C'}}">
							<button class="btn btn-sm btn-default" data-id="{{item.id}}" bindtap="handelCheckRfDetail">查看详情</button>
						</view>
						<view class="order-status-rf" wx-if="{{item.status == 'N'}}">
							<button class="btn btn-sm btn-default" data-id="{{item.id}}" bindtap="handelCheckRfDetail">查看详情</button>
							<button class="btn btn-sm btn-primary btn-outline" data-id="{{item.id}}" bindtap="handelCancelRefund">取消退款</button>
						</view>
						<view class="order-status-rf" wx-if="{{item.status == 'A'}}">
							<button class="btn btn-sm btn-default" data-id="{{item.id}}" bindtap="handelCheckRfDetail">查看详情</button>
							<button class="btn btn-sm btn-default" data-id="{{item.id}}" bindtap="handelCheckRfSend">退货寄回</button>
							<button class="btn btn-sm btn-primary btn-outline" data-id="{{item.id}}" bindtap="handelCancelRefund">取消退款</button>
						</view>
						<view class="order-status-rf" wx-if="{{item.status == 'R'}}">
							<button class="btn btn-sm btn-default" data-id="{{item.id}}" bindtap="handelCheckRfDetail">查看详情</button>
						</view>
						<view class="order-status-rf" wx-if="{{item.status == 'RJ'}}">
							<button class="btn btn-sm btn-default" data-id="{{item.id}}" bindtap="handelCheckRfDetail">查看详情</button>
						</view>
						<view class="order-status-rf" wx-if="{{item.status == 'D'}}">
							<button class="btn btn-sm btn-default" data-id="{{item.id}}" bindtap="handelCheckRfDetail">查看详情</button>
						</view>
					</view>
				</view>
				<view wx:else>
					<view class="btn-group">
						<view class="order-status" wx-if="{{item.status == 'C'}}">
							<button class="btn btn-sm btn-default" data-id="{{item.id}}" bindtap="handelDelOrder">删除订单</button>
						</view>
						<view class="order-status" wx-if="{{item.status == 'N'}}">
							<button class="btn btn-sm btn-primary btn-outline" data-id="{{item.id}}" bindtap="handelToPay">立即支付</button>
						</view>
						<view class="order-status" wx-if="{{item.status == 'P'}}">
							<navigator url="/pages/logistics/logistics?code={{item.logistic.supplierCode}}&logisticsNo={{item.logistic.code}}" hover-class="none">
								<button class="btn btn-sm btn-default" data-id="{{item.id}}">查看物流</button>
							</navigator>
						</view>
						<view class="order-status" wx-if="{{item.status == 'D'}}">
							<navigator url="/pages/logistics/logistics?code={{item.logistic.supplierCode}}&logisticsNo={{item.logistic.code}}" hover-class="none">
								<button class="btn btn-sm btn-default" data-id="{{item.id}}">查看物流</button>
							</navigator>
							<button class="btn btn-sm btn-primary btn-outline" data-id="{{item.id}}" bindtap="handelConfirmReceipt">确认收货</button>
						</view>
						<view class="order-status" wx-if="{{item.status == 'R'}}" />
						<!--<button class="btn btn-sm btn-primary btn-outline ">再来一单</button>-->
					</view>
				</view>
			</view>
		</block>
		<view class="no-bottom">
			<no-more wx:if="{{noMoreFlag}}" />
		</view>
	</view>
	<view hidden="{{no_data}}" class="no-list df border_box">
		当前无数据
	</view>
</view>

<!--goHome-->
<go-home/>

