<template>
  <div class="myOrderDivC" v-if="show">
    <basicPop :pop="pop" @closeClick="closeClick">
      <div class="orderListDivAll">
        <div class="itemTitleDiv">
          <div class="titelDiv">订单编号</div>
          <div class="titelDiv1">订单状态</div>
          <div class="titelDiv1">订单金额</div>
          <div class="titelDiv">下单时间</div>
        </div>
        <div class="orderItemDivAll" v-if="orderList.length > 0">
          <div class="orderItemDiv" v-for="(item, index) in orderList" :key="index">
            <div class="itemDiv1">{{item.orderId}}</div>
            <div class="itemDiv2">
              <span style="color: #ff9900;">{{item.orderStatus}}</span>
              <!-- <span v-if="item.orderStatus == '进行中'" style="color: #23a771;">{{item.orderStatus}}</span> -->
            </div>
            <div class="itemDiv2">￥{{item.orderPrice}}</div>
            <div class="itemDiv1">{{item.orderTime | filterDate}}</div>
          </div>
        </div>
        <div class="orderItemDivAll" v-else>
          <div class="a">
            暂无订单记录哦~
          </div>
        </div>

      </div>
    </basicPop>
  </div>
</template>

<script>
import basicPop from './hdzxtbasicPop.vue';
import apis from '../../../util/apis1.js';
let { getMyOrderRepurchase } = apis;
export default {
  props: [],
  components: {
    basicPop
  },
  data() {
    return {
      pop: {
        title: '我的订单',
        titlepop: ''
      },
      orderList: []
    };
  },
  created() {
    console.log(this.styleDataNew, 'this.styleDataNew');
    this.pop.titlepop = this.styleDataNew.titlepop
      ? this.styleDataNew.titlepop
      : { backgroundImage: 'url(//img10.360buyimg.com/imgzone/jfs/t1/141588/29/18217/44025/5fd571b9Ef55329ec/42dba91b188b9dce.png)' };
    this.pop.leftLineDiv = this.styleDataNew.leftLineDiv;
    this.pop.rightLineDiv = this.styleDataNew.rightLineDiv;

    this.initData();
  },
  methods: {
    initData() {
      getMyOrderRepurchase(responseData => {
        // console.log(responseData, 'responseData');
        this.orderList = responseData.data;
        this.$forceUpdate();
      });
    },
    closeClick() {
      this.submit();
    }
  }
};
</script>

<style lang="scss">
.myOrderDivC {
  .orderListDivAll {
    .itemTitleDiv {
      display: flex;
      color: #303030;
      font-size: 0.22rem;
      justify-content: center;
      align-items: center;
      margin-top: 0.54rem;
      .titelDiv {
        flex: 1;
        display: flex;
        justify-content: center;
        align-items: center;
      }
      .titelDiv1{
        flex: 0.5;
        display: flex;
        justify-content: center;
        align-items: center;
      }
    }
    .orderItemDivAll {
      height: 5.3rem;
      overflow-y: scroll;
      margin-top: 0.42rem;
      .orderItemDiv {
        display: flex;
        .itemDiv1 {
          color: #000000;
          font-size: 0.2rem;
          flex: 1;
          display: flex;
          justify-content: center;
        }
        .itemDiv2 {
          color: #000000;
          font-size: 0.2rem;
          flex: 0.5;
          display: flex;
          justify-content: center;
        }
      }
    }
  }
  .a{
        height: 100%;
    font-size: 0.24rem;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    color: #8c8c8c;
  }
}
</style>
