<template>
	<view class="shop" @tap="goCart">
		<view class="cu-tag badge" v-if="carts.includes(class_attend_id)"></view>
		<text class="cuIcon-cart text-student cart"></text>
	</view>
</template>

<script>
import { mapGetters } from 'vuex'
export default {
  props: {
    class_attend_id: {
      type: Number,
      default: 0
    }
  },
  data() {
    return {
      key: 1212
    }
  },
  computed: {
    ...mapGetters([
      'carts'
    ])
  },
  methods: {
    goCart() {
      this.globalNavigateTo('classCart')
    }
  }
}
</script>

<style lang="scss" scoped>
.shop{
	position:relative;
}
.cart{
	font-size:24px;
}
.cu-tag.badge{
	top:2px;
}
</style>
