<template>
    <!-- <div class="rounded-borders overflow-hidden q-pb-md" :style="{'width':width,'background-color':bgColor}" v-if="product">
      <q-img :src="product.ImgCover" spinner-color="white" :ratio="16/9" fit="cover" />
      <div class="ellipsis-2-lines text-body1 q-ma-md cursor-pointer">{{ product.Title }}{{ product.Title }}{{ product.Title }}{{ product.Title }}{{ product.Title }}</div>
      <div class="text-subtitle2 text-weight-bolder text-dark q-mx-md">
          <span>CNY {{moneyFormat(product.B2CPrice,2)}}</span>
          <span class="f12 q-ml-sm">起</span>
      </div>
    </div> -->
    <div class="rounded-borders overflow-hidden" v-if="product">
       <div class="row" :style="{'background-color':bgColor}" >
        <q-img :src="product.ImgCover" spinner-color="dark" :ratio="4/3" fit="cover" class=" col-5" >
            <div class="absolute-top text-shadow" style="background: linear-gradient(rgba(0, 0, 0, 0.5),rgba(0, 0, 0, 0));">
                {{ formatEnum(product.ProductType) }}
            </div>
        </q-img>
        <div class="q-px-md col">
            <div class="ellipsis-2-lines text-body1 q-ma-md cursor-pointer" style="height:50px;" @click="CommonJump(product,{})">{{ product.Title }}</div>
            <div class="text-subtitle2 text-weight-bolder text-dark q-mx-md">
                <span>CNY {{moneyFormat(product.B2CPrice,2)}}</span>
                <span class="f12 q-ml-sm">起</span>
            </div>
        </div>
       </div>
    </div>
</template>
  
  
  <script>
  import ListProductTypeEnum from 'src/utils/listProductType';
import EnumHelper from '../../utils/enumhelper'
  export default {
      props:{
          product:{
              type:Object,
              required:true
          },
          width:{
              type:String,
              default:"250px"
          },
          bgColor:{
              type:String,
              default:'#fff'
          }
      },
      methods: {
        formatEnum(t){
            let temp = EnumHelper.ParseToEnum(ListProductTypeEnum,t,'value')
            return temp.desc
        }
    },
  }
  </script>
  
  <style>
  
  </style>