<template>
  <view class="goods">
    <image class="goods-logo" :src="goodsDetail.img" mode="widthFix"></image>
    <view class="goods-info">
      <view class="title">
        {{goodsDetail.name}}
      </view>
      <!-- <view class="sales" v-show="goodsDetail.sales_volume > 0">
        月销：{{goodsDetail.sales_volume}}
      </view> -->
      <view class="price">
        <view class="hot-large">
          <rich-text :nodes="$mUtil.priceBigSmall(goodsDetail.price)"></rich-text>
        </view>
        <view class="small">¥ {{ goodsDetail.original_price }}</view>
      </view>
    </view>
  </view>
</template>

<script>
  export default {
    name: 'shop-goods',
    props: {
      goodsDetail: {
        type: Object,
        default: () => {}
      }
    },
    data() {
      return {

      }
    },
    methods: {

    }
  }
</script>

<style lang="scss" scoped>
  .goods {
    width: 100%;
    display: flex;
    padding-bottom: 20rpx;
    margin-bottom: 25rpx;
    border-bottom: 1rpx solid #e6e6e6;

    .goods-logo {
      width: 132rpx;
      height: 132rpx !important;
      flex-shrink: 0;
      margin-right: 27rpx;
      border-radius: 10rpx;
    }

    .goods-info {
      flex: 1;
      width: 0;
      padding-top: 5rpx;

      .title {
        width: 100%;
        margin-bottom: 16rpx;
        font-size: 28rpx;
        font-family: PingFang SC, PingFang SC-Regular;
        font-weight: 400;
        color: #181818;
        display: -webkit-box;
        text-overflow: ellipsis;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
      }

      .sales {
        margin-bottom: 5rpx;
      }

      .price {
        display: flex;
        align-items: center;

        .hot-large {
          color: #FF6600;
          font-size: 36rpx;
          font-weight: Bold;
          line-height: 24rpx;

          text {
            font-size: 36rpx;
            margin-left: 10rpx;
          }
        }

        .small {
          margin-left: 20rpx;
          font-size: 22rpx;
          font-family: PingFang SC, PingFang SC-Medium;
          font-weight: 500;
          text-decoration: line-through;
          color: #cccccc;
        }
      }
    }
  }
</style>
