<!--pages/promotion-order/promotion-order.wxml-->
<view class='container'>
  <view class='pro-order'>
    <view class='title'>
      <!-- (0:待支付 1:待结算 2:已结算 -1:订单失效) -->
      <text bindtap='onStsTap'  data-state="0" class="{{state==0?'on':''}}">全部</text>
      <text bindtap='onStsTap'  data-state="1" class="{{state==1?'on':''}}">未结算</text>
      <text bindtap='onStsTap'  data-state="2" class="{{state==2?'on':''}}">已结算</text>
      <text bindtap='onStsTap'  data-state="-1" class="{{state==-1?'on':''}}">已失效</text>
    </view>

    <!-- 推广订单列表 -->
    <view class='main' >
      <view class='prod-item' wx:for="{{records}}" wx:key="id">
        <view class="order-num">
          <text>订单编号：{{item.orderNumber}}</text>
          <view class='order-state'>
            <text class="order-sts  {{item.status==2?'red':''}}  {{(item.status==1)?'gray':''}}">
              {{item.status==1?'已结算':(item.status==2?'未结算':'')}}</text>
          </view>
        </view>
        <!-- 一个订单单个商品的显示 -->
        <block wx:if="{{item.orderItemDtoList.length===1}}">

          <block wx:for="{{item.orderItemDtoList}}" wx:for-item="prod" wx:key="prodName">
            <view>
              <view class='item-cont' >
                <view class='prod-pic'>
                  <image src='{{prod.pic}}'></image>
                </view>
                <view class='prod-info'>
                  <view class='prodname'>
                    {{prod.prodName}}
                  </view>
                  <view class='prod-info-cont'>{{prod.skuName||''}}</view>
                  <view class='price-nums'>
                    <text class='prodprice'>
                    <text class='symbol'>￥</text>
                    <!-- <text class='big-num'>{{wxs.parsePrice(35)[0]}}</text>
                    <text class='small-num'>.{{wxs.parsePrice(00)[1]}}</text>-->
                    <text class='big-num'>{{wxs.toPrice(prod.price)}}</text>
                    </text>
                    <text class="prodcount">x{{prod.prodCount}}</text>
                  </view>
                </view>
              </view>
            </view>
          </block>
        </block>
        <!-- 一个订单多个商品时的显示 -->
        <block wx:else>
          <view class='item-cont' bindtap='toOrderDetailPage' data-ordernum="{{item.orderNumber}}">
            <scroll-view scroll-x="true" scroll-left='0' scroll-with-animation="false" class="categories">
              <block wx:for="{{item.orderItemDtoList}}" wx:for-item="prod" wx:key='prodName'>
                <view class='prod-pic'>
                  <image src="{{prod.pic}}"></image>
                </view>
              </block>
            </scroll-view>
          </view>
        </block>
        <view class='total-num'>
          <view>
            <text class="prodcount">共1件商品</text>
            <view class='prodprice'>合计：
              <text class='symbol'>￥</text>
              <text class='big-num'>{{wxs.toPrice(item.actualTotal)}}</text>
              <!-- <text class='big-num'>{{wxs.parsePrice(35)[0]}}</text> -->
              <!-- <text class='small-num'>.{{wxs.parsePrice(00)[1]}}</text> -->
            </view>
          </view>
          <view class='prodprice'>佣金：
            <text class='symbol color'>￥</text>
            <!-- <text class='big-num color'>{{wxs.parsePrice(35)[0]}}</text>
            <text class='small-num color'>.{{wxs.parsePrice(00)[1]}}</text> -->
            <text class='big-num color'>{{wxs.toPrice(item.incomeAmount)}}</text>
          </view>

        </view>
      </view>
    </view>

    <view class="empty" wx:if="{{records.length==0}}">{{emptyMsg}}</view>
    <view class="loading" wx:if="{{totalPage>1}}">{{loadingMsg}}</view>


    <!-- end 推广订单列表 -->
  </view>

</view>
<wxs module="wxs" src="../../wxs/number.wxs" />