import {
  request
} from '../_utils/request';

/** 优惠券列表 */
export async function fetchCouponList(parm) {
  return new Promise((resolve, reject) => {
    request({
      url: `CustomerCouponApi/getCustomerCouponList`,
      data: parm,
      method: 'GET',
      success: function (res) {
        let data = res.data;
 
        resolve(data);
      },
      fail: function (error) {
        reject(error);
      }
    });
  });
}

/** 优惠券详情 */
export function fetchCouponDetail(id) {
  return new Promise((resolve, reject) => {
    request({
      url: `CustomerCouponApi/getCustomerCouponDetails`,
      data: {CustomerCouponId: id},
      method: 'GET',
      success: function (res) {
        let data = res.data;
 
        resolve(data);
      },
      fail: function (error) {
        reject(error);
      }
    });
  });
}