import { defineStore } from 'pinia'
import { getCouponList } from '@/api/home'

export const useCouponStore = defineStore('coupon', {
    state: () => ({
        discountVoucherList: [], // 满减券
        couponList: [], // 折扣券
    }),
    actions: {
        async getCouponListByType() {
            const res = await getCouponList()
            this.discountVoucherList = res.discountCoupon || []
            this.couponList = res.equityVoucher || []
        }
    }
})
