import http from "../utils/http";
import config from "../config/config";

/**
 * 获取订单列表
 * @author Seven
 * @data 2025-3-28
 * @param {
 *  storeId: 1, //店铺Id
 *  keyword: 'DD-',  //搜索订单关键字
 *  pageNum: 1, //页码
 *  pageSize: 10, //页大小
 *  delivery: 1, // 1-同城配送；2-物流配送
 *  status: 1, 1-进行中；2-超时的订单；3-退款的订单
 *  }
 * @returns {  }
 * @see https://mall.gpxscs.cn/admin/shop/shop-order-base/mch/order/list
 */

export function GetOrderList(params) {
  return http({
    url: "/shop/shop-order-base/mch/order/list",
    method: "post",
    data: params,
    baseURL: config.adminApi,
  });
}

/**
 * 获取退货订单列表
 * @author Seven
 * @data 2025-3-28
 * @param {
 *  storeId: 1, //店铺Id
 *  keyword: 'DD-',  //搜索订单关键字
 *  pageNum: 1, //页码
 *  pageSize: 10, //页大小
 *  delivery: 1, // 1-同城配送；2-物流配送
 *  status: 1, 1-进行中；2-超时的订单；3-退款的订单
 *  }
 * @returns {  }
 * @see https://mall.gpxscs.cn/api/admin/shop/shop-order-return/list?pageNum=1&pageSize=20&order_id=&return_id=&startDate=&endDate=&source_lang=zh_CN
 */

export function GetSalesReturnOrderList(params) {
  return http({
    url: "/shop/shop-order-return/list",
    method: "get",
    params,
    baseURL: config.adminApi,
  });
}

/**
 * 获取退货订单详情
 * @author Seven
 * @data 2025-3-28
 * @param {
 *  return_id: FX-20241223-4  退货订单编号
 *  }
 * @returns {  }
 * @see https://mall.gpxscs.cn/api/admin/shop/shop-order-return/get?return_id=FX-20241223-4&source_lang=zh_CN
 */

export function GetSalesReturnOrderDetails(params) {
  return http({
    url: "/shop/shop-order-return/get",
    method: "get",
    params,
    baseURL: config.adminApi,
  });
}

/**
 * 退货订单不通过
 * @author Seven
 * @data 2025-3-28
 * @param {
 *  return_store_message: "" , 备注
 *  return_id: FX-20241223-4  退货订单编号
 *  }
 * @returns {  }
 * @see https://mall.gpxscs.cn/api/admin/shop/shop-order-return/refused?source_lang=zh_CN
 */

export function GetSalesReturnOrderNoPass(params) {
  return http({
    url: "/shop/shop-order-return/refused",
    method: "post",
    params,
    baseURL: config.adminApi,
  });
}

/**
 * 退货订单不通过
 * @author Seven
 * @data 2025-3-28
 * @param {
 *  return_flag： 0 不用退货 1需要退货
 *  return_store_message: "" , 备注
 *  receiving_address：2
 *  return_id: FX-20241223-4  退货订单编号
 *  }
 * @returns {  }
 * @see https://mall.gpxscs.cn/api/admin/shop/shop-order-return/review?source_lang=zh_CN
 */

export function GetSalesReturnOrderPass(params) {
  return http({
    url: "/shop/shop-order-return/review",
    method: "post",
    params,
    baseURL: config.adminApi,
  });
}

/**
 * 获取订单列表 模拟数据
 **/

// export function GetOrderList (params){
//   return  new Promise((resolve, reject) => {
//     http({
//       url:'/mchapp/static/data/order.json',
//       method:'get',
//       data:params,
//       baseURL:''
//     }).then(res=>{
//       resolve(res)
//     }).catch(e => reject(console.warn(e)))
//   })
// }

/**
 * 获取订单SSE
 * @author Seven
 * @data 2025-3-28
 * @param channel
 * @returns {  }
 * @see https://mall.gpxscs.cn/api/mobile/shop/sf-express/order/status/listening
 */

// export function GetOrderList (params){
//   return  new Promise((resolve, reject) => {
//     http({
//       url:'/shop/userOrder/mch/order/list',
//       method:'post',
//       params,
//       baseURL:''
//     }).then(res=>{
//       resolve(res)
//     }).catch(e => reject(console.warn(e)))
//   })
// }
