import {
  stringify
} from "qs";
import request from "@/utils/request";

// 获取首页 轮播图
export async function getCarouselImgUrlAPI(params) {
  return request("/buyer/banner-settings?search_EQ_isEnable=1", {
    method: "GET",
    body: params,
    description: "获取首页轮播图"
  });
}

// 获取首页 轮播时间间隔
export async function getAutoPlaySpeedAPI(params) {
  return request("/buyer/banner-setting-hs", {
    method: "GET",
    body: params,
    description: "获取首页轮播时间间隔"
  });
}

// 获取首页 四级分类商品
export async function getGoodsLevelDataAPI(params) {
  return request("/buyer/goods-category/tree", {
    method: "GET",
    body: params,
    description: "获取首页四级分类商品"
  });
}

// 获取首页 全部商品
export async function getGoodsCommonDataAPI(params) {
  return request("/b2b/goods/find-allInfo-by-customer", {
    method: "GET",
    body: params,
    description: "获取首页全部商品"
  });
}

// 获取首页 促销
// export async function getGoodsHotDataAPI(params) {
//   return request("/occ-b2b-order/b2b/goods/find-prom-goodslist-by-customerId", {
//     method: "GET",
//     body: params
//   });
// }
// export async function getGoodsHotDataAPI(params) {
//   return request("/buyer/goods/index-promotions", {
//     method: "GET",
//     body: params
//   });
// }
export async function getGoodsHotDataAPI(params) {
  return request("/b2b/goods/find-prom-goodslist-by-customerId", {
    method: "GET",
    body: params,
    description: "获取促销商品",
    dontShowErrMsg: true
  });
}

export async function getGoodsRecentDataAPI(params) {
  return request("/b2b/goods/find-recent-page-goodslist-by-customerId", {
    method: "GET",
    body: params,
    description: "获取最近购买商品",
    dontShowErrMsg: true
  });
}

export async function getGoodsHotPageDataAPI(params) {
  return request("/b2b/goods/find-prom-page-goodslist-by-customerId", {
    method: "GET",
    body: params,
    description: "获取促销商品列表",
    dontShowErrMsg: true
  });
}

// 获取供应商
export async function getSupplierDataAPI(params) {
  return request("/buyer/order-common-info/supplier-list", {
    method: "GET",
    body: params,
    description: "获取供应商"
  });
}

// 获取收货人信息
export async function getAddressDataAPI(params) {
  return request("/buyer/order-common-info/receive-address-list", {
    method: "GET",
    body: params,
    description: "获取收货人信息"
  });
}

// 获取物流方式
export async function getLogisticsDataAPI(params) {
  return request("/buyer/order-common-info/logistics-list", {
    method: "GET",
    body: params,
    description: "获取物流方式"
  });
}

// 获取结算方式
export async function getSettlementDataAPI(params) {
  return request("/buyer/order-common-info/settlement-list", {
    method: "GET",
    body: params,
    description: "获取结算方式"
  });
}

// 获取主表支付方式
export async function getPayforMainDataAPI(params) {
  return request("/buyer/order-common-info/under-paymode-list", {
    method: "GET",
    body: params,
    description: "获取支付方式"
  });
}

// 获取发票信息
export async function getInvoiceInfoDataAPI(params) {
  return request("/buyer/order-common-info/invoice-list", {
    method: "GET",
    body: params,
    description: "获取发票信息"
  });
}

// 获取项目
export async function getProjectDataAPI(params) {
  return request("/occ-base/base/projects", {
    method: "GET",
    body: params,
    description: "获取项目"
  });
}

// 补充BOM信息
export async function fillItemBomInfoAPI(params) {
  return request("/occ-base/base/goods-boms/goods-bom-by-parent-good-id", {
    method: "GET",
    body: params,
    description: "补充BOM信息"
  });
}

// 获取票扣信息
// export async function getCustfeeDataAPI(params) {
//   return request("/order-custfee/list?custmerCode=cc", {
//     method: "GET",
//     body: params
//   });
// }
// 获取订单商品
export async function getOrderCartDataAPI(params) {
  return request("/cart/viewOrderCart?custmerCode=cc", {
    method: "GET",
    body: params,
    description: "获取订单商品"
  });
}

// 暂存订单
export async function saveTempOrderAPI(params) {
  return request("/b2b/req-order/create-temp", {
    method: "POST",
    body: params,
    description: "暂存订单"
  });
}

// 提交订单
export async function sumbtOrderAPI(params) {
  return request("/b2b/req-order/submit-req", {
    method: "POST",
    body: params,
    description: "提交订单"
  });
}

// 订单编辑
export async function orderEditAPI(params) {
  params.type = "edit";
  return request("/b2b/req-order/edit-or-copy", {
    method: "GET",
    body: params,
    description: "订单编辑"
  });
}

// 复制订单
export async function orderEditForCopyAPI(params) {
  params.type = "copy";
  return request("/b2b/req-order/edit-or-copy", {
    method: "GET",
    body: params,
    description: "复制订单"
  });
}
// 匹配账期
export async function getAccountPeriodInfoAPI(params) {
  return request("/occ-settlement/api/settlement/AccountDateSettings/settlement-checkSettings", {
    method: "GET",
    body: params,
    description: "匹配账期"
  });
}
// 基于原单退货
export async function orderReturnForBaseAPI(params) {
  return request("/b2b/req-order/return-from-req", {
    method: "GET",
    body: params,
    description: "基于原单退货"
  });
}

//请求支付方式--支付宝
export async function getOnlinePayalipayAPI(params) {
  return request("/occ-pay/alipay/redirectpaypage", {
    method: "GET",
    body: params,
    description: "打开支付宝支付页面"
  });
}

//请求支付方式--畅捷通
export async function getOnlinePaychanpayAPI(params) {
  return request("/occ-pay/chanpay/redirectpaypage", {
    method: "GET",
    body: params,
    description: "打开畅捷通支付页面"
  });
}

// 获取退货原因
export async function queryAllReturnCauseAPI(params) {
  return request("/b2b/return-causes", {
    method: "GET",
    body: params,
    description: "获取退货原因"
  });
}

// 获取自定义档案
export async function getCustDocDefsByCodeAPI(params) {
  return request("/occ-base/cust-doc-defs/cust_doc_code", {
    method: "GET",
    body: params,
    description: "获取自定义档案"
  });
}

// 获取促销
export async function promotionInfoAPI(params) {
  return request("/b2b/prom/reqorder-prom", {
    method: "POST",
    body: params,
    description: "获取促销"
  });
}

// 设置默认收获地址
export async function setDefaultAddressAPI(params) {
  return request("/buyer/order-common-info/setDefaultAddress", {
    method: "GET",
    body: params,
    description: "设置默认收获地址"
  });
}

// 获取客户可用余额及冲抵比例
export async function occupyMnyTopLimitAPI(params) {
  return request("/b2b/customer-cast/cast-rate", {
    method: "GET",
    body: params,
    description: "获取客户可用余额及冲抵比例"
  });
}

// 信用检测
export async function orderCreditCheckerAPI(params) {
  return request("/b2b/req-order/req-credit-check", {
    method: "POST",
    body: params,
    description: "信用检测"
  });
}

// 信用数据
export async function getCreditDataAPI(params) {
  return request("/occ-cr/api/cr/credit/query", {
    method: "GET",
    body: params,
    description: "信用数据"
  });
}

// 商品分类列表
export async function getGoodsSubSpecsDataAPI(params) {
  return request("/buyer/goods-category/tree", {
    method: "GET",
    body: params,
    description: "商品分类列表"
  });
}

// 获取订单列表的订单状态枚举
export async function getOrderStatusDataAPI(params) {
  return request(
    "/order/enum-data?enumClassName=com.yonyou.enums.OrderStatusEnum", {
      method: "GET",
      body: params,
      description: "获取订单状态"
    }
  );
}

// 获取订单列表
export async function getOrderListDataAPI(params) {
  return request("/b2b/req-order", {
    method: "GET",
    body: params,
    description: "获取订单列表"
  });
}

// 获取退货单列表的订单状态枚举
export async function getReturnOrderStatusDataAPI(params) {
  return request(
    "/order/enum-data?enumClassName=com.yonyou.enums.OrderStatusEnum", {
      method: "GET",
      body: params,
      description: "获取订单状态枚举"
    }
  );
}

// 获取退货单列表
export async function getReturnOrderListDataAPI(params) {
  return request("/b2b/req-order", {
    method: "GET",
    body: params,
    description: "获取退货单列表"
  });
}

// 退货确认
export async function confirmReturnAPI(params) {
  return request("/b2b/req-order/returnConfrim", {
    method: "GET",
    body: params,
    description: "退货确认"
  });
}

export async function getNoticeDataAPI(params) {
  return request("/buyer/notices/queryNoticeSomeInfo", {
    method: "GET",
    body: params,
    description: "获取公告信息"
  });
}

// 首页待办事项
export async function getTodoDadaAPI(params) {
  return request("/b2b/req-order/query-count-groupby-status", {
    method: "GET",
    body: params,
    description: "首页待办事项"
  });
}

// 获取门户设置信息
export async function getPortalConfigAPI(params) {
  return request("/buyer/portalConfig", {
    method: "GET",
    body: params,
    description: "获取门户设置信息"
  });
}

// 添获取商品详情描述
export async function getGoodsDetailAPI(params) {
  return request("/buyer/goods/goods-detail", {
    method: "GET",
    body: params,
    description: "添获取商品详情描述"
  });
}

// 添获取商品详情信息
export async function getGoodsInfoAPI(params) {
  return request("/buyer/goods/goods-info", {
    method: "GET",
    body: params,
    description: "添获取商品详情信息"
  });
}

// 获取商品详情  new
export async function getGoodsDetailNewAPI(params) {
  return request("/occ-b2b-order/b2b/goods/find-by-id", {
    method: "GET",
    body: params,
    description: "获取商品详情"
  });
}

// 获取商品详情规则
export async function getGoodsDetailProductAttrsAPI(params) {
  return request("/occ-b2b-order/b2b/goods/find-attrs-by-product", {
    method: "GET",
    body: params,
    description: "获取商品详情规则"
  });
}

// 获取商品详情规则
export async function getOptByIdAPI(params) {
  return request("/occ-base/base/goods/get-opt-byIdAndGroupId", {
    method: "GET",
    body: params,
    description: "获取商品详情规则"
  });
}

// 获取商品详情-图片
export async function getGoodsDetailImageAPI(params) {
  return request("/occ-b2b-order/b2b/goods/find-goodspicture-by-goodsid", {
    method: "GET",
    body: params,
    description: "获取商品详情-图片"
  });
}

// 添获取商品价格
export async function getGoodsPriceAPI(params) {
  return request("/buyer/goods/goods-price", {
    method: "GET",
    body: params,
    description: "添获取商品价格"
  });
}

// 添获取商品规格
export async function getGoodsSpecsAPI(params) {
  return request("/buyer/goods/goods-specs", {
    method: "GET",
    body: params,
    description: "添获取商品规格"
  });
}

// 添获取选配商品价格
export async function getGoodAndPalettePriceConAPI(params) {
  return request("/occ-price/price/price-inquires/inquireGoodAndPalettePriceCon", {
    method: "GET",
    body: params,
    description: "添获取选配商品价格"
  });
}

// 添获取商品库存
export async function getGoodsStockAPI(params) {
  return request("/buyer/goods/goods-stock", {
    method: "GET",
    body: params,
    description: "添获取商品库存"
  });
}

// 获取商品列表
export async function getGoodsDataAPI(params) {
  return request("/b2b/goods/find-allInfo-by-customer", {
    method: "GET",
    body: params,
    description: "获取商品列表"
  });
}

// 补货
export async function purchaseGoodsAPI(params) {
  return request("/b2b/goods/find-allInfo-by-customer", {
    method: "GET",
    body: params,
    description: "获取商品列表"
  });
}

// 获取订单详情页数据
export async function getOrderDetailDataAPI(params) {
  return request("/b2b/req-order/detail", {
    method: "GET",
    body: params,
    description: "获取订单详情页数据"
  });
}

// 获取公告列表页数据
export async function getAnnouncementDataAPI(params) {
  return request("/buyer/notices/getAll", {
    method: "GET",
    body: params,
    description: "获取公告列表页数据"
  });
}

export async function getAnnouncementClassifyDataAPI(params) {
  return request("/buyer/bulletins", {
    method: "GET",
    body: params,
    description: "获取公告分类"
  });
}

// 根据主键获取发货单明细
export async function getDeliveryDetailAPI(params) {
  return request("/b2b/saleOutOrder/queryBySaleoutId", {
    method: "GET",
    body: params,
    description: "获取发货单明细"
  });
}

// 签收确认
export async function signConfirmAPI(params) {
  const org = params.pkOrgId || "";
  return request(
    `/occ-stock/stock/sale-out-orders/create-sign-info?org=${org}`, {
      method: "POST",
      body: params.saleOutOrderItemInfoDtos,
      description: "签收确认"
    }
  );
}

// 赠品兑付列表
export async function getGoodsSupplyListAPI(params) {
  return request("/occ-fee/customer-casts/queryCastTypeBalanceByGroup", {
    method: "GET",
    body: params,
    description: "获取赠品兑付列表"
  });
}

// 获取供应商列表
export async function getGoodsSupplyDetailAPI(params) {
  return request("/occ-fee/customer-casts/getSaleOrgByCustAndCastType", {
    method: "GET",
    body: params,
    description: "获取供应商列表"
  });
}

// 根据客户费用单类型主键、供货方、商品关键字查询货补商品
export async function getGoodsListAPI(params) {
  return request("/b2b/goods/find-GoodsSupplementRange", {
    method: "GET",
    body: params,
    description: "查询货补商品"
  });
}

// 根据公告ID获取公告详情
export async function getNoticeDetailDataAPI(params) {
  return request("/buyer/notices/findByNoticeId", {
    method: "GET",
    body: params,
    description: "获取公告详情"
  });
}

export async function updateNoticeReadAPI(params) {
  return request("/buyer/notices/isRead", {
    method: "GET",
    body: params,
    description: "设置公告已读"
  });
}

// 获取签收订单列表
export async function getOrderSignDataAPI(params) {
  return request("/b2b/saleOutOrder/page-saleoutorder", {
    method: "GET",
    body: params,
    description: "获取签收订单列表"
  });
}

export async function deleteOrderListAPI(params) {
  return request("/b2b/req-order/delete-req", {
    method: "GET",
    body: params,
    description: "删除订单"
  });
}

// ---------- 购物车 ----------//
// 获取购物车 数量
export async function getCartNumDataAPI(params) {
  return request("/buyer/cart/get-cart-count", {
    method: "GET",
    body: params,
    description: "获取购物车数量"
  });
}

// 添加购物车 数量
export async function addCartAPI(params) {
  return request("/buyer/cart/add-cart", {
    method: "POST",
    body: params,
    description: "加入购物车"
  });
}

// 获取购物车列表
export async function getCartListDataAPI(params) {
  return request("/buyer/cart/check-cart", {
    method: "GET",
    body: params,
    description: "获取购物车"
  });
}

// 清空购物车
export async function emptyCartAPI(params) {
  return request("/buyer/cart/empty-cart", {
    method: "GET",
    body: params,
    description: "清空购物车"
  });
}

// 更新购物车数量
export async function updateCartAPI(params) {
  return request("/buyer/cart/edit-cart", {
    method: "POST",
    body: params,
    description: "更新购物车数量"
  });
}

// 删除购物车列表-单删
export async function deleteCartListDataAPI(params) {
  return request("/buyer/cart/del-cart", {
    method: "GET",
    body: params,
    description: "从购物车中删除"
  });
}

// ---------- 购物车结束 ----------//

// ---------- 公共 ----------//

// 销售组织参照  暂时不用
export async function getOrganizationsAPI(params) {
  return request("/occ-base/organizations", {
    method: "GET",
    body: params,
    description: "获取销售组织参照"
  });
}

// 财务组织
export async function getFinanorgsBySaleorgsAPI(params) {
  return request(
    "/occ-b2b-order/b2b/contrast-saleorg-finanorgs/getFinanorgsBySaleorgs", {
      method: "POST",
      body: params,
      description: "获取财务组织"
    }
  );
}

// 兑付方式/单据状态参照
export async function getCustDocDefsAPI(params) {
  return request("/occ-base/base/cust-doc-defs", {
    method: "GET",
    body: params,
    description: "获取自定义档案"
  });
}

// 费用单类型/单据状态参照
export async function getTranstypesAPI(params) {
  return request("/occ-base/base/trantypes", {
    method: "GET",
    body: params,
    description: "获取交易类型"
  });
}

// 获取供应商列表
export async function getsuppliersAPI(params) {
  return request("/buyer/order-common-info/supplier-list", {
    method: "GET",
    body: params,
    description: "获取供应商列表"
  });
}

// 获取供应商及产品线 1级 (销售组织)
export async function getsuppliersJurisdictionAPI(params) {
  return request(
    "/occ-base/api/base/customer-jurisdiction/find-by-customer-ids", {
      method: "GET",
      body: params,
      description: "获取供应商及产品线"
    }
  );
}

// 获取供应商及产品线 非1级
export async function getsuppliersPsrAPI(params) {
  return request(
    "/occ-base/api/base/customer-psr/find-by-purchase-customer-id", {
      method: "GET",
      body: params,
      description: "获取供应商及产品线"
    }
  );
}

// 获取产品线
export async function getproductLineAPI(params) {
  return request("/occ-base/product-lines", {
    method: "GET",
    body: params,
    description: "获取产品线"
  });
}

// 获取关注商品
export async function getCheckStoreAPI(params) {
  return request("/occ-b2b-buyer/buyer/stores/check-store", {
    method: "GET",
    body: params,
    description: "获取关注商品"
  });
}

// 关注 单条
export async function getAddStoreAPI(params) {
  return request("/occ-b2b-buyer/buyer/stores/add-store", {
    method: "POST",
    body: params,
    description: "添加关注"
  });
}

// 关注 多条
export async function getAddStoresAPI(params) {
  return request("/occ-b2b-buyer/buyer/stores/add-stores", {
    method: "POST",
    body: params,
    description: "添加关注"
  });
}

// 取消关注
export async function getDelStoreAPI(params) {
  return request("/occ-b2b-buyer/buyer/stores/del-store", {
    method: "GET",
    body: params,
    description: "取消关注"
  });
}

// 关注数量
export async function getStoreLengthAPI(params) {
  return request("/occ-b2b-buyer/buyer/stores/get-store-count", {
    method: "GET",
    body: params,
    description: "获取关注数量"
  });
}

// 新增最近浏览
export async function addGoodsBrowseAPI(params) {
  return request("/buyer/viewed-goods/update-view-goods", {
    method: "POST",
    body: params,
    description: "新增最近浏览"
  });
}

// 首页费用余额
export async function castAmountByCustAndDateAPI(params) {
  return request("/occ-fee/customer-casts/castAmountByCustAndDate", {
    method: "GET",
    body: params,
    description: "首页费用余额查询"
  });
}

// ---------- 公共 end----------//
// ---------- 账户中心 ----------//

// 费用/货补余额
export async function getSumCastBalanceAPI(params) {
  return request("/occ-fee/customer-casts/sumCastBalance", {
    method: "GET",
    body: params,
    description: "获取费用/货补余额"
  });
}

// 费用
export async function getCastBalanceAPI(params) {
  return request("/occ-fee/customer-casts", {
    method: "GET",
    body: params,
    description: "费用"
  });
}

// 费用详情
export async function getSumCastFlushdetailAPI(params) {
  return request("/occ-fee/customer-casts/flushdetail", {
    method: "GET",
    body: params,
    description: "获取费用详情"
  });
}

// 客户信息
export async function getCustomersAPI(params) {
  return request(`/occ-base/api/base/customer/${params.customer}`, {
    method: "GET",
    body: params,
    description: "获取客户信息"
  });
}

// 客户信息--联系人
export async function getfindByCustomerContactsAPI(params) {
  return request("/occ-base/base/customer-contacts/findByCustomerId", {
    method: "GET",
    body: params,
    description: "获取客户信息--联系人"
  });
}

// 客户信息--收货地址
export async function getfindByCustomerAddressesAPI(params) {
  return request("/occ-base/base/customer-addresses/findByCustomerId", {
    method: "GET",
    body: params,
    description: "获取客户信息--收货地址"
  });
}

// 客户信息--银行账户
export async function getfindByCustomeraccountsAPI(params) {
  const url = `/occ-base/base/customer-accounts/find-by-customer-id/${params.customerId}`;
  return request(url, {
    method: "GET",
    body: null,
    description: "获取客户信息--银行账户"
  });
}

// 费用对账
export async function getCastAccountAPI(params) {
  return request("/occ-fee/customer-casts/castAccount", {
    method: "GET",
    body: params,
    description: "获取费用对账"
  });
}

// 账户余额
export async function getAccountBalanceAPI(params) {
  return request("/occ-settlement/api/settlement/query-prepaymentbalance", {
    method: "GET",
    body: params,
    description: "获取当前预付余额"
  });
}

// 余额变动
export async function getAccountChangeAPI(params) {
  return request(
    "/occ-settlement/api/settlement/query-detailsofbalancechanges", {
      method: "GET",
      body: params,
      description: "余额变动"
    }
  );
}

// 应付对账
// 应付对账统计页面
export async function getPayStatisticAPI(params) {
  return request(
    "/occ-settlement/api/settlement/portal-accountpayable/query-payableaccountstatistics", {
      method: "GET",
      body: params,
      description: "应付对账统计页面"
    }
  );
}

// 应付对账详情列表
export async function getPayListAPI(params) {
  return request(
    "/occ-settlement/api/settlement/portal-accountpayable/query-payableaccountlist", {
      method: "GET",
      body: params,
      description: "应付对账详情列表"
    }
  );
}

// 付款单登记保存
export async function savePaymentNoticeAPI(params) {
  let method = "POST";
  let url = "/occ-settlement/settlement/billclaims/add";
  if (params && params.id) {
    method = "PUT";
    url = "/occ-settlement/settlement/billclaims/edit-portal";
  }
  return request(url, {
    method: method,
    body: params,
    description: "付款单登记保存"
  });
}

// 获取企业银行账户（收款方账号）
export async function getEnterpriseAccountsAPI(params) {
  return request("/occ-base/base/enterprise-bank-accounts", {
    method: "GET",
    body: params,
    description: "获取收款方账号"
  });
}

export async function getPayBillEnterpriseAccountsAPI(params) {
  return request("/buyer/order-common-info/payeeAccount", {
    method: "GET",
    body: params,
    description: "获取收款方账号"
  });
}

// 获取客户档案账户信息（付款方账号）
export async function getPayAccountDataAPI(params) {
  const url = `/occ-base/base/customer-accounts/find-by-customer-id/${params.customer}`;
  return request(url, {
    method: "GET",
    body: null,
    description: "获取付款方账号"
  });
}

// 获取收付款类型 （收款业务类型）
export async function getBillreceiptTypeDataAPI(params) {
  return request("/occ-settlement/settlement/payment-types", {
    method: "GET",
    body: params,
    description: "获取收付款类型"
  });
}

// 获取付款通知单列表
export async function getPaymentNoticeListDataAPI(params) {
  return request("/occ-settlement/settlement/billclaims", {
    method: "GET",
    body: params,
    description: "付款通知单列表查询"
  });
}

// 根据主键获取认领单信息
export async function getPaymentNoticeByIdAPI(params) {
  return request("/occ-settlement/settlement/billclaims/detailById", {
    method: "GET",
    body: params,
    description: "查询认领单"
  });
}

// 付款通知单操作 提交 or 删除
export async function operationPaymentAPI(params) {
  let url = "/occ-settlement/settlement/billclaims/delete-portal";
  const type = params.type;
  if (type == "submit") {
    url = "/occ-settlement/settlement/billclaims/submit-portal";
  }
  return request(url, {
    method: "GET",
    body: params,
    description: type == "submit" ? "付款通知单提交" : "付款通知单删除"
  });
}

// 商品选配属性
export async function getGoodsOptAPI(params) {
  return request(`/occ-base/api/base/goods/get-opt/${params.id}`, {
    method: "GET",
    description: "商品选配属性"
  });
}

// 商品选配结果
export async function getGoodsOptsResultAPI(params) {
  return request("/occ-base/api/base/goodsOpt/find-by-ids", {
    method: "GET",
    body: params,
    description: "商品选配"
  });
}

// 保存选配结果
export async function saveGoodsOptsResultAPI(params) {
  return request("/occ-base/api/base/goodsOpt/save-opt", {
    method: "POST",
    body: params,
    description: "保存商品选配"
  });
}

// 支付单列表
export async function getOnlinePayListDataAPI(params) {
  return request("/occ-pay/paybill", {
    method: "GET",
    body: params,
    description: "支付单列表查询"
  });
}

// 根据主键获取支付单信息
export async function getOnlinePayByIdAPI(params) {
  return request("/occ-pay/paybill/findByParentid", {
    method: "GET",
    body: params,
    description: "查询支付单"
  });
}

// // 支付单操作 提交 or 删除
// export async function operationOnlinePayAPI(params) {
//   let url = "/occ-pay/paybill/delete-portal";
//   const type = params.type;
//   if (type == "submit") {
//     url = "/occ-pay/paybill/submit-portal";
//   }
//   return request(url, {
//     method: "GET",
//     body: params,
//     description: type == "submit" ? "支付单提交" : "支付单删除"
//   });
// }
// 支付单登记保存
export async function saveOnlinePayAPI(params) {
  let method = "POST";
  let url = "/occ-pay/paybill";
  if (params && params.id) {
    method = "PUT";
    url = "/occ-pay/paybill/edit-portal";
  }
  return request(url, {
    method: method,
    body: params,
    description: "支付单登记保存"
  });
}

// 暂存单转支付单保存
export async function saveTempToPayAPI(params) {
  let method = "GET";
  let url = "/b2b/req-order/reqorder-paybill";
  // if (params && params.id) {
  //   method = "PUT";
  //   url = "/occ-pay/paybill/edit-portal";
  // }
  return request(url, {
    method: method,
    body: params,
    description: "暂存单转支付单保存"
  });
}

// 获取支付方式
export async function getPayDataAPI(params) {
  return request("/buyer/order-common-info/paymode-list", {
    method: "GET",
    body: params,
    description: "获取支付方式"
  });
}

// ---------- 账户中心 end ----------//
