Blame view

apps/pages/showorder/components/product-item.vue 1.03 KB
htoooth authored
1
<template>
htoooth authored
2 3
  <div class="product-wrapper" @click="onclick">
      <img class="image-cls" :src="url" alt="" srcset="">
htoooth authored
4 5 6 7 8 9 10 11
      <div class="price">{{price}}</div>
  </div>
</template>

<script>
export default {
  name: 'ProductItem',
  props: {
htoooth authored
12
    pid: {
htoooth authored
13 14
      type: String,
      default() {
htoooth authored
15
        return '1212';
htoooth authored
16 17 18 19 20 21 22 23 24 25 26 27 28 29
      }
    },
    url: {
      type: String,
      default() {
        return '//tvax2.sinaimg.cn/crop.0.0.828.828.50/006IPkwKly8fyhr791kkxj30n00n0q3u.jpg';
      }
    },
    price: {
      type: String,
      default() {
        return '¥121314';
      }
    }
htoooth authored
30 31 32 33 34 35 36
  },
  methods: {
    onclick() {
      console.log('click product')
    }
  },
};
htoooth authored
37 38 39 40 41 42 43 44 45 46
</script>

<style lang="scss" scoped>
.product-wrapper {
  display: inline-block;
  position: relative;
  width: 100px;
  height: 100px;
}
htoooth authored
47 48 49 50 51
.image-cls {
  width: 100px;
  height: 100px;
}
htoooth authored
52 53 54 55 56 57 58 59
.price {
  width: 100%;
  height: 28px;
  line-height: 28px;
  font-size: 20px;
  position: absolute;
  bottom: 0;
  text-align: center;
htoooth authored
60
  background: rgba(0, 0, 0, 0.5);
htoooth authored
61 62 63 64 65
  color: white;
}


</style>