import { request } from 'umi';
import { getDataBaseUrl,getStoremanagement } from '@/global_data';

/** 获取优惠卷  sdsa GET /kitchen/api/coupon/couponpgage */
export async function GetGoodsCouponPgage(data) {
  return request(getStoremanagement()+`/api/goodscoupon/getGoodsCouponPgage`, {
    method: 'POST',
    data: data,
    // params: { ...params },
    // ...(options || {}),
  });
}
/** 新增优惠卷 POST /kitchen/api/coupon/addCoupon */

export async function AddGoodsCoupon(data) {
  // http://localhost:7002
  return request(getStoremanagement()+'/api/goodscoupon/addGoodsCoupon', {
    method: 'POST',
    // type:'json',
    data: data,
    // ...(options || {}),
  });
}

/** 删除优惠卷 POST /kitchen/api/coupon/deleteCoupon */

export async function DeleteGoodsCoupon(data) {
  // http://localhost:7002
  return request(getStoremanagement()+'/api/goodscoupon/updateGoodsCouponEnable?Ids='+data, {
    method: 'GET',
    // type:'json',
    //data: data,
    // ...(options || {}),
  });
}

/** 修改优惠卷 POST /kitchen/api/coupon/updateCoupon */

export async function UpdateGoodsCoupon(data) {
  // http://localhost:7002
  return request(getStoremanagement()+'/api/goodscoupon/updateGoodsCoupon', {
    method: 'POST',
    // type:'json',
    data: data,
    // ...(options || {}),
  });
  
}
/** 获取优惠卷类型  sdsa GET //kitchen/api/coupon/coupon-status-or-type/{type} */
export async function GetPaperCouponType() {
    return request(getStoremanagement()+`/api/papercoupon/getPaperCouponType`, {
      method: 'GET',
      //data: null,
      // params: { ...params },
      // ...(options || {}),
    });
  }
  /** 添加优惠卷类型 */
  export async function AddPaperCouponType(data) {
    // http://localhost:7002
    return request(getStoremanagement()+'/api/papercoupon/addPaperCouponType', {
      method: 'POST',
      // type:'json',
      data: data,
      // ...(options || {}),
    });
  }
/** 获取店铺上架商品  */
export async function GetStoreGoods(data) {
  return request(getStoremanagement()+`​​/api/Store/GetStoreGoods`, {
    method: 'POST',
    data: data,
    // params: { ...params },

    // ...(options || {}),
  });
}
/** 获取  */
export async function GetStoreInfoPage(data) {
  return request(getStoremanagement()+`/api/Store/GetStoreList`, {
   method: 'POST',
   data: data,
   // params: { ...params },
   // ...(options || {}),
 });
}
  