<template>
  <view class="order-box">
    <view class="order-item" v-for="item in list" :key="item.id" @click="orderDetail(item.id)">
      <view class="item-info">
        <view class="order-num">
          <text class="num">订单号：</text>
          <text class="">{{item.order_code}}</text>
        </view>
        <view class="order-time-price">
          <text class="time">{{item.create_time}}</text>
          <text class="">消费金额：{{item.sales_money}}</text>
        </view>
      </view>
      <view class="iconfont3 item-icon">&#xe65e;</view>
    </view>
  </view>
</template>

<script>
  export default {
    name: 'z-order-list',
    props: {
      list: {
        type: Array,
        default: () => []
      },
      isMine: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {}
    },
    methods: {
      orderDetail(id) {
        uni.navigateTo({
          url: `/pages/workbench/order/detail?orderId=${id}&isMine=${this.isMine}`
        })
      },
    }
  }
</script>

<style lang="scss" scoped>
  .order-item {
    height: 130rpx;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1rpx solid #f2f2f2;

    .item-info {
      font-size: 28rpx;
      font-family: PingFang SC, PingFang SC-Regular;
      font-weight: 400;
      color: #808080;

      .order-num {
        margin-bottom: 10rpx;

        .num {
          color: #1A1A1A;
        }
      }

      .order-time-price {
        font-size: 24rpx;

        .time {
          margin-right: 89rpx;
        }
      }
    }

    .item-icon {
      width: 32rpx;
      height: 32rpx;
      transform: rotate(-90deg);
      flex-shrink: 0;
    }
  }
</style>
