<template>
  <div class="gerenzhongxin">
    <Header></Header>
    <div class="bg"></div>
    <div class="info jz d-flex">
      <img src="../assets/photo.png">
      <p class="f_36 c_1B">welcome, 用户名</p>
      <a>量体数据</a>
    </div>
    <div class="jz">
      <a-menu class="menu" v-model="current" mode="horizontal" @click="menuChange">
        <a-menu-item key="mail"> 我的账户 </a-menu-item>
        <a-menu-item key="collect"> 我的收藏 </a-menu-item>
        <a-menu-item key="addr"> 地址管理 </a-menu-item>
        <a-sub-menu>
          <span slot="title" class="submenu-title-wrapper">发票管理<a-icon type="down" /></span>

            <a-menu-item key="invoice:1">
              Option 1
            </a-menu-item>
            <a-menu-item key="invoice:2">
              Option 2
            </a-menu-item>
            <a-menu-item key="invoice:3">
              Option 3
            </a-menu-item>
            <a-menu-item key="invoice:4">
              Option 4
            </a-menu-item>
        </a-sub-menu>
        <a-sub-menu>
          <span slot="title" class="submenu-title-wrapper">全部订单<a-icon type="down" /></span>
            <a-menu-item key="daizhifu">
              待支付
            </a-menu-item>
            <a-menu-item key="daishouhuo">
              待收货
            </a-menu-item>
            <a-menu-item key="yiwancheng">
              已完成
            </a-menu-item>
            <a-menu-item key="tuihuan">
              退换服务
            </a-menu-item>
        </a-sub-menu>

      </a-menu>
      <div class="orderList">
        <div class="item" v-for="(item,index) in allOrders" :key="index">
          <div class="top d-flex">
            <span>订单编号:{{item.orderNum}}</span>
            <span>
              <a class="delete">删除</a>
              <a class="pay" v-if="!item.pay">未支付</a>
              <a class="pay" v-if="item.pay">已支付</a>
            </span>
          </div>
          <div class="bottom d-flex">
            <div class="l">
              <img :src="item.url">
            </div>
            <div class="r">
              <p class="name f_18 c_333">{{item.name}}</p>
              <p class="kuanshi f_16 c_666 d-flex">
                <span>款式:{{item.type}}<span class="line">|</span>尺码:{{item.size}}<span class="line">|</span>数量:{{item.num}}件</span>
                <span  class="f_20 c_333">¥ {{item.price}}</span>
              </p>
              <p><span class="c_666 f_16">主辅料:{{item.material}}</span><span class="c_333 f_14"></span></p>
              <p class="heji d-flex">
                <span class="f_20 c_1B">总计:¥ {{item.total}}</span>
                <span class="f_16 c_333 ">
                  <a class="btn ljzf" v-if="!item.pay">立即支付</a>
                  <router-link to="/shopping/views/order" class="btn ckxq">查看详情</router-link>
                </span>
              </p>
            </div>
          </div>
        </div>
      </div>
    </div>
    <Footer></Footer>
  </div>
</template>
<script>
  import Header from "../components/Header/HeaderView";
  import Footer from "../components/Footer/FooterView"
  export default {
    name: "gerenzhongxin",
    components: { Header,Footer },
    data() {
      return {
        current: ['mail'],
        allOrders:[
          {
            id:1,
            orderNum:'CN172839729',
            pay:false,
            url:require("../assets/cloth001.png"),
            name:'商品名商品名商品名商品名商品',
            type:'衬衫',
            size:'XXL',
            num:2,
            price:2456,
            material:'主料1,辅料2,辅料3,辅料4,辅料5,辅料6',
            total:5912
          },
          {
            id:2,
            orderNum:'CN172839730',
            pay:true,
            url:require("../assets/cloth002.png"),
            name:'商品名商品名商品名商品名商品',
            type:'衬衫',
            size:'XXL',
            num:3,
            price:2456,
            material:'主料1,辅料2,辅料3,辅料4,辅料5,辅料6',
            total:5912
          }
        ],

      };
    },
    methods: {
      callback(key) {
        console.log(key);
      },
      menuChange(key){
        if(key == daizhifu){
          // this.allOrders.forEach()
        }
      }
    },
  };
</script>
<!--<style>-->
<!--  .gerenzhongxin .top .middle .router-link-exact-active.router-link-active {-->
<!--    border-bottom: 2px solid #000;-->
<!--  }-->
<!--</style>-->
<style lang="less" scoped>
  @import '../assets/common.css';
  .bg{
    width: 100%;
    height: 250px;
    background-image: url("../assets/bg05.png");
  }
  .info{
    flex-direction: column;
    align-items: center;
    margin-top: -75px;
    img{
      width: 150px;
      height: 150px;
      margin-bottom: 30px;
    }
    p{
      margin-bottom: 15px;
    }
    a{
      color: #666;
      font-size: 16px;
      margin-bottom: 60px;
    }
  }
  .menu{width: 1114px;margin:0 auto}
  /deep/ .ant-menu{
    display: flex;
    justify-content: space-between;
  }
  .orderList{
    /*margin-top: 60px;*/
    width: 1114px;margin:0 auto;
    padding: 20px;
    .item{
      border-bottom: 1px solid #DADADA;
      padding-top: 30px;
      .top{
        justify-content: space-between;
        color: #333;
        .delete{
          text-decoration: underline;
          color: #1B1B1B;
          margin-right: 20px;
        }
        .pay{
          color: #E53E41;
        }
      }
      .bottom{
        justify-content: space-between;
        .l{
          img{
            width: 230px;
            height: 230px;
          }
        }
        .r{
          min-width: 800px;
          padding-top: 30px;
          .name{
            font-weight: 500;
          }
          .kuanshi{
            justify-content: space-between;
          }
          .line{
            margin-left: 30px;
            margin-right: 30px;
          }
          .heji{
            justify-content: space-between;
            .btn{
              display: inline-block;
              width: 145px;
              height: 40px;
              line-height: 40px;
              text-align: center;
            }
            .ljzf{
              background: #333333;
              color: #fff;
              margin-right: 20px;
              border: 1px solid #333333;

              &:hover{
                background: rgba(0,0,0,0.7);
                /*color: #333;*/
              }
            }
            .ckxq{
              color: #333;
              border: 1px solid #333333;
              &:hover{
                background: #333;
                color: #fff;
              }
            }
          }
        }
      }
    }
  }
</style>