<template>
  <div class="goods-simple-content " :style = "{'border-bottom': isLast?'none':''}">
<!--    <div class="goods-company">-->
<!--      <span class="company-name">{{item.company}}</span>-->
<!--      <span class="state-type order-type-tip-cold">{{item.goodsType}}</span>-->
<!--    </div>-->
    <div class="goods-info">
<!--      <van-icon :name="goodsIcon.pill" style="font-size:38px"/>-->
      <img :src="goodsIcon.pill" style="width:40px;height:40px"/>
      <div class="goods-info-text">
        <div class="goods-name">{{ calGoodsName() }}</div>
        <div class="goods-num-price">
          <span class="price-num">¥{{moneyFormat(item.taxPrice)}}</span>
          <span class="pkg-num">订单数量: {{item.packageNum}}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { AmountNumFormat } from '@/utils/common'
export default {
  name: 'goodsSimpleItem',
  data () {
    return {
      goodsIcon: {
        pill: require('@/assets/img/order.png'),
        normal: require('@/assets/img/u90.svg')
      }
    }
  },
  props: {
    item: {
      type: Object,
      default: () => {
        return {
          company: '',
          goodsType: '',
          goodsCode: '',
          goodsId: '',
          goodsName: '',
          goodsSpec: '',
          taxPrice: '',
          packageNum: '',
          manufacturer: ''
        }
      }
    },
    isLast: {
      type: Boolean,
      default: false
    }
  },
  methods: {
    moneyFormat(num) {
      return AmountNumFormat(num)
    },
    calGoodsName() {
      return '【' + this.item.goodsCode + '】' +
        this.item.goodsName +
        '/' + this.item.goodsSpec +
        '/' + this.item.manufacturer
    }
  }
}
</script>

<style lang="scss" scoped>
  .goods-simple-content {
    border-bottom: 1px solid #eeeeee;
    padding:10px 5px;
    //.goods-company {
    //  margin-top:5px;
    //  display: flex;
    //  align-items: center;
    //  .company-name{
    //    font-size: 12px;
    //    font-weight:650;
    //    overflow: hidden;
    //    white-space: nowrap;
    //    text-overflow: ellipsis;
    //    width: 70%;
    //    display: inline-block;
    //  }
    //  .state-type {
    //    display: inline-block;
    //    line-height: 16px;
    //    transform: scale(0.85);
    //    height: 16px;
    //    padding: 0 6px;
    //    margin-left: 15px;
    //  }
    //}
    .goods-info {
      display: flex;
      margin-top: 10px;
      i {
        font-size:30px;
      }
      .goods-info-text {
        margin-left: 10px;
        flex: 1;
        width: 80%;
        .goods-name {
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
        }
        .goods-num-price {
          color:$txtBlack;
          display: flex;
          margin-top: 6px;
          .price-num {
            flex: 1;
            //color:red;
          }
          .pkg-num {
            color:$txtGray9;
            transform: scale(0.9);
          }
        }
      }
    }
  }
</style>
