<template>
    <div class="rounded-borders overflow-hidden" v-if="product">
       <div class="row" :style="{'background-color':bgColor}" >
        <q-img :src="product.ImgCover==''?'http://www.oytour.com':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>
            <template v-slot:error>
                <div class="absolute-full flex flex-center bg-grey-3 text-white">
                  暫無圖片
                </div>
              </template>
        </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,{},'blank')">{{ 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>