<template>
  <view class="mygarage">
    <view class="carinfo">
      <img :src="picurl" alt class="caricon" />
      <view class="carinfodetail">
        <view class="carname">{{carname}}</view>
        <view class="desc">{{cardesc}}</view>
      </view>
    </view>
    <view class="btns">
      <view class="btn" v-if="isdefault" >
        <img src="../../static/img/bingo.png" alt class="default" />
        <text class="mr">已设为默认</text>
      </view>
      <view class="del" v-else @click="mr(carid)">设为默认</view>
      <view class="del" @click="del(carid)">删除</view>
    </view>
  </view>
</template>
<script>
export default {
  name: "mygarageList",
  props:{
    isdefault:{
      type:Boolean
    },
    picurl:{
      type:String
    },
    carname:{
      type:String
    },
    cardesc:{
      type:String
    },
    carid:{
      type:Number
    }
  },
  methods:{
    mr(e){
      console.log(74500000)
      this.$emit('mr',e)
    },
    del(e){
      this.$emit('del',e)
    }
  }
};
// isdefault: true  已设为默认    isdefault: false或不填  设为默认
// picurl 车库页面商品图片  carname 车名  cardesc  车库页面的商品介绍
</script>
<style lang="scss" scoped>
.mygarage {
  height: 295upx;
  background-color:white;
  .carinfo {
    height: 199upx;
    display: flex;
    border-bottom: 1upx solid #d9d9d9;
    .caricon {
      width: 96upx;
      height: 96upx;
      margin: auto 0;
      margin-left: 55upx;
    }
    .carinfodetail {
      // width: 276upx;
      height: 95upx;
      font-size: 26upx;
      color: #3c3a3c;
      margin-top: 51upx;
      border-left: 1upx solid #d9d9d9;
      margin-left: 56upx;
      text-indent: 32upx;
      .carname {
        margin-top: 16upx;
      }
      .desc {
        color: #999999;
        font-size: 22upx;
      }
    }
  }
  .btns {
    height: 94upx;
    display: flex;
    justify-content: space-around;
    .btn {
      width: 203upx;
      height: 54upx;
      border: 2upx solid #df3348;
      margin: auto 0;
      .default {
        width: 27upx;
        height: 25upx;
        margin-left: 18upx;
      }
      .mr {
        font-size: 25upx;
        color: #df3348;
        margin-left: 8upx;
        line-height: 54upx;
      }
    }
    .del {
      width: 203upx;
      height: 54upx;
      border: 2upx solid #df3348;
      margin: auto 0;
      font-size: 25upx;
      color: #df3348;
      text-align: center;
      line-height: 54upx;
    }
  }
}
</style>