<template>
  <view class="screen_all flex">
    <FlatList
        @changeData="flatChangeData"
        @fetch="fetch"
        :ref="base_flat_id"
        :emptyText="emptyText"
        background="transparent"
    >
      <!-- 订单 -->
      <view class="order_screen_padding">
        <view
            class="order-item"
            v-for="(item,index) in base_flat_data.data"
            :key="index"
            v-if="!base_flat_remove[item.id]"
            @click="goOrderDetail(item)"
        >
          <view class="row aCenter order-title-model">
            <view class="flex-all-1 row aCenter">
              <image src="/static/images/shop.png" class="order-shop-icon"></image>
              <view class="line-1 order-title-container">{{item.shopName}}</view>
              <text class="iconfont iconfont-more order-more"></text>
            </view>
            <text class="order-info">{{item.statusOrder.label}}</text>
          </view>
          <layout-ui-shop-item
              bindrouter="goOrderDetail"
              v-for="(cItem,cIndex) in item.productList"
              :key="cIndex"
              :item="cItem"
              :number="cItem.number > 0"
              :periods="item.orderDelivery_count"
          ></layout-ui-shop-item>

          <view class="order-shop-refund" v-if="item.statusOrder.status==6">商家审核中</view>
          <view class="order-shop-refund" v-else-if="item.statusOrder.status==7">待发货给商家</view>
          <view class="order-shop-refund" v-else-if="item.statusOrder.status==8">退款成功￥{{item.order_price}}</view>
          <view class="order-shop-refund" v-else-if="item.statusOrder.status==9">退款失败 原因: {{item.refuse_explain || ''}}</view>

          <view  v-if="item.statusOrder.buttonGroup" class="order-button-group">
            <!--       item.button_group   v-if="item.button_group && item.button_group.length > 0"-->
            <layout-button-group
                :buttonGroup="item.statusOrder.buttonGroup"
                @changeStatus="changeStatus"
                @openPayModal="openPayModal"
                :item="item"
                :index="index"
                :page="page"
                :type="type"
            ></layout-button-group>
          </view>

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

</template>

<script>
import FlatList from '@/components/flat-list/src/main.vue';
import layoutButtonGroup from '../layout-button-group/layout-button-group';
import layoutUiShopItem from '../layout-ui-shop-item/main';
import mixins from './mixins';
import props from "./props";
export default {
  name: "layout-order",
  mixins,
  props,
  components:{
    FlatList,
    layoutButtonGroup,
    layoutUiShopItem
  }
}
</script>

<style scoped lang="scss" src="./style.scss">

</style>