import request from "@/utils/request.js";
import request_php from "@/utils/request_php.js";

/**
 * 团购卷订单列表(分页)
 * @param {*} data
 * @returns
 */
export function groupOrderlist(data) {
  return request({
    method: "post",
    url: "/groupOrder/list",
    data,
  });
}

/**
 * 团购卷核销前回显
 * @param {*} params
 * @returns
 */
export function groupOrderorderInfo(params) {
  return request({
    method: "get",
    url: "/groupOrder/orderInfo",
    params,
  });
}

/**
 * 团购卷核销(仅核销待使用订单)
 * @param {*} params
 * @returns
 */
export function groupOrdergroupScan(params) {
  return request({
    method: "get",
    url: "/groupOrder/groupScan",
    params,
  });
}

/**
 * 退单
 * @param {*} data
 * @returns
 */
export function returnGpOrder(data) {
  return request({
    method: "post",
    url: "/pay/returnGpOrder",
    data,
  });
}

// 注意 抖音核销使用的请求为PHP服务 request_php

/**
 * 会员签入
 * @param {*} data
 * @returns
 */
export function douyincheckIn(data) {
  return request_php({
    method: "post",
    url: "douyin/checkIn",
    data,
  });
}

/**
 * 团购核销准备
 * @param {*} data
 * @returns
 */
export function douyinfulfilmentcertificateprepare(data) {
  return request_php({
    method: "post",
    url: "douyin/fulfilmentcertificateprepare",
    data,
  });
}

/**
 * 团购核销
 * @param {*} data
 * @returns
 */
export function douyincertificateprepare(data) {
  return request_php({
    method: "post",
    url: "douyin/certificateprepare",
    data,
  });
}

/**
 * 团购核销记录
 * @param {*} data
 * @returns
 */
export function douyinorderlist(data) {
  return request_php({
    method: "post",
    url: "douyin/orderlist",
    data,
  });
}

/**
 * 团购核销撤销
 * @param {*} data
 * @returns
 */
export function douyinfulfilmentcertificatecancel(data) {
  return request_php({
    method: "post",
    url: "douyin/fulfilmentcertificatecancel",
    data,
  });
}

/**
 * 门店列表
 * @param {*} data
 * @returns
 */
export function douyinstorelist(data) {
  return request_php({
    method: "post",
    url: "douyin/storelist",
    data,
  });
}

/**
 * 绑定门店
 * @param {*} data
 * @returns
 */
export function douyinbindstore(data) {
  return request_php({
    method: "post",
    url: "douyin/bindstore",
    data,
  });
}

/**
 * 登出团购
 * @param {*} data
 * @returns
 */
export function tglogout(data) {
  return request_php({
    method: "post",
    url: "user/logout",
    data,
  });
}

/**
 * 美团团购核销
 * 绑定-获取绑定状态
 * @param {*} data
 * @returns
 */
export function thirdPartyCoupon_state(data) {
  return request_php({
    method: "post",
    url: "/meituan/searchstorestatus",
    data,
  });
}

/**
 * 美团团购核销
 * 绑定-获取绑定url
 * @param {*} data
 * @returns
 */
export function thirdPartyCoupon_bindUrl(data) {
  return request_php({
    method: "post",
    url: "/meituan/getuisdkurl",
    data,
  });
}

/**
 * 美团团购核销
 * 团购券-获取可用券
 * @param {*} data
 * @returns
 */
export function thirdPartyCoupon_list(data) {
  return request_php({
    method: "post",
    url: "/meituan/fulfilmentcertificateprepare",
    data,
  });
}

/**
 * 美团团购核销
 * 执行核销
 * @param {*} data
 * @returns
 */
export function certificateprepare(data) {
  return request_php({
    method: "post",
    url: "/meituan/certificateprepare",
    data,
  });
}

/**
 * 美团团购核销
 * 团购核销记录
 * @param {*} data
 * @returns
 */
export function meituan_orderlist(data) {
  return request_php({
    method: "post",
    url: "/meituan/orderlist",
    data,
  });
}

/**
 * 美团团购核销
 * 团购撤销
 * @param {*} data
 * @returns
 */
export function meituan_fulfilmentcertificatecancel(data) {
  return request_php({
    method: "post",
    url: "/meituan/fulfilmentcertificatecancel",
    data,
  });
}
