<template>
  <view class="list">
    <view class="merchant"
      ><image class="merchant-img" :src="goodsList.image" mode="scaleToFill" />
      <view class="merchant-name">{{ goodsList.merchant_name }}</view>
    </view>
    <view v-for="item in goodsList.goods" :key="item.id" class="detail">
      <image :src="item.sku_item.image" class="detail-img" mode=""></image>
      <view class="detail-right">
        <view class="">
          <text class="toptitle">{{ item.goods_name }}</text>
          <view class="weight">{{ item.sku_item.item }} </view>
        </view>
        <view class="u-flex u-row-between">
          <view class="money">
            <text>¥</text>
            <text style="font-size: 34rpx">{{ item.discount_price }}</text>
          </view>
          <view class="stepping">
            <text>x</text>
            <!-- <u-icon
              name="minus"
              size="12"
              @click="$emit('changeGoodsNum', 'reduce')"
            ></u-icon> -->
            <text>{{ item.goods_num }}</text>
            <!-- <u-icon
              name="plus"
              size="12"
              @click="$emit('changeGoodsNum', 'increase')"
            ></u-icon> -->
          </view>
        </view>
      </view>
    </view>
  </view>
</template>
<script>
export default {
  props: {
    //商品列表
    goodsList: {
      typeof: Array,
      default: () => {
        return [];
      },
    },
    goodsValue: {
      typeof: Number,
      default: 0,
    },
  },
};
</script>
<style scoped lang="scss">
.list {
  margin-top: 20rpx;
  background-color: #fff;
  border-radius: 16rpx;
  padding: 28rpx 26rpx 36rpx 24rpx;
  .merchant {
    display: flex;
    justify-content: flex-start;
    .merchant-img {
      width: 38rpx;
      height: 38rpx;
      margin-right: 16rpx;
    }
    .merchant-name {
      font-size: 30rpx;
      color: #222;
    }
  }
  .detail {
    margin-top: 32rpx;
    display: flex;
    .detail-img {
      width: 184rpx;
      height: 184rpx;
      margin-right: 24rpx;
    }
    .detail-right {
      flex-direction: column;
      justify-content: space-between;
      height: 184rpx;
      display: flex;
      flex: 1;

      .toptitle {
        font-family: PingFangSC, PingFang SC;
        font-size: 28rpx;
        color: #222222;
        width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        -webkit-line-clamp: 1;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        word-break: break-all;
        margin-bottom: 16rpx;
      }
      .weight {
        font-family: PingFangSC, PingFang SC;
        font-size: 24rpx;
        color: rgba(34, 34, 34, 0.6);
        line-height: 34rpx;
      }

      .money {
        font-family: HarmonyOS_Sans_Medium;
        font-size: 24rpx;
        color: #f83224;
        line-height: 38rpx;
        text-align: left;
        font-style: normal;
        // font-weight: 500;
        font-weight: bold;
      }
      .stepping {
        display: flex;
        width: 50rpx;
        height: 40rpx;
        justify-content: space-around;
        align-items: center;
        font-size: 30rpx;
        // border: 2rpx solid rgba(151, 151, 151, 0.4);
        border-radius: 20rpx;
      }
    }
  }
}
</style>
