<template>
	<view class="page__view">

		<navbar title="我的优惠券" leftClick @leftClick="$utils.navigateBack" bgColor="#FFFFFF" />

    <view class="list">
      <view class="list-item" v-for="item in list" :key="item.id">
        <couponCard 
          :data="item" 
          @select="onSelect"
        ></couponCard>
      </view>
    </view>

  </view>
  
</template>

<script>
	import mixinsList from '@/mixins/list.js'

  import couponCard from './couponCard.vue'

  export default {
		mixins: [mixinsList],
    components: {
      couponCard,
    },
    data() {
      return {
				mixinsListApi: 'queryCouponList',
        queryParams: {
          pageNo: 1,
          pageSize: 10,
          status: 0,
        },
        selectedId: null,
      }
    },
    methods: {
      onSelect(id) {
        console.log('onSelect', id)
        this.selectedId = id
      },
      onRadioChange(e) {
        console.log('onRadioChange', e)
      },
    },
  }
</script>

<style scoped lang="scss">
  .page__view {
		width: 100vw;
		min-height: 100vh;
		background: $uni-bg-color;
		position: relative;
  }

  .list {
    padding: 32rpx 40rpx;

    &-item {

      & + & {
        margin-top: 24rpx;
      }

    }
  }

</style>